Skip to content
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

Update MonadTestnet explorer configuration now that it's public #307

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
3 changes: 1 addition & 2 deletions api_secrets.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@
"rpcUrl": ""
},
"monad_testnet": {
"rpcUrl": "",
"blockscoutApi": ""
"rpcUrl": ""
},
"unichain": {
"etherscanKey": "",
Expand Down
3 changes: 2 additions & 1 deletion chain_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@
"deployment": {
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x0000000000001fF3684f28c67538d4D072C22734"
}
},
"sourcifyApi": "https://sourcify-api-monad.blockvision.org"
},
"unichain": {
"chainId": 130,
Expand Down
28 changes: 16 additions & 12 deletions sh/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,17 @@ function verify_contract {
declare -r _verify_source_path="$1"
shift

# Unichain, WorldChain, MonadTestnet, Mode, and Ink use Blockscout, not Etherscan
declare -r -i _verify_source_blockscout=$((chainid == 130 || chainid == 480 || chainid == 10143 || chainid == 34443 || chainid == 57073))
# all other chains use Etherscan; Unichain and WorldChain use both
declare -r -i _verify_source_etherscan=$((chainid == 130 || chainid == 480 || ! _verify_source_blockscout))
# Sourcify doesn't support Unichain, Sonic, WorldChain, MonadTestnet, Ink, Berachain, Blast, or Taiko
declare -r -i _verify_source_sourcify=$(( chainid != 130 && chainid != 146 && chainid != 480 && chainid != 10143 && chainid != 57073 && chainid != 80094 && chainid != 81457 && chainid != 167000 ))
# Unichain, WorldChain, Mode, and Ink use Blockscout, not Etherscan
declare -r -i _verify_source_blockscout=$((chainid == 130 || chainid == 480 || chainid == 34443 || chainid == 57073))
# except MonadTestnet, all other chains use Etherscan; Unichain and WorldChain use both
declare -r -i _verify_source_etherscan=$((chainid != 10143 && (chainid == 130 || chainid == 480 || ! _verify_source_blockscout)))
# Sourcify doesn't support Unichain, Sonic, WorldChain, Ink, Berachain, Blast, or Taiko
declare -r -i _verify_source_sourcify=$(( chainid != 130 && chainid != 146 && chainid != 480 && chainid != 57073 && chainid != 80094 && chainid != 81457 && chainid != 167000 ))

if (( _verify_source_blockscout )) ; then
declare _verify_blockscoutApi
if (( chainid == 10143 )) ; then # MonadTestnet is private. The explorer credentials are stored in the secrets file
_verify_blockscoutApi="$(get_api_secret blockscoutApi)"
else
_verify_blockscoutApi="$(get_config blockscoutApi)"
fi
_verify_blockscoutApi="$(get_config blockscoutApi)"
declare -r _verify_blockscoutApi
forge verify-contract --watch --chain $chainid --verifier blockscout --verifier-url "$_verify_blockscoutApi" --constructor-args "$_verify_constructor_args" "$_verify_deployed_address" "$_verify_source_path"
fi

Expand All @@ -124,6 +121,13 @@ function verify_contract {
fi

if (( _verify_source_sourcify )) ; then
forge verify-contract --watch --chain $chainid --verifier sourcify --constructor-args "$_verify_constructor_args" "$_verify_deployed_address" "$_verify_source_path"
declare _verify_sourcifyApi
_verify_sourcifyApi="$(get_config sourcifyApi)"
declare -r _verify_sourcifyApi
if [[ ${_verify_sourcifyApi:-null} == null ]] ; then
forge verify-contract --watch --chain $chainid --verifier sourcify --constructor-args "$_verify_constructor_args" "$_verify_deployed_address" "$_verify_source_path"
else # MonadTestnet uses BlockVision (which works like Sourcify)
forge verify-contract --watch --chain $chainid --verifier sourcify --verifier-url "$_verify_sourcifyApi" --constructor-args "$_verify_constructor_args" "$_verify_deployed_address" "$_verify_source_path"
fi
fi
}
Loading