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
23 changes: 0 additions & 23 deletions .github/workflows/lint.yml

This file was deleted.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ Master list of UniV3 forks:
* Create new Settler version for intent-based settlement -- the taker only signs
the slippage, not the actions
* This is now `tokenId` 4

## 2025-02-20

### Breaking changes

### Non-breaking changes

* Add UniswapV3 UniV3 fork to Monad Testnet

## 2025-02-12
Expand Down
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
43 changes: 29 additions & 14 deletions chain_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x0000000000001fF3684f28c67538d4D072C22734"
},
"etherscanApi": "https://api-sepolia.etherscan.io/api"
"etherscanApi": "https://api-sepolia.etherscan.io/api",
"sourcifyApi": "https://sourcify.dev/server/"
},
"mainnet": {
"chainId": 1,
Expand All @@ -49,7 +50,8 @@
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x0000000000001fF3684f28c67538d4D072C22734"
},
"etherscanApi": "https://api.etherscan.io/api"
"etherscanApi": "https://api.etherscan.io/api",
"sourcifyApi": "https://sourcify.dev/server/"
},
"polygon": {
"chainId": 137,
Expand All @@ -75,7 +77,8 @@
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x0000000000001fF3684f28c67538d4D072C22734"
},
"etherscanApi": "https://api.polygonscan.com/api"
"etherscanApi": "https://api.polygonscan.com/api",
"sourcifyApi": "https://sourcify.dev/server/"
},
"base": {
"chainId": 8453,
Expand All @@ -101,7 +104,8 @@
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x0000000000001fF3684f28c67538d4D072C22734"
},
"etherscanApi": "https://api.basescan.org/api"
"etherscanApi": "https://api.basescan.org/api",
"sourcifyApi": "https://sourcify.dev/server/"
},
"optimism": {
"chainId": 10,
Expand All @@ -127,7 +131,8 @@
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x0000000000001fF3684f28c67538d4D072C22734"
},
"etherscanApi": "https://api-optimistic.etherscan.io/api"
"etherscanApi": "https://api-optimistic.etherscan.io/api",
"sourcifyApi": "https://sourcify.dev/server/"
},
"arbitrum": {
"chainId": 42161,
Expand All @@ -153,7 +158,8 @@
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x0000000000001fF3684f28c67538d4D072C22734"
},
"etherscanApi": "https://api.arbiscan.io/api"
"etherscanApi": "https://api.arbiscan.io/api",
"sourcifyApi": "https://sourcify.dev/server/"
},
"bnb": {
"chainId": 56,
Expand All @@ -179,7 +185,8 @@
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x0000000000001fF3684f28c67538d4D072C22734"
},
"etherscanApi": "https://api.bscscan.com/api"
"etherscanApi": "https://api.bscscan.com/api",
"sourcifyApi": "https://sourcify.dev/server/"
},
"avalanche": {
"chainId": 43114,
Expand All @@ -205,7 +212,8 @@
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x0000000000001fF3684f28c67538d4D072C22734"
},
"etherscanApi": "https://api.snowtrace.io/api"
"etherscanApi": "https://api.snowtrace.io/api",
"sourcifyApi": "https://sourcify.dev/server/"
},
"blast": {
"chainId": 81457,
Expand Down Expand Up @@ -257,7 +265,8 @@
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x000000000000175a8b9bC6d539B3708EEd92EA6c"
},
"etherscanApi": "https://api.lineascan.build/api"
"etherscanApi": "https://api.lineascan.build/api",
"sourcifyApi": "https://sourcify.dev/server/"
},
"scroll": {
"chainId": 534352,
Expand All @@ -283,7 +292,8 @@
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x0000000000005E88410CcDFaDe4a5EfaE4b49562"
},
"etherscanApi": "https://api.scrollscan.com/api"
"etherscanApi": "https://api.scrollscan.com/api",
"sourcifyApi": "https://sourcify.dev/server/"
},
"mantle": {
"chainId": 5000,
Expand All @@ -309,7 +319,8 @@
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x0000000000005E88410CcDFaDe4a5EfaE4b49562"
},
"etherscanApi": "https://api.mantlescan.xyz/api"
"etherscanApi": "https://api.mantlescan.xyz/api",
"sourcifyApi": "https://sourcify.dev/server/"
},
"mode": {
"chainId": 34443,
Expand All @@ -335,7 +346,8 @@
"allowanceHolder": "0x0000000000001fF3684f28c67538d4D072C22734",
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae"
},
"blockscoutApi": "https://explorer.mode.network/api"
"blockscoutApi": "https://explorer.mode.network/api",
"sourcifyApi": "https://sourcify.dev/server/"
},
"taiko": {
"chainId": 167000,
Expand Down Expand Up @@ -414,7 +426,8 @@
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x0000000000001fF3684f28c67538d4D072C22734"
},
"etherscanApi": "https://api.gnosisscan.io/api"
"etherscanApi": "https://api.gnosisscan.io/api",
"sourcifyApi": "https://sourcify.dev/server/"
},
"sonic": {
"chainId": 146,
Expand Down Expand Up @@ -491,7 +504,9 @@
"deployment": {
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae",
"allowanceHolder": "0x0000000000001fF3684f28c67538d4D072C22734"
}
},
"sourcifyApi": "https://sourcify-api-monad.blockvision.org",
"blockscoutApi": "https://api.socialscan.io/monad-testnet/v1/explorer/command_api/contract"
},
"unichain": {
"chainId": 130,
Expand Down
41 changes: 24 additions & 17 deletions sh/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,28 +102,35 @@ 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 ))

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)"
declare _verify_etherscanApi
_verify_etherscanApi="$(get_config etherscanApi)"
declare -r _verify_etherscanApi

