Skip to content

Solidity 0.5.17 installed with Homebrew produces a different output than the version downloaded from solc-bin.ethereum.org #10183

@alcuadrado

Description

@alcuadrado

Hi

@udwig, reported to us that he was unable to verify a contract on Etherscan, even when using the exact same solidity standard input json. We spent some time debugging it, and found this problem with solc or with its distribution:

If you install solc 0.5.17+commit.d19bba13 using Homebrew and downloading it from solc-bin.ethereum.org, you can get a different output for the same input.

Here's a script that can be used to reproduce it:

brew tap ethereum/ethereum
brew install ethereum/ethereum/solidity@5

wget --quiet https://gist.githubusercontent.com/alcuadrado/06c1ad0cf7e23758e17a32e829f26497/raw/b9f864cfda21d0cc9c5365fa1a1b435aec6285e8/input-to-get-different-outputs.json

wget --quiet https://solc-bin.ethereum.org/macosx-amd64/solc-macosx-amd64-v0.5.17+commit.d19bba13
chmod +x solc-macosx-amd64-v0.5.17+commit.d19bba13

echo '\n\n\n'
echo Brew solc
solc --version
cat input-to-get-different-outputs.json | solc --standard-json | md5sum

echo '\n\n\n'
echo Native solc
./solc-macosx-amd64-v0.5.17+commit.d19bba13 --version
cat input-to-get-different-outputs.json | ./solc-macosx-amd64-v0.5.17+commit.d19bba13 --standard-json | md5sum

It will output

Brew solc
solc, the solidity compiler commandline interface
Version: 0.5.17+commit.d19bba13.Darwin.appleclang
b2051480575328ea24cdfa7cbdc71cf5  -




Native solc
solc, the solidity compiler commandline interface
Version: 0.5.17+commit.d19bba13.mod.Darwin.appleclang
a13020de9abb553ca40d7171744a8735  -

Another interesting thing is that Etherscan seems to be running the same version than the one distributed by Homebrew. It may actually be solcjs. I got into this other bug when trying to reproduce it with solcjs.

Any idea what's going on? Are the solc-bin.ethereum.org binaries somehow corrupted? This is really important to us, as it can lead to people deploying contracts that aren't verifiable on Etherscan.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions