feat(chain138): Monad CCIP, token aggregation OMNL gates, HYBX client, and PMM deploy updates.
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m11s
CI/CD Pipeline / Security Scanning (push) Has been cancelled
CI/CD Pipeline / Lint and Format (push) Has been cancelled
CI/CD Pipeline / Terraform Validation (push) Has been cancelled
CI/CD Pipeline / Kubernetes Validation (push) Has been cancelled
Validation / validate-genesis (push) Has been cancelled
Validation / validate-terraform (push) Has been cancelled
Validation / validate-kubernetes (push) Has been cancelled
Validation / validate-smart-contracts (push) Has been cancelled
Validation / validate-security (push) Has been cancelled
Validation / validate-documentation (push) Has been cancelled
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 1m4s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 31s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (push) Failing after 29s
Verify Deployment / Verify Deployment (push) Failing after 57s
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m11s
CI/CD Pipeline / Security Scanning (push) Has been cancelled
CI/CD Pipeline / Lint and Format (push) Has been cancelled
CI/CD Pipeline / Terraform Validation (push) Has been cancelled
CI/CD Pipeline / Kubernetes Validation (push) Has been cancelled
Validation / validate-genesis (push) Has been cancelled
Validation / validate-terraform (push) Has been cancelled
Validation / validate-kubernetes (push) Has been cancelled
Validation / validate-smart-contracts (push) Has been cancelled
Validation / validate-security (push) Has been cancelled
Validation / validate-documentation (push) Has been cancelled
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 1m4s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 31s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (push) Failing after 29s
Verify Deployment / Verify Deployment (push) Failing after 57s
Relay router, reserve system, oracle publisher, token-aggregation compliance middleware, and Monad deployment scripts. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
25
script/DeployChain138WethRelayBridge.s.sol
Normal file
25
script/DeployChain138WethRelayBridge.s.sol
Normal file
@@ -0,0 +1,25 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.19;
|
||||
|
||||
import {Script, console} from "forge-std/Script.sol";
|
||||
import {CCIPRelayBridge} from "../contracts/relay/CCIPRelayBridge.sol";
|
||||
import {CCIPRelayRouter} from "../contracts/relay/CCIPRelayRouter.sol";
|
||||
|
||||
/// @notice Deploy WETH inbound CCIPRelayBridge on Chain 138 and authorize on existing relay router.
|
||||
contract DeployChain138WethRelayBridge is Script {
|
||||
function run() external {
|
||||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
|
||||
address weth9 = vm.envAddress("WETH9");
|
||||
address relayRouter = vm.envAddress("CCIP_RELAY_ROUTER_CHAIN138");
|
||||
|
||||
vm.startBroadcast(deployerPrivateKey);
|
||||
|
||||
CCIPRelayBridge bridge = new CCIPRelayBridge(weth9, relayRouter);
|
||||
console.log("Chain138 WETH CCIPRelayBridge:", address(bridge));
|
||||
|
||||
CCIPRelayRouter(relayRouter).authorizeBridge(address(bridge));
|
||||
console.log("Authorized on CCIPRelayRouter:", relayRouter);
|
||||
|
||||
vm.stopBroadcast();
|
||||
}
|
||||
}
|
||||
33
script/DeployMonad138OutboundLane.s.sol
Normal file
33
script/DeployMonad138OutboundLane.s.sol
Normal file
@@ -0,0 +1,33 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.19;
|
||||
|
||||
import {Script, console} from "forge-std/Script.sol";
|
||||
import {CCIPRouter} from "../contracts/ccip/CCIPRouter.sol";
|
||||
import {CCIPWETH9Bridge} from "../contracts/ccip/CCIPWETH9Bridge.sol";
|
||||
|
||||
/// @notice Event-only send router + WMON bridge on Monad for Monad→138 relay lane.
|
||||
contract DeployMonad138OutboundLane is Script {
|
||||
function run() external {
|
||||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
|
||||
address deployer = vm.addr(deployerPrivateKey);
|
||||
address wmon = vm.envAddress("WETH9_MONAD");
|
||||
address feeToken = vm.envOr("CCIP_FEE_TOKEN", address(0));
|
||||
uint64 chain138Selector = uint64(vm.envUint("CHAIN138_SELECTOR"));
|
||||
|
||||
console.log("Deployer:", deployer);
|
||||
console.log("WMON:", wmon);
|
||||
console.log("Fee token (0=native MON):", feeToken);
|
||||
|
||||
vm.startBroadcast(deployerPrivateKey);
|
||||
|
||||
CCIPRouter router = new CCIPRouter(feeToken, 0, 0);
|
||||
console.log("Monad event-only CCIPRouter:", address(router));
|
||||
|
||||
router.addSupportedChain(chain138Selector);
|
||||
|
||||
CCIPWETH9Bridge bridge = new CCIPWETH9Bridge(address(router), wmon, feeToken);
|
||||
console.log("Monad outbound CCIPWETH9Bridge:", address(bridge));
|
||||
|
||||
vm.stopBroadcast();
|
||||
}
|
||||
}
|
||||
66
script/reserve/RefreshChain138UsdFeedsAndWireUsdc.s.sol
Normal file
66
script/reserve/RefreshChain138UsdFeedsAndWireUsdc.s.sol
Normal file
@@ -0,0 +1,66 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {Script, console} from "forge-std/Script.sol";
|
||||
|
||||
interface IAggregatorRefresh {
|
||||
function updateAnswer(uint256 answer) external;
|
||||
}
|
||||
|
||||
interface IOraclePriceFeedWireUsdc {
|
||||
function setAggregator(address asset, address aggregator, uint256 multiplier) external;
|
||||
function updatePriceFeed(address asset) external;
|
||||
function aggregators(address asset) external view returns (address);
|
||||
}
|
||||
|
||||
/// @notice Refresh stale USD/USD mirror aggregator + wire official USDC on OraclePriceFeed + sync pegged feeds.
|
||||
contract RefreshChain138UsdFeedsAndWireUsdc is Script {
|
||||
uint256 internal constant MULT = 1e10;
|
||||
uint256 internal constant USD_1E8 = 100_000_000;
|
||||
|
||||
address internal constant USD_AGG = 0x34EEd677b6D7CDc84FC23c7dA8480C41C776b1E0;
|
||||
address internal constant CUSDT = 0x93E66202A11B1772E55407B32B44e5Cd8eda7f22;
|
||||
address internal constant CUSDC = 0xf22258f57794CC8E06237084b353Ab30fFfa640b;
|
||||
address internal constant USDC = 0x71D6687F38b93CCad569Fa6352c876eea967201b;
|
||||
address internal constant USDT = 0x004b63A7B5b0E06f6bB6adb4a5F9f590BF3182D1;
|
||||
|
||||
function run() external {
|
||||
require(block.chainid == 138, "ChainID 138 only");
|
||||
|
||||
uint256 pk = vm.envUint("PRIVATE_KEY");
|
||||
address opf = vm.envAddress("ORACLE_PRICE_FEED");
|
||||
|
||||
console.log("=== Refresh USD aggregator + wire official USDC ===");
|
||||
console.log("OraclePriceFeed:", opf);
|
||||
console.log("USD aggregator:", USD_AGG);
|
||||
|
||||
vm.startBroadcast(pk);
|
||||
|
||||
IAggregatorRefresh(USD_AGG).updateAnswer(USD_1E8);
|
||||
console.log("USD aggregator refreshed at $1.00");
|
||||
|
||||
IOraclePriceFeedWireUsdc feed = IOraclePriceFeedWireUsdc(opf);
|
||||
if (feed.aggregators(USDC) == address(0)) {
|
||||
feed.setAggregator(USDC, USD_AGG, MULT);
|
||||
console.log("Wired official USDC -> USD aggregator");
|
||||
} else {
|
||||
console.log("Official USDC already wired");
|
||||
}
|
||||
|
||||
if (feed.aggregators(USDT) == address(0)) {
|
||||
feed.setAggregator(USDT, USD_AGG, MULT);
|
||||
console.log("Wired official USDT -> USD aggregator");
|
||||
} else {
|
||||
console.log("Official USDT already wired");
|
||||
}
|
||||
|
||||
address[4] memory assets = [CUSDT, CUSDC, USDC, USDT];
|
||||
for (uint256 i = 0; i < assets.length; i++) {
|
||||
feed.updatePriceFeed(assets[i]);
|
||||
console.log("ReserveSystem synced:", assets[i]);
|
||||
}
|
||||
|
||||
vm.stopBroadcast();
|
||||
console.log("=== Done ===");
|
||||
}
|
||||
}
|
||||
54
script/reserve/SyncChain138ReserveFromOracle.s.sol
Normal file
54
script/reserve/SyncChain138ReserveFromOracle.s.sol
Normal file
@@ -0,0 +1,54 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {Script, console} from "forge-std/Script.sol";
|
||||
|
||||
interface IOraclePriceFeedSync {
|
||||
function updatePriceFeed(address asset) external;
|
||||
function aggregators(address asset) external view returns (address);
|
||||
}
|
||||
|
||||
/// @notice Push wired Chain 138 aggregators into ReserveSystem via OraclePriceFeed (fixes getPoolPriceOrOracle).
|
||||
contract SyncChain138ReserveFromOracle is Script {
|
||||
address internal constant WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
|
||||
address internal constant CUSDT = 0x93E66202A11B1772E55407B32B44e5Cd8eda7f22;
|
||||
address internal constant CUSDC = 0xf22258f57794CC8E06237084b353Ab30fFfa640b;
|
||||
address internal constant USDT = 0x004b63A7B5b0E06f6bB6adb4a5F9f590BF3182D1;
|
||||
address internal constant USDC = 0x71D6687F38b93CCad569Fa6352c876eea967201b;
|
||||
|
||||
function run() external {
|
||||
require(block.chainid == 138, "ChainID 138 only");
|
||||
|
||||
uint256 pk = vm.envUint("PRIVATE_KEY");
|
||||
address opf = vm.envAddress("ORACLE_PRICE_FEED");
|
||||
|
||||
address[] memory assets = new address[](5);
|
||||
assets[0] = WETH9;
|
||||
assets[1] = CUSDT;
|
||||
assets[2] = CUSDC;
|
||||
assets[3] = USDT;
|
||||
assets[4] = USDC;
|
||||
|
||||
console.log("=== Sync ReserveSystem from OraclePriceFeed ===");
|
||||
console.log("OraclePriceFeed:", opf);
|
||||
|
||||
vm.startBroadcast(pk);
|
||||
|
||||
IOraclePriceFeedSync feed = IOraclePriceFeedSync(opf);
|
||||
for (uint256 i = 0; i < assets.length; i++) {
|
||||
address asset = assets[i];
|
||||
if (feed.aggregators(asset) == address(0)) {
|
||||
console.log("SKIP (no aggregator):", asset);
|
||||
continue;
|
||||
}
|
||||
try feed.updatePriceFeed(asset) {
|
||||
console.log("Updated:", asset);
|
||||
} catch {
|
||||
console.log("WARN updatePriceFeed failed:", asset);
|
||||
}
|
||||
}
|
||||
|
||||
vm.stopBroadcast();
|
||||
console.log("=== Done ===");
|
||||
}
|
||||
}
|
||||
40
script/reserve/WireChain138ReserveConversionAdapter.s.sol
Normal file
40
script/reserve/WireChain138ReserveConversionAdapter.s.sol
Normal file
@@ -0,0 +1,40 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {Script, console} from "forge-std/Script.sol";
|
||||
import {ReserveConversionPriceAdapter} from "../../contracts/reserve/ReserveConversionPriceAdapter.sol";
|
||||
|
||||
interface IDODOPMMIntegrationWire {
|
||||
function setReserveSystem(address reserveSystem_) external;
|
||||
function reserveSystem() external view returns (address);
|
||||
}
|
||||
|
||||
/// @notice Deploy conversion adapter and point Stack A DODOPMMIntegration at it (live ReserveSystem formula fix).
|
||||
contract WireChain138ReserveConversionAdapter is Script {
|
||||
address internal constant DEFAULT_RESERVE = 0x607e97cD626f209facfE48c1464815DDE15B5093;
|
||||
address internal constant DEFAULT_DODO = 0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895;
|
||||
|
||||
function run() external {
|
||||
require(block.chainid == 138, "ChainID 138 only");
|
||||
|
||||
uint256 pk = vm.envUint("PRIVATE_KEY");
|
||||
address reserve = vm.envOr("RESERVE_SYSTEM", DEFAULT_RESERVE);
|
||||
address dodo = vm.envOr("DODO_PMM_INTEGRATION_ADDRESS", DEFAULT_DODO);
|
||||
|
||||
console.log("=== Wire ReserveConversionPriceAdapter ===");
|
||||
console.log("ReserveSystem:", reserve);
|
||||
console.log("DODOPMMIntegration:", dodo);
|
||||
console.log("Current reserveSystem:", IDODOPMMIntegrationWire(dodo).reserveSystem());
|
||||
|
||||
vm.startBroadcast(pk);
|
||||
|
||||
ReserveConversionPriceAdapter adapter = new ReserveConversionPriceAdapter(reserve);
|
||||
console.log("Adapter deployed:", address(adapter));
|
||||
IDODOPMMIntegrationWire(dodo).setReserveSystem(address(adapter));
|
||||
|
||||
vm.stopBroadcast();
|
||||
|
||||
console.log("Wired reserveSystem:", IDODOPMMIntegrationWire(dodo).reserveSystem());
|
||||
console.log("=== Done ===");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user