Skip to content

Commit c2f9aad

Browse files
committed
Improved verification scripts
1 parent 0b053e6 commit c2f9aad

11 files changed

Lines changed: 3110 additions & 52 deletions

File tree

.env.example

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ ENTRYPOINT_ADDRESS=0x0000000071727De22E5E9d8BAf0edAc6f37da032
66
MULTISIG_DELEGATOR_IMPLEMENTATION_ADDRESS=
77
META_SWAP_ADAPTER_OWNER_ADDRESS=
88
METASWAP_ADDRESS=
9+
SWAPS_API_SIGNER_ADDRESS=
10+
ARGS_EQUALITY_CHECK_ENFORCER_ADDRESS=
911

1012
# Required for verifying contracts
1113
ETHERSCAN_API_KEY=
@@ -27,9 +29,12 @@ LINEA_RPC_URL=https://linea-mainnet.infura.io/v3/${RPC_API_KEY}
2729
OPTIMISM_RPC_URL=https://optimism-mainnet.infura.io/v3/${RPC_API_KEY}
2830
POLYGON_RPC_URL=https://polygon-mainnet.infura.io/v3/${RPC_API_KEY}
2931
BSC_RPC_URL=https://bsc-mainnet.infura.io/v3/${RPC_API_KEY}
30-
GNOSIS_RPC_URL=
32+
GNOSIS_RPC_URL=https://gnosis-rpc.publicnode.com
33+
BINANCE_RPC_URL=https://binance.llamarpc.com
34+
3135
# Testnets
3236
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/${RPC_API_KEY}
3337
LINEA_SEPOLIA_RPC_URL=https://linea-sepolia.infura.io/v3/${RPC_API_KEY}
3438
BASE_SEPOLIA_RPC_URL=https://base-sepolia.infura.io/v3/${RPC_API_KEY}
35-
MEGA_ETH_RPC_URL=https://carrot.megaeth.com/rpc # chain Id: 6342, native: ETH
39+
MEGA_ETH_RPC_URL=https://carrot.megaeth.com/rpc # chain Id: 6342, native: ETH
40+
GNOSIS_CHIADO_RPC_URL=https://rpc.chiadochain.net

broadcast/DeployCaveatEnforcers.s.sol/10200/run-1745416596.json

Lines changed: 1065 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployCaveatEnforcers.s.sol/10200/run-latest.json

Lines changed: 1065 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployDelegationFramework.s.sol/10200/run-1745416276.json

Lines changed: 289 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployDelegationFramework.s.sol/10200/run-latest.json

Lines changed: 289 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployEIP7702StatelessDeleGator.s.sol/10200/run-1745416765.json

Lines changed: 79 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployEIP7702StatelessDeleGator.s.sol/10200/run-latest.json

