4.3 KiB
4.3 KiB
DVM (DODO Vending Machine) Deployment Check — Chain 138
Date: 2026-02-20
Summary
There is no official DODO DVM factory deployment on Chain 138.
- 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 not in that list, so there is no canonical DVM factory address for Chain 138 from DODO.
Implications
DODO_VENDING_MACHINE_ADDRESSin.envmust point to a DVM factory you deploy or obtain on Chain 138; it will not be an “official” DODO-listed address.- Until that address is set, PMM (run-pmm-and-pools.sh) and DODOPMMIntegration cannot be used on Chain 138.
Options
-
Use mock DVM (this repo)
- 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.
- 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. - Blocker: DODO contractV2 mixes Solidity 0.6.9 (DVM, Factory) and 0.8.16 (DODOGasSavingPool, SmartRoute). Truffle compiles the whole repo with one solc version, so
truffle compilefails. Until DODO adds multi-compiler support or we vendor only the DVM 0.6.9 tree, use the mock DVM (option 0) or deploy from a DODO fork that compiles. - One-shot (when Truffle compiles):
scripts/deployment/deploy-official-dvm-chain138.sh- 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).
- Requires
- 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).
- 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.