Consider the following solidity source file A.sol
:
pragma solidity ^0.4.8;
contract A {}
and B.sol
:
pragma solidity ^0.4.8;
contract A {}
contract B is A {}
Using solc version 0.4.8, the code produced for the two versions of contract A are not identical:
$ solc --bin A.sol
======= A =======
Binary:
6060604052346000575b60358060166000396000f30060606040525b60005600a165627a7a723058201f05fd362367eb20b594d9537e2d735626b1fc0909c76826b94103a678da6cf10029
$ solc --bin B.sol
======= A =======
Binary:
6060604052346000575b60358060166000396000f30060606040525b60005600a165627a7a723058207dd14680c4efdd761b8db9a748045c916aff2f0a11c4ee7b82731d287045f0540029
======= B =======
Binary:
6060604052346000575b60358060166000396000f30060606040525b60005600a165627a7a72305820942c33894954b0c78b1da86869a47c578755a698e26f671c5b4450476a3d56bc0029
If you scan to the bytes 5820
in the compilations of A, you'll see the two versions differ just after.
I'd expected solc compilations to be repeatable (that seems important for verifying that code on the blockchain is consistent with public source), and don't understand why these two versions of A should differ. What am I missing?
Many thanks for any insight!
Update: I'm using the empty contract as an example here, but I first encountered inconsistent compilations with a less trivial contract. It's not just a quirk of the empty contract.