I have not been able to verify a contract on Etherscan. While the local compiled bytecode matches what is on Etherscan, I cannot seem to get Etherscan to reproduce the bytecode.
I’ve tried the settings:
Compiler: solc 0.5.10 (commit.5a6ea5b1)
I’ve used both the Etherscan UI and the OpenZeppelin CLI tool and neither have worked.
You can replicate the problem using the source code. Note that you’ll need your own Infura api key and Etherscan api key:
git clone email@example.com:pooltogether/pooltogether-contracts.git cd pooltogether-contracts cp .envrc.example .envrc # edit the INFURA_PROVIDER_URL_MAINNET api key to match an api key you own direnv allow oz verify # Answer Pool contract, on mainnet, no optimizations, etherscan, and paste in your api key # fails to verify
You’ll notice that the produced bytecode matches the code that was contract creation tx
Am I missing something here?