#!/usr/bin/env bash
# B7: Register ISO-4217W tokens with BridgeRegistry (BRG-ISO)
# Requires: PRIVATE_KEY, RPC_URL_138, USDW_ADDRESS, EURW_ADDRESS, BRIDGE_REGISTRY_ADDRESS

set -euo pipefail
cd "$(dirname "$0")/../.."
source .env 2>/dev/null || true

: "${PRIVATE_KEY:?PRIVATE_KEY required}"
: "${RPC_URL_138:?RPC_URL_138 required}"
: "${BRIDGE_REGISTRY_ADDRESS:?BRIDGE_REGISTRY_ADDRESS required}"

echo "Registering ISO-4217W tokens (USDW, EURW, GBPW) with BridgeRegistry..."
echo "Use cast send to call bridgeRegistry.registerToken(token, ...)"
echo "Note: Include 42793 (Etherlink) and 1 (Tezos L1) in allowedDestinations when registering tokens for Tezos bridging."
