4
4
set -x
5
5
set -o pipefail
6
6
7
- if [ " $1 " = " start" ]; then npx hardhat localnet --exit-on-error & sleep 25 ; fi
7
+ if [ " $1 " = " start" ]; then npx hardhat localnet & sleep 15 ; fi
8
8
9
9
echo -e " \n🚀 Compiling contracts..."
10
10
npx hardhat compile --force --quiet
11
11
12
12
ZRC20_ETHEREUM=$( jq -r ' .addresses[] | select(.type=="ZRC-20 ETH on 5") | .address' localnet.json)
13
13
ERC20_ETHEREUM=$( jq -r ' .addresses[] | select(.type=="ERC-20 USDC" and .chain=="ethereum") | .address' localnet.json)
14
14
ZRC20_BNB=$( jq -r ' .addresses[] | select(.type=="ZRC-20 BNB on 97") | .address' localnet.json)
15
+ ZRC20_SOL=$( jq -r ' .addresses[] | select(.type=="ZRC-20 SOL on 901") | .address' localnet.json)
15
16
GATEWAY_ETHEREUM=$( jq -r ' .addresses[] | select(.type=="gatewayEVM" and .chain=="ethereum") | .address' localnet.json)
16
17
GATEWAY_ZETACHAIN=$( jq -r ' .addresses[] | select(.type=="gatewayZEVM" and .chain=="zetachain") | .address' localnet.json)
17
18
SENDER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
@@ -107,4 +108,100 @@ npx hardhat universal-withdraw-and-call \
107
108
108
109
npx hardhat localnet-check
109
110
111
+ # Testing toolkit methods
112
+
113
+ npx hardhat evm-deposit \
114
+ --receiver " $CONTRACT_ZETACHAIN " \
115
+ --gateway-evm " $GATEWAY_ETHEREUM " \
116
+ --network localhost \
117
+ --amount 1
118
+
119
+ npx hardhat localnet-check
120
+
121
+ npx hardhat evm-deposit \
122
+ --receiver " $CONTRACT_ZETACHAIN " \
123
+ --gateway-evm " $GATEWAY_ETHEREUM " \
124
+ --network localhost \
125
+ --erc20 " $ERC20_ETHEREUM " \
126
+ --amount 1
127
+
128
+ npx hardhat localnet-check
129
+
130
+ npx hardhat evm-call \
131
+ --receiver " $CONTRACT_ZETACHAIN " \
132
+ --gateway-evm " $GATEWAY_ETHEREUM " \
133
+ --network localhost \
134
+ --types ' ["string"]' alice
135
+
136
+ npx hardhat localnet-check
137
+
138
+ npx hardhat evm-deposit-and-call \
139
+ --receiver " $CONTRACT_ZETACHAIN " \
140
+ --gateway-evm " $GATEWAY_ETHEREUM " \
141
+ --network localhost \
142
+ --amount 1 \
143
+ --types ' ["string"]' alice
144
+
145
+ npx hardhat localnet-check
146
+
147
+ npx hardhat evm-deposit-and-call \
148
+ --receiver " $CONTRACT_ZETACHAIN " \
149
+ --gateway-evm " $GATEWAY_ETHEREUM " \
150
+ --network localhost \
151
+ --amount 1 \
152
+ --erc20 " $ERC20_ETHEREUM " \
153
+ --types ' ["string"]' alice
154
+
155
+ npx hardhat localnet-check
156
+
157
+ npx hardhat zetachain-withdraw \
158
+ --receiver " $CONTRACT_ETHEREUM " \
159
+ --gateway-zeta-chain " $GATEWAY_ZETACHAIN " \
160
+ --zrc20 " $ZRC20_ETHEREUM " \
161
+ --network localhost \
162
+ --amount 1
163
+
164
+ npx hardhat localnet-check
165
+
166
+ npx hardhat zetachain-withdraw \
167
+ --receiver " DrexsvCMH9WWjgnjVbx1iFf3YZcKadupFmxnZLfSyotd" \
168
+ --gateway-zeta-chain " $GATEWAY_ZETACHAIN " \
169
+ --zrc20 " $ZRC20_SOL " \
170
+ --network localhost \
171
+ --amount 1
172
+
173
+ npx hardhat localnet-check
174
+
175
+ npx hardhat zetachain-call \
176
+ --receiver " $CONTRACT_ETHEREUM " \
177
+ --gateway-zeta-chain " $GATEWAY_ZETACHAIN " \
178
+ --zrc20 " $ZRC20_ETHEREUM " \
179
+ --function " hello(string)" \
180
+ --network localhost \
181
+ --types ' ["string"]' alice
182
+
183
+ npx hardhat localnet-check
184
+
185
+ npx hardhat zetachain-withdraw-and-call \
186
+ --receiver " $CONTRACT_ETHEREUM " \
187
+ --gateway-zeta-chain " $GATEWAY_ZETACHAIN " \
188
+ --zrc20 " $ZRC20_ETHEREUM " \
189
+ --function " hello(string)" \
190
+ --amount 1 \
191
+ --network localhost \
192
+ --call-options-is-arbitrary-call \
193
+ --types ' ["string"]' hello
194
+
195
+ npx hardhat localnet-check
196
+
197
+ npx hardhat zetachain-withdraw-and-call \
198
+ --receiver " $CONTRACT_ETHEREUM " \
199
+ --gateway-zeta-chain " $GATEWAY_ZETACHAIN " \
200
+ --zrc20 " $ZRC20_ETHEREUM " \
201
+ --amount 1 \
202
+ --network localhost \
203
+ --types ' ["string"]' hello
204
+
205
+ npx hardhat localnet-check
206
+
110
207
if [ " $1 " = " start" ]; then npx hardhat localnet-stop; fi
0 commit comments