-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
outputSelection
with contract name does not compile while compiles with *
#1017
Comments
Came across another case with Chain: Godwoken Testnet v1 (71401) JSON input: {
"settings": {
"evmVersion": "byzantium",
"libraries": {
"": {}
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": [],
"outputSelection": {
"*": {
"RollBackWithCallCodeContract": [
"evm.bytecode.object",
"evm.deployedBytecode.object",
"evm.deployedBytecode.immutableReferences",
"metadata"
]
}
},
"metadata": {}
},
"sources": {
"contracts/RollBackCallCode.sol": {
"content": "pragma solidity ^0.4.24;\ncontract StateContract{\n\n uint256 public state = 1;\n function modState() public{\n state++;\n }\n function modStateWithRevert() public {\n state++;\n revert();\n }\n}\n\ncontract RollBackWithCallCodeContract{\n\n uint256 public state = 1;\n\n function getState() public view returns(uint256){\n return state;\n }\n function callCodeWithMethod(string memory methodName) public {\n StateContract sc = new StateContract();\n address(sc).callcode(bytes4(keccak256(abi.encodePacked(methodName))));\n }\n\n}\n"
}
},
"language": "Solidity"
} Compiler output: "contracts": {
"contracts/RollBackCallCode.sol": {
"RollBackWithCallCodeContract": {
"evm": {
"bytecode": {
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
}
},
"metadata": ""
},
"StateContract": {
"evm": {}
}
}
}, When setting the The same happens with the version This leaves me wondering if this actually is because of the above mentioned Identical ExampleAnother similar example with Chain: Goerli (5) Input JSON: Source Code and Metadata: |
Opened the issue ethereum/solidity#14214 in the Solidity repository as I couldn't really pin this down to As a mitigation, and since there have been many issues regarding this, setting the |
Description
I've come across another similar case to #928. We've already worked around this by always using
*
in the selected files. This new case was affected by the selected contract.I can see this is related to
outputSelection
being introduced in 0.4.18 and updated with the selection items array in 0.4.19.Normally we set the
ouputSelection
asbut for this and older versions we should set it both to
*
.Todo
outputSelection
for contracts for these earlier versions.Example contract
This is an already verified contract on mainnet
Chain: Ethereum Mainnet Address:
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
version:
0.4.19+commit.c4cbbb05
Non-working
outputSelection
:Working:
Complete JSON input: WETH9.json.txt
The compiler does not throw etc. but gives empty output:
Source code + metadata: metadata.json.txt WETH9.sol.txt
Another Identical Example
Chain: Binance Smart Chain Mainnet (56) Address:
0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c
JSON Input: 56-0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c-solc-input.json.txt
Source Code and Metadata: metadata.json.txt front_run.sol.txt WBNB.sol.txt
View in Huly HI-414
The text was updated successfully, but these errors were encountered: