-
Notifications
You must be signed in to change notification settings - Fork 54
chore: switch to context sender/senderEVM #257
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,10 @@ set -e | |
set -x | ||
set -o pipefail | ||
|
||
if [ "$1" = "start" ]; then npx hardhat localnet & sleep 20; fi | ||
yarn zetachain localnet start --skip sui ton solana --exit-on-error & | ||
|
||
while [ ! -f "localnet.json" ]; do sleep 1; done | ||
Comment on lines
+7
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Capture and trap the background process. Running the CLI in the background without tracking its PID can lead to orphaned processes. Consider: yarn zetachain localnet start --skip sui ton solana --exit-on-error &
LOCALNET_PID=$!
trap "kill $LOCALNET_PID" EXIT This ensures proper cleanup on script exit. |
||
|
||
echo -e "\n🚀 Compiling contracts..." | ||
npx hardhat compile --force --quiet | ||
|
||
ZRC20_ETHEREUM=$(jq -r '.addresses[] | select(.type=="ZRC-20 ETH on 5") | .address' localnet.json) | ||
|
@@ -35,7 +36,7 @@ npx hardhat connected-deposit \ | |
--abort-address "$CONTRACT_ZETACHAIN" \ | ||
--amount 1 | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat connected-deposit \ | ||
--contract "$CONTRACT_ETHEREUM" \ | ||
|
@@ -45,7 +46,7 @@ npx hardhat connected-deposit \ | |
--abort-address "$CONTRACT_ZETACHAIN" \ | ||
--amount 1 | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat connected-call \ | ||
--contract "$CONTRACT_ETHEREUM" \ | ||
|
@@ -54,7 +55,7 @@ npx hardhat connected-call \ | |
--abort-address "$CONTRACT_ZETACHAIN" \ | ||
--types '["string"]' alice | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat connected-deposit-and-call \ | ||
--contract "$CONTRACT_ETHEREUM" \ | ||
|
@@ -64,7 +65,7 @@ npx hardhat connected-deposit-and-call \ | |
--abort-address "$CONTRACT_ZETACHAIN" \ | ||
--types '["string"]' alice | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat connected-deposit-and-call \ | ||
--contract "$CONTRACT_ETHEREUM" \ | ||
|
@@ -75,7 +76,7 @@ npx hardhat connected-deposit-and-call \ | |
--abort-address "$CONTRACT_ZETACHAIN" \ | ||
--types '["string"]' alice | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat universal-withdraw \ | ||
--contract "$CONTRACT_ZETACHAIN" \ | ||
|
@@ -85,7 +86,7 @@ npx hardhat universal-withdraw \ | |
--abort-address "$CONTRACT_ZETACHAIN" \ | ||
--amount 1 | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat universal-call \ | ||
--contract "$CONTRACT_ZETACHAIN" \ | ||
|
@@ -96,7 +97,7 @@ npx hardhat universal-call \ | |
--abort-address "$CONTRACT_ZETACHAIN" \ | ||
--types '["string"]' alice | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat universal-withdraw-and-call \ | ||
--contract "$CONTRACT_ZETACHAIN" \ | ||
|
@@ -109,7 +110,7 @@ npx hardhat universal-withdraw-and-call \ | |
--abort-address "$CONTRACT_ZETACHAIN" \ | ||
--types '["string"]' hello | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat universal-withdraw-and-call \ | ||
--contract "$CONTRACT_ZETACHAIN" \ | ||
|
@@ -120,7 +121,7 @@ npx hardhat universal-withdraw-and-call \ | |
--abort-address "$CONTRACT_ZETACHAIN" \ | ||
--types '["string"]' hello | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
# Testing toolkit methods | ||
|
||
|
@@ -130,7 +131,7 @@ npx hardhat evm-deposit \ | |
--network localhost \ | ||
--amount 1 | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat evm-deposit \ | ||
--receiver "$CONTRACT_ZETACHAIN" \ | ||
|
@@ -139,15 +140,15 @@ npx hardhat evm-deposit \ | |
--erc20 "$ERC20_ETHEREUM" \ | ||
--amount 1 | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat evm-call \ | ||
--receiver "$CONTRACT_ZETACHAIN" \ | ||
--gateway-evm "$GATEWAY_ETHEREUM" \ | ||
--network localhost \ | ||
--types '["string"]' alice | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat evm-deposit-and-call \ | ||
--receiver "$CONTRACT_ZETACHAIN" \ | ||
|
@@ -156,7 +157,7 @@ npx hardhat evm-deposit-and-call \ | |
--amount 1 \ | ||
--types '["string"]' alice | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat evm-deposit-and-call \ | ||
--receiver "$CONTRACT_ZETACHAIN" \ | ||
|
@@ -166,7 +167,7 @@ npx hardhat evm-deposit-and-call \ | |
--erc20 "$ERC20_ETHEREUM" \ | ||
--types '["string"]' alice | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat zetachain-withdraw \ | ||
--receiver "$CONTRACT_ETHEREUM" \ | ||
|
@@ -175,16 +176,16 @@ npx hardhat zetachain-withdraw \ | |
--network localhost \ | ||
--amount 1 | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat zetachain-withdraw \ | ||
--receiver "DrexsvCMH9WWjgnjVbx1iFf3YZcKadupFmxnZLfSyotd" \ | ||
--gateway-zeta-chain "$GATEWAY_ZETACHAIN" \ | ||
--zrc20 "$ZRC20_SOL" \ | ||
--network localhost \ | ||
--amount 1 | ||
# npx hardhat zetachain-withdraw \ | ||
# --receiver "DrexsvCMH9WWjgnjVbx1iFf3YZcKadupFmxnZLfSyotd" \ | ||
# --gateway-zeta-chain "$GATEWAY_ZETACHAIN" \ | ||
# --zrc20 "$ZRC20_SOL" \ | ||
# --network localhost \ | ||
# --amount 1 | ||
|
||
npx hardhat localnet-check | ||
# yarn zetachain localnet check | ||
|
||
npx hardhat zetachain-call \ | ||
--receiver "$CONTRACT_ETHEREUM" \ | ||
|
@@ -194,7 +195,7 @@ npx hardhat zetachain-call \ | |
--network localhost \ | ||
--types '["string"]' alice | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
npx hardhat zetachain-withdraw-and-call \ | ||
--receiver "$CONTRACT_ETHEREUM" \ | ||
|
@@ -206,7 +207,7 @@ npx hardhat zetachain-withdraw-and-call \ | |
--call-options-is-arbitrary-call \ | ||
--types '["string"]' hello | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
# ENCODED_ACCOUNTS_AND_DATA=$(npx ts-node solana/setup/encodeCallArgs.ts "sol" "$USDC_SPL") | ||
# npx hardhat zetachain-withdraw-and-call \ | ||
|
@@ -217,7 +218,7 @@ npx hardhat localnet-check | |
# --network localhost \ | ||
# --types '["bytes"]' $ENCODED_ACCOUNTS_AND_DATA | ||
|
||
# npx hardhat localnet-check | ||
# yarn zetachain localnet check | ||
|
||
# ENCODED_ACCOUNTS_AND_DATA=$(npx ts-node solana/setup/encodeCallArgs.ts "spl" "$USDC_SPL") | ||
# npx hardhat zetachain-withdraw-and-call \ | ||
|
@@ -228,7 +229,7 @@ npx hardhat localnet-check | |
# --network localhost \ | ||
# --types '["bytes"]' $ENCODED_ACCOUNTS_AND_DATA | ||
|
||
# npx hardhat localnet-check | ||
# yarn zetachain localnet check | ||
|
||
npx hardhat zetachain-withdraw-and-call \ | ||
--receiver "$CONTRACT_ETHEREUM" \ | ||
|
@@ -238,6 +239,6 @@ npx hardhat zetachain-withdraw-and-call \ | |
--network localhost \ | ||
--types '["string"]' hello | ||
|
||
npx hardhat localnet-check | ||
yarn zetachain localnet check | ||
|
||
if [ "$1" = "start" ]; then npx hardhat localnet-stop; fi | ||
yarn zetachain localnet stop | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Ensure graceful shutdown. After yarn zetachain localnet stop
wait $LOCALNET_PID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are already on 3.0.0 here so might be worth checking to upgrade this as well in separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do!