Issues verifying contract on etherscan
See original GitHub issueI know this issue was discussed in #456 and #475, but it is still a pain to verify deployment on etherscan. Works out of the box with remix, it should work with truffle to!
Issue
After a migration using truffle migrate
(which is a pain, but that is not the point here), my contract are deployed and visible on etherscan. I’m trying to verify the code so my users can trust the deployment and use the read/write features of etherscan.
when I past my contract code, and give the compiler version and optimization options, it tells me the bytecode is not the correct one. If I deploy using remix, the verification happens well … which makes me wonder, why isn’t the same source, with the same compiler not giving the same result?
For the THESE contracts (flatten version here) the deployed addresses are (for example)
0x6FDcfA51758205E9D717dce7B8F416447D612174 AppRegistry (empty constructor) 0x22e0b72EA21D4DfF26F075c291cECc00cb01e978 IexecODBLibOrders (library, so no constructor)
using:
compilers: {
solc: {
version: "0.5.7",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
}
},
- Operating System: Archlinux
- Truffle version (
truffle version
): 5.0.13 - node version (
node --version
): 11.12.0 - npm version (
npm --version
): 6.9.0
EDIT: I’ve tried with evmVersion “petersburg” and “byzantium”, none of these give me the same bytecode as remix (with same compiler version and optimisation)
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Just including this for reference: https://github.com/rkalis/truffle-plugin-verify
(Can we close this yet? Thanks all.)
@Amxx you should add
evmVersion: 'petersburg',
in your truffle-config.js like below.Default is “byzantium” and Etherscan fails to verify your code.