foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.33k stars 1.76k forks source link

bug(`forge script --verify`): `deserialization error: invalid value: string "Error! Missing Or invalid Module name (#2)"` #9371

Closed nufailTanjiro closed 21 hours ago

nufailTanjiro commented 22 hours ago

Component

Forge

Have you ensured that all of these are up to date?

What version of Foundry are you on?

forge 0.2.0 (f479e94 2024-06-01T00:21:09.122773900Z)

What command(s) is the bug in?

forge script script/Deploy.s.sol --rpc-url $BASE_SEPOLIA_RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --broadcast -vvvv --verify --etherscan-api-key $BASESCAN_API_KEY --via-ir

Operating System

Windows

Describe the bug

This is my: BASE_SEPOLIA_RPC_URL='https://api-sepolia.basescan.org/api'

Whenever I run try to deploy my Upgradeable contract with proxy I am getting this error

Error: 
deserialization error: invalid value: string "Error! Missing Or invalid Module name (#2)", expected a 8 byte hex string at line 1 column 44

Context:
- invalid value: string "Error! Missing Or invalid Module name (#2)", expected a 8 byte hex string at line 1 column 44

I deployed the proxy on amoy testnet but when I try to deploy it on base sepolia I am facing this issue

I also tried using blockscout:

 forge script script/Deploy.s.sol --rpc-url $BASE_SEPOLIA_RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --broadcast -vvvv --verify --verifier blockscout  --verifier-url 'https://base-sepolia.blockscout.com/api?apikey=<API_KEY>' --via-ir

But couldn't deploy and verify

zerosnacks commented 21 hours ago

Hi @nufailTanjiro,

BASE_SEPOLIA_RPC_URL='https://api-sepolia.basescan.org/api' is the Etherscan API endpoint, not the RPC URL

You are recommended to use an RPC provider like Alchemy / Infura or pick one from the public RPC list (less reliable): https://chainlist.org/?search=base and use that as your RPC_URL

In most cases you don't have to specify the Etherscan API endpoint manually as we automatically derive it from the chain id