2022-10-13 18:23:23 -07:00
|
|
|
#!/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)
|
|
|
|
|
2023-01-11 07:30:13 -08:00
|
|
|
# 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)
|
|
|
|
|
2022-10-13 18:23:23 -07:00
|
|
|
# TODO: this will not be needed when the sdk is published
|
2023-05-06 02:02:05 -07:00
|
|
|
NFT_BRIDGE_ADDR=$(worm info contract devnet aptos NFTBridge)
|
2022-10-13 18:23:23 -07:00
|
|
|
|
2023-01-11 07:30:13 -08:00
|
|
|
# 5. use 'worm' to submit each registration VAA
|
2022-10-13 18:23:23 -07:00
|
|
|
for VAA in $VAAS
|
|
|
|
do
|
|
|
|
VAA=${!VAA}
|
2023-01-11 07:30:13 -08:00
|
|
|
worm submit $VAA --chain aptos --contract-address $NFT_BRIDGE_ADDR --network devnet
|
2022-10-13 18:23:23 -07:00
|
|
|
done
|
|
|
|
echo "Registrations successful."
|