feat(scripts): resolve CCIP/LINK addresses via config inventory
- Add scripts/lib/address-inventory.sh (jq + JSON inventory fallback) - Wire deployment helper scripts to load_explorer_runtime_env + resolve_address_value - Persist new LINK to address-inventory.json via persist_inventory_value - Document config/*.json in config/README.md Made-with: Cursor
This commit is contained in:
@@ -5,8 +5,9 @@ set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
source "$PROJECT_ROOT/scripts/lib/address-inventory.sh"
|
||||
|
||||
source "$PROJECT_ROOT/.env" 2>/dev/null || source "$PROJECT_ROOT/../.env" 2>/dev/null || true
|
||||
load_explorer_runtime_env
|
||||
|
||||
RPC_URL="${RPC_URL_138:-http://192.168.11.250:8545}"
|
||||
GAS_PRICE="${1:-$(cast --to-wei 20 gwei)}"
|
||||
@@ -158,10 +159,10 @@ if [ "$CONFIRMED" != "true" ]; then
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=== Updating .env ==="
|
||||
sed -i "s|^LINK_TOKEN=.*|LINK_TOKEN=$LINK_ADDRESS|" "$PROJECT_ROOT/.env" 2>/dev/null || \
|
||||
echo "LINK_TOKEN=$LINK_ADDRESS" >> "$PROJECT_ROOT/.env"
|
||||
echo "✓ Updated .env"
|
||||
echo "=== Updating address inventory ==="
|
||||
persist_inventory_value "LINK_TOKEN" "$LINK_ADDRESS"
|
||||
persist_inventory_value "CCIP_CHAIN138_FEE_TOKEN" "$LINK_ADDRESS"
|
||||
echo "✓ Updated config/address-inventory.json"
|
||||
echo ""
|
||||
|
||||
echo "=== Verifying Token Functions ==="
|
||||
@@ -197,4 +198,3 @@ fi
|
||||
echo "✅✅✅ LINK TOKEN DEPLOYMENT COMPLETE!"
|
||||
echo "Address: $LINK_ADDRESS"
|
||||
echo ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user