Skip to content
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

feat: add burn to i2a transfer script #863

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions devnet/docker/icon-algorand/i2a-tokenTransfer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,34 @@ ALGO_RECEIVER_BALANCE=$(PRIVATE_KEY=$(cat cache/algo_receiver_private_key) ALGOD

echo "Transfer Complete"
echo "$ALGORAND_RECEIVER_ADDRESS Test Token balance: $ALGO_RECEIVER_BALANCE"

echo "Burn Algorand Wrapped Token"
echo "Create ICON receiver account"
goloop ks gen --out receiver.keystore.json
ICON_RECEIVER_ADDRESS=$(cat receiver.keystore.json | jq -r '.address')

echo "Fund ICON wallet $ICON_RECEIVER_ADDRESS"
echo "Press enter to start transfer..."
read

PRIVATE_KEY=$(cat cache/algo_receiver_private_key) ALGOD_ADDRESS=$(cat cache/algod_address) ALGOD_TOKEN=$(cat cache/algo_token) algorand-burn-token ../../../pyteal/teal/reserve $(cat cache/bmc_app_id) $(cat cache/reserve_app_id) $ICON_RECEIVER_ADDRESS $(cat cache/algo_wrapped_token_id) 5000

echo "Wait 30 seconds for transfer BTP message to ICON"
sleep 30

echo "Check ICON receiver balance"
ICON_RECEIVER_BALANCE=$(goloop rpc call \
--from $(cat icon.keystore.json | jq -r '.address') \
--to $(cat cache/icon_test_token_addr) \
--method balanceOf \
--param _owner=$ICON_RECEIVER_ADDRESS \
--uri https://lisbon.net.solidwallet.io/api/v3/icon_dex
)

if [ $(printf "%d\n" $(echo $ICON_RECEIVER_BALANCE | cut -d '"' -f 2)) != 5000 ]
then
echo "ICON receiver balance is not correct"
exit 1
fi

echo "Burn successful"