Lines changed: 79 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"transactions": [
3+
{
4+
"hash": "0xb0fde8128b3a52b55a439d4819d74362a9efa8e9df298a138ae4cdbc1fef09ab",
5+
"transactionType": "CREATE2",
6+
"contractName": "SimpleFactory",
7+
"contractAddress": "0x69aa2f9fe1572f1b640e1bbc512f5c3a734fc77c",
8+
"function": null,
9+
"arguments": null,
10+
"transaction": {
11+
"from": "0xb0403b32f54d0bd752113f4009e8b534c6669f44",
12+
"to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
13+
"gas": "0x4d1b8",
14+
"value": "0x0",
15+
"input": "0x4741544f52000000000000000000000000000000000000000000000000000000608060405234801561001057600080fd5b506102ef806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063481286e61461003b5780634af63f021461006a575b600080fd5b61004e6100493660046101cc565b61007d565b6040516001600160a01b03909116815260200160405180910390f35b61004e610078366004610204565b610090565b60006100898284610115565b9392505050565b600061009e60008385610122565b9050806001600160a01b03163b6000036100db576040516301e3495560e61b81526001600160a01b03821660048201526024015b60405180910390fd5b6040516001600160a01b038216907ff40fcec21964ffb566044d083b4073f29f7f7929110ea19e1b3ebe375d89055e90600090a292915050565b60006100898383306101a2565b60008347101561014e5760405163392efb2b60e21b8152476004820152602481018590526044016100d2565b815160000361017057604051631328927760e21b815260040160405180910390fd5b8282516020840186f590506001600160a01b03811661008957604051633a0ba96160e11b815260040160405180910390fd5b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b600080604083850312156101df57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561021757600080fd5b823567ffffffffffffffff8082111561022f57600080fd5b818501915085601f83011261024357600080fd5b813581811115610255576102556101ee565b604051601f8201601f19908116603f0116810190838211818310171561027d5761027d6101ee565b8160405282815288602084870101111561029657600080fd5b82602086016020830137600060209382018401529896909101359650505050505056fea2646970667358221220c5ebe4333fa061619df2864b76011685b4a25867b9958ff350b638fd1a460aaa64736f6c63430008170033",
16+
"nonce": "0x0",
17+
"chainId": "0x27d8"
18+
},
19+
"additionalContracts": [],
20+
"isFixedGasLimit": false
21+
}
22+
],
23+
"receipts": [
24+
{
25+
"status": "0x1",
26+
"cumulativeGasUsed": "0x34bc4",
27+
"logs": [],
28+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
29+
"type": "0x2",
30+
"transactionHash": "0xb0fde8128b3a52b55a439d4819d74362a9efa8e9df298a138ae4cdbc1fef09ab",
31+
"transactionIndex": "0x0",
32+
"blockHash": "0x00472ee65cd01844d5903f0a577b69d243403720f93270b2556ca7da3989e964",
33+
"blockNumber": "0xeb496e",
34+
"gasUsed": "0x34bc4",
35+
"effectiveGasPrice": "0x59682f07",
36+
"from": "0xb0403b32f54d0bd752113f4009e8b534c6669f44",
37+
"to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
38+
"contractAddress": null
39+
}
40+
],
41+
"libraries": [],
42+
"pending": [],
43+
"returns": {},
44+
"timestamp": 1745415905,
45+
"chain": 10200,
46+
"commit": "0b053e6"
47+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"transactions": [
3+
{
4+
"hash": "0xb0fde8128b3a52b55a439d4819d74362a9efa8e9df298a138ae4cdbc1fef09ab",
5+
"transactionType": "CREATE2",
6+
"contractName": "SimpleFactory",
7+
"contractAddress": "0x69aa2f9fe1572f1b640e1bbc512f5c3a734fc77c",
8+
"function": null,
9+
"arguments": null,
10+
"transaction": {
11+
"from": "0xb0403b32f54d0bd752113f4009e8b534c6669f44",
12+
"to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
13+
"gas": "0x4d1b8",
14+
"value": "0x0",
15+
"input": "0x4741544f52000000000000000000000000000000000000000000000000000000608060405234801561001057600080fd5b506102ef806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063481286e61461003b5780634af63f021461006a575b600080fd5b61004e6100493660046101cc565b61007d565b6040516001600160a01b03909116815260200160405180910390f35b61004e610078366004610204565b610090565b60006100898284610115565b9392505050565b600061009e60008385610122565b9050806001600160a01b03163b6000036100db576040516301e3495560e61b81526001600160a01b03821660048201526024015b60405180910390fd5b6040516001600160a01b038216907ff40fcec21964ffb566044d083b4073f29f7f7929110ea19e1b3ebe375d89055e90600090a292915050565b60006100898383306101a2565b60008347101561014e5760405163392efb2b60e21b8152476004820152602481018590526044016100d2565b815160000361017057604051631328927760e21b815260040160405180910390fd5b8282516020840186f590506001600160a01b03811661008957604051633a0ba96160e11b815260040160405180910390fd5b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b600080604083850312156101df57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561021757600080fd5b823567ffffffffffffffff8082111561022f57600080fd5b818501915085601f83011261024357600080fd5b813581811115610255576102556101ee565b604051601f8201601f19908116603f0116810190838211818310171561027d5761027d6101ee565b8160405282815288602084870101111561029657600080fd5b82602086016020830137600060209382018401529896909101359650505050505056fea2646970667358221220c5ebe4333fa061619df2864b76011685b4a25867b9958ff350b638fd1a460aaa64736f6c63430008170033",
16+
"nonce": "0x0",
17+
"chainId": "0x27d8"
18+
},
19+
"additionalContracts": [],
20+
"isFixedGasLimit": false
21+
}
22+
],
23+
"receipts": [
24+
{
25+
"status": "0x1",
26+
"cumulativeGasUsed": "0x34bc4",
27+
"logs": [],
28+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
29+
"type": "0x2",
30+
"transactionHash": "0xb0fde8128b3a52b55a439d4819d74362a9efa8e9df298a138ae4cdbc1fef09ab",
31+
"transactionIndex": "0x0",
32+
"blockHash": "0x00472ee65cd01844d5903f0a577b69d243403720f93270b2556ca7da3989e964",
33+
"blockNumber": "0xeb496e",
34+
"gasUsed": "0x34bc4",
35+
"effectiveGasPrice": "0x59682f07",
36+
"from": "0xb0403b32f54d0bd752113f4009e8b534c6669f44",
37+
"to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
38+
"contractAddress": null
39+
}
40+
],
41+
"libraries": [],
42+
"pending": [],
43+
"returns": {},
44+
"timestamp": 1745415905,
45+
"chain": 10200,
46+
"commit": "0b053e6"
47+
}

script/verification/verify-contract.sh

