Files
smom-dbis-138/script/DeployMainnetCwReverseRouter.s.sol
defiQUG 18651b97f1 Add token-aggregation official-protocol reports and fix test drift.
Wire pool registry, LP positions, and official-protocol API routes; align
cBTC pricing tests with canonical address; mock getReferenceMarketData; use
d-bis.org logo URLs in MetaMask config tests; extend CW bridge forge tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 02:04:26 -07:00

38 lines
1.5 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import {Script, console2} from "forge-std/Script.sol";
import {CCIPRouter} from "../contracts/ccip/CCIPRouter.sol";
import {CWMultiTokenBridgeL2} from "../contracts/bridge/CWMultiTokenBridgeL2.sol";
/// @notice Deploy event-only CCIPRouter on Ethereum mainnet for cW burnAndSend → Chain 138 relay.
/// @dev Wire CW_BRIDGE_MAINNET.sendRouter to this router (supports CHAIN138_SELECTOR).
contract DeployMainnetCwReverseRouter is Script {
uint64 constant CHAIN138_SELECTOR = 16015286601757825753;
uint256 constant BASE_FEE = 1e15;
uint256 constant DATA_FEE_PER_BYTE = 100_000_000;
function run() external {
uint256 deployerKey = vm.envUint("PRIVATE_KEY");
address link = vm.envOr("MAINNET_LINK_TOKEN", address(0x514910771AF9Ca656af840dff83E8264EcF986CA));
address l2 = vm.envOr("CW_BRIDGE_MAINNET", address(0x2bF74583206A49Be07E0E8A94197C12987AbD7B5));
bool wire = vm.envOr("WIRE_L2_SEND_ROUTER", true);
vm.startBroadcast(deployerKey);
CCIPRouter router = new CCIPRouter(link, BASE_FEE, DATA_FEE_PER_BYTE);
router.addSupportedChain(CHAIN138_SELECTOR);
console2.log("MainnetCwReverseRouter:", address(router));
console2.log("CHAIN138_SELECTOR:", CHAIN138_SELECTOR);
if (wire) {
CWMultiTokenBridgeL2 bridge = CWMultiTokenBridgeL2(payable(l2));
bridge.setSendRouter(address(router));
console2.log("CW_BRIDGE_MAINNET sendRouter updated:", l2);
}
vm.stopBroadcast();
}
}