wormhole/aptos/scripts/register_devnet

36 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
set -e
DOTENV=../.env
[ -f $DOTENV ] || (echo "$DOTENV does not exist." >&2; exit 1)
# 1. load variables from .env file
. $DOTENV
# 2. next we get all the token bridge registration VAAs from the environment
# if a new VAA is added, this will automatically pick it up
VAAS=$(set | grep "REGISTER_.*_TOKEN_BRIDGE_VAA" | grep -v APTOS | cut -d '=' -f1)
# 3. use 'worm' to submit each registration VAA
for VAA in $VAAS
do
VAA=${!VAA}
worm submit $VAA --chain aptos --network devnet
done
# 4. next we get all the NFT bridge registration VAAs from the environment
# if a new VAA is added, this will automatically pick it up
VAAS=$(set | grep "REGISTER_.*_NFT_BRIDGE_VAA" | grep -v APTOS | cut -d '=' -f1)
# TODO: this will not be needed when the sdk is published
NFT_BRIDGE_ADDR=$(worm contract devnet aptos NFTBridge)
# 5. use 'worm' to submit each registration VAA
for VAA in $VAAS
do
VAA=${!VAA}
worm submit $VAA --chain aptos --contract-address $NFT_BRIDGE_ADDR --network devnet
done
echo "Registrations successful."