Closed uF4No closed 1 month ago
Hey Antonio! Thanks for raising this issue. I tried this morning with a couple of contracts of mine and I was able to verify them from my end. I tried with two custom tokens here:
The command I use was this
forge verify-contract 0xbA3bF88220daC494C33c61cfc26c67A750F61693 src/MyToken.sol:TestToken --constructor-args $(cast abi-encode "constructor(string memory,string memory)" "JUAN" "ASD" ) --rpc-url https://sepolia.era.zksync.dev/ --chain-id 300 --watch --zksync -e {API_KEY}
I saw the exact same error you got once today (the first contract I tried) and after retrying it worked and I didn't get the error again. We were facing intermittent RPC issues before as well. Let me know if this helps and if this occurs again. If you have the contract I can try it from my end also.
hey @Jrigada yeah, looks like an intermitent RPC issue. I managed to verify with the exact same script after a couple of times.
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.0.2 (46d9f92 2024-09-30T00:36:58.923333000Z)
What command(s) is the bug in?
forge verify-contract
Operating System
macOS (Apple Silicon)
Describe the bug
I'm trying to verify a basic ERC20 token contract deployed to ZKsync Sepolia testnet.
Contract was deployed with
forge create --rpc-url https://sepolia.era.zksync.dev --private-key MY_PRIVATE_KEY contracts/MyToken.sol:MyToken --constructor-args "Yadayada" "YDD" --zksync
Contract deployed to 0x9602866f8919f5d781967Cff6e5467049A8C5a89.
I added the etherscan config to the
foundry.toml
file:And tried with the following command:
(not that constructor args are encoded)
I get the following output:
I've been able to verify ZKsync contracts deployed to etherscan with
forge verify-contract
before, so not sure what the issue could be.