**Purpose:** Single source of truth for component status and ordered steps required before deployment (Chain 138).
**See also:** [DEPLOYMENT_ORDER_OF_OPERATIONS.md](DEPLOYMENT_ORDER_OF_OPERATIONS.md) — full deployment order (Phase 0–6) 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](../11-references/DEPLOYMENT_GAS_COSTS_REALTIME.md)) 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`).
| **EnhancedSwapRouter** | ❌ Not deployed | Chain 138 deployment script exists, but live WETH-to-stable routes and non-DODO providers are still not configured. |
| **Token-aggregation API** | ✅ Implemented, runnable | Single-hop quotes; now persists the canonical Chain 138 DODO pool set on the live explorer deployment. |
For PMM: `DODO_PMM_INTEGRATION_ADDRESS=0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895`, `DODO_PMM_PROVIDER_ADDRESS=0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e`.
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)
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.
### Step 3: Add liquidity to pools (optional but recommended)
Use `DODOPMMIntegration.addLiquidity(pool, baseAmount, quoteAmount)` for each pool. Approve base/quote tokens to the integration contract first. See [DODO_PMM_INTEGRATION.md](../../smom-dbis-138/docs/integration/DODO_PMM_INTEGRATION.md).
### Step 4: Deploy DODOPMMProvider and register pools
- Ensure `CHAIN_138_DODO_PMM_INTEGRATION=0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895` (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](../../smom-dbis-138/services/token-aggregation/src/config/dex-factories.ts)).
Target: all expected addresses (e.g. **67/67** per check-contracts-on-chain-138.sh when TransactionMirror, DODO pools, vault/reserve, CompliantFiatTokens, ISO20022Router, and the cross-chain flash trio are present). Update [REQUIRED_FIXES_AND_DEPLOYMENTS_STATUS.md](REQUIRED_FIXES_AND_DEPLOYMENTS_STATUS.md) and [CONTRACT_ADDRESSES_REFERENCE.md](../11-references/CONTRACT_ADDRESSES_REFERENCE.md) with new pool, provider, and flash-infrastructure addresses.
| `smom-dbis-138/script/bridge/trustless/DeployEnhancedSwapRouter.s.sol` | Legacy router deployment path (mainnet-oriented). The live Chain 138 execution surface is `EnhancedSwapRouterV2` plus the funded pilot-compatible venue layer; verify with `scripts/verify/check-chain138-pilot-dex-venues.sh`. |
- [POOLS_AND_NETWORKS_FULL_DESIGN.md](../11-references/POOLS_AND_NETWORKS_FULL_DESIGN.md) — Every pool and network in the full design (61 pools, 6 networks).