- CCIP/trustless bridge contracts, GRU tokens, DEX/PMM tests, reserve vault. - Token-aggregation service routes, planner, chain config, relay env templates. - Config snapshots and multi-chain deployment markdown updates. - gitignore services/btc-intake/dist/ (tsc output); do not track dist. Run forge build && forge test before deploy (large solc graph). Made-with: Cursor
5.5 KiB
5.5 KiB
DVM (DODO Vending Machine) Deployment Check — Chain 138
Date: 2026-04-02
Summary
Chain 138 now has a self-deployed official DODO V2 DVM stack, but it is not DODO-listed.
- DODO’s official contract list (api.dodoex.io/dodo-contract/list?version=v1,v2) includes chains such as 1 (Ethereum), 5 (Goerli), 10 (Optimism), 56 (BSC), 133 (Syscoin), 137 (Polygon), 8453 (Base), etc.
- Chain ID 138 is still not in that list, so there is no DODO-published canonical DVM factory address for Chain 138.
- This repo now operates a self-deployed official DODO V2 DVM stack on Chain 138:
- DVMFactory:
0xc93870594C7f83A0aE076c2e30b494Efc526b68E - DVMFactoryAdapter / DODO_VENDING_MACHINE_ADDRESS:
0xb6D9EF3575bc48De3f011C310DC24d87bEC6087C - DODOPMMIntegration:
0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895 - DODOPMMProvider:
0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e - Stable pools (canonical corrected stack):
cUSDT/cUSDC:0x9e89bAe009adf128782E19e8341996c596ac40dCcUSDT/USDT:0x866Cb44b59303d8dc5f4F9E3E7A8e8b0bf238d66cUSDC/USDC:0xc39B7D0F40838cbFb54649d327f49a6DAC964062
- DVMFactory:
Implications
DODO_VENDING_MACHINE_ADDRESSin.envmust point to a Chain 138 factory adapter you deploy or obtain; it is not a DODO-listed public address.- The canonical Chain 138 PMM path is now the official DODO V2 DVMFactoryAdapter above, not the earlier mock DVM path.
Options
-
Use mock DVM (this repo, fallback only)
- A minimal
MockDVMFactory(andMockDVMPool) is provided so PMM can run on Chain 138 without official DODO. Deploy with: forge script script/dex/DeployMockDVMFactory.s.sol:DeployMockDVMFactory --rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" --legacy- Set
DODO_VENDING_MACHINE_ADDRESSin.envto the deployed address, then runscripts/deployment/run-pmm-and-pools.sh. Pools created are mocks (no real AMM); swap views return stubs. - Do not treat this as canonical anymore unless you are intentionally testing without the official DVM stack.
- A minimal
-
Deploy official DODO DVM on Chain 138 (this repo)
- Submodule lib/dodo-contractV2 (DODOEX/contractV2) is used to deploy the official DVM stack via Truffle. Our DVMFactoryAdapter wraps
createDODOVendingMachineascreateDVMsoDODOPMMIntegrationworks unchanged. - The repo deployment helper now runs the vendored DODO tree in a DVM-only compile mode by temporarily hiding unrelated Solidity
0.8.xcontracts duringtruffle compile/truffle migrate, then restoring them on exit. That allows the official DVM0.6.9stack to compile without forking the upstream repo. - One-shot:
scripts/deployment/deploy-official-dvm-chain138.sh- To verify compile before broadcast:
scripts/deployment/deploy-official-dvm-chain138.sh --compile-only - Requires
lib/dodo-contractV2deps:cd lib/dodo-contractV2 && npm install(if npm hits a registry/cert error, usenpm install --registry https://registry.npmjs.org/ --no-package-lock).
- To verify compile before broadcast:
- Manual:
- In
lib/dodo-contractV2: setprivKeyandRPC_URL_138(e.g. from parent.env), thennpx truffle migrate -f 1 --to 1 --network chain138andnpx truffle migrate -f 9 --to 9 --network chain138. - Set
DODO_DVM_FACTORYto the deployed DVMFactory address, then from repo root:
forge script script/dex/DeployDVMFactoryAdapter.s.sol:DeployDVMFactoryAdapter --rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" --legacy - Set
DODO_VENDING_MACHINE_ADDRESSin.envto the DVMFactoryAdapter address (not the DVMFactory address).
- In
- Then run
scripts/deployment/run-pmm-and-pools.sh(you may need to re-deploy DODOPMMIntegration if it was previously deployed with the mock DVM). - Current live Chain 138 result: the repo has already deployed this path and currently uses the addresses listed in the Summary section above.
- Stable-pair calibration note: for equal-reserve stable pairs on the official DODO V2 DVM stack, the current canonical Chain 138 pools use
i = 1e18,k = 0,lpFeeRate = 10 bps,isOpenTWAP = false. Earlierk = 0.5e18pools were removed because they priced above parity.
- Submodule lib/dodo-contractV2 (DODOEX/contractV2) is used to deploy the official DVM stack via Truffle. Our DVMFactoryAdapter wraps
-
Deploy DVM factory yourself from DODO source (outside this repo)
- DODO’s contracts are open source: DODOEX GitHub (contractV2).
- Deploy DVMFactory (and dependencies) to Chain 138, then deploy our DVMFactoryAdapter pointing at that factory, set
DODO_VENDING_MACHINE_ADDRESSto the adapter, and runrun-pmm-and-pools.sh.
-
Use an existing DVM factory on Chain 138 (if any)
- If someone else has already deployed a DODO-compatible DVM factory on Chain 138, set
DODO_VENDING_MACHINE_ADDRESSto that address. - We are not aware of any public deployment; you would need to confirm with your network or chain operator.
- If someone else has already deployed a DODO-compatible DVM factory on Chain 138, set
-
Leave PMM disabled on Chain 138
- Keep
DODO_VENDING_MACHINE_ADDRESSunset. ensure-prerequisites.shwill continue to warn;run-pmm-and-pools.shwill exit until the variable is set.
- Keep
Reference
- DODO V1/V2 addresses: docs.dodoex.io — Contract Addresses
- DVM product overview: DODO Vending Machine
- This repo:
DODOPMMIntegration.solusesIDODOVendingMachine.createDVM(...); the factory must implement that interface.