Files
proxmox/docs/03-deployment/PRE_DEPLOYMENT_CHECKLIST.md
defiQUG dedb55e05c
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs(03-deployment): runbooks and deployment status updates
Made-with: Cursor
2026-03-27 18:48:41 -07:00

10 KiB
Raw Blame History

Pre-Deployment Checklist — DODO PMM, Pools, Provider, Router & APIs

Last Updated: 2026-03-26
Purpose: Single source of truth for component status and ordered steps required before deployment (Chain 138).

See also: DEPLOYMENT_ORDER_OF_OPERATIONS.md — full deployment order (Phase 06) and remaining recommendations.

Deployment safety (required)

  • Correct RPC: Use only Core RPC (RPC_URL_138 = VMID 2101, e.g. http://192.168.11.211:8545). Never use Public RPC for deployments. Set in smom-dbis-138/.env.
  • Correct dotenv: All secrets from smom-dbis-138/.env only. Check: cd smom-dbis-138 && ./scripts/deployment/check-env-required.sh. Pre-flight from repo root: ./scripts/deployment/preflight-chain138-deploy.sh.
  • Gas / cost estimate: Run cd smom-dbis-138 && ./scripts/deployment/calculate-costs-consolidated.sh (or see DEPLOYMENT_GAS_COSTS_REALTIME) before deploying for accurate cost estimates.
  • Do not deploy when stuck: If nonce has pending txs or you see "Replacement transaction underpriced", run ./scripts/clear-all-transaction-pools.sh then wait ~60s before deploying. Prefer scripts that check nonce (e.g. deploy-transaction-mirror-and-pmm-pool-after-txpool-clear.sh).

1. Component status (current state)

Component Status Address / Notes
DODOPMMIntegration Deployed Chain 138 canonical corrected stack: 0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d.
PMM pools Reconciled 104 desired-state pools aligned; live funded public pools include cUSDT/cUSDC 0xff8d3b8fDF7B112759F076B69f4271D4209C0849, cUSDT/USDT 0x6fc60DEDc92a2047062294488539992710b99D71, cUSDC/USDC 0x9f74Be42725f2Aa072a9E0CdCce0E7203C510263, cUSDT/cXAUC 0x94316511621430423a2cff0C036902BAB4aA70c2, cUSDC/cXAUC 0x7867D58567948e5b9908F1057055Ee4440de0851, cEURT/cXAUC 0x505403093826D494983A93b43Aa0B8601078A44e.
DODOPMMProvider Deployed 0x5CAe6Ce155b7f08D3a956F5Dc82fC9945f29B381; 104/104 desired-state routes aligned.
EnhancedSwapRouter Not deployed Mainnet-only script today; for Chain 138 deploy when Uniswap/Balancer pools exist; set quoter/poolId.
Token-aggregation API Implemented, runnable Single-hop quotes; can index DODO once pools exist (set CHAIN_138_DODO_PMM_INTEGRATION).
Bridge quote (swap+bridge+swap) Implemented POST /api/bridge/quote; on-chain coordinator optional.
Cross-chain cW mesh* Design/tooling only Edge pools and bots not deployed.

2. Prerequisites before running deployment

  • RPC 2101 (Core) writable
    If Core was read-only: run
    ./scripts/maintenance/make-rpc-vmids-writable-via-ssh.sh then
    ./scripts/maintenance/health-check-rpc-2101.sh.
    See RPC_2101_READONLY_FIX.md.

  • Deployer wallet funded (Chain 138)
    At least ~0.006 ETH (5M gas × 1 gwei + buffer). Recommended 12 ETH.
    Check: ./scripts/deployment/check-balances-gas-and-deploy.sh (from smom-dbis-138).

  • Env set in smom-dbis-138/.env only
    Required: PRIVATE_KEY, RPC_URL_138 (must be Core RPC, not Public).
    For PMM: DODO_PMM_INTEGRATION_ADDRESS=0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d, DODO_PMM_PROVIDER_ADDRESS=0x5CAe6Ce155b7f08D3a956F5Dc82fC9945f29B381.
    Optional: GAS_PRICE_138 or GAS_PRICE (default 1 gwei).
    After TransactionMirror deploy: set TRANSACTION_MIRROR_ADDRESS from script output.
    Verify: cd smom-dbis-138 && ./scripts/deployment/check-env-required.sh.

  • Gas / cost estimate run
    Before deploying: cd smom-dbis-138 && ./scripts/deployment/calculate-costs-consolidated.sh for estimated deployment cost (Chain 138 min gas 1 gwei).

  • Deployer has POOL_MANAGER_ROLE on DODOPMMIntegration
    Pool creation and (if used) DODOPMMProvider registration require this role.

  • No stuck transactions
    Do not deploy if there are pending/stuck txs. If you see "Replacement transaction underpriced" or stuck nonce: run ./scripts/clear-all-transaction-pools.sh then wait ~60s before re-running deploy. Use scripts that check nonce when available.


3. Steps to complete before deployment (in order)

Step 1: Deploy TransactionMirror (if not already deployed)

cd smom-dbis-138
export RPC_URL_138="${RPC_URL_138:-http://192.168.11.211:8545}"
forge script script/DeployTransactionMirror.s.sol:DeployTransactionMirror \
  --rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" --with-gas-price 1000000000
  • Save the logged TransactionMirror address to smom-dbis-138/.env as TRANSACTION_MIRROR_ADDRESS.

Step 2: Create PMM pools (mesh-first; legacy three as minimum)

Use Core RPC only (no Public fallback). Preferred is full mesh creation; use legacy three-pool flow as minimum fallback.

2a) Preferred — full mesh on Chain 138:

