@@ -45,23 +45,17 @@ if [[ "$L1_NETWORK" == "$L2_NETWORK" ]]; then
45
45
fi
46
46
47
47
# ## > SCRIPT AUX FUNCTIONS <
48
- function pre_deploy () {
48
+ function deploy () {
49
49
local NETWORK=$1
50
50
local GRAPH_CONFIG=$2
51
-
52
- # Create named accounts
53
- npx hardhat migrate:accounts --network " $NETWORK " --graph-config " $GRAPH_CONFIG " --disable-secure-accounts
54
-
51
+ local ADDRESS_BOOK= $3
52
+
53
+ echo " Deploying protocol on $NETWORK "
54
+
55
55
# Fund accounts if using nitro test nodes
56
56
if [[ " $NETWORK " == * " localnitro" * ]]; then
57
- npx hardhat nitro:fund-accounts --network " $NETWORK " --graph-config " $GRAPH_CONFIG " --disable-secure-accounts
57
+ npx hardhat migrate: nitro:fund-accounts --network " $NETWORK " --graph-config " $GRAPH_CONFIG " --disable-secure-accounts
58
58
fi
59
- }
60
-
61
- function deploy() {
62
- local NETWORK=$1
63
- local GRAPH_CONFIG=$2
64
- local ADDRESS_BOOK=$3
65
59
66
60
# Deploy protocol
67
61
npx hardhat migrate \
@@ -73,18 +67,6 @@ function deploy() {
73
67
--address-book " $ADDRESS_BOOK "
74
68
}
75
69
76
- function post_deploy () {
77
- local NETWORK=$1
78
- local GRAPH_CONFIG=$2
79
- local ADDRESS_BOOK=$3
80
-
81
- # Governor to accept contracts ownership
82
- npx hardhat migrate:ownership --network " $NETWORK " --graph-config " $GRAPH_CONFIG " --address-book " $ADDRESS_BOOK " --disable-secure-accounts
83
-
84
- # Unpause the protocol
85
- npx hardhat migrate:unpause:protocol --network " $NETWORK " --graph-config " $GRAPH_CONFIG " --address-book " $ADDRESS_BOOK " --disable-secure-accounts
86
- }
87
-
88
70
function configure_bridge () {
89
71
local L1_NETWORK=$1
90
72
local L1_GRAPH_CONFIG=$2
@@ -94,29 +76,12 @@ function configure_bridge () {
94
76
local ARBITRUM_ADDRESS_BOOK=$6
95
77
local ARBITRUM_DEPLOYMENT_FILE=$7
96
78
97
- # These settings are only used for CLI bridge commands
98
- # so we keep them here to avoid confusion with hardhat based tasks
99
- local L1_CHAIN_ID=${L1_CHAIN_ID:- " 1337" }
100
- local L2_CHAIN_ID=${L2_CHAIN_ID:- " 412346" }
101
-
102
- local L1_RPC=${L1_RPC:- " http://127.0.0.1:8545" }
103
- local L2_RPC=${L2_RPC:- " http://127.0.0.1:8547" }
104
-
105
- local L1_MNEMONIC=${L1_MNEMONIC:- " myth like bonus scare over problem client lizard pioneer submit female collect" }
106
- local L2_MNEMONIC=${L2_MNEMONIC:- " urge never interest human any economy gentle canvas anxiety pave unlock find" }
107
-
108
79
# Copy required arbitrum contract addresses to the local arbitrum address book
109
80
if [[ " $L1_NETWORK " == * " localnitro" * ]]; then
110
- npx hardhat nitro:address-book-setup --deployment-file " $ARBITRUM_DEPLOYMENT_FILE " --arbitrum-address-book " $ARBITRUM_ADDRESS_BOOK "
81
+ npx hardhat migrate: nitro:address-book --deployment-file " $ARBITRUM_DEPLOYMENT_FILE " --arbitrum-address-book " $ARBITRUM_ADDRESS_BOOK "
111
82
fi
112
83
113
- # Configure the bridge
114
- npx hardhat bridge:configure:l1 --network " $L1_NETWORK " --graph-config " $L1_GRAPH_CONFIG " --address-book " $ADDRESS_BOOK " --arbitrum-address-book " $ARBITRUM_ADDRESS_BOOK " --disable-secure-accounts
115
- npx hardhat bridge:configure:l2 --network " $L2_NETWORK " --graph-config " $L2_GRAPH_CONFIG " --address-book " $ADDRESS_BOOK " --arbitrum-address-book " $ARBITRUM_ADDRESS_BOOK " --disable-secure-accounts
116
-
117
- # Unpause the bridge
118
- npx hardhat migrate:unpause:bridge --network " $L2_NETWORK " --graph-config " $L2_GRAPH_CONFIG " --address-book " $ADDRESS_BOOK " --disable-secure-accounts
119
- npx hardhat migrate:unpause:bridge --network " $L1_NETWORK " --graph-config " $L1_GRAPH_CONFIG " --address-book " $ADDRESS_BOOK " --disable-secure-accounts
84
+ npx hardhat migrate:bridge --network " $L1_NETWORK " --l1-graph-config " $L1_GRAPH_CONFIG " --l2-graph-config " $L2_GRAPH_CONFIG " --address-book " $ADDRESS_BOOK " --arbitrum-address-book " $ARBITRUM_ADDRESS_BOOK " --disable-secure-accounts
120
85
}
121
86
122
87
function test_e2e () {
188
153
# # DEPLOY
189
154
# Deploy L1
190
155
if [[ -n " $L1_NETWORK " ]]; then
191
- echo " Deploying L1 protocol"
192
- pre_deploy " $L1_NETWORK " " $L1_GRAPH_CONFIG "
193
156
deploy " $L1_NETWORK " " $L1_GRAPH_CONFIG " " $ADDRESS_BOOK "
194
- post_deploy " $L1_NETWORK " " $L1_GRAPH_CONFIG " " $ADDRESS_BOOK "
195
157
fi
196
158
197
159
# Deploy L2
198
160
if [[ -n " $L2_NETWORK " ]]; then
199
- echo " Deploying L2 protocol"
200
- pre_deploy " $L2_NETWORK " " $L2_GRAPH_CONFIG "
201
161
deploy " $L2_NETWORK " " $L2_GRAPH_CONFIG " " $ADDRESS_BOOK "
202
- post_deploy " $L2_NETWORK " " $L2_GRAPH_CONFIG " " $ADDRESS_BOOK "
203
162
fi
204
163
205
164
# Configure bridge
0 commit comments