Lines changed: 99 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Usage:
55
# ./verify-contract.sh
66
#
7-
# Verifies a standard contract (with optional constructor arguments)
7+
# Verifies multiple contracts (with optional constructor arguments)
88
# across multiple chains.
99

1010
set -e
@@ -17,29 +17,101 @@ set +o allexport
1717
# Load shared logic
1818
source ./verify-utils.sh
1919

20-
# Example for contract verfication
21-
###############################################################################
22-
CONTRACT_NAME="NativeTokenPaymentEnforcer"
23-
CONTRACT_PATH="src/enforcers/$CONTRACT_NAME.sol"
24-
ADDRESS="0x4803a326ddED6dDBc60e659e5ed12d85c7582811"
25-
26-
# Example: you can encode constructor arguments with cast directly here:
27-
28-
CONSTRUCTOR_ARGS=$(cast abi-encode \
29-
"constructor(address,address)" \
30-
"0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3" \
31-
"0x44B8C6ae3C304213c3e298495e12497Ed3E56E41" \
32-
)
33-
34-
# No external library references
35-
LIB_STRING=""
36-
37-
###############################################################################
38-
# Call the shared function
39-
###############################################################################
40-
verify_across_chains \
41-
"$CONTRACT_PATH" \
42-
"$CONTRACT_NAME" \
43-
"$ADDRESS" \
44-
"$CONSTRUCTOR_ARGS" \
45-
"$LIB_STRING"
20+
##########################################
21+
# Helper functions for contract configuration
22+
##########################################
23+
24+
# Function to encode constructor arguments
25+
encode_args() {
26+
local signature="$1"
27+
shift
28+
cast abi-encode "$signature" "$@"
29+
}
30+
31+
# Function to add a contract to verify
32+
add_contract() {
33+
local name="$1"
34+
local path="$2"
35+
local address="$3"
36+
local constructor_args="$4"
37+
local lib_string="$5"
38+
39+
# Add to contracts array
40+
CONTRACTS+=("$name:$path:$address:$constructor_args:$lib_string")
41+
}
42+
43+
##########################################
44+
# Contract Configurations
45+
##########################################
46+
47+
# Initialize empty array
48+
declare -a CONTRACTS
49+
50+
# DelegationManager
51+
add_contract \
52+
"DelegationManager" \
53+
"src/DelegationManager.sol" \
54+
"0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3" \
55+
"$(encode_args "constructor(address)" \
56+
"0xB0403B32f54d0Bd752113f4009e8B534C6669f44")" \
57+
""
58+
59+
# MultiSigDeleGator
60+
add_contract \
61+
"MultiSigDeleGator" \
62+
"src/MultiSigDeleGator.sol" \
63+
"0x56a9EdB16a0105eb5a4C54f4C062e2868844f3A7" \
64+
"$(encode_args "constructor(address,address)" \
65+
"0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3" \
66+
"0x0000000071727De22E5E9d8BAf0edAc6f37da032")" \
67+
""
68+
69+
# EIP7702StatelessDeleGator
70+
add_contract \
71+
"EIP7702StatelessDeleGator" \
72+
"src/EIP7702/EIP7702StatelessDeleGator.sol" \
73+
"0x63c0c19a282a1B52b07dD5a65b58948A07DAE32B" \
74+
"$(encode_args "constructor(address,address)" \
75+
"0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3" \
76+
"0x0000000071727De22E5E9d8BAf0edAc6f37da032")" \
77+
""
78+
79+
# NativeTokenPaymentEnforcer
80+
add_contract \
81+
"NativeTokenPaymentEnforcer" \
82+
"src/enforcers/NativeTokenPaymentEnforcer.sol" \
83+
"0x4803a326ddED6dDBc60e659e5ed12d85c7582811" \
84+
"$(encode_args "constructor(address,address)" \
85+
"0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3" \
86+
"0x44B8C6ae3C304213c3e298495e12497Ed3E56E41")" \
87+
""
88+
89+
# Add more contracts here:
90+
# add_contract "ContractName" "path/to/contract.sol" "0xAddress" "$(encode_args "constructor(type)" "value")" ""
91+
92+
##########################################
93+
# Process Contracts
94+
##########################################
95+
96+
# Process each contract
97+
for contract in "${CONTRACTS[@]}"; do
98+
# Split the configuration string
99+
IFS=':' read -r name path address constructor_args lib_string <<< "$contract"
100+
101+
echo "============================================="
102+
echo "Verifying contract: $name"
103+
echo "============================================="
104+
105+
# Call the shared function
106+
verify_across_chains \
107+
"$path" \
108+
"$name" \
109+
"$address" \
110+
"$constructor_args" \
111+
"$lib_string"
112+
113+
echo "============================================="
114+
echo "Completed verification for: $name"
115+
echo "============================================="
116+
echo
117+
done

0 commit comments

Comments
 (0)