Files
proxmox/docs/03-deployment/DEPLOYER_GAS_AUTO_ROUTE_RUNBOOK.md
defiQUG b8613905bd
Some checks failed
Deploy to Phoenix / validate (push) Failing after 15s
Deploy to Phoenix / deploy (push) Has been skipped
chore: sync workspace — configs, docs, scripts, CI, pnpm, submodules
- Submodule pins: dbis_core, cross-chain-pmm-lps, mcp-proxmox (local, push may be pending), metamask-integration, smom-dbis-138
- Atomic swap + cross-chain-pmm-lops-publish, deploy-portal workflow, phoenix deploy-targets, routing/aggregator matrices
- Docs, token-lists, forge proxy, phoenix API, runbooks, verify scripts

Made-with: Cursor
2026-04-21 22:01:33 -07:00

6.7 KiB

Deployer Gas Auto-Route Runbook

Purpose: Convert deployer wallet ERC-20 (or compliant) tokens to native gas tokens on each target chain where balance is below threshold. Uses internal path (Chain 138), Protocolink (public chains), or manual/LiFi (Wemix).

Deployer address: 0x4A666F96fC8764181194447A7dFdb7d471b301C8


Prerequisites

  1. Balance check: Run deployer balance check first so you know which chains need gas.
  2. Environment: smom-dbis-138/.env (or project env loaded by scripts/lib/load-project-env.sh) with:
    • PRIVATE_KEY or DEPLOYER_ADDRESS
    • Per-chain RPC URLs: RPC_URL_138, ETHEREUM_MAINNET_RPC, BSC_RPC_URL, POLYGON_MAINNET_RPC, GNOSIS_MAINNET_RPC, ARBITRUM_MAINNET_RPC, OPTIMISM_MAINNET_RPC, BASE_MAINNET_RPC, AVALANCHE_RPC_URL, CRONOS_RPC_URL, CELO_RPC_URL, WEMIX_RPC, GNOSIS_RPC. For ALL Mainnet (651940) and Etherlink (42793): set RPC_URL_651940 and RPC_URL_42793 (or equivalent) when present so the orchestrator can show balance/route for those chains; otherwise they appear as "no RPC configured".
  3. Config: config/deployer-gas-routes.json — chain-to-method mapping and thresholds. Multiple swap routes for CRO and WEMIX: config/cro-wemix-swap-routes.json — SwapSpace, ChangeNOW, SimpleSwap, StealthEX and others; used by acquire-cro-and-wemix-gas.sh.

Steps

cd smom-dbis-138
./scripts/deployment/check-balances-gas-and-deploy.sh

Or from repo root (if env is loaded):

source scripts/lib/load-project-env.sh
cd smom-dbis-138 && ./scripts/deployment/check-balances-gas-and-deploy.sh

Confirm which chains show INSUFFICIENT for deploy.

2. Run the orchestrator

From repo root:

./scripts/deployment/deployer-gas-auto-route.sh

Options:

  • --dry-run — do not execute any tx; only report and run path scripts in read-only mode.
  • --no-execute — output tx data and instructions only; no signing (Protocolink path never signs; script only outputs quote and next steps).
  • --chain 138 — run only for chain 138 (or --chain 1111 for Wemix only).

The orchestrator:

  1. Reads config/deployer-gas-routes.json.
  2. For each chain, gets deployer native balance via RPC and compares to thresholdEther.
  3. For chains below threshold, dispatches by method:

3. Per-path actions

Path Action
Chain 138 If token-aggregation has no c*→WETH pool: fund deployer via genesis alloc or validator transfer. See FUNDING_AND_DEPLOYMENT_CHECKLIST.md.
Protocolink (public chains) Use the quote/output from protocolink-swap-to-gas.cjs. Build transaction via Protocolink API (estimate router data, build tx); sign with deployer key and submit.
Cronos (25) Manual (multiple routes): Protocolink does not support Cronos. Use any aggregator from config/cro-wemix-swap-routes.json (SwapSpace, ChangeNOW, SimpleSwap, StealthEX) to swap ETH/BNB/USDT/USDC → CRO; send to deployer on Cronos. Required ~15 CRO. List all routes: ./scripts/deployment/acquire-cro-and-wemix-gas.sh or --list.
Wemix (1111) Manual (multiple routes, only if gas needs a top-up): Use any aggregator from config/cro-wemix-swap-routes.json (SwapSpace, ChangeNOW, SimpleSwap, StealthEX) to swap ETH/BNB/POL → WEMIX; send to deployer on chain 1111. Current blocker is no longer native gas by default; the live gap is LINK funding on the deployed WEMIX bridge contracts plus a proof transfer. See WEMIX_ACQUISITION_TABLED.md.

References

Multiple swap routes (CRO / WEMIX)

Config: config/cro-wemix-swap-routes.json defines all aggregator routes for Cronos (25) and Wemix (1111). Each chain has a swapRoutes array with id, name, type, fromAssets, toAsset, url, description. To add a new route: append an object to chains."25".swapRoutes or chains."1111".swapRoutes and run acquire-cro-and-wemix-gas.sh to list it.


Quick reference

Command Purpose
./scripts/deployment/deployer-gas-auto-route.sh Run full auto-route (report + path scripts).
./scripts/deployment/deployer-gas-auto-route.sh --dry-run Report only; no execute.
./scripts/deployment/deployer-gas-auto-route.sh --chain 138 Only Chain 138 path.
./scripts/deployment/chain138-tokens-to-gas.sh Chain 138: token-aggregation quote c*→WETH (or "use genesis/validator").
node scripts/deployment/protocolink-swap-to-gas.cjs --chain-id 1 Protocolink quote for Ethereum (USDC→WETH).
node scripts/deployment/wemix-acquire-via-lifi.js Wemix: manual instructions and deployer address (JSON).
./scripts/deployment/acquire-cro-and-wemix-gas.sh Print all CRO and WEMIX swap routes from config (multiple aggregators).
./scripts/deployment/acquire-cro-and-wemix-gas.sh --list One line per route (name + URL).
./scripts/deployment/acquire-cro-and-wemix-gas.sh --json Emit deployer and config path only (for tooling).