Skip to content

Commit 5d109a9

Browse files
authored
evm: adding contract verification to deploy scripts (#461)
1 parent 7a5b86f commit 5d109a9

4 files changed

+32
-3
lines changed

evm/env/.env.sample

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
export RPC=""
22

3+
export ETHERSCAN_KEY=""
4+
35
### Foundry profile, we always need to deploy with prod.
46
export FOUNDRY_PROFILE=prod
57

evm/sh/deploy_wormhole_ntt.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/bin/bash
22

3-
while getopts ":n:c:u:k:" opt; do
3+
while getopts ":n:c:u:e:k:" opt; do
44
case $opt in
55
n) network="$OPTARG"
66
;;
77
c) chain="$OPTARG"
88
;;
99
u) rpc="$OPTARG"
1010
;;
11+
e) etherscan_key="$OPTARG"
12+
;;
1113
k) private_key="$OPTARG"
1214
;;
1315
\?) echo "Invalid option -$OPTARG" >&2
@@ -54,9 +56,16 @@ then
5456
rpc=$RPC
5557
fi
5658

59+
# Use the ETHERSCAN_KEY environment variable if etherscan_key isn't set.
60+
if [ -z ${etherscan_key+x} ];
61+
then
62+
etherscan_key=$ETHERSCAN_KEY
63+
fi
64+
5765
forge script $FORGE_SCRIPTS/DeployWormholeNtt.s.sol \
5866
--rpc-url $rpc \
5967
--broadcast \
6068
--private-key $private_key \
69+
--verify --etherscan-api-key $etherscan_key \
6170
--slow \
6271
--skip test

evm/sh/upgrade_ntt_manager.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/bin/bash
22

3-
while getopts ":n:c:u:k:" opt; do
3+
while getopts ":n:c:u:e:k:" opt; do
44
case $opt in
55
n) network="$OPTARG"
66
;;
77
c) chain="$OPTARG"
88
;;
99
u) rpc="$OPTARG"
1010
;;
11+
e) etherscan_key="$OPTARG"
12+
;;
1113
k) private_key="$OPTARG"
1214
;;
1315
\?) echo "Invalid option -$OPTARG" >&2
@@ -54,9 +56,16 @@ then
5456
rpc=$RPC
5557
fi
5658

59+
# Use the ETHERSCAN_KEY environment variable if etherscan_key isn't set.
60+
if [ -z ${etherscan_key+x} ];
61+
then
62+
etherscan_key=$ETHERSCAN_KEY
63+
fi
64+
5765
forge script $FORGE_SCRIPTS/UpgradeNttManager.s.sol \
5866
--rpc-url $rpc \
5967
--broadcast \
6068
--private-key $private_key \
69+
--verify --etherscan-api-key $etherscan_key \
6170
--slow \
6271
--skip test

evm/sh/upgrade_wormhole_transceiver.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/bin/bash
22

3-
while getopts ":n:c:u:k:" opt; do
3+
while getopts ":n:c:u:e:k:" opt; do
44
case $opt in
55
n) network="$OPTARG"
66
;;
77
c) chain="$OPTARG"
88
;;
99
u) rpc="$OPTARG"
1010
;;
11+
e) etherscan_key="$OPTARG"
12+
;;
1113
k) private_key="$OPTARG"
1214
;;
1315
\?) echo "Invalid option -$OPTARG" >&2
@@ -54,9 +56,16 @@ then
5456
rpc=$RPC
5557
fi
5658

59+
# Use the ETHERSCAN_KEY environment variable if etherscan_key isn't set.
60+
if [ -z ${etherscan_key+x} ];
61+
then
62+
etherscan_key=$ETHERSCAN_KEY
63+
fi
64+
5765
forge script $FORGE_SCRIPTS/UpgradeWormholeTransceiver.s.sol \
5866
--rpc-url $rpc \
5967
--broadcast \
6068
--private-key $private_key \
69+
--verify --etherscan-api-key $etherscan_key \
6170
--slow \
6271
--skip test

0 commit comments

Comments
 (0)