**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`).
| **DODOPMMProvider** | ✅ Deployed | `0x8EF6657D2a86c569F6ffc337EE6b4260Bd2e59d0`; all three pools registered via `script/liquidity/RegisterDODOPools.s.sol`. |
| **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`). |
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
(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-138–aware 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](CONTRACT_DEPLOYMENT_RUNBOOK.md) § EnhancedSwapRouter.
### Step 6: Token-aggregation API (DODO indexing)
- Ensure `CHAIN_138_DODO_PMM_INTEGRATION=0x79cdbaFBaA0FdF9F55D26F360F54cddE5c743F7D` (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)).
- Once pools exist, the service can index DODO pools from DODOPMMIntegration and expose single-hop quotes.
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](REQUIRED_FIXES_AND_DEPLOYMENTS_STATUS.md) and [CONTRACT_ADDRESSES_REFERENCE.md](../11-references/CONTRACT_ADDRESSES_REFERENCE.md) with new pool and provider addresses.
- [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).