Files
proxmox/docs/11-references/CONTRACT_INVENTORY_AND_VERIFICATION.md
defiQUG bea1903ac9
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
Sync all local changes: docs, config, scripts, submodule refs, verification evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 15:46:06 -08:00

189 lines
15 KiB
Markdown

# Contract Inventory and Verification — ChainID 138
**Last Updated:** 2026-02-13
**Status:** Authoritative inventory for deployed/undeployed contracts, on-chain confirmation, and deprecated addresses.
**On-chain check:** 36 addresses (26 canonical + 5 channels/mirror/trustless + 5 CREATE2) — run `./scripts/verify/check-contracts-on-chain-138.sh` (uses `RPC_URL_138`) or pass URL. Use `--with-gas-price 1000000000` for all Chain 138 Forge deploys.
**Sources:** Documentation, dotenv examples, reports, `CONTRACT_ADDRESSES_REFERENCE.md`, `CHAIN138_TOKEN_ADDRESSES.md`, `CONTRACTS_TO_DEPLOY.md`, scripts, and env templates.
---
## 1. Summary
| Category | Count | Notes |
|----------|--------|--------|
| **Deployed (Chain 138)** | 36 | 36 addresses in check script (26 canonical + 5 channels/mirror/trustless + 5 CREATE2). Phased core 2026-02-11; AddressMapper, MirrorManager 2026-02-12. See tables below; verify on Blockscout when needed. |
| **Undeployed / placeholders** | Multiple | TransactionMirror (deploy via forge create if needed); trustless mainnet stack; Dodo PMM; etc. |
| **Deprecated / do not use** | 1 | Old CCIPWETH9 bridge (router mismatch) |
| **Other chains** | — | Mainnet/ALL/651940 addresses in env examples only; not verified here |
---
## 2. Deployed Contracts (Chain 138)
### 2.1 Pre-deployed (Genesis)
| Contract | Address | On-chain | Verified (Blockscout) | Notes |
|----------|---------|----------|------------------------|--------|
| WETH9 | `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2` | ✅ Documented | Confirm at explorer | Genesis allocation |
| WETH10 | `0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f` | ✅ Documented | Confirm at explorer | Genesis allocation |
| Multicall | `0x99b3511a2d315a497c8112c1fdd8d508d4b1e506` | ✅ Documented | Confirm at explorer | Genesis allocation; same address used for Oracle Aggregator in some docs — verify which contract is at this slot |
### 2.2 Core / Oracle / CCIP
| Contract | Address | On-chain | Verified (Blockscout) | Notes |
|----------|---------|----------|------------------------|--------|
| Oracle Aggregator | `0x99b3511a2d315a497c8112c1fdd8d508d4b1e506` | ✅ Documented | Confirm at explorer | May share address with Multicall; see [CONTRACT_ADDRESSES_REFERENCE](CONTRACT_ADDRESSES_REFERENCE.md) |
| Oracle Proxy | `0x3304b747e565a97ec8ac220b0b6a1f6ffdb837e6` | ✅ Documented | Confirm at explorer | MetaMask price feed |
| CCIP Router | `0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e` | ✅ Documented | Confirm at explorer | Cross-chain router |
| CCIP Sender | `0x105F8A15b819948a89153505762444Ee9f324684` | ✅ Documented | ⏳ Pending (doc) | [CCIP_SENDER_CONTRACT_REFERENCE](../07-ccip/CCIP_SENDER_CONTRACT_REFERENCE.md). Empty on mainnet; use on Chain 138 only. |
| CCIPWETH9Bridge | `0x971cD9D156f193df8051E48043C476e53ECd4693` | ✅ Documented | Confirm at explorer | **Use for sendCrossChain**; working router |
| CCIPWETH10Bridge | `0xe0E93247376aa097dB308B92e6Ba36bA015535D0` | ✅ Documented | Confirm at explorer | WETH10 cross-chain |
| CCIPReceiver | `0xC12236C03b28e675d376774FCE2C2C052488430F` | ✅ Deployed 2026-02-13 | DeployCCIPReceiver.s.sol | Chain 138 |
| Voting | `0x022267b26400114aF01BaCcb92456Fe36cfccD93` | ✅ Deployed 2026-02-13 | DeployVoting.s.sol | Chain 138 |
### 2.3 Tokens (Chain 138)
| Contract | Address | On-chain | Verified (Blockscout) | Notes |
|----------|---------|----------|------------------------|--------|
| LINK | `0xb7721dD53A8c629d9f1Ba31a5819AFe250002b03` | ✅ Documented | Confirm at explorer | CCIP fees |
| CompliantUSDT (cUSDT) | `0x93E66202A11B1772E55407B32B44e5Cd8eda7f22` | ✅ Documented | Confirm at explorer | 6 decimals |
| CompliantUSDC (cUSDC) | `0xf22258f57794CC8E06237084b353Ab30fFfa640b` | ✅ Documented | Confirm at explorer | 6 decimals; used by WithdrawalEscrow |
### 2.4 Registry / Factory / Keeper
| Contract | Address | On-chain | Verified (Blockscout) | Notes |
|----------|---------|----------|------------------------|--------|
| TokenRegistry | `0x91Efe92229dbf7C5B38D422621300956B55870Fa` | ✅ In MASTER_SECRETS, CHAIN138_TOKEN_ADDRESSES | Confirm at explorer | Central token registry |
| TokenFactory | `0xEBFb5C60dE5f7C4baae180CA328D3BB39E1a5133` | ✅ In MASTER_SECRETS, explorer docs | Confirm at explorer | Token factory |
| Price Feed Keeper | `0xD3AD6831aacB5386B8A25BB8D8176a6C8a026f04` | ✅ In scripts, INTEGRATION_TEST_SUMMARY, archive | ⏳ Pending (archive docs) | Automation; confirm at explorer |
### 2.5 Governance / vault / policy (canonical .env)
Canonical addresses from [CONTRACT_ADDRESSES_REFERENCE § Canonical source of truth](CONTRACT_ADDRESSES_REFERENCE.md#-canonical-source-of-truth-chain-138). Confirm on-chain when RPC/explorer is reachable.
| Contract | Address | On-chain | Verified (Blockscout) | Notes |
|----------|---------|----------|------------------------|--------|
| ComplianceRegistry | `0xbc54fe2b6fda157c59d59826bcfdbcc654ec9ea1` | ✅ Documented | Confirm at explorer | Governance |
| BridgeVault | `0x31884f84555210FFB36a19D2471b8eBc7372d0A8` | ✅ Documented | Confirm at explorer | Vault |
| FeeCollector | `0xF78246eB94c6CB14018E507E60661314E5f4C53f` | ✅ Documented | Confirm at explorer | Fees |
| DebtRegistry | `0x95BC4A997c0670d5DAC64d55cDf3769B53B63C28` | ✅ Documented | Confirm at explorer | Debt |
| PolicyManager | `0x0C4FD27018130A00762a802f91a72D6a64a60F14` | ✅ Documented | Confirm at explorer | Policy |
| TokenImplementation | `0x0059e237973179146237aB49f1322E8197c22b21` | ✅ Documented | Confirm at explorer | Token impl |
### 2.6 Settlement (alltra-lifi-settlement)
| Contract | Address | On-chain | Verified (Blockscout) | Notes |
|----------|---------|----------|------------------------|--------|
| MerchantSettlementRegistry | `0x16D9A2cB94A0b92721D93db4A6Cd8023D3338800` | ✅ Documented | Confirm at explorer | alltra-lifi-settlement |
| WithdrawalEscrow | `0xe77cb26eA300e2f5304b461b0EC94c8AD6A7E46D` | ✅ Documented | Confirm at explorer | alltra-lifi-settlement; depends on cUSDC |
### 2.7 Phased core (deployed 2026-02-11)
| Contract | Address | On-chain | Verified (Blockscout) | Notes |
|----------|---------|----------|------------------------|--------|
| UniversalAssetRegistry (proxy) | `0xAEE4b7fBe82E1F8295951584CBc772b8BBD68575` | ✅ Deployed | Confirm at explorer | 01_DeployCore |
| GovernanceController (proxy) | `0xA6891D5229f2181a34D4FF1B515c3Aa37dd90E0e` | ✅ Deployed | Confirm at explorer | 01_DeployCore |
| UniversalCCIPBridge (proxy) | `0xCd42e8eD79Dc50599535d1de48d3dAFa0BE156F8` | ✅ Deployed | Confirm at explorer | 02_DeployBridges |
| BridgeOrchestrator (proxy) | `0x89aB428c437f23bAB9781ff8Db8D3848e27EeD6c` | ✅ Deployed | Confirm at explorer | 02_DeployBridges |
### 2.8 Channels / Trustless / Reserve / Vault (deployed 2026-02-11)
| Contract | Address | Notes |
|----------|---------|--------|
| PaymentChannelManager | `0x302aF72966aFd21C599051277a48DAa7f01a5f54` | Channels |
| GenericStateChannelManager | `0xe5e3bB424c8a0259FDE23F0A58F7e36f73B90aBd` | Channels |
| Lockbox138 | `0xFce6f50B312B3D936Ea9693C5C9531CF92a3324c` | Trustless bridge |
| AddressMapper | `0x439Fcb2d2ab2f890DCcAE50461Fa7d978F9Ffe1A` | DeployAddressMapper 2026-02-12 |
| MirrorManager | `0x6eD905A30c552a6e003061A38FD52A5A427beE56` | DeployMirrorManager 2026-02-12 |
| ReserveSystem | `0x607e97cD626f209facfE48c1464815DDE15B5093` | Reserve |
| ReserveTokenIntegration | `0x34B73e6EDFd9f85a7c25EeD31dcB13aB6E969b96` | Reserve |
| Vault system (Registry, Ledger, Liquidation, XAU Oracle, VaultFactory, etc.) | See CONTRACT_ADDRESSES_REFERENCE § Channels/Trustless/Reserve/Vault | DeployVaultSystem.s.sol |
---
## 3. Deprecated Smart Contracts
| Contract / Address | Reason | Action |
|--------------------|--------|--------|
| **CCIPWETH9Bridge** at `0x89dd12025bfCD38A168455A44B400e913ED33BE2` | **Deprecated.** Old bridge with router mismatch (pointed to address with no code). Replaced by bridge at `0x971cD9D156f193df8051E48043C476e53ECd4693`. | Do not use. Use `CCIPWETH9_BRIDGE_CHAIN138` from env or `0x971cD9D156f193df8051E48043C476e53ECd4693`. See [CCIP_SECURITY_DOCUMENTATION](../07-ccip/CCIP_SECURITY_DOCUMENTATION.md), [scripts/README.md](../../scripts/README.md). |
---
## 4. Undeployed / Placeholder Contracts
Addresses that appear in config or env templates as placeholders or not yet deployed on Chain 138:
- **Trustless bridge (Chain 138):** **Lockbox138 deployed** at `0xFce6f50B312B3D936Ea9693C5C9531CF92a3324c`. INBOX_ETH, BOND_MANAGER, CHALLENGE_MANAGER, LIQUIDITY_POOL, SWAP_ROUTER, BRIDGE_SWAP_COORDINATOR, MULTISIG — still placeholders in config when needed.
- **Phased core:** Deployed 2026-02-11 (see §2.7).
- **CREATE2 / deterministic:** **Deployed 2026-02-11** via DeployDeterministicCore.s.sol. Addresses: CREATE2Factory, UniversalAssetRegistry (proxy), UniversalCCIPBridge (proxy), MirrorRegistry, AlltraAdapter — see [CONTRACT_ADDRESSES_REFERENCE](CONTRACT_ADDRESSES_REFERENCE.md) § CREATE2 / Deterministic. setCCIPRouter(router) set on deterministic bridge 2026-02-11.
- **Dodo / swap:** ENHANCED_SWAP_ROUTER is mainnet-only script; Chain 138 Dodo placeholders in .env.example when needed.
- **Channels:** **PaymentChannelManager** and **GenericStateChannelManager** deployed 2026-02-11 (see §2.8). **AddressMapper** and **MirrorManager** deployed 2026-02-12 at `0x439Fcb2d2ab2f890DCcAE50461Fa7d978F9Ffe1A` and `0x6eD905A30c552a6e003061A38FD52A5A427beE56`. **TransactionMirror** — deploy when needed. If Forge script hits constructor-args decode bug, use `forge create` or run `./scripts/deployment/deploy-transaction-mirror-chain138.sh` (see CONTRACT_DEPLOYMENT_RUNBOOK § TransactionMirror).
- **Firefly:** Auto-deployed by Firefly (VMID 6200); addresses not in this repo.
---
## 5. Confirming and Verifying On-Chain
- **Explorer:** https://explorer.d-bis.org (Blockscout).
- **Verification:** Use [BLOCKSCOUT_VERIFICATION_GUIDE](../08-monitoring/BLOCKSCOUT_VERIFICATION_GUIDE.md) and [CONTRACT_DEPLOYMENT_RUNBOOK](../03-deployment/CONTRACT_DEPLOYMENT_RUNBOOK.md) (Forge Verification Proxy).
- **Quick checks (RPC):**
```bash
export RPC_URL_138=http://192.168.11.211:8545 # or https://rpc-core.d-bis.org (Chain 138 Core)
cast code <ADDRESS> --rpc-url $RPC_URL # non-empty = contract present
```
- **Verification status** in this doc is based on documentation and scripts; **confirm each contract on Blockscout** (explorer.d-bis.org) for "Verified" status and bytecode.
---
## 6. Dotenv / Config Sources
Contract-related env and config were reviewed in:
- Root: `.env.example`
- `smom-dbis-138`: `.env`, `.env.example`, `terraform/phases/phase1/config/env.chain138.example`, `config/trustless-bridge.config.json.example`
- `alltra-lifi-settlement`: `env.example`
- `config/production`: `.env.production.example`
- Backups under `backups/configs/` (production env examples)
- Docs: [CONTRACT_ADDRESSES_REFERENCE](CONTRACT_ADDRESSES_REFERENCE.md), [CHAIN138_TOKEN_ADDRESSES](CHAIN138_TOKEN_ADDRESSES.md), [CONTRACTS_TO_DEPLOY](CONTRACTS_TO_DEPLOY.md), [MASTER_SECRETS_INVENTORY](../04-configuration/MASTER_SECRETS_INVENTORY.md), [07-ccip/CCIP_SECURITY_DOCUMENTATION](../07-ccip/CCIP_SECURITY_DOCUMENTATION.md), [07-ccip/CCIP_SENDER_CONTRACT_REFERENCE](../07-ccip/CCIP_SENDER_CONTRACT_REFERENCE.md)
No secrets (e.g. private keys) are stored in this inventory; only public addresses.
---
## 7. Inconsistencies Resolved (2026-02-11)
The following were corrected for consistency with [CONTRACT_ADDRESSES_REFERENCE](CONTRACT_ADDRESSES_REFERENCE.md):
| Location | Issue | Correction |
|----------|--------|------------|
| `smom-dbis-138/.env.example` | `CCIP_ROUTER_ADDRESS` was `0x99B3...` (Multicall/Oracle Aggregator) | Set to CCIP Router `0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e` |
| `smom-dbis-138/terraform/phases/phase1/config/env.chain138.example` | Wrong CCIP_ROUTER, CCIPWETH9/10 bridges, LINK (mainnet values) | Set to Chain 138 addresses: CCIP_ROUTER `0x8078...`, CCIPWETH9_BRIDGE `0x971c...`, CCIPWETH10_BRIDGE `0xe0E9...`, LINK `0xb772...` |
| `smom-dbis-138/services/token-aggregation/src/api/routes/bridge.ts` | `WETH9_BRIDGE_138` hardcoded to deprecated `0x89dd...` | Set to `0x971cD9D156f193df8051E48043C476e53ECd4693` |
| `explorer-monorepo/frontend/public/index.html` | WETH9 Bridge displayed as `0x89dd...` in two places | Set to `0x971c...` |
| `scripts/add-weth-wrap-unwrap-utilities.sh` | Injected deprecated bridge address into HTML | Set to `0x971c...` |
| Multiple `scripts/*.sh` | Fallback `CCIPWETH9_BRIDGE_CHAIN138:-0x89dd...` when env unset | Fallback changed to `0x971c...` (e.g. bridge-with-dynamic-gas.sh, monitor-bridge-transfers.sh, add-bridge-monitoring-to-explorer.sh, etc.) |
| `scripts/create-integration-test-summary.sh` | Generated doc cited deprecated as fallback | Updated to canonical address and deprecated note |
| `smom-dbis-138/scripts/verify-bridge-setup-checklist.sh` | Deprecated bridge, mainnet LINK/CCIP_ROUTER | Chain 138 addresses used for bridge, LINK, CCIP_ROUTER |
| `scripts/update-blockscout-bridge-info.sh` | `WETH9_BRIDGE_138` hardcoded to deprecated | Set to `0x971c...` |
| `smom-dbis-138/frontend-dapp/src/config/bridge.ts` | `WETH9_BRIDGE` hardcoded to deprecated | Set to `0x971c...` |
| `smom-dbis-138/scripts/verify-bridge-prerequisites.sh` | `WETH9_BRIDGE` hardcoded to deprecated | Set to `0x971c...` |
| `explorer-monorepo/scripts/*.sh` (multiple) | `WETH9_BRIDGE` or similar defaulting to deprecated | Default set to `0x971c...` |
**Note:** Archive scripts under `scripts/archive/` and `.bak` files were not changed; they may still reference the deprecated address for historical runs. The string "Deprecated (do not use): \`0x89dd...\`" in `scripts/create-integration-test-summary.sh` is intentional documentation.
---
## 8. Other Chains (reference only)
- **Ethereum Mainnet:** CCIP Sender at `0x105F8A15b819948a89153505762444Ee9f324684` has **empty bytecode** — not used on mainnet.
- **ALL Mainnet (651940):** Token addresses in [ALL_MAINNET_TOKEN_ADDRESSES](ALL_MAINNET_TOKEN_ADDRESSES.md); not re-verified here.
- **Terraform/env examples:** `env.mainnet.example`, `env.chain138.example` contain mainnet and Chain 138 bridge addresses for deployment context only.
---
**Related:** [CONTRACT_NEXT_STEPS_AND_RECOMMENDATIONS_COMPLETE](CONTRACT_NEXT_STEPS_AND_RECOMMENDATIONS_COMPLETE.md) | [CONTRACT_ADDRESSES_REFERENCE](CONTRACT_ADDRESSES_REFERENCE.md) | [CONTRACTS_TO_DEPLOY](CONTRACTS_TO_DEPLOY.md) | [CHAIN138_TOKEN_ADDRESSES](CHAIN138_TOKEN_ADDRESSES.md) | [CONTRACT_DEPLOYMENT_RUNBOOK](../03-deployment/CONTRACT_DEPLOYMENT_RUNBOOK.md) | [BLOCKSCOUT_VERIFICATION_GUIDE](../08-monitoring/BLOCKSCOUT_VERIFICATION_GUIDE.md)
---
**Document change log:** 2026-02-11 — Added §7 Inconsistencies Resolved; all addresses aligned with CONTRACT_ADDRESSES_REFERENCE and deprecated bridge removed from defaults.