feat: bridges, PMM, flash workflow, token-aggregation, and deployment docs
- 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
This commit is contained in:
@@ -112,6 +112,8 @@ After deployment, add the AddressMapper address to `.env`:
|
||||
ADDRESS_MAPPER=0x...
|
||||
```
|
||||
|
||||
On **Chain 138**, the canonical mapper is documented in the parent repo at `docs/11-references/ADDRESS_MATRIX_AND_STATUS.md` (`0x439Fcb2d2ab2f890DCcAE50461Fa7d978F9Ffe1A`); inventory also lists `ADDRESS_MAPPER_LEGACY_DUPLICATE` in `config/address-inventory.chain138.json`. Prefer the canonical address in `.env`.
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Always use deployed addresses** for contract interactions
|
||||
|
||||
@@ -156,7 +156,7 @@ forge script script/dex/DeployPrivatePoolRegistryAndPools.s.sol:DeployPrivatePoo
|
||||
|
||||
### PMM (Chain 138) completion checklist
|
||||
|
||||
1. Set **DODO_VENDING_MACHINE_ADDRESS** in `.env` to the DODO DVM factory address on Chain 138. **Chain 138 is not in DODO’s official list** — see [DVM_DEPLOYMENT_CHECK.md](DVM_DEPLOYMENT_CHECK.md). Deploy the factory yourself from [DODOEX](https://github.com/DODOEX) or use an existing deployment if available.
|
||||
1. Set **DODO_VENDING_MACHINE_ADDRESS** in `.env` to the DODO DVM factory adapter address on Chain 138. **Chain 138 is not in DODO’s official list** — see [DVM_DEPLOYMENT_CHECK.md](DVM_DEPLOYMENT_CHECK.md). Use `scripts/deployment/deploy-official-dvm-chain138.sh` to deploy the official DVM `0.6.9` stack from the vendored DODO tree and then deploy the local adapter.
|
||||
2. Set **OFFICIAL_USDT_ADDRESS** and **OFFICIAL_USDC_ADDRESS** to the live Chain 138 quote-side mirror stables:
|
||||
- `OFFICIAL_USDT_ADDRESS=0x004b63A7B5b0E06f6bB6adb4a5F9f590BF3182D1`
|
||||
- `OFFICIAL_USDC_ADDRESS=0x71D6687F38b93CCad569Fa6352c876eea967201b`
|
||||
@@ -169,7 +169,7 @@ forge script script/dex/DeployPrivatePoolRegistryAndPools.s.sol:DeployPrivatePoo
|
||||
|
||||
| Chain ID | Network | Mapper (AddressMapperEmpty) |
|
||||
|----------|-----------|----------------------------------|
|
||||
| 138 | Chain 138 | 0xe48E3f248698610e18Db865457fcd935Bb3da856 (AddressMapper) |
|
||||
| 138 | Chain 138 | 0x439Fcb2d2ab2f890DCcAE50461Fa7d978F9Ffe1A (AddressMapper; legacy dup `0xe48E3f248698610e18Db865457fcd935Bb3da856`) |
|
||||
| 1 | Ethereum | 0x0ea68F5B5A8427bB58e54ECcee941F543Dc538c5 |
|
||||
| 56 | BSC | 0x6e94e53F73893b2a6784Df663920D31043A6dE07 |
|
||||
| 137 | Polygon | 0xb689c1C69DAa08DEb5D8feA2aBF0F64bFD409727 |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Deployed Smart Contracts — Cross-Network Overview
|
||||
|
||||
> Historical note (2026-03-26): this overview includes superseded PMM stack references from earlier deployment phases. The current canonical Chain 138 PMM stack is `DODOPMMIntegration=0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d` and `DODOPMMProvider=0x5CAe6Ce155b7f08D3a956F5Dc82fC9945f29B381`.
|
||||
> Historical note (2026-04-01): this overview preserves earlier deployment phases, but the live canonical Chain 138 PMM stable stack is now `DODOPMMIntegration=0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895` and `DODOPMMProvider=0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e`.
|
||||
|
||||
**Last updated:** 2026-02-20
|
||||
**Source:** `smom-dbis-138/.env` and deployment runbooks.
|
||||
@@ -64,8 +64,9 @@ flowchart TB
|
||||
| | CCIPWETH10 Bridge | `0xe0E93247376aa097dB308B92e6Ba36bA015535D0` | WETH10 cross-chain |
|
||||
| | CCIP Router | `0x42DAb7b888Dd382bD5Adcf9E038dBF1fD03b4817` | CCIP router (on 138) |
|
||||
| | CCIPTxReporter | `0x3F88b662F04d9B1413BA8d65bFC229e830D7d077` | Report txs to mainnet logger |
|
||||
| **PMM** | Mock DVM Factory | `0xB16c3D48A111714B1795E58341FeFDd643Ab01ab` | Create mock pools |
|
||||
| | DODOPMMIntegration | `0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d` | Canonical corrected PMM integration |
|
||||
| **PMM** | DODO V2 DVMFactory | `0xc93870594C7f83A0aE076c2e30b494Efc526b68E` | Create canonical DVM-backed stable pools |
|
||||
| | DODOPMMIntegration | `0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895` | Canonical official-DVM-backed PMM integration |
|
||||
| | DODOPMMProvider | `0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e` | Canonical stable-pool routing provider |
|
||||
| **Core eMoney** | Compliance Registry, Token Factory, Bridge Vault, Debt Registry, Policy Manager, Token Impl | (see .env) | Core system |
|
||||
| **Channels** | Payment Channel Manager, Address Mapper, Mirror Manager | (see .env) | State channels |
|
||||
| **Oracle** | Oracle Aggregator, Oracle Proxy | (see .env) | Price feeds |
|
||||
|
||||
@@ -1,30 +1,41 @@
|
||||
# DVM (DODO Vending Machine) Deployment Check — Chain 138
|
||||
|
||||
**Date:** 2026-02-20
|
||||
**Date:** 2026-04-02
|
||||
|
||||
## Summary
|
||||
|
||||
**There is no official DODO DVM factory deployment on Chain 138.**
|
||||
**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](https://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.
|
||||
- DODO’s official contract list ([api.dodoex.io/dodo-contract/list?version=v1,v2](https://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`: `0x9e89bAe009adf128782E19e8341996c596ac40dC`
|
||||
- `cUSDT/USDT`: `0x866Cb44b59303d8dc5f4F9E3E7A8e8b0bf238d66`
|
||||
- `cUSDC/USDC`: `0xc39B7D0F40838cbFb54649d327f49a6DAC964062`
|
||||
|
||||
## 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.
|
||||
- **`DODO_VENDING_MACHINE_ADDRESS`** in `.env` must 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
|
||||
|
||||
0. **Use mock DVM (this repo)**
|
||||
0. **Use mock DVM (this repo, fallback only)**
|
||||
- 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.
|
||||
- **Do not treat this as canonical anymore** unless you are intentionally testing without the official DVM stack.
|
||||
|
||||
1. **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`
|
||||
- The repo deployment helper now runs the vendored DODO tree in a **DVM-only compile mode** by temporarily hiding unrelated Solidity `0.8.x` contracts during `truffle compile` / `truffle migrate`, then restoring them on exit. That allows the official DVM `0.6.9` stack 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-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`.
|
||||
@@ -32,6 +43,8 @@
|
||||
`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).
|
||||
- **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`. Earlier `k = 0.5e18` pools were removed because they priced above parity.
|
||||
|
||||
2. **Deploy DVM factory yourself from DODO source (outside this repo)**
|
||||
- DODO’s contracts are open source: [DODOEX GitHub](https://github.com/DODOEX) (contractV2).
|
||||
|
||||
@@ -197,17 +197,17 @@ chainRegistry.registerEVMChain(
|
||||
|
||||
---
|
||||
|
||||
### **Hyperledger Firefly**
|
||||
### **Hyperledger FireFly**
|
||||
|
||||
**Status**: ✅ Adapter + Service Client Created
|
||||
|
||||
**Infrastructure**: ✅ VMIDs 6202, 6203 deployed
|
||||
**Infrastructure**: `6200` is the only validated FireFly runtime, `6201` is retired / standby, and `6202` / `6203` are not deployed in the current cluster.
|
||||
|
||||
**Deployment Steps**:
|
||||
|
||||
1. Initialize Firefly on VMID 6202:
|
||||
1. Initialize FireFly only after confirming `6200` is healthy and intentionally in scope:
|
||||
```bash
|
||||
ssh root@192.168.11.175
|
||||
ssh root@192.168.11.35
|
||||
ff init alltra-bridge --multiparty
|
||||
```
|
||||
|
||||
@@ -237,21 +237,26 @@ namespaces:
|
||||
- erc20_erc721
|
||||
```
|
||||
|
||||
For current runtime truth, prefer [docs/03-deployment/DBIS_HYPERLEDGER_RUNTIME_STATUS.md](../../../docs/03-deployment/DBIS_HYPERLEDGER_RUNTIME_STATUS.md).
|
||||
|
||||
---
|
||||
|
||||
## 🔧 **Hyperledger Integration**
|
||||
|
||||
### **Cacti (VMID 5201)**
|
||||
### **Cacti (VMIDs 5200 / 5201 / 5202)**
|
||||
|
||||
**Status**: ⚠️ Needs Adapter
|
||||
|
||||
**Infrastructure**: `5200` is the primary Cacti / Besu connector node. `5201` and `5202` are the live Alltra/HYBX public Cacti surfaces and each also exposes a local Hyperledger Cacti API on `:4000`.
|
||||
|
||||
**Deployment Steps**:
|
||||
|
||||
1. Install Cacti API server on VMID 5201
|
||||
2. Configure Besu connector plugin
|
||||
3. Configure Fabric connector plugin (if needed)
|
||||
4. Deploy CactiAdapter contract
|
||||
5. Create Cacti client service
|
||||
1. Maintain the core connector deployment on VMID `5200`.
|
||||
2. Keep VMIDs `5201` and `5202` healthy for the public Alltra/HYBX Cacti surfaces and local `:4000` APIs.
|
||||
3. Configure the Besu connector plugin.
|
||||
4. Configure the Fabric connector plugin if needed.
|
||||
5. Deploy the `CactiAdapter` contract.
|
||||
6. Create the Cacti client service.
|
||||
|
||||
**Cacti Configuration**:
|
||||
```json
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Next Steps Completion Summary
|
||||
|
||||
> Historical note (2026-03-26): this completion summary preserves an earlier PMM deployment phase. The current canonical Chain 138 PMM stack is `DODOPMMIntegration=0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d` and `DODOPMMProvider=0x5CAe6Ce155b7f08D3a956F5Dc82fC9945f29B381`.
|
||||
> Historical note (2026-04-01): this completion summary preserves an earlier PMM deployment phase. The live canonical Chain 138 PMM stable stack is now `DODOPMMIntegration=0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895` and `DODOPMMProvider=0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e`.
|
||||
|
||||
**Date:** 2026-02-20
|
||||
|
||||
@@ -21,7 +21,7 @@ This document summarizes what was completed in the "next steps" pass and what re
|
||||
| **Verify script** | Optional checks (CCIPTxReporter, genesis) are warnings; log_* fallbacks; safe unset-var handling. |
|
||||
| **Hardhat / Forge** | @emoney/interfaces replaced with relative imports; Hardhat viaIR for 0.8.22; Forge build available. |
|
||||
| **Docs** | WARNINGS_AND_OPTIONAL_TASKS.md, DVM_DEPLOYMENT_CHECK.md, ALL_MAINNETS_DEPLOYMENT_RUNBOOK (PMM step → DVM doc), TODO_TASK_LIST_MASTER §10b updated. |
|
||||
| **PMM (Chain 138)** | Earlier Mock DVM phase completed; current canonical PMM integration is `0x5BDc62f1ae7D630c37A8B363a1d49845356Ee72d` and supersedes the initial stack. `DODO_VENDING_MACHINE_ADDRESS` and `DODO_PMM_INTEGRATION` were set in .env during the first deployment phase. |
|
||||
| **PMM (Chain 138)** | Earlier mock-DVM phase completed; the live canonical stable stack is now `0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895` with provider `0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e`. `DODO_VENDING_MACHINE_ADDRESS` and `DODO_PMM_INTEGRATION` should follow the current DVM-backed deployment in `.env`. |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -47,6 +47,17 @@ The Master Plan specifies four **public** liquidity pool types for user routing
|
||||
|
||||
For cUSDT/XAU, cUSDC/XAU, and cEURT/XAU: use the deployed Chain 138 XAU anchor token (`cXAUC` at `0x290E52a8819A4fbD0714E517225429aA2B70EC6b` or `cXAUT` at `0x94e408E26c6FD8F4ee00b54dF19082FDA07dC96E`), then call `createPool(baseToken, quoteToken, lpFeeRate, initialPrice, k, isOpenTWAP)` with `POOL_MANAGER_ROLE`. **Unit:** 1 full XAU token = **1 troy ounce** of gold (`10^6` base units with 6 decimals). Public pools serve user routing, price discovery, and flash loan access; they do not serve as the primary stabilization engine (see Master Plan private mesh).
|
||||
|
||||
### Planned `cUSDW / cUSDC_V2` hub pool
|
||||
|
||||
For the repo-native D-WIN stabilization path on Chain 138, the generic `createPool` flow is also the correct path for `cUSDW / cUSDC_V2`.
|
||||
|
||||
- `baseToken`: `cUSDW` (`0xcA6BFa614935f1AB71c9aB106bAA6FBB6057095e`)
|
||||
- `quoteToken`: `cUSDC_V2` (`0x219522c60e83dEe01FC5b0329d6fA8fD84b9D13d`)
|
||||
- decimals: both `6`
|
||||
- script support: `script/dex/CreateCUSDWCUSDCV2Pool.s.sol` and `script/dex/AddLiquidityCUSDWCUSDCV2PoolChain138.s.sol`
|
||||
|
||||
See [docs/03-deployment/CUSDW_CUSDC_V2_HUB_POOL_RUNBOOK.md](../../../docs/03-deployment/CUSDW_CUSDC_V2_HUB_POOL_RUNBOOK.md) for the full operator sequence.
|
||||
|
||||
---
|
||||
|
||||
## DODO PMM Overview
|
||||
|
||||
@@ -57,11 +57,17 @@ References: [DEPLOYMENT_COMPLETE_GUIDE.md](../deployment/DEPLOYMENT_COMPLETE_GUI
|
||||
| `KEEPER_PRIVATE_KEY` | Wallet with **KEEPER_ROLE** on `PriceFeedKeeper` for `performUpkeep` txs. |
|
||||
| `MESH_WETH_WRAP_WEI` | Optional tiny `WETH.deposit{value}` on a throttled cadence (`MESH_WETH_WRAP_EVERY_N`); costs gas—default **0** (off). |
|
||||
|
||||
**Dedicated keeper signer:** generate and store a separate keeper key with
|
||||
`scripts/deployment/generate-chain138-keeper-key.sh`.
|
||||
By default it writes the secret to `~/.secure-secrets/chain138-keeper.env` and a local helper
|
||||
to `.env.keeper.local` (gitignored) that sources the secret file.
|
||||
|
||||
**systemd:** `config/systemd/chain138-pmm-mesh-automation.service.example` in the Proxmox repo—copy, fix paths, `enable --now`.
|
||||
|
||||
**Bring-up checklist (operator):**
|
||||
1. `PRICE_FEED_KEEPER_ADDRESS` in `smom-dbis-138/.env` (Chain 138: `0xD3AD6831aacB5386B8A25BB8D8176a6C8a026f04` per explorer docs—verify live).
|
||||
2. `KEEPER_PRIVATE_KEY` optional if same as `PRIVATE_KEY` (must have `KEEPER_ROLE` on the keeper).
|
||||
2. `KEEPER_PRIVATE_KEY` should be a dedicated keeper signer with `KEEPER_ROLE` on the keeper.
|
||||
The mesh now skips keeper writes cleanly when no dedicated keeper key is present.
|
||||
3. `./scripts/reserve/set-price-feed-keeper-interval.sh 6` once if the keeper still used a 30s interval.
|
||||
4. Oracle: `scripts/update-oracle-price.sh` needs Besu-safe paths (eth_call + explicit `--gas-limit`); set `AGGREGATOR_ADDRESS` / transmitter as deployed.
|
||||
5. If the keeper uses a **WETH MockPriceFeed** (`CHAIN138_WETH_MOCK_PRICE_FEED`), run `scripts/reserve/sync-weth-mock-price.sh` on a schedule (or from the same cron as the mesh) so ReserveSystem WETH tracks the market.
|
||||
|
||||
Reference in New Issue
Block a user