refactor(archive): move historical contracts and adapters to archive directory

- Archived multiple non-EVM adapters (Algorand, Hedera, Tron, TON, Cosmos, Solana) and compliance contracts (IndyVerifier) to `archive/solidity/contracts/`.
- Updated documentation to reflect the historical status of archived components.
- Adjusted `foundry.toml` and `README.md` for clarity on historical dependencies and configurations.
- Enhanced Makefile and package.json scripts for improved contract testing and building processes.
- Removed obsolete contracts (AlltraCustomBridge, CommodityCCIPBridge, ISO4217WCCIPBridge, VaultBridgeAdapter) from the main directory.
- Updated implementation reports to indicate archived status for various components.
This commit is contained in:
defiQUG
2026-04-12 18:21:05 -07:00
parent 8ec6af94d5
commit 2b52cc6e32
146 changed files with 2010 additions and 423 deletions

View File

@@ -77,7 +77,7 @@
- Dependencies: None (if custom router)
- Status: **NOT DEPLOYED**
10.**CCIPRouterOptimized** (`contracts/ccip/CCIPRouterOptimized.sol`)
10.**CCIPRouterOptimized** (`archive/solidity/contracts/ccip/CCIPRouterOptimized.sol`)
- Script: None (may need creation)
- Dependencies: Unknown
- Status: **NOT DEPLOYED** (no script found)

View File

@@ -16,8 +16,8 @@ A single reference for all bridges, core contracts, routers, oracles, mappers, r
| **CCIPWETH10Bridge** | `contracts/ccip/CCIPWETH10Bridge.sol` | Cross-chain bridge for WETH10 via CCIP. |
| **UniversalCCIPBridge** | `contracts/bridge/UniversalCCIPBridge.sol` | Base CCIP bridge logic; extended by token-specific bridges. |
| **GRUCCIPBridge** | `contracts/bridge/GRUCCIPBridge.sol` | CCIP bridge for GRU (Global Reserve Unit) tokens. |
| **ISO4217WCCIPBridge** | `contracts/bridge/ISO4217WCCIPBridge.sol` | CCIP bridge for ISO-4217 W tokens. |
| **CommodityCCIPBridge** | `contracts/bridge/CommodityCCIPBridge.sol` | CCIP bridge for commodity-backed tokens. |
| **ISO4217WCCIPBridge** | `archive/solidity/contracts/bridge/ISO4217WCCIPBridge.sol` | Historical CCIP bridge for ISO-4217 W tokens; archived out of the active compile graph. |
| **CommodityCCIPBridge** | `archive/solidity/contracts/bridge/CommodityCCIPBridge.sol` | Historical CCIP bridge for commodity-backed tokens; archived out of the active compile graph. |
**Typical .env:** `CCIP_ROUTER`, `CCIPWETH9_BRIDGE_*`, `CCIPWETH10_BRIDGE_*`, `*_SELECTOR`, `LINK_TOKEN`, per chain.
@@ -42,13 +42,13 @@ A single reference for all bridges, core contracts, routers, oracles, mappers, r
| Contract | Path | Purpose |
|----------|------|---------|
| **AlltraCustomBridge** | `contracts/bridge/AlltraCustomBridge.sol` | Alltra transport for custom bridge messaging. |
| **AlltraCustomBridge** | `archive/solidity/contracts/bridge/AlltraCustomBridge.sol` | Historical Alltra transport for custom bridge messaging; archived out of the active compile graph. |
| **EtherlinkRelayReceiver** | `contracts/bridge/EtherlinkRelayReceiver.sol` | Receives relayed messages (e.g. Etherlink). |
| **BridgeRegistry** | `contracts/bridge/interop/BridgeRegistry.sol` | Registry of tokens and routes for bridge operations. |
| **BridgeEscrowVault** | `contracts/bridge/interop/BridgeEscrowVault.sol` | Escrow for bridge-in/bridge-out flows. |
| **BridgeVerifier** | `contracts/bridge/interop/BridgeVerifier.sol` | Verification of bridge messages (e.g. EIP-712). |
| **MintBurnController** | `contracts/bridge/interop/MintBurnController.sol` | Mint/burn control for bridged tokens. |
| **VaultBridgeAdapter** | `contracts/bridge/VaultBridgeAdapter.sol` | Adapter for vault ↔ bridge. |
| **VaultBridgeAdapter** | `archive/solidity/contracts/bridge/VaultBridgeAdapter.sol` | Historical vault ↔ bridge adapter; archived out of the active compile graph. |
| **BridgeOrchestrator** | `contracts/bridge/BridgeOrchestrator.sol` | Orchestrates multi-bridge flows. |
---
@@ -61,7 +61,7 @@ A single reference for all bridges, core contracts, routers, oracles, mappers, r
| **SwapRouter** | `contracts/bridge/trustless/SwapRouter.sol` | Basic swap router (trustless bridge context). |
| **EnhancedSwapRouter** | `contracts/bridge/trustless/EnhancedSwapRouter.sol` | Aggregates Uniswap V3, Dodoex, Curve, Balancer, 1inch for swap+bridge+swap. |
| **CCIPRouter** | `contracts/ccip/CCIPRouter.sol` | Optional custom router logic (project-specific). |
| **CCIPRouterOptimized** | `contracts/ccip/CCIPRouterOptimized.sol` | Optimized fee/router variant. |
| **CCIPRouterOptimized** | `archive/solidity/contracts/ccip/CCIPRouterOptimized.sol` | Historical optimized fee/router variant; archived out of the active compile graph. |
**Typical .env:** `SWAP_ROUTER`, `ENHANCED_SWAP_ROUTER`, `UNISWAP_V3_ROUTER`, `DODOEX_ROUTER`, `CURVE_3POOL`, `BALANCER_VAULT`, `ONEINCH_ROUTER`.
@@ -79,7 +79,7 @@ A single reference for all bridges, core contracts, routers, oracles, mappers, r
| **Aggregator** | `contracts/oracle/Aggregator.sol` | Chainlink-compatible price aggregator (on-chain). |
| **Proxy** | `contracts/oracle/Proxy.sol` | Oracle proxy (consumer-facing). |
| **OracleWithCCIP** | `contracts/oracle/OracleWithCCIP.sol` | Oracle that uses CCIP for cross-chain data. |
| **PMMPriceProvider** | `contracts/vault/adapters/PMMPriceProvider.sol` | Returns asset price in quote token from DODO PMM (oracle-backed when ReserveSystem set). |
| **PMMPriceProvider** | `archive/solidity/contracts/vault/adapters/PMMPriceProvider.sol` | Historical asset price provider in quote token from DODO PMM; archived out of the active compile graph. |
**Typical .env:** `ORACLE_AGGREGATOR_ADDRESS`, `ORACLE_PROXY_ADDRESS`, `RESERVE_SYSTEM`, `ORACLE_PRICE_FEED`, `RPC_URL_138`. See `docs/integration/ORACLE_AND_KEEPER_CHAIN138.md`.
@@ -102,22 +102,22 @@ A single reference for all bridges, core contracts, routers, oracles, mappers, r
|----------|------|---------|
| **ChainRegistry** | `contracts/registry/ChainRegistry.sol` | Registry of chains and chain-specific config. |
| **UniversalAssetRegistry** | `contracts/registry/UniversalAssetRegistry.sol` | Registry of asset types and handlers (GRU, ISO4217W, Commodity, etc.). |
| **GRUHandler** | `contracts/registry/handlers/GRUHandler.sol` | Asset type handler for GRU. |
| **ISO4217WHandler** | `contracts/registry/handlers/ISO4217WHandler.sol` | Asset type handler for ISO-4217 W tokens. |
| **CommodityHandler** | `contracts/registry/handlers/CommodityHandler.sol` | Asset type handler for commodities. |
| **ERC20Handler** | `contracts/registry/handlers/ERC20Handler.sol` | Generic ERC20 handler. |
| **SecurityHandler** | `contracts/registry/handlers/SecurityHandler.sol` | Security-type asset handler. |
| **GRUHandler** | `archive/solidity/contracts/registry/handlers/GRUHandler.sol` | Historical asset type handler for GRU; archived out of the active compile graph. |
| **ISO4217WHandler** | `archive/solidity/contracts/registry/handlers/ISO4217WHandler.sol` | Historical asset type handler for ISO-4217 W tokens; archived out of the active compile graph. |
| **CommodityHandler** | `archive/solidity/contracts/registry/handlers/CommodityHandler.sol` | Historical asset type handler for commodities; archived out of the active compile graph. |
| **ERC20Handler** | `archive/solidity/contracts/registry/handlers/ERC20Handler.sol` | Historical generic ERC20 handler; archived out of the active compile graph. |
| **SecurityHandler** | `archive/solidity/contracts/registry/handlers/SecurityHandler.sol` | Historical security-type asset handler; archived out of the active compile graph. |
| **BridgeRegistry** | `contracts/bridge/interop/BridgeRegistry.sol` | Registry of bridgeable tokens and routes. |
| **BridgeModuleRegistry** | `contracts/bridge/modules/BridgeModuleRegistry.sol` | Registry of bridge modules. |
| **ConfigurationRegistry** | `contracts/config/ConfigurationRegistry.sol` | System configuration registry. |
| **PluginRegistry** | `contracts/plugins/PluginRegistry.sol` | Plugin registration. |
| **BridgeModuleRegistry** | `archive/solidity/contracts/bridge/modules/BridgeModuleRegistry.sol` | Historical bridge module registry; archived out of the active compile graph. |
| **ConfigurationRegistry** | `archive/solidity/contracts/config/ConfigurationRegistry.sol` | Historical system configuration registry; archived out of the active compile graph. |
| **PluginRegistry** | `archive/solidity/contracts/plugins/PluginRegistry.sol` | Historical plugin registration flow; archived out of the active compile graph. |
| **MirrorRegistry** | `contracts/mirror/MirrorRegistry.sol` | Mirror/duplicate contract registry. |
| **PrivatePoolRegistry** | `contracts/dex/PrivatePoolRegistry.sol` | Registry of private (e.g. XAU-anchored) DODO pools. |
| **VaultFactory** | `contracts/vault/VaultFactory.sol` | Creates Vault instances and associated tokens. |
| **TokenFactory** (ISO4217W) | `contracts/iso4217w/TokenFactory.sol` | Creates ISO-4217 W tokens. |
| **TokenRegistry** (ISO4217W) | `contracts/iso4217w/registry/TokenRegistry.sol` | Registry of W tokens by currency code. |
| **TokenRegistry** (tokenization) | `contracts/tokenization/TokenRegistry.sol` | Generic token registry. |
| **ProxyFactory** | `contracts/upgrades/ProxyFactory.sol` | Creates upgradeable proxies. |
| **ProxyFactory** | `archive/solidity/contracts/upgrades/ProxyFactory.sol` | Historical upgradeable proxy factory; archived out of the active compile graph. |
---
@@ -151,8 +151,8 @@ A single reference for all bridges, core contracts, routers, oracles, mappers, r
| **Liquidation** | `contracts/vault/Liquidation.sol` | Liquidation logic. |
| **DepositToken** | `contracts/vault/tokens/DepositToken.sol` | Receipt token for collateral. |
| **DebtToken** | `contracts/vault/tokens/DebtToken.sol` | Debt position token. |
| **PMMPriceProvider** | `contracts/vault/adapters/PMMPriceProvider.sol` | Optional PMM-based price for assets (vault/UI). |
| **BridgeVaultExtension** | `contracts/vault/BridgeVaultExtension.sol` | Vault extension for bridge flows. |
| **PMMPriceProvider** | `archive/solidity/contracts/vault/adapters/PMMPriceProvider.sol` | Historical PMM-based price provider for vault/UI use; archived out of the active compile graph. |
| **BridgeVaultExtension** | `archive/solidity/contracts/vault/BridgeVaultExtension.sol` | Historical vault extension for bridge flows; archived out of the active compile graph. |
---
@@ -164,7 +164,7 @@ A single reference for all bridges, core contracts, routers, oracles, mappers, r
| **DODOPMMProvider** | `contracts/liquidity/providers/DODOPMMProvider.sol` | ILiquidityProvider wrapper; uses getPoolPriceOrOracle for quotes. |
| **PrivatePoolRegistry** | `contracts/dex/PrivatePoolRegistry.sol` | Registry of private (e.g. XAU) pools. |
| **LiquidityManager** | `contracts/liquidity/LiquidityManager.sol` | Aggregates liquidity providers. |
| **PoolManager** | `contracts/liquidity/PoolManager.sol` | Pool management. |
| **PoolManager** | `archive/solidity/contracts/liquidity/PoolManager.sol` | Historical pool-management helper; archived out of the active compile graph. |
| **Stabilizer** | `contracts/bridge/trustless/integration/Stabilizer.sol` | Uses private DODO PMM pools for peg stabilization. |
**Typical .env:** `DODO_VENDING_MACHINE_ADDRESS`, `DODOPMM_INTEGRATION_ADDRESS`, `CHAIN_138_DODO_PMM_INTEGRATION` (token-aggregation), `OFFICIAL_USDT_ADDRESS`, `OFFICIAL_USDC_ADDRESS`, `COMPLIANT_USDT_ADDRESS`, `COMPLIANT_USDC_ADDRESS`.
@@ -233,14 +233,14 @@ A single reference for all bridges, core contracts, routers, oracles, mappers, r
| **CactiAdapter** | `contracts/bridge/adapters/hyperledger/CactiAdapter.sol` | Hyperledger Cacti. |
| **FabricAdapter** | `contracts/bridge/adapters/hyperledger/FabricAdapter.sol` | Hyperledger Fabric. |
| **FireflyAdapter** | `contracts/bridge/adapters/hyperledger/FireflyAdapter.sol` | Hyperledger Firefly. |
| **SolanaAdapter** | `contracts/bridge/adapters/non-evm/SolanaAdapter.sol` | Solana. |
| **SolanaAdapter** | `archive/solidity/contracts/bridge/adapters/non-evm/SolanaAdapter.sol` | Historical Solana adapter; archived out of the active compile graph. |
| **XRPLAdapter** | `contracts/bridge/adapters/non-evm/XRPLAdapter.sol` | XRPL. |
| **TronAdapter** | `contracts/bridge/adapters/non-evm/TronAdapter.sol` | Tron. |
| **TronAdapter** | `archive/solidity/contracts/bridge/adapters/non-evm/TronAdapter.sol` | Historical Tron adapter; archived out of the active compile graph. |
| **StellarAdapter** | `contracts/bridge/adapters/non-evm/StellarAdapter.sol` | Stellar. |
| **CosmosAdapter** | `contracts/bridge/adapters/non-evm/CosmosAdapter.sol` | Cosmos. |
| **HederaAdapter** | `contracts/bridge/adapters/non-evm/HederaAdapter.sol` | Hedera. |
| **AlgorandAdapter** | `contracts/bridge/adapters/non-evm/AlgorandAdapter.sol` | Algorand. |
| **TONAdapter** | `contracts/bridge/adapters/non-evm/TONAdapter.sol` | TON. |
| **CosmosAdapter** | `archive/solidity/contracts/bridge/adapters/non-evm/CosmosAdapter.sol` | Historical Cosmos adapter; archived out of the active compile graph. |
| **HederaAdapter** | `archive/solidity/contracts/bridge/adapters/non-evm/HederaAdapter.sol` | Historical Hedera adapter; archived out of the active compile graph. |
| **AlgorandAdapter** | `archive/solidity/contracts/bridge/adapters/non-evm/AlgorandAdapter.sol` | Historical Algorand adapter; archived out of the active compile graph. |
| **TONAdapter** | `archive/solidity/contracts/bridge/adapters/non-evm/TONAdapter.sol` | Historical TON adapter; archived out of the active compile graph. |
---
@@ -248,11 +248,11 @@ A single reference for all bridges, core contracts, routers, oracles, mappers, r
| Contract | Path | Purpose |
|----------|------|---------|
| **GRUFormulasNFT** | `contracts/nft/GRUFormulasNFT.sol` | ERC-721 with on-chain SVG for three GRU formulas (Money Supply, Velocity, Multiplier). |
| **GRUFormulasNFT** | `archive/solidity/contracts/nft/GRUFormulasNFT.sol` | Historical ERC-721 with on-chain SVG for three GRU formulas; archived out of the active compile graph. |
| **GovernanceController** | `contracts/governance/GovernanceController.sol` | Governance control. |
| **TokenlistGovernanceSync** | `contracts/sync/TokenlistGovernanceSync.sol` | Sync token list with governance. |
| **AccountWalletRegistryExtended** | `contracts/smart-accounts/AccountWalletRegistryExtended.sol` | Account wallet registry. |
| **IndyVerifier** | `contracts/compliance/IndyVerifier.sol` | Indy-based verification. |
| **IndyVerifier** | `archive/solidity/contracts/compliance/IndyVerifier.sol` | Historical Indy-based verification contract; archived out of the active compile graph. |
| **wXRP** | `contracts/bridge/interop/wXRP.sol` | Wrapped XRP. |
---

View File

@@ -460,7 +460,7 @@
- **Parallel With**: 3.1.1, 3.1.2, 3.1.3, 3.1.5, 3.1.6
#### Subtask 3.1.5: Create CCIPRouterOptimized Deployment Script (If Needed)
- **Contract**: `contracts/ccip/CCIPRouterOptimized.sol`
- **Contract**: `archive/solidity/contracts/ccip/CCIPRouterOptimized.sol`
- **Script**: Create `script/DeployCCIPRouterOptimized.s.sol` (if using)
- **Dependencies**: Review contract for constructor params
- **Estimated Time**: 20 minutes

View File

@@ -137,6 +137,7 @@ make keys
- `src = "contracts"` - Source directory for contracts
- `test/` - Default test directory (not specified, uses default)
- `script/` - Default script directory (not specified, uses default)
- For monorepo day-to-day work, prefer the scoped workflow in [FOUNDRY_MONOREPO_SCOPES.md](FOUNDRY_MONOREPO_SCOPES.md) so Forge only compiles the contract subtree you are editing.
### Test Configuration
- Foundry tests: Configured in `foundry.toml`
@@ -187,4 +188,3 @@ make keys
| `scripts/` | Shell | Utility scripts | `*.sh` |
This structure follows Foundry conventions while providing clear separation between Solidity and shell script files.

View File

@@ -0,0 +1,113 @@
# Foundry Monorepo Scopes
## Why this exists
`smom-dbis-138` has grown beyond the shape of a single small Foundry package:
- `258` Solidity files under `contracts/`
- `120` Solidity tests under `test/`
- `133` Solidity scripts under `script/`
In practice that means the root repo-wide `forge build` is a compatibility path, not a good inner-loop default. A clean full build in this workspace did not finish within `120s`, while scoped builds did:
- `treasury` scoped build: about `17s`
- `flash` scoped build: about `44s`
- `treasury` scoped test compile: `39` files instead of `338`
## Recommended workflow
Use the scope runner for day-to-day work:
```bash
bash scripts/forge/scope.sh list
bash scripts/forge/scope.sh build treasury
bash scripts/forge/scope.sh test treasury
bash scripts/forge/scope.sh script bridge/trustless script/bridge/trustless/DeployTrustlessBridge.s.sol:DeployTrustlessBridge --rpc-url "$RPC_URL_138"
bash scripts/forge/scope.sh script script/DeployOracle.s.sol:DeployOracle --rpc-url "$RPC_URL_138"
```
You can also drive it through npm scripts:
```bash
FORGE_SCOPE=treasury pnpm run forge:build
FORGE_SCOPE=treasury pnpm run forge:test
pnpm run forge:script -- script/DeployOracle.s.sol:DeployOracle --rpc-url "$RPC_URL_138"
pnpm run forge:scope:list
pnpm run forge:orphans
```
Or through `make`:
```bash
make contracts SCOPE=treasury
make test SCOPE=bridge/trustless
```
Many shell deployment scripts in this repo now get scoped Forge automatically through shared shell bootstrap files:
- `scripts/lib/init.sh`
- `scripts/lib/deployment/dotenv.sh`
- `scripts/load-env.sh`
At this point every shell script under `scripts/` that invokes `forge build`, `forge test`, or `forge script` is covered by one of those shared paths or calls the scope runner directly.
## How scopes work
The scope runner keeps the root `foundry.toml` for compatibility, but overrides the active package boundary via environment variables:
- `FOUNDRY_SRC=contracts/<scope>`
- `FOUNDRY_TEST=test/<scope>` when that directory exists
- `FOUNDRY_OUT=out/scopes/<scope>`
- `FOUNDRY_CACHE_PATH=cache/scopes/<scope>`
- `FOUNDRY_BROADCAST=broadcast/scopes/<scope>`
This keeps artifact churn local to the subtree you are editing and prevents unrelated domains from dominating compile time.
When you omit the scope, the runner tries to infer it from:
- `contracts/<scope>/...`
- `test/<scope>/...`
- `script/<scope>/...`
- `script/deploy/<scope>/...` where `<scope>` maps back to `contracts/<scope>/...`
- common root-level deployment scripts such as `script/DeployOracle.s.sol`, `script/DeployWETH.s.sol`, `script/DeployMulticall.s.sol`, and `script/DeployCCIPRouter.s.sol`
## Full repo builds
Use the full repo intentionally:
```bash
forge build
forge test
pnpm run forge:build:full
pnpm run forge:test:full
```
That is the right choice for:
- release validation
- repo-wide refactors
- remapping or compiler setting changes
- compatibility checks before CI changes
## Legacy contract archival
Use the reachability report before moving old Solidity out of `contracts/`:
```bash
python3 scripts/forge/report-contract-reachability.py
python3 scripts/forge/report-contract-reachability.py --json
```
The report highlights contracts that are unreachable from the repo's current Solidity tests or scripts. That is an archival queue, not proof that deletion is safe. Move those files in small batches and re-run the scoped build/test commands for the affected domain.
Archived Solidity that should stay out of the compile graph lives under `archive/solidity/`.
After the current archive passes, the reachability report is down to `29` unreachable contracts from `35`, with the bridge bucket reduced to `5`.
## Best-practice rules for this repo
1. Prefer `scripts/forge/scope.sh` for local work.
2. Keep root `forge build` and `forge test` as explicit full-graph checks.
3. Add new contracts under an existing domain whenever possible instead of expanding the root package mentally.
4. When a subtree no longer has active tests or scripts, move it toward archive only after confirming it is not referenced by deployment runbooks or external repos.
5. Avoid reintroducing broad compile paths in npm scripts, Make targets, or shell wrappers when a narrower scope is known.

View File

@@ -5,7 +5,7 @@ Upgrade paths and pause procedures for bridge contracts (Tezos/Etherlink context
## Upgrade paths
- **Upgradeable (UUPS)**: UniversalAssetRegistry, BridgeOrchestrator, GovernanceController, TokenlistGovernanceSync. Upgrade via UPGRADER_ROLE after timelock if policy requires. Run: prepare upgrade (new impl), schedule timelock, execute upgrade.
- **Non-upgradeable**: TezosAdapter, EVMAdapter, AlltraCustomBridge. Deploy new version; register new adapter in ChainRegistry (or update adapter address); phase out old (revoke roles, drain if any).
- **Non-upgradeable**: TezosAdapter, EVMAdapter, AlltraCustomBridge (historical; archived under `archive/solidity/contracts/bridge/AlltraCustomBridge.sol`). Deploy new version; register new adapter in ChainRegistry (or update adapter address); phase out old (revoke roles, drain if any).
- **CCIP Router**: Per Chainlink; DON upgrades are separate from application contracts.
## Pause procedures

View File

@@ -44,12 +44,12 @@
2. **Deploy Contract**
```bash
npm run deploy:reporter:chain138
export CHAIN138_CCIP_REPORTER=0x...
```
3. **Update .env**
- Contract address will be automatically added
- Verify `CCIP_REPORTER_CHAIN138_ADDRESS` is set
- Persist `CHAIN138_CCIP_REPORTER`
- Restore `archive/solidity/contracts/ccip-integration/CCIPTxReporter.sol` only if a fresh redeploy is required
4. **Fund Contract**
```bash
@@ -112,4 +112,3 @@ See `docs/ccip-integration/README.md` for complete environment variable referenc
## Troubleshooting
See main README for troubleshooting guide.

View File

@@ -36,8 +36,8 @@ PRIVATE_KEY=0x...
# 1. Deploy CCIPLogger to Ethereum Mainnet
npm run deploy:logger:mainnet
# 2. Deploy CCIPTxReporter to Chain-138
npm run deploy:reporter:chain138
# 2. Point the flow at the historical Chain-138 reporter
export CHAIN138_CCIP_REPORTER=0x...
# 3. Start watcher
cd watcher && npm start

View File

@@ -35,8 +35,9 @@ Chain-138 (Source) Chainlink CCIP Ethereum
- Event emission for indexing
#### CCIPTxReporter (Chain-138)
- **Location**: `contracts/ccip-integration/CCIPTxReporter.sol`
- **Location**: `archive/solidity/contracts/ccip-integration/CCIPTxReporter.sol`
- **Purpose**: Reports Chain-138 transactions to Ethereum via CCIP
- **Status**: Historical source archived out of the active compile graph
- **Features**:
- Single transaction reporting
- Batch reporting (cost optimization)
@@ -46,7 +47,7 @@ Chain-138 (Source) Chainlink CCIP Ethereum
### 2. Deployment Scripts
- **CCIPLogger**: `scripts/ccip-deployment/deploy-ccip-logger.js`
- **CCIPTxReporter**: `scripts/ccip-deployment/deploy-ccip-reporter.js`
- **CCIPTxReporter**: `scripts/ccip-deployment/deploy-ccip-reporter.js` (archival note only; restore source before redeploying)
### 3. Watcher/Relayer Service
@@ -107,13 +108,13 @@ This will:
### Step 2: Deploy CCIPTxReporter to Chain-138
```bash
npm run deploy:reporter:chain138
export CHAIN138_CCIP_REPORTER=0x...
```
This will:
1. Deploy CCIPTxReporter contract
2. Configure it with CCIPLogger address
3. Display deployment address
1. Point the flow at the existing historical deployment
2. Keep verification scripts aware of the reporter address
3. Avoid restoring archived source unless a fresh redeploy is truly needed
### Step 3: Verify Contracts

View File

@@ -40,11 +40,9 @@ helm install besu-rpc ./helm/besu-network -f helm/besu-network/values-rpc.yaml -
### Contract Deployment
```bash
# Deploy CCIPTxReporter to Chain-138
npm run deploy:reporter:chain138
# Or manually:
npx hardhat run scripts/ccip-deployment/deploy-ccip-reporter.js --network chain138
# Historical CCIPTxReporter source is archived
export CHAIN138_CCIP_REPORTER=0x...
# Restore archive/solidity/contracts/ccip-integration/CCIPTxReporter.sol before any fresh redeploy
```
### Verification

View File

@@ -105,11 +105,9 @@ helm install besu-rpc ./helm/besu-network \
### Step 3: Deploy Contracts
```bash
# Deploy CCIPTxReporter to Chain-138
npm run deploy:reporter:chain138
# Or manually:
npx hardhat run scripts/ccip-deployment/deploy-ccip-reporter.js --network chain138
# Historical CCIPTxReporter source is archived
export CHAIN138_CCIP_REPORTER=0x...
# Restore archive/solidity/contracts/ccip-integration/CCIPTxReporter.sol before any fresh redeploy
```
### Step 4: Verify Deployment

View File

@@ -32,7 +32,7 @@
- **Reason**: Function is `external`, requires `this.` prefix for internal calls
#### **verifyCredentialProof Call**
- **Fixed**: `contracts/compliance/IndyVerifier.sol`
- **Fixed**: `archive/solidity/contracts/compliance/IndyVerifier.sol`
- **Changed**: `verifyCredentialProof(...)``this.verifyCredentialProof(...)`
### **4. Payable Function Issues**
@@ -62,6 +62,7 @@
- **Fixed**: GRUCCIPBridge, ISO4217WCCIPBridge, CommodityCCIPBridge
- **Changed**: `bridge(op)``this.bridge(op)`
- **Reason**: `bridge()` is `external`, requires `this.` for internal calls
- **Current status**: ISO4217WCCIPBridge and CommodityCCIPBridge are retained only as archived historical implementations under `archive/solidity/`
### **7. Test Files**

View File

@@ -81,8 +81,8 @@
# Deploy CCIPLogger
npm run deploy:logger:mainnet
# Deploy CCIPTxReporter (on Chain-138)
npm run deploy:reporter:chain138
# Reuse the historical CCIPTxReporter deployment (on Chain-138)
export CHAIN138_CCIP_REPORTER=0x...
```
### WETH Bridges

View File

@@ -112,8 +112,8 @@ This document tracks the status of smart contract deployments to Ethereum Mainne
# Deploy CCIPLogger to Ethereum Mainnet
npm run deploy:logger:mainnet
# Deploy CCIPTxReporter to Chain-138
npm run deploy:reporter:chain138
# Reuse the historical CCIPTxReporter deployment on Chain-138
export CHAIN138_CCIP_REPORTER=0x...
```
#### Option B: Deploy WETH Bridges

View File

@@ -10,6 +10,8 @@
This guide shows how to extend the Universal Bridge to support a new asset type without modifying core contracts.
> Note: This plugin-handler flow is historical reference material. The original `IAssetTypeHandler` and `PluginRegistry` sources were archived under `archive/solidity/contracts/registry/interfaces/` and `archive/solidity/contracts/plugins/` to keep them out of the active Forge compile graph.
---
## Prerequisites
@@ -28,7 +30,7 @@ This guide shows how to extend the Universal Bridge to support a new asset type
Implement `IAssetTypeHandler` interface:
```solidity
// contracts/registry/handlers/MyAssetHandler.sol
// Historical reference: archive/solidity/contracts/registry/handlers/MyAssetHandler.sol
import "../interfaces/IAssetTypeHandler.sol";
contract MyAssetHandler is IAssetTypeHandler {
@@ -64,7 +66,7 @@ forge create contracts/registry/handlers/MyAssetHandler.sol:MyAssetHandler \
--private-key $PRIVATE_KEY
```
### Step 3: Register with PluginRegistry
### Step 3: Historical PluginRegistry Registration
```solidity
// Register handler as plugin

View File

@@ -54,7 +54,7 @@ This document provides a comprehensive inventory of all contracts in the project
- Status: ✅ Production-ready
- Dependencies: None
- **IAggregator.sol** (`contracts/interfaces/IAggregator.sol`)
- **IAggregator.sol** (`contracts/oracle/IAggregator.sol`)
- Status: ✅ Production-ready
- Dependencies: None
@@ -91,8 +91,8 @@ This document provides a comprehensive inventory of all contracts in the project
- Refactoring: Can be refactored to use minimal IERC20 interface
- Tests: `test/ccip/CCIPIntegration.t.sol`
- **CCIPRouterOptimized.sol** (`contracts/ccip/CCIPRouterOptimized.sol`)
- Status: ⚠️ Requires OpenZeppelin
- **CCIPRouterOptimized.sol** (`archive/solidity/contracts/ccip/CCIPRouterOptimized.sol`)
- Status: Historical archived contract
- Dependencies: `SafeERC20`, `IERC20` from OpenZeppelin
- Usage: SafeERC20 for fee token handling
- Refactoring: Can be refactored to use minimal IERC20 interface
@@ -122,7 +122,7 @@ This document provides a comprehensive inventory of all contracts in the project
|----------|-----------|--------|---------|-------------------|
| CCIPSender | ✅ | ✅ | ❌ | Low (similar to CCIPWETH9Bridge) |
| CCIPRouter | ✅ | ✅ | ❌ | Low (similar to CCIPWETH9Bridge) |
| CCIPRouterOptimized | ✅ | ✅ | ❌ | Low (similar to CCIPWETH9Bridge) |
| CCIPRouterOptimized | Archived | Archived | Archived | Historical reference only |
| MultiSig | ❌ | ❌ | ✅ | Medium (custom admin pattern) |
| Voting | ❌ | ❌ | ✅ | Medium (custom admin pattern) |
@@ -160,7 +160,7 @@ This document provides a comprehensive inventory of all contracts in the project
### ⚠️ Contracts Requiring OpenZeppelin
- CCIPSender.sol
- CCIPRouter.sol
- CCIPRouterOptimized.sol
- CCIPRouterOptimized.sol (historical, archived)
- MultiSig.sol
- Voting.sol
@@ -233,7 +233,7 @@ forge test
### Phase 2: Refactor Contracts (Long-term)
1. Refactor CCIPSender.sol → Use minimal IERC20 interface
2. Refactor CCIPRouter.sol → Use minimal IERC20 interface
3. Refactor CCIPRouterOptimized.sol → Use minimal IERC20 interface
3. Historical reference: CCIPRouterOptimized.sol was archived instead of keeping it in the active compile graph
4. Refactor MultiSig.sol → Use custom admin pattern
5. Refactor Voting.sol → Use custom admin pattern
@@ -274,4 +274,3 @@ forge test
- [OpenZeppelin Dependency Assessment](./OPENZEPPELIN_DEPENDENCY_ASSESSMENT.md)
- [OpenZeppelin Tasks Checklist](./OPENZEPPELIN_TASKS_CHECKLIST.md)
- [WETH CCIP Deployment Guide](./WETH_CCIP_DEPLOYMENT.md)

View File

@@ -18,7 +18,7 @@ This document outlines tasks to assess and resolve OpenZeppelin dependencies in
- [ ] List contracts using OpenZeppelin:
- [ ] `contracts/ccip/CCIPSender.sol` - Uses `SafeERC20`, `IERC20`
- [ ] `contracts/ccip/CCIPRouter.sol` - Uses `SafeERC20`, `IERC20`
- [ ] `contracts/ccip/CCIPRouterOptimized.sol` - Uses `SafeERC20`, `IERC20`
- [ ] `archive/solidity/contracts/ccip/CCIPRouterOptimized.sol` - Uses `SafeERC20`, `IERC20`
- [ ] `contracts/governance/MultiSig.sol` - Uses `Ownable`
- [ ] `contracts/governance/Voting.sol` - Uses `Ownable`
- [ ] Document which OpenZeppelin contracts are used:
@@ -65,7 +65,7 @@ This document outlines tasks to assess and resolve OpenZeppelin dependencies in
- [ ] Test compilation of existing CCIP contracts:
- [ ] `contracts/ccip/CCIPSender.sol`
- [ ] `contracts/ccip/CCIPRouter.sol`
- [ ] `contracts/ccip/CCIPRouterOptimized.sol`
- [ ] `archive/solidity/contracts/ccip/CCIPRouterOptimized.sol`
- [ ] Test compilation of governance contracts:
- [ ] `contracts/governance/MultiSig.sol`
- [ ] `contracts/governance/Voting.sol`

View File

@@ -17,7 +17,7 @@
- [x] Found 5 contracts using OpenZeppelin:
- `contracts/ccip/CCIPSender.sol`
- `contracts/ccip/CCIPRouter.sol`
- `contracts/ccip/CCIPRouterOptimized.sol`
- `archive/solidity/contracts/ccip/CCIPRouterOptimized.sol`
- `contracts/governance/MultiSig.sol`
- `contracts/governance/Voting.sol`
- [x] OpenZeppelin imports identified:
@@ -179,7 +179,7 @@ forge test
### Contracts with OpenZeppelin Dependencies
1. `contracts/ccip/CCIPSender.sol` - Needs SafeERC20, IERC20
2. `contracts/ccip/CCIPRouter.sol` - Needs SafeERC20, IERC20
3. `contracts/ccip/CCIPRouterOptimized.sol` - Needs SafeERC20, IERC20
3. `archive/solidity/contracts/ccip/CCIPRouterOptimized.sol` - Needs SafeERC20, IERC20
4. `contracts/governance/MultiSig.sol` - Needs Ownable
5. `contracts/governance/Voting.sol` - Needs Ownable

View File

@@ -316,7 +316,7 @@ See also: [PRICE_FEED_SETUP.md](PRICE_FEED_SETUP.md) for ReserveSystem/OraclePri
### PMM price for vault / reporting
**PMMPriceProvider** (`contracts/vault/adapters/PMMPriceProvider.sol`) exposes `getPrice(asset, quoteToken)` using DODOPMMIntegrations `getPoolPriceOrOracle`. Use it for vault collateral valuation (e.g. cUSDT/cUSDC in USD terms) or off-chain reporting when the asset is a PMM pair token. Deploy with the DODOPMMIntegration address; see [Vault IMPLEMENTATION_SUMMARY](../vault/IMPLEMENTATION_SUMMARY.md#gru-smart-vault-and-pmm-integration).
**PMMPriceProvider** (`archive/solidity/contracts/vault/adapters/PMMPriceProvider.sol`) exposes `getPrice(asset, quoteToken)` using DODOPMMIntegrations `getPoolPriceOrOracle`. It is retained as a historical reference implementation for vault collateral valuation and off-chain reporting patterns.
---

View File

@@ -1,6 +1,6 @@
# GRU Formulas NFT
**Contract**: `contracts/nft/GRUFormulasNFT.sol`
**Contract**: `archive/solidity/contracts/nft/GRUFormulasNFT.sol`
**Standard**: ERC-721
---
@@ -35,7 +35,7 @@ The GRU Formulas NFT mints up to three token types, each depicting a GRU-related
Deploy with an admin address (receives `DEFAULT_ADMIN_ROLE` and `MINTER_ROLE`). Grant `MINTER_ROLE` to any additional minters as needed.
```bash
forge create contracts/nft/GRUFormulasNFT.sol:GRUFormulasNFT --constructor-args <ADMIN_ADDRESS> --rpc-url $RPC_URL --private-key $PRIVATE_KEY
forge create archive/solidity/contracts/nft/GRUFormulasNFT.sol:GRUFormulasNFT --constructor-args <ADMIN_ADDRESS> --rpc-url $RPC_URL --private-key $PRIVATE_KEY
```
## References

View File

@@ -65,7 +65,7 @@ All code, infrastructure, testing, documentation, and enhancement tasks are comp
### Contracts
- `contracts/governance/Voting.sol`
- `contracts/ccip/CCIPRouterOptimized.sol`
- `archive/solidity/contracts/ccip/CCIPRouterOptimized.sol`
### Testing
- `test/e2e/ContractDeployment.t.sol`

View File

@@ -37,7 +37,7 @@ All remaining tasks have been completed:
- Files: `monitoring/prometheus/alerts/region.yml`
6.**PERF-001 through PERF-008**: Performance optimizations
- Files: `contracts/ccip/CCIPRouterOptimized.sol`
- Files: `archive/solidity/contracts/ccip/CCIPRouterOptimized.sol`
- Files: `services/oracle-publisher/oracle_publisher_optimized.py`
7.**GOV-007**: On-chain voting

View File

@@ -678,7 +678,7 @@ See [Project Review](docs/PROJECT_REVIEW.md), [Recommendations](docs/RECOMMENDAT
- Status: ✅ Completed - Optimized router with batching and caching created
- Priority: 🟡 Medium
- Effort: 8-16 hours
- Files: `contracts/ccip/CCIPRouterOptimized.sol`
- Files: `archive/solidity/contracts/ccip/CCIPRouterOptimized.sol`
- Dependencies: CCIP-001
- Notes: Optimized message processing with batching and fee caching
@@ -686,7 +686,7 @@ See [Project Review](docs/PROJECT_REVIEW.md), [Recommendations](docs/RECOMMENDAT
- Status: ✅ Completed - Message batching implemented
- Priority: 🟡 Medium
- Effort: 8-16 hours
- Files: `contracts/ccip/CCIPRouterOptimized.sol`
- Files: `archive/solidity/contracts/ccip/CCIPRouterOptimized.sol`
- Dependencies: CCIP-001
- Notes: Batch multiple messages with configurable batch size and window
@@ -694,7 +694,7 @@ See [Project Review](docs/PROJECT_REVIEW.md), [Recommendations](docs/RECOMMENDAT
- Status: ✅ Completed - Fee caching implemented
- Priority: 🟡 Medium
- Effort: 4-8 hours
- Files: `contracts/ccip/CCIPRouterOptimized.sol`
- Files: `archive/solidity/contracts/ccip/CCIPRouterOptimized.sol`
- Dependencies: CCIP-005
- Notes: Fee calculations cached with configurable expiry
@@ -702,7 +702,7 @@ See [Project Review](docs/PROJECT_REVIEW.md), [Recommendations](docs/RECOMMENDAT
- Status: ✅ Completed - Caching implemented in optimized router
- Priority: 🟡 Medium
- Effort: 4-8 hours
- Files: `contracts/ccip/CCIPRouterOptimized.sol`
- Files: `archive/solidity/contracts/ccip/CCIPRouterOptimized.sol`
- Dependencies: CCIP-001
- Notes: Fee caching with TTL for frequently accessed data

View File

@@ -54,9 +54,9 @@ The tokenization system for central bank/IFI settlements has been successfully i
### Deployment & Testing
- `scripts/deployment/deploy-tokenization.sh` - Deployment script
- `scripts/tokenization/DeployTokenizedEUR.s.sol` - TokenizedEUR deployment
- `scripts/tokenization/DeployTokenRegistry.s.sol` - TokenRegistry deployment
- `scripts/tokenization/RegisterToken.s.sol` - Token registration
- `script/tokenization/DeployTokenizedEUR.s.sol` - TokenizedEUR deployment
- `script/tokenization/DeployTokenRegistry.s.sol` - TokenRegistry deployment
- `script/tokenization/RegisterToken.s.sol` - Token registration
- `test/tokenization/TokenizationIntegration.t.sol` - Integration tests
### Documentation

View File

@@ -89,7 +89,7 @@ CurrencyA → XAU → CurrencyB
### Implementation
The `XAUTriangulation` library enforces this requirement:
The historical `XAUTriangulation` library, archived at `archive/solidity/contracts/vault/libraries/XAUTriangulation.sol`, documents this requirement:
- All conversions use `triangulate()` function
- Direct currency-to-currency conversions are NOT permitted
- XAU is the universal unit of account

View File

@@ -18,7 +18,7 @@
- ✅ Currency type enumeration (ISO4217_FIAT, NON_ISO_SYNTHETIC, etc.)
**Files**:
- `contracts/vault/libraries/CurrencyValidation.sol`
- `archive/solidity/contracts/vault/libraries/CurrencyValidation.sol`
### 2. Non-ISO Currency Classification ✅
@@ -31,7 +31,7 @@
-`getCurrencyType()` returns explicit classification
**Files**:
- `contracts/vault/libraries/CurrencyValidation.sol`
- `archive/solidity/contracts/vault/libraries/CurrencyValidation.sol`
- `contracts/vault/libraries/GRUConstants.sol`
### 3. GRU as Non-Legal Tender ✅
@@ -46,7 +46,7 @@
**Files**:
- `contracts/vault/libraries/GRUConstants.sol`
- `contracts/vault/libraries/CurrencyValidation.sol`
- `archive/solidity/contracts/vault/libraries/CurrencyValidation.sol`
- `docs/vault/COMPLIANCE_REQUIREMENTS.md`
### 4. GRU Conversion Ratios ✅
@@ -70,14 +70,14 @@
**Requirement**: ALL currency conversions MUST go through XAU
**Implementation**:
-`XAUTriangulation.sol` library enforces triangulation
- Historical `XAUTriangulation.sol` library enforces triangulation
-`triangulate()` function: CurrencyA → XAU → CurrencyB
- ✅ All conversions documented as requiring XAU intermediation
- ✅ Ledger contract documents XAU normalization
- ✅ XAU Oracle provides ETH/XAU pricing
**Files**:
- `contracts/vault/libraries/XAUTriangulation.sol`
- `archive/solidity/contracts/vault/libraries/XAUTriangulation.sol`
- `contracts/vault/Ledger.sol` (XAU normalization comments)
- `contracts/vault/XAUOracle.sol`
@@ -93,7 +93,7 @@
- ✅ Money Multiplier: `m = (1 + c) / (r + c)` - `calculateMoneyMultiplierWithCurrency()`
**Files**:
- `contracts/vault/libraries/MonetaryFormulas.sol`
- `archive/solidity/contracts/vault/libraries/MonetaryFormulas.sol`
### 7. Documentation Compliance ✅
@@ -129,7 +129,7 @@
| Non-ISO Classification | ✅ | CurrencyValidation.sol + GRUConstants.sol |
| GRU Non-Legal Tender | ✅ | GRUConstants.sol + Documentation |
| GRU Conversion Ratios | ✅ | GRUConstants.sol (exact enforcement) |
| XAU Triangulation | ✅ | XAUTriangulation.sol + Ledger.sol |
| XAU Triangulation | ✅ | archive/solidity/contracts/vault/libraries/XAUTriangulation.sol + Ledger.sol |
| Monetary Formulas | ✅ | MonetaryFormulas.sol (exact implementation) |
| Documentation | ✅ | COMPLIANCE_REQUIREMENTS.md |

View File

@@ -231,7 +231,7 @@ All interfaces have been created:
- Money Multiplier: m = 1 / r and m = (1 + c) / (r + c)
- Exact formula implementations without modification
**XAUTriangulation.sol**:
**XAUTriangulation.sol** (historical, archived):
- XAU triangulation for all currency conversions
- CurrencyA → XAU → CurrencyB enforcement
- XAU conversion utilities
@@ -259,7 +259,7 @@ contracts/vault/
│ ├── CurrencyValidation.sol ✅ ISO 4217 compliance
│ ├── GRUConstants.sol ✅ GRU relationships
│ ├── MonetaryFormulas.sol ✅ Mandatory formulas
│ └── XAUTriangulation.sol ✅ XAU triangulation
│ └── XAUTriangulation.sol ✅ XAU triangulation (historical, archived)
├── errors/
│ └── VaultErrors.sol
├── Ledger.sol
@@ -322,9 +322,9 @@ See `docs/vault/COMPLIANCE_REQUIREMENTS.md` for complete compliance documentatio
### GRU Smart Vault and PMM Integration
- **PMM price for vault valuation**: When collateral or debt is a token that has a PMM pool (e.g. cUSDT, cUSDC), price can be obtained from **PMMPriceProvider** (`contracts/vault/adapters/PMMPriceProvider.sol`). It wraps DODOPMMIntegration and exposes `getPrice(asset, quoteToken)` using `getPoolPriceOrOracle` (oracle-backed when ReserveSystem is set on DODOPMMIntegration). The Ledgers primary valuation remains XAU via XAUOracle; PMMPriceProvider is for optional use by keepers, UIs, or a future Ledger extension that supports a secondary price source per asset.
- **PMM price for vault valuation**: When collateral or debt is a token that has a PMM pool (e.g. cUSDT, cUSDC), price can be obtained from the historical **PMMPriceProvider** reference implementation (`archive/solidity/contracts/vault/adapters/PMMPriceProvider.sol`). It wraps DODOPMMIntegration and exposes `getPrice(asset, quoteToken)` using `getPoolPriceOrOracle` (oracle-backed when ReserveSystem is set on DODOPMMIntegration). The Ledgers primary valuation remains XAU via XAUOracle; PMMPriceProvider is retained as a reference pattern for optional use by keepers, UIs, or a future Ledger extension that supports a secondary price source per asset.
- **Vault as LP / PMM liquidity**: A vault (or its regulated entity) can add liquidity to PMM pools by calling **DODOPMMIntegration.addLiquidity(pool, baseAmount, quoteAmount)**. The vault (or entity) must hold base and quote tokens and approve the integration contract. Required role on DODOPMMIntegration: none for addLiquidity (anyone can add); pool creation requires **POOL_MANAGER_ROLE**. LP positions are not currently accepted as collateral in the Ledger; that would require a future extension (e.g. LP token as approved asset and a valuation path for LP shares).
- **GRUHandler / registry**: GRU assets used in vaults should be validated via **GRUHandler** (`contracts/registry/handlers/GRUHandler.sol`). Register any new PMM-related or GRU asset types in **ChainRegistry** / **UniversalAssetRegistry** as applicable.
- **GRUHandler / registry**: GRU assets used in vaults should be validated via the historical **GRUHandler** reference implementation (`archive/solidity/contracts/registry/handlers/GRUHandler.sol`). Register any new PMM-related or GRU asset types in **ChainRegistry** / **UniversalAssetRegistry** as applicable.
See also: `docs/integration/DODO_PMM_INTEGRATION.md`, `docs/integration/ORACLE_AND_KEEPER_CHAIN138.md`.
@@ -334,4 +334,4 @@ See also: `docs/integration/DODO_PMM_INTEGRATION.md`, `docs/integration/ORACLE_A
- All contracts follow OpenZeppelin security best practices
- The system enforces strict access controls and compliance checks
- XAU normalization ensures consistent valuation across all operations
- **MANDATORY COMPLIANCE**: All currency codes, GRU relationships, and monetary formulas are enforced
- **MANDATORY COMPLIANCE**: All currency codes, GRU relationships, and monetary formulas are enforced