You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiled with solidity v0.8.0, it will produce the following unmarshal error: json: cannot unmarshal array into Go struct field .Contracts.Abi of type string
Steps to reproduce the behaviour
Try deploy the smart contracts with compiler, execute this line of code: contracts, err := compiler.CompileSolidity("./solc-macos", path...)
The following is a deploy example:
System information
Geth version:
geth version
Solidity version: 0.8.0
OS & Version: Windows/Linux/OSX
Commit hash : (if
develop
)Expected behaviour
https://github.com/ethereum/go-ethereum/blob/3c46f5570bd674cf49c0113352ff79a4e026a5b8/common/compiler/solidity.go#L143
When executing this line, the json string is expected to marshal in the output struct where abi is of type string. The abi string will be further marshalled into another struct and the process should report no error if compiled with
solc
command(which is solidity compiler).Actual behaviour
When compiled with solidity v0.8.0, it will produce the following unmarshal error:
json: cannot unmarshal array into Go struct field .Contracts.Abi of type string
Steps to reproduce the behaviour
Try deploy the smart contracts with compiler, execute this line of code:
contracts, err := compiler.CompileSolidity("./solc-macos", path...)
The following is a deploy example:
Suggestion
For developers, please try to modify the output behavior of solidity 0.8.0 compiler from outputing array to string, or try to modify the https://github.com/ethereum/go-ethereum/blob/3c46f5570bd674cf49c0113352ff79a4e026a5b8/common/compiler/solidity.go#L141 function to make it compatible with the new solidity compiler version.
The text was updated successfully, but these errors were encountered: