diff --git a/forge/script/marketupdates/helpers/BridgeHelper.sol b/forge/script/marketupdates/helpers/BridgeHelper.sol index 19aa9bba1..98c1a2f8c 100644 --- a/forge/script/marketupdates/helpers/BridgeHelper.sol +++ b/forge/script/marketupdates/helpers/BridgeHelper.sol @@ -43,7 +43,7 @@ library BridgeHelper { uint256 proposalId = arbitrumBridgeReceiver.proposalCount(); arbitrumBridgeReceiver.executeProposal(proposalId); - } else if (chain == ChainAddresses.Chain.OPTIMISM || chain == ChainAddresses.Chain.BASE) { + } else if (chain == ChainAddresses.Chain.OPTIMISM || chain == ChainAddresses.Chain.BASE || chain == ChainAddresses.Chain.MANTLE) { // Common setup for Optimism and Base address crossDomainMessenger = 0x4200000000000000000000000000000000000007; vm.prank(crossDomainMessenger); @@ -66,6 +66,15 @@ library BridgeHelper { uint256 proposalId = optimismBridgeReceiver.proposalCount(); optimismBridgeReceiver.executeProposal(proposalId); + } if (chain == ChainAddresses.Chain.MANTLE) { + OptimismBridgeReceiver optimismBridgeReceiver = OptimismBridgeReceiver(payable(ChainAddresses.MANTLE_BRIDGE_RECEIVER)); + + address(optimismBridgeReceiver).call(l2Payload); + + uint256 delay = ITimelock(ChainAddresses.MANTLE_LOCAL_TIMELOCK).delay(); + vm.warp(block.timestamp + delay + 10); + uint256 proposalId = optimismBridgeReceiver.proposalCount(); + optimismBridgeReceiver.executeProposal(proposalId); } else { // For Base chain BaseBridgeReceiver baseBridgeReceiver = BaseBridgeReceiver(payable(ChainAddresses.BASE_BRIDGE_RECEIVER)); diff --git a/forge/script/marketupdates/helpers/ChainAddresses.sol b/forge/script/marketupdates/helpers/ChainAddresses.sol index 61f6ecad5..85643ed32 100644 --- a/forge/script/marketupdates/helpers/ChainAddresses.sol +++ b/forge/script/marketupdates/helpers/ChainAddresses.sol @@ -20,7 +20,8 @@ library ChainAddresses { SCROLL, OPTIMISM, MAINNET_SEPOLIA, - OP_SEPOLIA + OP_SEPOLIA, + MANTLE } @@ -84,6 +85,17 @@ library ChainAddresses { address constant public OPTIMISM_MARKET_UPDATE_PAUSE_GUARDIAN = 0x3fFd6c073a4ba24a113B18C8F373569640916A45; // See - https://optimistic.etherscan.io/address/0xE36A30D249f7761327fd973001A32010b521b6Fd#readProxyContract address constant public OPTIMISM_MARKET_UPDATE_PROPOSAL_GUARDIAN = 0x3fFd6c073a4ba24a113B18C8F373569640916A45; // See - https://optimistic.etherscan.io/address/0xE36A30D249f7761327fd973001A32010b521b6Fd#readProxyContract + address constant public MANTLE_MARKET_ADMIN = 0x7e14050080306cd36b47DE61ce604b3a1EC70c4e; + address constant public MANTLE_MARKET_UPDATE_PAUSE_GUARDIAN = 0x2127338F0ff71Ecc779dce407D95C7D32f7C5F45; + address constant public MANTLE_MARKET_UPDATE_PROPOSAL_GUARDIAN = 0x2127338F0ff71Ecc779dce407D95C7D32f7C5F45; + + address constant public MANTLE_LOCAL_TIMELOCK = 0x16C7B5C1b10489F4B111af11de2Bd607c9728107; // See - https://mantlescan.xyz/address/0x6d903f6003cca6255D85CcA4D3B5E5146dC33925 + address constant public MANTLE_CONFIGURATOR_PROXY = 0xb77Cd4cD000957283D8BAf53cD782ECf029cF7DB; // See - https://mantlescan.xyz/address/0xb77Cd4cD000957283D8BAf53cD782ECf029cF7DB + address constant public MANTLE_COMET_PROXY_ADMIN = 0xe268B436E75648aa0639e2088fa803feA517a0c7; // See - https://mantlescan.xyz/address/0xe268B436E75648aa0639e2088fa803feA517a0c7 + address constant public MANTLE_BRIDGE_RECEIVER = 0xc91EcA15747E73d6dd7f616C49dAFF37b9F1B604; // See - https://mantlescan.xyz/address/0xc91EcA15747E73d6dd7f616C49dAFF37b9F1B604 + + + function getChainAddresses(Chain chain) internal pure returns (ChainAddressesStruct memory) { if (chain == Chain.ETHEREUM) { return ChainAddressesStruct({ @@ -139,7 +151,7 @@ library ChainAddresses { marketUpdateProposalGuardian: OPTIMISM_MARKET_UPDATE_PROPOSAL_GUARDIAN, marketAdmin: OPTIMISM_MARKET_ADMIN }); - } else if (chain == Chain.OP_SEPOLIA) { + } else if (chain == Chain.OP_SEPOLIA) { return ChainAddressesStruct({ governorTimelockAddress: OPTIMISM_LOCAL_TIMELOCK, configuratorProxyAddress: OPTIMISM_CONFIGURATOR_PROXY, @@ -148,11 +160,11 @@ library ChainAddresses { marketUpdateProposalGuardian: OPTIMISM_MARKET_UPDATE_PROPOSAL_GUARDIAN, marketAdmin: OPTIMISM_MARKET_ADMIN }); - } else if (chain == Chain.MAINNET_SEPOLIA) { + } else if (chain == Chain.MANTLE) { return ChainAddressesStruct({ - governorTimelockAddress: MAINNET_GOVERNOR_TIMELOCK, - configuratorProxyAddress: MAINNET_CONFIGURATOR_PROXY, - cometProxyAdminAddress: MAINNET_COMET_PROXY_ADMIN, + governorTimelockAddress: MANTLE_LOCAL_TIMELOCK, + configuratorProxyAddress: MANTLE_CONFIGURATOR_PROXY, + cometProxyAdminAddress: MANTLE_COMET_PROXY_ADMIN, marketUpdatePauseGuardian: address(0), marketUpdateProposalGuardian: address(0), marketAdmin: address(0) @@ -175,6 +187,8 @@ library ChainAddresses { return SCROLL_LOCAL_TIMELOCK; } else if (chain == Chain.OPTIMISM) { return OPTIMISM_LOCAL_TIMELOCK; + } else if (chain == Chain.MANTLE) { + return MANTLE_LOCAL_TIMELOCK; } else { revert("MarketUpdateAddresses: Chain not supported"); } @@ -197,6 +211,8 @@ library ChainAddresses { return Chain.OP_SEPOLIA; } else if(chainId == 11155111) { return Chain.MAINNET_SEPOLIA; + } else if(chainId == 5000) { + return Chain.MANTLE; } else { revert("MarketUpdateAddresses: Chain not supported"); } diff --git a/forge/script/marketupdates/helpers/MarketAddresses.sol b/forge/script/marketupdates/helpers/MarketAddresses.sol index 220f37970..b35b9176f 100644 --- a/forge/script/marketupdates/helpers/MarketAddresses.sol +++ b/forge/script/marketupdates/helpers/MarketAddresses.sol @@ -34,6 +34,8 @@ library MarketAddresses { address constant public OPTIMISM_USDT_MARKET = 0x995E394b8B2437aC8Ce61Ee0bC610D617962B214; // See - https://optimistic.etherscan.io/address/0x995E394b8B2437aC8Ce61Ee0bC610D617962B214 address constant public OPTIMISM_ETH_MARKET = 0xE36A30D249f7761327fd973001A32010b521b6Fd; // See - https://optimistic.etherscan.io/address/0xE36A30D249f7761327fd973001A32010b521b6Fd + address constant public MANTLE_USDe_MARKET = 0x606174f62cd968d8e684c645080fa694c1D7786E; // See - https://mantlescan.xyz/address/0x606174f62cd968d8e684c645080fa694c1D7786E + function getMarketsForChain(ChainAddresses.Chain chain) internal pure returns (MarketInfo[] memory) { if (chain == ChainAddresses.Chain.ETHEREUM) { MarketInfo[] memory markets = new MarketInfo[](4); @@ -106,6 +108,13 @@ library MarketAddresses { cometProxyAddress: SCROLL_USDC_MARKET }); return markets; + } else if (chain == ChainAddresses.Chain.MANTLE) { + MarketInfo[] memory markets = new MarketInfo[](1); + markets[0] = MarketInfo({ + baseTokenSymbol: "USDe", + cometProxyAddress: MANTLE_USDe_MARKET + }); + return markets; } else if (chain == ChainAddresses.Chain.OPTIMISM) { MarketInfo[] memory markets = new MarketInfo[](3); markets[0] = MarketInfo({ diff --git a/forge/test/MarketUpdateMantleDeploymentTest.t.sol b/forge/test/MarketUpdateMantleDeploymentTest.t.sol new file mode 100644 index 000000000..844f905ed --- /dev/null +++ b/forge/test/MarketUpdateMantleDeploymentTest.t.sol @@ -0,0 +1,35 @@ +pragma solidity 0.8.15; + +import {Test} from "forge-std/Test.sol"; +import "@comet-contracts/Comet.sol"; +import "@comet-contracts/marketupdates/MarketUpdateProposer.sol"; + +import "../script/marketupdates/helpers/GovernanceHelper.sol"; +import "../script/marketupdates/helpers/MarketUpdateAddresses.sol"; +import "../script/marketupdates/helpers/MarketUpdateContractsDeployer.sol"; +import "../script/marketupdates/helpers/ChainAddresses.sol"; +import "../script/marketupdates/helpers/MarketAddresses.sol"; +import "../script/marketupdates/helpers/GovernanceHelper.sol"; +import "./MarketUpdateDeploymentBaseTest.sol"; + +contract MarketUpdateMantleDeploymentTest is Test, MarketUpdateDeploymentBaseTest { + + MarketUpdateContractsDeployer.DeployedContracts deployedContracts; + + function setUp() public { + vm.createSelectFork("mantle"); + deployedContracts = createMarketUpdateDeploymentForL2(vm, ChainAddresses.Chain.MANTLE); + } + + function test_MantleUSDeDeployment() public { + console.log("Create Supply Kink Proposal for USDCe Market and verify after execution"); + + updateAndVerifySupplyKinkInL2( + vm, + "cUSDev3", + ChainAddresses.Chain.MANTLE, + MarketAddresses.MANTLE_USDe_MARKET, + deployedContracts + ); + } +} diff --git a/foundry.toml b/foundry.toml index 344e51668..1b25dd554 100644 --- a/foundry.toml +++ b/foundry.toml @@ -23,3 +23,4 @@ optimism = "${OPTIMISM_RPC_URL}" scroll = "${SCROLL_RPC_URL}" base = "${BASE_RPC_URL}" sepolia = "${SEPOLIA_RPC_URL}" +mantle = "${MANTLE_RPC_URL}"