Closed Santiago0412 closed 1 year ago
Hmm this shouldn't be the case—I'll give it a look cc @mattsse
I second this being an issue. But in my case it doesn't verify on etherscan even when I upload the whole flattened file, so I don't exactly know what's going on.
On a related note, if I have more advanced compiler settings (optimizer true, constantOptimizer false), will forge create --verify
still be able to send etherscan the correct compiler settings?
Update: here is a concrete contract which failed to verify no matter what I did using foundry --version nightly
. After doing foundryup --commit 8bbde620ab39246f3c89700a19dfe6f347e99f4f
the verify worked fine.
https://goerli.etherscan.io/address/0x24623e2c87bdf420204e21a75a5b6921950872b8#code
I experienced the same verification issue on forge 0.2.0 (08a629a 2023-06-03T00:04:22.625130135Z)
, but was not able to validate the workaround from @jonathanpwang due to running into the foundry config error: Unknown evm version: paris for setting
evm_version`` when trying to run at the foundry version specified above.
Response I got on the nightly commit was this:
Start verification for (1) contracts
Start verifying contract `0xa519457b3d3734a6ca54e3b8be7f408ac87feb0b` deployed on goerli
Submitting verification for [src/Preseller.sol:Preseller] "0xa519457b3d3734a6CA54e3B8be7f408ac87feB0B".
Submitted contract for verification:
Response: `OK`
GUID: `kmewdcmqcmrduuqhcfipyffqrspxhkh19vrzxfdpqza8tpznc1`
URL:
https://goerli.etherscan.io/address/0xa519457b3d3734a6ca54e3b8be7f408ac87feb0b
Contract verification status:
Response: `NOTOK`
Details: `Pending in queue`
Contract verification status:
Response: `NOTOK`
Details: `Fail - Unable to verify. Please check if the correct constructor argument was entered.`
Contract failed to verify.
I experienced the same issue on forge 0.2.0 (08a629a 2023-06-03T00:04:22.625130135Z)
, both with verification and with using foundry-zksync. Any workaround?
foundryup --commit 8bbde620ab39246f3c89700a19dfe6f347e99f4f
I trid this but still fail.
Hmm right now it's impossible to test on goerli to reproduce, but I can't reproduce the mumbai issues and Sepolia and other testnets (L2s) work properly—this might be an API issue with mumbai and ZKSync.
We're on it folks - pls send us repros if possible.
Tried deploying to Sepolia with a private repo, and tried Goerli with this repo of mine. Both failed to verify with
Details: Fail - Unable to verify. Please check if the correct constructor argument was entered.
being the culprit here.
I was able to resolve this by using foundryup --commit 577e8b8d
. From my testing it seems that any contract that uses constructor arguments can no longer be verified. I believe this is a regression. To reproduce the issue, attempt to deploy and verify any contract with constructor args.
Hey all, a fix is on the way with https://github.com/gakonst/ethers-rs/pull/2468 — we'll let you know when this is upstreamed to foundry!
Thanks Team! Just ran into a similar issue on my first time ever verifying a contract from @Patricks course, herewith my repo if you'd like to take a look, https://github.com/0xPublicGoods/Foundry-FundMe-F23, it also happens to be a constructor argument issue
Start verification for (1) contracts
Start verifying contract `0x98d67f24558f78588386c5372f5a023b19b735a1` deployed on sepolia
Submitting verification for [src/FundMe.sol:FundMe] "0x98D67f24558F78588386c5372F5A023B19b735a1".
Submitting verification for [src/FundMe.sol:FundMe] "0x98D67f24558F78588386c5372F5A023B19b735a1".
Submitting verification for [src/FundMe.sol:FundMe] "0x98D67f24558F78588386c5372F5A023B19b735a1".
Submitting verification for [src/FundMe.sol:FundMe] "0x98D67f24558F78588386c5372F5A023B19b735a1".
Submitted contract for verification:
Response: `OK`
GUID: `tk4ia76s1qgfv8kv2fdsme11jvfmuxfwzycxlvxp7n1bwgycpr`
URL:
https://sepolia.etherscan.io/address/0x98d67f24558f78588386c5372f5a023b19b735a1
Contract verification status:
Response: `NOTOK`
Details: `Pending in queue`
Contract verification status:
Response: `NOTOK`
Details: `Fail - Unable to verify. Please check if the correct constructor argument was entered.`
Contract failed to verify.
Replicating this on my end also (and going a bit crazy thinking I had bad constructor args). I'm seeing the problem with any contract that has constructor args.
forge 0.2.0 (08a629a 2023-06-03T00:14:26.563741000Z)
Command ran
forge verify-contract 0xdC4E3E75F444f4A83C02740fc0014c1D6F05570F SingleTokenPortfolio --constructor-args 00000000000000000000000094106ca9c7e567109a1d39413052887d1f412183000000000000000000000000ae78736cd615f374d3085123a210448e74fc639300000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000746a52880000000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f526f636b6574706f6f6c2045544820506f7274666f6c696f20536861726573000000000000000000000000000000000000000000000000000000000000000007724554482d505300000000000000000000000000000000000000000000000000 --chain-id mainnet --watch
With output
Contract verification status:
Response: `NOTOK`
Details: `Fail - Unable to verify. Please check if the correct constructor argument was entered.`
Contract failed to verify.
gakonst/ethers-rs#2468
Any update? and how to build forge with special ethers version? Thanks
@kuncle we recently released a patched foundry version—could you try doing foundryup
and trying verification?
@kuncle we recently released a patched foundry version—could you try doing
foundryup
and trying verification?
Thanks. But still got same error "expected value at line 1 column 1" after done foundryup
.
.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx
╔═╗ ╔═╗ ╦ ╦ ╔╗╔ ╔╦╗ ╦═╗ ╦ ╦ Portable and modular toolkit ╠╣ ║ ║ ║ ║ ║║║ ║║ ╠╦╝ ╚╦╝ for Ethereum Application Development ╚ ╚═╝ ╚═╝ ╝╚╝ ═╩╝ ╩╚═ ╩ written in Rust.
.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx
Repo : https://github.com/foundry-rs/
Book : https://book.getfoundry.sh/
Chat : https://t.me/foundry_rs/
Support : https://t.me/foundry_support/
Contribute : https://github.com/orgs/foundry-rs/projects/2/
.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx
foundryup: installing foundry (version nightly, tag nightly-1a1d6532c4da2105e871054208d606192ed695f9) foundryup: downloading latest forge, cast, anvil, and chisel ########################################################################################################################################## 100.0% foundryup: downloading manpages ########################################################################################################################################## 100.0% foundryup: installed - forge 0.2.0 (1a1d653 2023-06-14T00:06:18.409597000Z) foundryup: installed - cast 0.2.0 (1a1d653 2023-06-14T00:06:18.409597000Z) foundryup: installed - anvil 0.1.0 (1a1d653 2023-06-14T00:06:29.034672000Z) foundryup: installed - chisel 0.1.1 (1a1d653 2023-06-14T00:06:29.176105000Z) foundryup: done!
Verify ERROR:
Start verifying contract xxx
deployed on goerli
Error:
expected value at line 1 column 1
@Evalir Can confirm latest foundryup: installed - forge 0.2.0 (1a1d653 2023-06-14T00:06:18.409597000Z)
worked for me, thanks!
@kuncle are you sure your error is this one? it seems like a different thing. Could you file another issue with your specific trouble and a minimal repro?
Hello everyone, yesterday I ran into the same problem with the deployment on sepolia and binance testnet
I went through the broadcast reports and found one embarrassing moment
Here is a list of arguments for the deployment from my last attempt (unable to verify), after large values in uint256
for some reason there is an abbreviated spelling (we can see it in the console logs from verbosity).
"arguments": [
"1686830400 \u001b[2;49;39m[1.686e9]\u001b[0m",
"1697407200 \u001b[2;49;39m[1.697e9]\u001b[0m",
"1697507200 \u001b[2;49;39m[1.697e9]\u001b[0m",
"10000 \u001b[2;49;39m[1e4]\u001b[0m",
"225"
]
Could it be that the same values (with an appendage on the right) are passed as arguments for verification?
Here are the same arguments, but from the previous version of the contract, which I deployed with successful verification a few weeks ago
"arguments": [
"1686830400",
"1697407200",
"1697507200",
"10000",
"225"
]
@Episqol issued this here #5150 (mostly unrelated since verification doesn't work despite this styling error occurring or not)
Alright, will do a bit of issue management here—as this has received a few people that might have had their issue solved with the latest foundry releases, I will close this. We'll handle the separate deserialization issue here: https://github.com/foundry-rs/foundry/issues/4865 and @episqol we'll file a new issue
foundryup
resolved my issue.
forge 0.2.0 (https://github.com/foundry-rs/foundry/commit/8bbde620ab39246f3c89700a19dfe6f347e99f4f 2023-11-03T09:29:47.566294Z) So, i don't verify that cmd: forge script script/Test.s.sol:Test --fork-url https://data-seed-prebsc-2-s2.binance.org:8545/ --broadcast --etherscan-api-key 34UZWJC71ISRNKG45K8RR759KUFCBSYRJP -vv --via-ir --verify
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (03aa926 2023-06-05T09:38:42.448503000Z)
What command(s) is the bug in?
forge create --rpc-url "https://matic-mumbai.chainstacklabs.com" \ --constructor-args "AAAA" "AA" "https://gateway.pinata.cloud/ipfs/ ... --verify \ src/AAAA.sol:AAAA
Operating System
macOS (Apple Silicon)
Describe the bug
Try to deploy my smart contract, always fail to verify the contract after running foundry up. before that everything works fine. here is the log I got: