Files
smom-dbis-138/docs/deployment/DVM_DEPLOYMENT_CHECK.md
2026-03-02 12:14:09 -08:00

4.3 KiB
Raw Permalink Blame History

DVM (DODO Vending Machine) Deployment Check — Chain 138

Date: 2026-02-20

Summary

There is no official DODO DVM factory deployment on Chain 138.

  • DODOs 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_ADDRESS in .env must 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

  1. Use mock DVM (this repo)

    • A minimal MockDVMFactory (and MockDVMPool) 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_ADDRESS in .env to the deployed address, then run scripts/deployment/run-pmm-and-pools.sh. Pools created are mocks (no real AMM); swap views return stubs.
  2. 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 createDODOVendingMachine as createDVM so DODOPMMIntegration works 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 compile fails. 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-contractV2 deps: cd lib/dodo-contractV2 && npm install (if npm hits a registry/cert error, use npm install --registry https://registry.npmjs.org/ --no-package-lock).
    • Manual:
      1. In lib/dodo-contractV2: set privKey and RPC_URL_138 (e.g. from parent .env), then npx truffle migrate -f 1 --to 1 --network chain138 and npx truffle migrate -f 9 --to 9 --network chain138.
      2. Set DODO_DVM_FACTORY to 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
      3. Set DODO_VENDING_MACHINE_ADDRESS in .env to the DVMFactoryAdapter address (not the DVMFactory address).
    • 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).
  3. Deploy DVM factory yourself from DODO source (outside this repo)

    • DODOs 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_ADDRESS to the adapter, and run run-pmm-and-pools.sh.
  4. 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_ADDRESS to that address.
    • We are not aware of any public deployment; you would need to confirm with your network or chain operator.
  5. Leave PMM disabled on Chain 138

    • Keep DODO_VENDING_MACHINE_ADDRESS unset.
    • ensure-prerequisites.sh will continue to warn; run-pmm-and-pools.sh will exit until the variable is set.

Reference