cd smom-dbis-138
# Creates c* vs c*; optional c* vs official USDT/USDC; optional c* vs WETH; optional official vs WETH.
./scripts/create-pmm-full-mesh-chain138.sh

# Optional flags:
# MESH_ONLY_C_STAR=1
# MESH_INCLUDE_WETH=0
# MESH_INCLUDE_OFFICIAL_WETH=0

2b) Combined (TransactionMirror + cUSDT/cUSDC pool only):

./scripts/deployment/deploy-transaction-mirror-and-pmm-pool-after-txpool-clear.sh

This deploys TransactionMirror then creates only the cUSDT/cUSDC pool. For minimum legacy completion use 2c.

2c) Create each legacy pool manually (e.g. after 2b, or if mirror already deployed):

cd smom-dbis-138
export DODO_PMM_INTEGRATION="${DODO_PMM_INTEGRATION_ADDRESS:-0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d}"
export RPC_URL_138="${RPC_URL_138:-http://192.168.11.211:8545}"
export GAS_PRICE="${GAS_PRICE_138:-${GAS_PRICE:-1000000000}}"

# cUSDT/cUSDC
forge script script/dex/CreateCUSDTCUSDCPool.s.sol:CreateCUSDTCUSDCPool \
  --rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" --with-gas-price "$GAS_PRICE"

# cUSDT/USDT
forge script script/dex/CreateCUSDTUSDTPool.s.sol:CreateCUSDTUSDTPool \
  --rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" --with-gas-price "$GAS_PRICE"

# cUSDC/USDC
forge script script/dex/CreateCUSDCUSDCPool.s.sol:CreateCUSDCUSDCPool \
  --rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" --with-gas-price "$GAS_PRICE"

If you see “Replacement transaction underpriced”, wait for the pending tx to be mined or clear the tx pool, then retry (optionally with higher gas). After each creation, note the pool address for Step 4.

Use DODOPMMIntegration.addLiquidity(pool, baseAmount, quoteAmount) for each pool. Approve base/quote tokens to the integration contract first. See DODO_PMM_INTEGRATION.md.

Step 4: Deploy DODOPMMProvider and register pools

cd smom-dbis-138
forge script script/liquidity/DeployDODOPMMProvider.s.sol:DeployDODOPMMProvider \
  --rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" --with-gas-price "$GAS_PRICE"

Save the logged address as DODO_PMM_PROVIDER_ADDRESS in .env. Then register each created pool (legacy three at minimum, full mesh when used):

provider.registerPool(tokenIn, tokenOut, poolAddress);

(e.g. via cast send or a small script) so that getQuote / executeSwap work for those pairs.

Step 5: EnhancedSwapRouter (optional, when Uniswap/Balancer exist on 138)

Current deploy script is mainnet-only (block.chainid == 1). For Chain 138:

  • When Uniswap V3 / Balancer pools exist on 138, add or use a Chain-138aware deploy script (env-based quoter/poolId).
  • Run with --rpc-url $RPC_URL_138 and configure quoter and Balancer poolId after deploy.
    See CONTRACT_DEPLOYMENT_RUNBOOK.md § EnhancedSwapRouter.

Step 6: Token-aggregation API (DODO indexing)

  • Ensure CHAIN_138_DODO_PMM_INTEGRATION=0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d (or equivalent) is set where the token-aggregation service runs. Optional: CHAIN_138_DODO_POOL_MANAGER, CHAIN_138_DODO_VENDING_MACHINE (see token-aggregation .env.example and dex-factories.ts).
  • Once pools exist, the service can index DODO pools from DODOPMMIntegration and expose single-hop quotes.

Step 7: On-chain verification

After any new deployment:

./scripts/verify/check-contracts-on-chain-138.sh [RPC_URL]

Target: all expected addresses (e.g. 59/59 per check-contracts-on-chain-138.sh when TransactionMirror, DODO pools, vault/reserve, and CompliantFiatTokens are present). Update REQUIRED_FIXES_AND_DEPLOYMENTS_STATUS.md and CONTRACT_ADDRESSES_REFERENCE.md with new pool and provider addresses.


4. Script reference

Script Purpose
scripts/deployment/deploy-transaction-mirror-and-pmm-pool-after-txpool-clear.sh Deploy TransactionMirror + create cUSDT/cUSDC pool (Core RPC only).
smom-dbis-138/script/dex/CreateCUSDTCUSDCPool.s.sol Create cUSDT/cUSDC pool.
smom-dbis-138/script/dex/CreateCUSDTUSDTPool.s.sol Create cUSDT/USDT pool.
smom-dbis-138/script/dex/CreateCUSDCUSDCPool.s.sol Create cUSDC/USDC pool.
smom-dbis-138/script/liquidity/DeployDODOPMMProvider.s.sol Deploy DODOPMMProvider (then register pools).
smom-dbis-138/script/bridge/trustless/DeployEnhancedSwapRouter.s.sol Deploy EnhancedSwapRouter (mainnet-only; Chain 138 needs env/config).
scripts/verify/check-contracts-on-chain-138.sh Verify expected contract addresses on Chain 138.

5. References