Closed
Description
Component
Forge
Have you ensured that all of these are up to date?
- Foundry
- Foundryup
What version of Foundry are you on?
forge 0.2.0 (bff4ed9 2023-08-29T00:16:15.395348141Z)
What command(s) is the bug in?
forge verify-contract
Operating System
Linux
Describe the bug
I have a very simple contract that I was able to verify with the Hardhat Etherscan plugin. Consequently I was going to try verifying it with Foundry in Moonbase Alpha and I ran into the following error:
forge verify-contract --chain-id 1287 \
--verifier etherscan \
--verifier-url https://api-moonbase.moonscan.io/api \
0x06F789662F6a776BF1C551409985311b52C41a32 \
--constructor-args 0x0000000000000000000000000000000000000000000000000000000000000014 \
src/Number.sol:Number \
--etherscan-api-key MY_API_KEY
Start verifying contract `0x06f789662f6a776bf1c551409985311b52c41a32` deployed on moonbase
2023-08-29T12:31:35.427671Z ERROR etherscan: Failed to deserialize response: expected value at line 1 column 1 res="<!DOCTYPE html><html lang=\"en-US\"><head><title>Just a moment...</title><meta http-equiv=\"Content-Type\" content=\"t
..... A LOT OF THINGS .......
Xzgw7a3gr5MEPQlJTp3M0-1693312295-0-gaNycGzNCrs\" + window._cf_chl_opt.cOgUHash);cpo.onload = function() {history.replaceState(null, null, ogU);};}document.getElementsByTagName('head')[0].appendChild(cpo);}());</script></body></html>"
Error:
expected value at line 1 column 1
Then I was thinking this could be an issue with Etherscan's Moonbase Alpha API. Soooo, I went to test the same thing against Sepolia (changing API Key, endpoint, chain id, etc) and the same error message there as well. I know some of my inputs are not mandatory but I was just trying different things.
The basic contract I was trying to verify is this one:
// SPDX-License-Identifier: MIT
pragma solidity =0.8.0;
contract Number {
uint public number;
constructor (uint _input) {
number = _input;
}
function setNumberTest(uint _input) public {
number = _input;
}
}
Thanks for looking into it