#!/usr/bin/env bash
# B6: Register Vault deposit tokens with BridgeRegistry (BRG-VLT)
# Requires: PRIVATE_KEY, RPC_URL_138, VAULT_BRIDGE_INTEGRATION_ADDRESS, BRIDGE_REGISTRY_ADDRESS
# Run after deploying Vault system and VaultBridgeIntegration

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

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

echo "Registering Vault deposit tokens with BridgeRegistry..."
echo "VaultBridgeIntegration: $VAULT_BRIDGE_INTEGRATION_ADDRESS"
echo "Use cast send to call registerDepositToken(depositToken, chainIds, min, max, riskLevel, feeBps)"
echo "Note: defaultDestinations in VaultBridgeIntegration include 42793 (Etherlink); for Tezos L1 include chainId 1 in allowedDestinations when registering tokens."
