Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Feb 3, 2025
1 parent cc7eeeb commit 3c4241a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
2 changes: 2 additions & 0 deletions examples/call/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ cache_forge
access_token

localnet.json

test-ledger
2 changes: 2 additions & 0 deletions examples/call/scripts/localnet.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

set -e
set -x
set -o pipefail

if [ "$1" = "start" ]; then npx hardhat localnet --exit-on-error & sleep 10; fi

Expand Down
42 changes: 26 additions & 16 deletions examples/swap/scripts/localnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
set -x
set -o pipefail

if [ "$1" = "start" ]; then npx hardhat localnet --exit-on-error & sleep 10; fi
if [ "$1" = "start" ]; then npx hardhat localnet & sleep 10; fi

echo -e "\n🚀 Compiling contracts..."
npx hardhat compile --force --quiet
Expand All @@ -22,21 +22,6 @@ SENDER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
CONTRACT_SWAP=$(npx hardhat deploy --name Swap --network localhost --gateway "$GATEWAY_ZETACHAIN" --uniswap-router "$UNISWAP_ROUTER" | jq -r '.contractAddress')
COMPANION=$(npx hardhat deploy-companion --gateway "$GATEWAY_ETHEREUM" --network localhost --json | jq -r '.contractAddress')

npx hardhat companion-swap \
--network localhost \
--contract "$COMPANION" \
--universal-contract "$CONTRACT_SWAP" \
--amount 1 \
--target "$ZRC20_SOL" \
--recipient "8Sw9oNHHyEyAfQHC41QeFBRMhxG6HmFjNQnSbRvsXGb2"

npx hardhat localnet-check

npx hardhat localnet:solana-deposit-and-call \
--receiver "$CONTRACT_SWAP" \
--amount 1 \
--types '["address", "bytes", "bool"]' "$ZRC20_ETHEREUM" "$SENDER" true

npx hardhat localnet-check

npx hardhat companion-swap \
Expand Down Expand Up @@ -89,4 +74,29 @@ npx hardhat zetachain-swap \

npx hardhat localnet-check

# TESTING REVERTS

# npx hardhat companion-swap \
# --network localhost \
# --contract "$COMPANION" \
# --universal-contract 0x0000000000000000000000000000000000000001 \
# --amount 1 \
# --target "$ZRC20_SOL" \
# --recipient "8Sw9oNHHyEyAfQHC41QeFBRMhxG6HmFjNQnSbRvsXGb2"

# npx hardhat localnet-check

# npx hardhat localnet:solana-deposit-and-call \
# --receiver 0x0000000000000000000000000000000000000001 \
# --amount 1 \
# --types '["address", "bytes", "bool"]' 0x0000000000000000000000000000000000000001 0x0000000000000000000000000000000000000001 true

# npx hardhat localnet-check

# npx hardhat localnet:solana-deposit \
# --receiver "$CONTRACT_SWAP" \
# --amount 1

# npx hardhat localnet-check

if [ "$1" = "start" ]; then npx hardhat localnet-stop; fi

0 comments on commit 3c4241a

Please sign in to comment.