Workaround for wildcard output selector bug in solc <= 0.5.8
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 349
- Avg merge
- 8m
- Merged PRs (30d)
- 1
Description
Related to https://github.com/ethereum/solidity/issues/14214.
In https://github.com/ethereum/solidity/pull/6606 (released in 0.5.9) we fixed a bug that broke the `*` at source level. Since solc-js acts as a compatibility layer for older binaries, we should include a workaround for that bug here.
We can avoid triggering the bug by modifying the input JSON to either use `*` at contract level as well or by listing all contract explicitly.
### Repro
```json
{
"language": "Solidity",
"sources": {
"C.sol": {
"content": "pragma solidity *; contract C {}"
}
},
"settings": {
"outputSelection": {"*": {"C": ["evm.bytecode"]}}
}
}
```
```json
{
"contracts": {
"C.sol": {
"C": {
"evm": {
"bytecode": {
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
}
}
}
}
},
"sources": {
"C.sol": {
"id": 0
}
}
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the provided standard JSON input and output with solc-js and a Solidity compiler binary at or below 0.5.8. Trace the input handling for outputSelection wildcards; done means the compatibility workaround avoids the old compiler bug while preserving the expected compiled output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity, typescript
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100