-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not verify deployed contract #852
Comments
perhaps related to #811 |
I believe the root of the problem is the Etherscan API Key
source: https://info.etherscan.com/api-return-errors/ However I am having the same issue despite attempting to verify with multiple API Keys and via the Etherscan website, too. The problem may have to do with using unversioned OpenZeppelin imports in the contract. See here https://forum.openzeppelin.com/t/how-to-verify-a-contract-on-etherscan-bscscan-polygonscan/14225#use-versioned-imports-in-remix-10 |
I don't think so. I use the same key but I was able to verify contract with hardhat |
hey guys, has this been resolved? having the exact same issue |
It seems that this caused by the for example:
|
@pyk : I can verify a simple counter contract with the newest version of foundry. But somehow with this contract, it's still failed: https://github.com/piavgh/simple-ens-foundry
The result is still:
|
haven't had any luck on the latest foundry master branch (includes #1242) as well with the below setup. Not entirely sure if I should be opening up a new issue or tagging on to this one repo https://github.com/0xSplits/splits-vesting; commands: |
I forked this repo and was able to duplicate your issue. Have you tried adding extra output metadata to your build? I think etherscan needs the additional information in metadata for deployments that have multiple libraries etc |
hi -- would love to try this.. where can I learn more about how to do this? |
(after some conversation on telegram) tried cleaning & redeploying w |
Thanks for the info, but I'm not sure if I understand it fully. Do you mean that it still has a bug or my verification procedure is incorrect? I tried to deploy the contract with arg:
which is
but it's still failed when verify |
ok, thanks for trying again @piavgh! with that fix I was able to successfully verify via cli on goerli: https://goerli.etherscan.io/address/0x2e7a3b5a0346b2b390a125c0ac8181236d19ca3c#code sorry about all of this, working with the etherscan API is a bit hard |
@mattsse : thanks for your time. But can you please list each command that you've used to verify it? (so that I can follow) I'm using the latest version of forge after running In the meantime, I will try with goerli to see if it has any different result. |
just did another test with the current master forge create --chain goerli --rpc-url "$ETH_RPC_URL" --constructor-args "geek" --private-key "$GOERLI_PK" src/Domains.sol:Domains forge verify-contract --chain-id goerli --constructor-args 000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000046765656b00000000000000000000
000000000000000000000000000000000000 --compiler-version v0.8.10+commit.fc410830 0xc3fe616452de64c289ae20db2b1d2224e126f123 --optimizer-runs 200 src/Domains.sol:Domains "$ETHERSCAN_API" forge verify-check --chain-id goerli xpmq925drkg29s8dxqfegtkcvbvh8md6wk2rbmbsvqybdbywtq "$ETHERSCAN_API" https://goerli.etherscan.io/address/0xc3fe616452de64c289ae20db2b1d2224e126f123 there was a fix in #1278 that just landed |
I found out that on If you have time, please try it on rinkeny or ropsten to see that you have the same problem :D |
interesting, will do |
Just verified on Rinkeby: https://rinkeby.etherscan.io/address/0x30b8add9d1c2cc440b33561b5e38a535680c5131#code
And Ropsten: https://ropsten.etherscan.io/address/0x48a42c5ed4f6fb093189f9b1b9e0d24dbd97cde0#code
|
I confirm that using the latest version of foundry, I can verify the contract successfully on both ropsten and rinkeby. Will close this issue |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.1.0 (2ff2b33 2022-03-06T00:10:54.403068+00:00)
What command(s) is the bug in?
forge verify-contract
Operating System
macOS (amd)
Describe the bug
The code of contract is here: https://github.com/piavgh/simple-ens-foundry
I deployed the contract using this command:
Then I verified it with
I tried with different values of --num-of-optimizations: 0, 200 (default), 1000000, and even skip this argument, but all of them give the same value when I tried the
forge verify-check
:The text was updated successfully, but these errors were encountered: