Files
proxmox/docs/03-deployment/UNDEPLOYED_CONTRACTS_PRE_DEPLOYMENT_TASKS.md
defiQUG b3a8fe4496
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
chore: sync all changes to Gitea
- Config, docs, scripts, and backup manifests
- Submodule refs unchanged (m = modified content in submodules)

Made-with: Cursor
2026-03-02 11:37:34 -08:00

11 KiB
Raw Blame History

Undeployed Contracts — Pre-Deployment Tasks

Last Updated: 2026-02-28
Execution summary (2026-02-27): On-chain verification 36/38. Two missing: TransactionMirror (set TRANSACTION_MIRROR_ADDRESS in .env from script output) and DODO cUSDT/cUSDC pool (0x9fcB...). Deploy uses Core RPC only. Before deploy: if Core was read-only, run ./scripts/maintenance/make-rpc-vmids-writable-via-ssh.sh then ./scripts/maintenance/health-check-rpc-2101.sh. See REQUIRED_FIXES_AND_DEPLOYMENTS_STATUS.md, RPC_2101_READONLY_FIX.md.

Execution summary (2026-02-26): All runnable tasks executed. Env check, unified deploy dry-run, PMM pool dry-run, on-chain verification (36/36), deploy-optional-future-all --dry-run, fund-ccip-bridges-with-link --dry-run, check-balances-gas-and-deploy.sh, get-multichain-gas-prices.sh all completed. Mainnet dry-run and TransactionMirror simulate started (mainnet compiles CCIP bridges; run to completion when mainnet RPC is responsive). Previous: 1.x wallet/gas, 2.x gas API and estimates, 3.1 unified deploy dry-run (RPC + init fixes in smom-dbis-138), 3.2 DeployDeterministicCore simulated, 3.3 PMM pool script dry-run, 3.4 TransactionMirror, 3.6 optional-future, 3.7 fund-ccip dry-run, 4.6 on-chain verification (36/36). Optional env vars added to smom-dbis-138/.env when missing: DODO_PMM_INTEGRATION_ADDRESS, QUOTE_TOKEN_ADDRESS, WETH_ADDRESS_138 (public addresses only). PMM and unified deploy dry-runs now work with .env only (no inline env). Remaining: 3.5 mainnet dry-run (run when mainnet RPC is reachable); 4.14.5 post-deploy validation when components are deployed.

Source: AI_AGENTS_57XX_MCP_CONTRACTS_AND_CHAINS.md, DEX_AND_CROSS_CHAIN_CONTRACTS_NEEDED.md, DEPLOYED_CONTRACTS_OVERVIEW, deployment-status.json

This checklist covers: testing anything not yet deployed, checking deployer wallet gas, using the gas API to estimate deployment costs, and dry-running deployments before live execution.

Optional env vars (add/set when needed): In smom-dbis-138/.env, if missing, add (public addresses only): DODO_PMM_INTEGRATION_ADDRESS=0x79cdbaFBaA0FdF9F55D26F360F54cddE5c743F7D, QUOTE_TOKEN_ADDRESS=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2, WETH_ADDRESS_138=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 so PMM pool script and dry-runs work with .env only. Check: ./scripts/deployment/check-env-required.sh.


1. Check deployer wallet for gas

  • 1.1 Resolve deployer address from env:
    cd smom-dbis-138 && cast wallet address $PRIVATE_KEY
    
  • 1.2 Run balance check (Chain 138 + all networks the script supports):
    cd smom-dbis-138
    ./scripts/deployment/check-balances-gas-and-deploy.sh
    
    Uses Infura/gas API where available; reports native token balance and estimated cost for 5M gas per chain. See FUNDING_AND_DEPLOYMENT_CHECKLIST.
  • 1.3 Chain 138: ensure deployer has at least ~0.006 ETH (5M gas × 1 gwei + buffer). Recommended 12 ETH. If balance is 0, fund from genesis alloc or validator (see FUNDING_AND_DEPLOYMENT_CHECKLIST §2).
  • 1.4 Mainnet / L2: ensure deployer has sufficient native token per chain for any planned deployments (see DEPLOYMENT_GAS_COSTS_REALTIME for recommended balances).

2. Use gas API to estimate all deployment costs

  • 2.1 Fetch current gas prices (Etherscan for mainnet, defaults/RPC for others):
    cd smom-dbis-138
    ./scripts/deployment/get-multichain-gas-prices.sh
    
    Output can be sourced or used to update cost estimates.
  • 2.2 (Optional) Update doc with latest estimates:
    ./scripts/deployment/update-gas-estimates.sh
    
    Updates DEPLOYMENT_GAS_COSTS_REALTIME (or scripts target doc).
  • 2.3 Estimate gas for undeployed items (by chain): TransactionMirror simulated via forge script (no broadcast); DeployDeterministicCore reported ~10.67M gas. For pool creation use cast estimate on DODOPMMIntegration with createCUSDTCUSDCPool/createPool args when ready. EnhancedSwapRouter/DODOPMMProvider: run script dry-run when implemented.
  • 2.4 Sum estimated cost per chain and confirm deployer balance ≥ sum + buffer (e.g. 2030%): Confirmed via check-balances-gas-and-deploy.sh; Chain 138 sufficient; mainnet/L2 need funding for full deploy.

3. Dry-run deployments

  • 3.1 Chain 138 — unified deploy (no broadcast): Run ./scripts/deployment/deploy-contracts-unified.sh --dry-run --rpc-url $RPC_URL_138. RPC check uses 10s timeout; init.sh LOG_LEVEL fix applied so script runs with .env loaded.
    cd smom-dbis-138
    ./scripts/deployment/deploy-contracts-unified.sh --dry-run --rpc-url "http://192.168.11.211:8545"
    
  • 3.2 Chain 138 — phased core (dry-run if script supports): Simulated forge script script/deploy/DeployDeterministicCore.s.sol --rpc-url $RPC_URL_138 (no --broadcast); script ran successfully with gas estimate.
    forge script script/deploy/DeployDeterministicCore.s.sol --rpc-url $RPC_URL_138
    
  • 3.3 Chain 138 — PMM pool creation (dry-run): Set DODO_PMM_INTEGRATION_ADDRESS and QUOTE_TOKEN_ADDRESS (e.g. WETH 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2), then run DRY_RUN=true CHAIN_ID=138 ./scripts/create-all-dodo-pools-from-token-api.sh. Script accepts DODO_PMM_INTEGRATION or DODO_PMM_INTEGRATION_ADDRESS. With Token API unavailable it reports "Pools created: 0"; with API running it would list tokens and log [DRY RUN] Would createPool .... Document: DODO_PMM_INTEGRATION, DODO_PMM_NEXT_STEPS.
  • 3.4 Chain 138 — TransactionMirror (optional): Run without --broadcast to simulate: forge script script/DeployTransactionMirror.s.sol:DeployTransactionMirror --rpc-url $RPC_URL_138. See CONTRACT_DEPLOYMENT_RUNBOOK § TransactionMirror.
  • 3.5 Mainnet — dry-run (if deploying anything new): Requires PRIVATE_KEY, ETHEREUM_MAINNET_RPC in .env. Run from environment with mainnet RPC access. Script validates tools, env, addresses, and compiles CCIP bridges.
    ./scripts/deployment/dry-run-mainnet-deployment.sh
    
    Or per-script: forge script script/... --rpc-url $MAINNET_RPC --dry-run.
  • 3.6 Optional/future deployments (dry-run only):
    cd smom-dbis-138
    ./scripts/deployment/deploy-optional-future-all.sh --dry-run
    
  • 3.7 Bridge/LINK funding (dry-run):
    ./scripts/deployment/fund-ccip-bridges-with-link.sh --link 10 --dry-run
    

4. Test anything not deployed (validation / unit / script)

  • 4.1 PMM pools (Chain 138): Create cUSDT/cUSDC pool with forge script script/dex/CreateCUSDTCUSDCPool.s.sol:CreateCUSDTCUSDCPool --rpc-url $RPC_URL_138 --broadcast --private-key $PRIVATE_KEY --with-gas-price 1000000000 (script: smom-dbis-138/script/dex/CreateCUSDTCUSDCPool.s.sol). Requires POOL_MANAGER_ROLE on DODOPMMIntegration. If you see "Replacement transaction underpriced", a tx is pending at that nonce; wait for it to be mined or clear mempool, then retry with same or higher gas. After creation, test: getMidPrice, getOraclePrice, getBaseReserve, getQuoteReserve on pool address; confirm MCP dodo.get_pool_state and dodo.identify_pool_interface work with that address in allowlist.
  • 4.2 DODOPMMProvider: Not deployed; implementation placeholder. When implemented, add unit tests and a script dry-run for deployment.
  • 4.3 TransactionMirror (Chain 138): Deploy with forge script script/DeployTransactionMirror.s.sol:DeployTransactionMirror --rpc-url $RPC_URL_138 --broadcast --private-key $PRIVATE_KEY --with-gas-price 1000000000. If you see "Known transaction", the tx may be pending or already mined; check code at the logged address. Then test mirror receive path.
  • 4.4 EnhancedSwapRouter: Not deployed. When Uniswap/Balancer pools exist on 138, run deploy script with --dry-run and test quote path.
  • 4.5 cW tokens and PMM pools on public chains (1, 56, 137, etc.):* No addresses in deployment-status. No deployment from this repo yet. When you have a deployment path (bridge + factory or DODO), run gas estimate and dry-run per chain.
  • 4.6 On-chain verification (38 addresses): After any new deployment, run:
    ./scripts/verify/check-contracts-on-chain-138.sh [RPC_URL]
    
    Includes TransactionMirror and DODO cUSDT/cUSDC pool in the list. Last run: 36 present, 2 missing; see REQUIRED_FIXES_AND_DEPLOYMENTS_STATUS.

5. Summary — undeployed items (for cost and dry-run scope)

Chain Item Action for estimate / dry-run
138 PMM pools (cUSDT/cUSDC, cUSDT/USDT, cUSDC/USDC) Estimate: createPool / createCUSDTCUSDCPool gas. Dry-run: pool-creation script or cast send --dry-run.
138 TransactionMirror forge script or forge create with --dry-run / cast estimate.
138 DODOPMMProvider When implemented: script dry-run + unit tests.
138 EnhancedSwapRouter When pools exist: script dry-run.
1 (Trustless stack deployed; no new DODO from repo) Gas estimate only if adding contracts.
56, 137, 10, 100, 25, 42161, 8453, 42220, 1111, 43114 cW* tokens, PMM pools When deployment path exists: per-chain gas estimate + deploy script dry-run.

6. References