When I deploy a contract with Truffle that has an import
statement, and try to verify it on etherscan, my understanding is that I need to paste in the contents of the imported file.
I get an error on etherscan that the bytecodes of the concatenated and deployed files are not the same. The strange thing is that if I deploy the contract (with imports) on remix then the bytecode matches with the concatenated source file.
Example
Here is a minimal example of contracts that exhibit this behaviour.
Combined.sol
is the concatenated file, and Outer.sol
contains the contract that is deployed.
Here is what I am doing that gets an error:
- Deploy
Outer.sol
with truffle - Go to deployed contract address on etherscan
- Input the
Concatenated.sol
source code and hit verify
Error, bytecodes do not match.
More info
- Using compiler
0.4.11
in remix and truffle. - Ubuntu 16.04.
- On Kovan, not that it should matter.
- Deployed contract