declare _verify_blockscoutApi
_verify_blockscoutApi="$(get_config blockscoutApi)"
declare -r _verify_blockscoutApi

declare _verify_sourcifyApi
_verify_sourcifyApi="$(get_config sourcifyApi)"
declare -r _verify_sourcifyApi

if [[ ${_verify_etherscanApi:-null} != [nN][uU][lL][lL] ]] ; then
declare _verify_etherscanKey
_verify_etherscanKey="$(get_api_secret etherscanKey)"
declare -r _verify_etherscanKey

if [[ ${_verify_etherscanKey:-null} == [nN][uU][lL][lL] ]] ; then
forge verify-contract --watch --verifier custom --verifier-url "$_verify_etherscanApi" --constructor-args "$_verify_constructor_args" "$_verify_deployed_address" "$_verify_source_path"
else
_verify_blockscoutApi="$(get_config blockscoutApi)"
forge verify-contract --watch --verifier custom --verifier-api-key "$_verify_etherscanKey" --verifier-url "$_verify_etherscanApi" --constructor-args "$_verify_constructor_args" "$_verify_deployed_address" "$_verify_source_path"
fi
forge verify-contract --watch --chain $chainid --verifier blockscout --verifier-url "$_verify_blockscoutApi" --constructor-args "$_verify_constructor_args" "$_verify_deployed_address" "$_verify_source_path"
fi

if (( _verify_source_etherscan )) ; then
forge verify-contract --watch --verifier custom --verifier-api-key "$(get_api_secret etherscanKey)" --verifier-url "$(get_config etherscanApi)" --constructor-args "$_verify_constructor_args" "$_verify_deployed_address" "$_verify_source_path"
if [[ ${_verify_blockscoutApi:-null} != [nN][uU][lL][lL] ]] ; then
forge verify-contract --watch --chain $chainid --verifier blockscout --verifier-url "$_verify_blockscoutApi" --constructor-args "$_verify_constructor_args" "$_verify_deployed_address" "$_verify_source_path"
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"
if [[ ${_verify_sourcifyApi:-null} != [nN][uU][lL][lL] ]] ; then
forge verify-contract --watch --chain $chainid --verifier sourcify --verifier-url "$_verify_sourcifyApi" --constructor-args "$_verify_constructor_args" "$_verify_deployed_address" "$_verify_source_path"
fi
}