Files
proxmox/scripts/deployment/acquire-cro-and-wemix-gas.sh
defiQUG 3f76bc9507
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: update master documentation and push to Gitea (2026-03-06)
- MASTER_INDEX: Last Updated 2026-03-06; status 59/59 contracts; add NEXT_STEPS_LIST, CONTRACT_NEXT_STEPS_LIST
- docs/README, NEXT_STEPS_INDEX, 06-besu/MASTER_INDEX: Last Updated 2026-03-06
- Contract check script: 59 addresses (PMM, vault/reserve, CompliantFiatTokens); canonical CCIP/router
- New docs: EXECUTION_CHECKLIST, NEXT_STEPS_LIST, DOTENV_AUDIT, ADDITIONAL_PATHS, deployer gas runbook, WEMIX_ACQUISITION_TABLED, etc.
- Config: deployer-gas-routes, cro-wemix-swap-routes, routing-registry, token-mapping
- Scripts: check-contracts-on-chain-138, check-pmm-pool-balances-chain138, deployer-gas-auto-route, acquire-cro-and-wemix-gas
- Operator rule: operator-lan-access-check.mdc

Made-with: Cursor
2026-03-06 19:11:25 -08:00

70 lines
2.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Print all swap routes and instructions to acquire CRO (Cronos) and WEMIX (Wemix) native gas for the deployer.
# Reads multiple routes from config/cro-wemix-swap-routes.json. No in-repo execution: use aggregator UIs.
#
# Usage:
# ./scripts/deployment/acquire-cro-and-wemix-gas.sh # full output from config
# ./scripts/deployment/acquire-cro-and-wemix-gas.sh --json # emit config paths + deployer only
# ./scripts/deployment/acquire-cro-and-wemix-gas.sh --list # one line per route (name, url)
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
CONFIG="${PROJECT_ROOT}/config/cro-wemix-swap-routes.json"
OUTPUT_JSON=false
OUTPUT_LIST=false
for a in "$@"; do
[[ "$a" == "--json" ]] && OUTPUT_JSON=true
[[ "$a" == "--list" ]] && OUTPUT_LIST=true
done
if [[ ! -f "$CONFIG" ]]; then
echo "Error: Config not found: $CONFIG" >&2
exit 1
fi
DEPLOYER="$(jq -r '.deployerAddress // "0x4A666F96fC8764181194447A7dFdb7d471b301C8"' "$CONFIG")"
if $OUTPUT_JSON; then
jq -c '{ deployerAddress, configPath: $config, chains: .chains | keys }' --arg config "$CONFIG" "$CONFIG"
exit 0
fi
echo ""
echo "=============================================="
echo " Swap routes: CRO and WEMIX deployer gas"
echo " Deployer: $DEPLOYER"
echo " Config: $CONFIG"
echo "=============================================="
echo ""
for chain_key in 25 1111; do
name=$(jq -r --arg k "$chain_key" '.chains[$k].name // empty' "$CONFIG")
[[ -z "$name" ]] && continue
native=$(jq -r --arg k "$chain_key" '.chains[$k].nativeSymbol // empty' "$CONFIG")
required=$(jq -r --arg k "$chain_key" '.chains[$k].requiredNative // empty' "$CONFIG")
unit=$(jq -r --arg k "$chain_key" '.chains[$k].requiredUnit // empty' "$CONFIG")
recipient=$(jq -r --arg k "$chain_key" '.chains[$k].recipientNote // empty' "$CONFIG")
echo "--- $name (chain $chain_key) ---"
echo " Required: ~$required $unit"
echo " $recipient"
echo " Deployer address: $DEPLOYER"
echo ""
if $OUTPUT_LIST; then
jq -r --arg k "$chain_key" '.chains[$k].swapRoutes[]? | " \(.name): \(.url)"' "$CONFIG" 2>/dev/null
else
echo " Swap routes (use any aggregator; send $unit to deployer when done):"
jq -r --arg k "$chain_key" '.chains[$k].swapRoutes[]? | " [\(.name)] \(.description)\n \(.url)"' "$CONFIG" 2>/dev/null
fi
echo ""
done
echo "After funding:"
echo " Cronos: set CRONOS_RPC (or CRONOS_RPC_URL) in smom-dbis-138/.env, then run deploy-bridges-config-ready-chains.sh cronos and complete-config-ready-chains.sh."
echo " Wemix: set WEMIX_RPC in smom-dbis-138/.env, then run deploy-bridges-config-ready-chains.sh wemix and complete-config-ready-chains.sh. See WEMIX_ACQUISITION_TABLED.md."
echo ""