diff --git a/.github/actions/setup-mips-permissions/action.yml b/.github/actions/setup-mips-permissions/action.yml new file mode 100644 index 000000000..f1b9ad244 --- /dev/null +++ b/.github/actions/setup-mips-permissions/action.yml @@ -0,0 +1,8 @@ +name: 'Setup MIPs Permissions' +description: 'Grant execute permissions to the proposals/mips directory' +runs: + using: 'composite' + steps: + - name: Give write permissions + shell: bash + run: chmod -R +x proposals/mips/ diff --git a/.github/workflows/base-integration.yml b/.github/workflows/base-integration.yml index f342444be..23f0330af 100644 --- a/.github/workflows/base-integration.yml +++ b/.github/workflows/base-integration.yml @@ -22,8 +22,8 @@ jobs: - name: Setup Environment uses: ./.github/actions - - name: Give write permissions - run: chmod -R +x proposals/mips/ + - name: Setup MIPs Permissions + uses: ./.github/actions/setup-mips-permissions - name: Live System Integration Tests uses: nick-fields/retry@v3 @@ -46,8 +46,8 @@ jobs: - name: Setup Environment uses: ./.github/actions - - name: Give write permissions - run: chmod -R +x proposals/mips/ + - name: Setup MIPs Permissions + uses: ./.github/actions/setup-mips-permissions - name: Reserve Automation Integration Tests uses: nick-fields/retry@v3 @@ -135,8 +135,8 @@ jobs: - name: Setup Environment uses: ./.github/actions - - name: Give write permissions - run: chmod -R +x proposals/mips/ + - name: Setup MIPs Permissions + uses: ./.github/actions/setup-mips-permissions - name: Run Integration Tests uses: nick-fields/retry@v3 @@ -159,6 +159,9 @@ jobs: - name: Setup Environment uses: ./.github/actions + - name: Setup MIPs Permissions + uses: ./.github/actions/setup-mips-permissions + - name: Run Integration Tests uses: nick-fields/retry@v3 with: diff --git a/.github/workflows/multichain-integration.yml b/.github/workflows/multichain-integration.yml index 2f1b7c93e..642ae5b5b 100644 --- a/.github/workflows/multichain-integration.yml +++ b/.github/workflows/multichain-integration.yml @@ -22,8 +22,8 @@ jobs: - name: Setup Environment uses: ./.github/actions - - name: Give write permissions - run: chmod -R +x proposals/mips/ + - name: Setup MIPs Permissions + uses: ./.github/actions/setup-mips-permissions - name: Run Integration Test uses: nick-fields/retry@v3 @@ -49,8 +49,8 @@ jobs: - name: Setup Environment uses: ./.github/actions - - name: Give write permission - run: chmod -R +x proposals/mips/ + - name: Setup MIPs Permissions + uses: ./.github/actions/setup-mips-permissions - name: Run Integration Test uses: nick-fields/retry@v3 @@ -75,8 +75,8 @@ jobs: - name: Setup Environment uses: ./.github/actions - - name: Give write permissions - run: chmod -R +x proposals/mips/ + - name: Setup MIPs Permissions + uses: ./.github/actions/setup-mips-permissions - name: Run Integration Test uses: nick-fields/retry@v3 @@ -111,8 +111,8 @@ jobs: run: | echo "PR_CHANGED_FILES=${{ steps.files.outputs.added_modified }}" >> $GITHUB_ENV - - name: Give write permissions - run: chmod -R +x proposals/mips/ + - name: Setup MIPs Permissions + uses: ./.github/actions/setup-mips-permissions - name: Make the script executable run: chmod +x bin/run-onchain-calldata-check.sh @@ -188,8 +188,8 @@ jobs: }); } - - name: Give write permissions - run: chmod -R +x proposals/mips/ + - name: Setup MIPs Permissions + uses: ./.github/actions/setup-mips-permissions - name: Run Calldata Printing uses: nick-fields/retry@v3 @@ -253,8 +253,8 @@ jobs: - name: Setup Environment uses: ./.github/actions - - name: Give write permissions - run: chmod -R +x proposals/mips/ + - name: Setup MIPs Permissions + uses: ./.github/actions/setup-mips-permissions - name: Run Integration Test uses: nick-fields/retry@v3 @@ -263,4 +263,4 @@ jobs: retry_wait_seconds: 60 timeout_minutes: 20 max_attempts: 1 - command: time forge test --match-contract PostProposalTest -vvvvv --ffi + command: time forge test --match-contract PostProposalTest -vvv --ffi diff --git a/.github/workflows/optimism-integration.yml b/.github/workflows/optimism-integration.yml index f8dac4057..337e5eb86 100644 --- a/.github/workflows/optimism-integration.yml +++ b/.github/workflows/optimism-integration.yml @@ -21,8 +21,8 @@ jobs: - name: Setup Environment uses: ./.github/actions - - name: Give write permissions - run: chmod -R +x proposals/mips/ + - name: Setup MIPs Permissions + uses: ./.github/actions/setup-mips-permissions - name: Live System Integration Tests uses: nick-fields/retry@v3 @@ -67,8 +67,8 @@ jobs: - name: Setup Environment uses: ./.github/actions - - name: Give write permissions - run: chmod -R +x proposals/mips/ + - name: Setup MIPs Permissions + uses: ./.github/actions/setup-mips-permissions - name: Run Integration Tests uses: nick-fields/retry@v3 diff --git a/chains/8453.json b/chains/8453.json index eca1d95f3..1c3236651 100644 --- a/chains/8453.json +++ b/chains/8453.json @@ -1218,5 +1218,10 @@ "addr": "0xc842d95b9C35bf97842110408A8C501645Fb1722", "isContract": true, "name": "MORPHO_CHAINLINK_stkWELL_USD_ORACLE" + }, + { + "addr": "0x74Cbb1E8B68dDD13B28684ECA202a351afD45EAa", + "isContract": true, + "name": "F-DEVGRANT" } ] diff --git a/proposals/hooks/BridgeValidationHook.sol b/proposals/hooks/BridgeValidationHook.sol index 615649900..de0e130c4 100644 --- a/proposals/hooks/BridgeValidationHook.sol +++ b/proposals/hooks/BridgeValidationHook.sol @@ -6,15 +6,15 @@ import {ProposalAction} from "@proposals/proposalTypes/IProposal.sol"; /// @title BridgeValidationHook /// @notice Hook to validate bridgeToRecipient calls in proposals -/// @dev Ensures that the native value sent with bridge calls is between 5x and 10x +/// @dev Ensures that the native value sent with bridge calls is between 4x and 10x /// the actual bridge cost returned by router.bridgeCost(destinationChain) abstract contract BridgeValidationHook { /// @notice Function selector for bridgeToRecipient(address,uint256,uint16) bytes4 private constant BRIDGE_TO_RECIPIENT_SELECTOR = xWELLRouter.bridgeToRecipient.selector; - /// @notice Minimum multiplier for bridge cost (5x) - uint256 private constant MIN_BRIDGE_COST_MULTIPLIER = 5; + /// @notice Minimum multiplier for bridge cost (4x) + uint256 private constant MIN_BRIDGE_COST_MULTIPLIER = 4; /// @notice Maximum multiplier for bridge cost (10x) uint256 private constant MAX_BRIDGE_COST_MULTIPLIER = 10; @@ -51,7 +51,7 @@ abstract contract BridgeValidationHook { // Get the actual bridge cost from the router with validation uint256 bridgeCost = _getBridgeCost(router, wormholeChainId); - // Validate that action value is between 5x and 10x the bridge cost + // Validate that action value is between 4x and 10x the bridge cost uint256 minValue = bridgeCost * MIN_BRIDGE_COST_MULTIPLIER; uint256 maxValue = bridgeCost * MAX_BRIDGE_COST_MULTIPLIER; diff --git a/proposals/mips/mip-b45/b45.sol b/proposals/mips/mip-b45/b45.sol index 3d364e2d9..805b39c37 100644 --- a/proposals/mips/mip-b45/b45.sol +++ b/proposals/mips/mip-b45/b45.sol @@ -73,7 +73,10 @@ contract mipb45 is HybridProposal, Configs { function beforeSimulationHook(Addresses addresses) public override { vm.selectFork(MOONBEAM_FORK_ID); // mock relayer so we can simulate bridging well - WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter(); + WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter( + new uint16[](0), + new uint256[](0) + ); vm.makePersistent(address(wormholeRelayer)); vm.label(address(wormholeRelayer), "MockWormholeRelayer"); diff --git a/proposals/mips/mip-b46/b46.sol b/proposals/mips/mip-b46/b46.sol index d95da702c..cdee02d5e 100644 --- a/proposals/mips/mip-b46/b46.sol +++ b/proposals/mips/mip-b46/b46.sol @@ -93,7 +93,10 @@ contract mipb46 is HybridProposal, Configs { function beforeSimulationHook(Addresses addresses) public override { vm.selectFork(MOONBEAM_FORK_ID); // mock relayer so we can simulate bridging well - WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter(); + WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter( + new uint16[](0), + new uint256[](0) + ); vm.makePersistent(address(wormholeRelayer)); vm.label(address(wormholeRelayer), "MockWormholeRelayer"); diff --git a/proposals/mips/mip-b50/mip-b50.sol b/proposals/mips/mip-b50/mip-b50.sol index 33766d4fc..9f90265f0 100644 --- a/proposals/mips/mip-b50/mip-b50.sol +++ b/proposals/mips/mip-b50/mip-b50.sol @@ -101,7 +101,10 @@ contract mipb50 is HybridProposal, Configs { function beforeSimulationHook(Addresses addresses) public override { vm.selectFork(MOONBEAM_FORK_ID); // mock relayer so we can simulate bridging well - WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter(); + WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter( + new uint16[](0), + new uint256[](0) + ); vm.makePersistent(address(wormholeRelayer)); vm.label(address(wormholeRelayer), "MockWormholeRelayer"); diff --git a/proposals/mips/mip-x33/x33.json b/proposals/mips/mip-x33/x33.json index 1887450ea..0acb7d531 100644 --- a/proposals/mips/mip-x33/x33.json +++ b/proposals/mips/mip-x33/x33.json @@ -19,7 +19,6 @@ "market": "MOONWELL_cbXRP", "reserveFactor": 0.15e18 } - ], "irModels": [ { diff --git a/proposals/mips/mip-x34/x34.json b/proposals/mips/mip-x34/x34.json new file mode 100755 index 000000000..4fdaae752 --- /dev/null +++ b/proposals/mips/mip-x34/x34.json @@ -0,0 +1,738 @@ +{ + "10": { + "initSale": { + "auctionPeriod": 1209600, + "delay": 3600, + "miniAuctionPeriod": 21600, + "periodMaxDiscount": 800000000000000000, + "periodStartingPremium": 1200000000000000000, + "reserveAutomationContracts": [ + "RESERVE_AUTOMATION_WBTC", + "RESERVE_AUTOMATION_cbETH", + "RESERVE_AUTOMATION_rETH", + "RESERVE_AUTOMATION_VELO" + ] + }, + "setMRDSpeeds": [ + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_USDC", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": 76573657770598660 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_USDT", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": 4372232831657142 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_DAI", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": 1662190440869837 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_WBTC", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_WETH", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": 320314730166049540 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_wstETH", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": 22263543032100536 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_cbETH", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_rETH", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": 3961318764479407 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_OP", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": 6400407423641418 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_weETH", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": 4785736766130668 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_VELO", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": 34512454980035044 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_wrsETH", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": 1191191673823781 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_USDT0", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": 2585229404392546 + } + ], + "stkWellEmissionsPerSecond": 28177837995047980, + "transferFrom": [ + { + "amount": 1.1578840095195412e24, + "from": "TEMPORAL_GOVERNOR", + "to": "MRD_PROXY", + "token": "xWELL_PROXY" + }, + { + "amount": 6.811082467762007e22, + "from": "TEMPORAL_GOVERNOR", + "to": "ECOSYSTEM_RESERVE_PROXY", + "token": "xWELL_PROXY" + } + ], + "transferReserves": [ + { + "amount": 520, + "market": "MOONWELL_WBTC", + "to": "RESERVE_AUTOMATION_WBTC" + }, + { + "amount": 9595543683, + "market": "MOONWELL_cbETH", + "to": "RESERVE_AUTOMATION_cbETH" + }, + { + "amount": 150598530062530, + "market": "MOONWELL_rETH", + "to": "RESERVE_AUTOMATION_rETH" + }, + { + "amount": 4.978443321988336e22, + "market": "MOONWELL_VELO", + "to": "RESERVE_AUTOMATION_VELO" + } + ], + "withdrawWell": [ + { + "amount": 56999999999999975000, + "to": "ECOSYSTEM_RESERVE_PROXY" + } + ], + "multiRewarder": [ + { + "distributor": "TEMPORAL_GOVERNOR", + "duration": 2419200, + "reward": 6.811082367762007e22, + "rewardToken": "xWELL_PROXY", + "vault": "USDC_MULTI_REWARDER" + } + ], + "merkleCampaigns": [] + }, + "1284": { + "bridgeToRecipient": [ + { + "amount": 1.1522432745502147e25, + "nativeValue": 26127590397908464000, + "network": 8453, + "target": "TEMPORAL_GOVERNOR" + }, + { + "amount": 3.9200723716034845e24, + "nativeValue": 26127590397908464000, + "network": 8453, + "target": "TEMPORAL_GOVERNOR" + }, + { + "amount": 1.2941056788747813e24, + "nativeValue": 26127590397908464000, + "network": 10, + "target": "TEMPORAL_GOVERNOR" + }, + { + "amount": 6.811083467762007e22, + "nativeValue": 26127590397908464000, + "network": 10, + "target": "DEX_RELAYER" + } + ], + "transferFrom": [ + { + "amount": 1.1522432835502147e25, + "from": "MGLIMMER_MULTISIG", + "to": "MULTICHAIN_GOVERNOR_PROXY", + "token": "GOVTOKEN" + }, + { + "amount": 3.920072461603484e24, + "from": "F-GLMR-DEVGRANT", + "to": "MULTICHAIN_GOVERNOR_PROXY", + "token": "GOVTOKEN" + }, + { + "amount": 1.3622165935524013e24, + "from": "MGLIMMER_MULTISIG", + "to": "MULTICHAIN_GOVERNOR_PROXY", + "token": "GOVTOKEN" + }, + { + "amount": 1.2739919169820069e22, + "from": "MGLIMMER_MULTISIG", + "to": "MULTICHAIN_GOVERNOR_PROXY", + "token": "GOVTOKEN" + }, + { + "amount": 1.2230312803027264e23, + "from": "MGLIMMER_MULTISIG", + "to": "UNITROLLER", + "token": "GOVTOKEN" + }, + { + "amount": 1.1975514619630864e23, + "from": "MGLIMMER_MULTISIG", + "to": "ECOSYSTEM_RESERVE_PROXY", + "token": "GOVTOKEN" + } + ], + "addRewardInfo": { + "amount": 1.2739919169820069e22, + "endTimestamp": 1764941418, + "pid": 15, + "rewardPerSec": 5266166158159750, + "target": "STELLASWAP_REWARDER" + }, + "setRewardSpeed": [ + { + "market": "mGLIMMER", + "newBorrowSpeed": 1019460594790708, + "newSupplySpeed": 1019460594790708, + "rewardType": 0 + }, + { + "market": "mGLIMMER", + "newBorrowSpeed": 1562910651606100, + "newSupplySpeed": 1562910651606100, + "rewardType": 1 + }, + { + "market": "mxcDOT", + "newBorrowSpeed": 1, + "newSupplySpeed": 47402331780543790, + "rewardType": 0 + }, + { + "market": "mxcDOT", + "newBorrowSpeed": 1, + "newSupplySpeed": 72671380953167490, + "rewardType": 1 + }, + { + "market": "mFRAX", + "newBorrowSpeed": 111477040137464, + "newSupplySpeed": 111477040137464, + "rewardType": 0 + }, + { + "market": "mFRAX", + "newBorrowSpeed": 170902783619736, + "newSupplySpeed": 170902783619736, + "rewardType": 1 + }, + { + "market": "mETHwh", + "newBorrowSpeed": 1, + "newSupplySpeed": 0, + "rewardType": 0 + }, + { + "market": "mETHwh", + "newBorrowSpeed": 1, + "newSupplySpeed": 0, + "rewardType": 1 + }, + { + "market": "MOONWELL_mWBTC", + "newBorrowSpeed": 1, + "newSupplySpeed": 0, + "rewardType": 0 + }, + { + "market": "MOONWELL_mWBTC", + "newBorrowSpeed": 1, + "newSupplySpeed": 0, + "rewardType": 1 + }, + { + "market": "mUSDCwh", + "newBorrowSpeed": 130764981879177, + "newSupplySpeed": 130764981879177, + "rewardType": 0 + }, + { + "market": "mUSDCwh", + "newBorrowSpeed": 200472665721819, + "newSupplySpeed": 200472665721819, + "rewardType": 1 + }, + { + "market": "mxcUSDT", + "newBorrowSpeed": 176432257235056, + "newSupplySpeed": 176432257235056, + "rewardType": 0 + }, + { + "market": "mxcUSDT", + "newBorrowSpeed": 270484073174194, + "newSupplySpeed": 270484073174194, + "rewardType": 1 + }, + { + "market": "mxcUSDC", + "newBorrowSpeed": 138296794852503, + "newSupplySpeed": 138296794852503, + "rewardType": 0 + }, + { + "market": "mxcUSDC", + "newBorrowSpeed": 212019508024569, + "newSupplySpeed": 212019508024569, + "rewardType": 1 + } + ], + "stkWellEmissionsPerSecond": 49501961886701650, + "withdrawWell": [] + }, + "8453": { + "initSale": { + "auctionPeriod": 1209600, + "delay": 3600, + "miniAuctionPeriod": 21600, + "periodMaxDiscount": 800000000000000000, + "periodStartingPremium": 1200000000000000000, + "reserveAutomationContracts": [ + "RESERVE_AUTOMATION_USDBC", + "RESERVE_AUTOMATION_cbETH", + "RESERVE_AUTOMATION_DAI", + "RESERVE_AUTOMATION_USDC", + "RESERVE_AUTOMATION_wstETH", + "RESERVE_AUTOMATION_AERO", + "RESERVE_AUTOMATION_weETH", + "RESERVE_AUTOMATION_cbBTC", + "RESERVE_AUTOMATION_VIRTUAL" + ] + }, + "multiRewarder": [], + "setMRDSpeeds": [ + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_USDBC", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": -1 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_USDBC", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_WETH", + "newBorrowSpeed": 386939545320730900, + "newEndTime": 1764941418, + "newSupplySpeed": 386939545320730900 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_WETH", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_cbETH", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": -1 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_cbETH", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_DAI", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": -1 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_DAI", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_USDC", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": 1431369560920015400 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_USDC", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_wstETH", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": -1 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_wstETH", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_rETH", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": -1 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_rETH", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_AERO", + "newBorrowSpeed": 123197075917198140, + "newEndTime": 1764941418, + "newSupplySpeed": 100797607568616670 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_AERO", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_weETH", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": -1 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_weETH", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_cbBTC", + "newBorrowSpeed": 170754459232001060, + "newEndTime": 1764941418, + "newSupplySpeed": 170754459232001060 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_cbBTC", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_EURC", + "newBorrowSpeed": 14659212357237808, + "newEndTime": 1764941418, + "newSupplySpeed": 14659212357237808 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_EURC", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_wrsETH", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": -1 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_wrsETH", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_WELL", + "newBorrowSpeed": 40931743553751520, + "newEndTime": 1764941418, + "newSupplySpeed": 33489608362160336 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_WELL", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_USDS", + "newBorrowSpeed": -1, + "newEndTime": 1764941418, + "newSupplySpeed": -1 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_USDS", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_TBTC", + "newBorrowSpeed": 4787082405655257, + "newEndTime": 1764941418, + "newSupplySpeed": 4787082405655257 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_TBTC", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_LBTC", + "newBorrowSpeed": 23969220912580464, + "newEndTime": 1764941418, + "newSupplySpeed": 23969220912580464 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_LBTC", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_VIRTUAL", + "newBorrowSpeed": 54556210213040830, + "newEndTime": 1764941418, + "newSupplySpeed": 44636899265215224 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_VIRTUAL", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_MORPHO", + "newBorrowSpeed": 101078963209503760, + "newEndTime": 1764941418, + "newSupplySpeed": 82700969898684900 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_MORPHO", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + }, + { + "emissionToken": "xWELL_PROXY", + "market": "MOONWELL_cbXRP", + "newBorrowSpeed": 65482763770240690, + "newEndTime": 1764941418, + "newSupplySpeed": 53576806721106020 + }, + { + "emissionToken": "USDC", + "market": "MOONWELL_cbXRP", + "newBorrowSpeed": -1, + "newEndTime": -1, + "newSupplySpeed": -1 + } + ], + "transferFrom": [ + { + "amount": 8.065702904851501e24, + "from": "TEMPORAL_GOVERNOR", + "to": "MRD_PROXY", + "token": "xWELL_PROXY" + } + ], + "transferReserves": [ + { + "amount": 791507, + "market": "MOONWELL_USDBC", + "to": "RESERVE_AUTOMATION_USDBC" + }, + { + "amount": 389545541471860000, + "market": "MOONWELL_cbETH", + "to": "RESERVE_AUTOMATION_cbETH" + }, + { + "amount": 393571483759490500000, + "market": "MOONWELL_DAI", + "to": "RESERVE_AUTOMATION_DAI" + }, + { + "amount": 90797234748, + "market": "MOONWELL_USDC", + "to": "RESERVE_AUTOMATION_USDC" + }, + { + "amount": 7978892804492543000, + "market": "MOONWELL_wstETH", + "to": "RESERVE_AUTOMATION_wstETH" + }, + { + "amount": 2.0817666223200417e23, + "market": "MOONWELL_AERO", + "to": "RESERVE_AUTOMATION_AERO" + }, + { + "amount": 6671047147360000, + "market": "MOONWELL_weETH", + "to": "RESERVE_AUTOMATION_weETH" + }, + { + "amount": 8155180, + "market": "MOONWELL_cbBTC", + "to": "RESERVE_AUTOMATION_cbBTC" + }, + { + "amount": 1.4916685444629005e22, + "market": "MOONWELL_VIRTUAL", + "to": "RESERVE_AUTOMATION_VIRTUAL" + } + ], + "withdrawWell": [ + { + "amount": 5.40306687032533e24, + "to": "TEMPORAL_GOVERNOR" + } + ], + "merkleCampaigns": [ + { + "amount": 8.859796691975974e24, + "campaignData": "0x000000000000000000000000e66e3a37c3274ac24fe8590f7d84a2427194dc1700000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "campaignType": 18, + "duration": 2419200, + "rewardToken": "xWELL_PROXY", + "startTimestamp": 1762522218 + }, + { + "amount": 1.5e24, + "campaignData": "0x000000000000000000000000c1256ae5ff1cf2719d4937adb3bbccab2e00a2ca0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "campaignType": 56, + "duration": 2419200, + "rewardToken": "xWELL_PROXY", + "startTimestamp": 1762522218 + }, + { + "amount": 7.5e23, + "campaignData": "0x000000000000000000000000a0e430870c4604ccfc7b38ca7845b1ff653d0ff10000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "campaignType": 56, + "duration": 2419200, + "rewardToken": "xWELL_PROXY", + "startTimestamp": 1762522218 + }, + { + "amount": 4e23, + "campaignData": "0x000000000000000000000000f24608e0ccb972b0b0f4a6446a0bbf58c701a0260000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "campaignType": 56, + "duration": 2419200, + "rewardToken": "xWELL_PROXY", + "startTimestamp": 1762522218 + }, + { + "amount": 4e23, + "campaignData": "0x000000000000000000000000543257ef2161176d7c8cd90ba65c2d4caef5a7960000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "campaignType": 56, + "duration": 2419200, + "rewardToken": "xWELL_PROXY", + "startTimestamp": 1762522218 + }, + { + "amount": 8.700723616034844e23, + "campaignData": "0x000000000000000000000000e1ba476304255353aef290e6474a417d06e7b7730000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "campaignType": 56, + "duration": 2419200, + "rewardToken": "xWELL_PROXY", + "startTimestamp": 1762522218 + } + ] + }, + "endTimeSTamp": 1764941418, + "startTimeStamp": 1762522218 +} diff --git a/proposals/mips/mip-x34/x34.md b/proposals/mips/mip-x34/x34.md new file mode 100755 index 000000000..0c4b4b49f --- /dev/null +++ b/proposals/mips/mip-x34/x34.md @@ -0,0 +1,740 @@ +# MIP-x34 Automated Liquidity Incentive Proposal + +This is an automated liquidity incentive governance proposal for the Moonwell +protocol. + +## Base Network + +If successful, the proposal would automatically distribute and adjust liquidity +incentives for the period beginning 2025-11-07 at 10:30:18 UTC and ending on +2025-12-05 at 10:30:18 UTC. + +| Metric | Value | +| -------------------------------------------------- | ------------------ | +| Timestamp of capture | 1761843670 | +| Closest block number | 37527161 | +| Total Supply in USD for incentivized markets | $300,844,482.47 | +| Total Borrows in USD | $112,695,051.13 | +| Safety Module APR | 4.60% | +| **Safety Module Boosted APR** | **11.76%** | +| **Total WELL acquired in auctions (USD)** | **$87,292.96** | +| | | +| Total LP (ETH/WELL on Aerodrome) | $12,669,760.00 | +| | | +| Total WELL to distribute DEX | 600,191.939 WELL | +| Total WELL to distribute Safety Module | 3,467,327.483 WELL | +| Total WELL to distribute Safety Module (Auctions) | 5,403,066.871 WELL | +| Total WELL to distribute Markets (Config) | 8,090,430.795 WELL | +| Total WELL to distribute Markets (Sanity Check) | 8090430.7947 WELL | +| Total WELL to distribute Markets (Supply Side) | 5680567.2481 WELL | +| Total WELL to distribute Markets (Borrow Side) | 2409863.5467 WELL | +| Total WELL to distribute Markets (Borrow + Supply) | 8090430.7947 WELL | +| Total WELL to distribute Markets (By Speed) | 8090430.7947 WELL | +| Total WELL to distribute (Config + Auctions) | 16960825.1495 WELL | +| Total WELL to distribute (Sanity Check) | 16960825.1495 WELL | +| | | + +### ETH (MOONWELL_WETH) + +Total Supply in USD: $54,107,689.67 Total Borrows in USD: $40,587,362.81 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.71% | 0.71% | +| Borrow APY | 1.05% | 1.05% | +| WELL Supply APR | 0.28% | 0.28% | +| WELL Borrow APR | 0.52% | 0.52% | +| Total Supply APR | 0.99% | 0.99% | +| Total Borrow APR | 0.53% | 0.53% | +| Total Supply Incentives Per Day in USD | $576.74 | $574.97 | +| Total Borrow Incentives Per Day in USD | $576.74 | $574.97 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -0.31% | +| WELL Borrow | -0.31% | + +### USDC (MOONWELL_USDC) + +Total Supply in USD: $52,780,702.33 Total Borrows in USD: $47,524,200.79 +**Reserves to auction: $90,639.69** + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 5.55% | 5.55% | +| Borrow APY | 6.85% | 6.85% | +| WELL Supply APR | 0.54% | 0.57% | +| WELL Borrow APR | 0% | 0% | +| Total Supply APR | 6.09% | 6.12% | +| Total Borrow APR | 6.85% | 6.85% | +| Total Supply Incentives Per Day in USD | $1,883.31 | $1,982.79 | +| Total Borrow Incentives Per Day in USD | $0.00 | $0.00 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | 5.28% | +| WELL Borrow | 0% | + +### AERO (MOONWELL_AERO) + +Total Supply in USD: $24,211,799.74 Total Borrows in USD: $6,927,410.01 +**Reserves to auction: $204,333.68** + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 1.32% | 1.32% | +| Borrow APY | 6.58% | 6.58% | +| WELL Supply APR | 0.28% | 0.25% | +| WELL Borrow APR | 0.94% | 0.86% | +| Total Supply APR | 1.60% | 1.57% | +| Total Borrow APR | 5.64% | 5.72% | +| Total Supply Incentives Per Day in USD | $146.49 | $134.15 | +| Total Borrow Incentives Per Day in USD | $179.04 | $163.96 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -8.42% | +| WELL Borrow | -8.42% | + +### cbBTC (MOONWELL_cbBTC) + +Total Supply in USD: $59,888,305.40 Total Borrows in USD: $9,065,230.13 +**Reserves to auction: $8,744.34** + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.13% | 0.13% | +| Borrow APY | 0.93% | 0.93% | +| WELL Supply APR | 0.35% | 0.28% | +| WELL Borrow APR | 1.15% | 0.93% | +| Total Supply APR | 0.48% | 0.41% | +| Total Borrow APR | 0.00% | 0.00% | +| Total Supply Incentives Per Day in USD | $286.39 | $231.89 | +| Total Borrow Incentives Per Day in USD | $286.39 | $231.89 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -19.03% | +| WELL Borrow | -19.03% | + +### EURC (MOONWELL_EURC) + +Total Supply in USD: $2,398,953.00 Total Borrows in USD: $1,970,448.04 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 4.37% | 4.37% | +| Borrow APY | 5.91% | 5.91% | +| WELL Supply APR | 0.32% | 0.28% | +| WELL Borrow APR | 0.39% | 0.34% | +| Total Supply APR | 4.69% | 4.65% | +| Total Borrow APR | 5.52% | 5.57% | +| Total Supply Incentives Per Day in USD | $21.17 | $18.61 | +| Total Borrow Incentives Per Day in USD | $21.17 | $18.61 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -12.07% | +| WELL Borrow | -12.07% | + +### WELL (MOONWELL_WELL) + +Total Supply in USD: $3,707,580.21 Total Borrows in USD: $541,344.86 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.35% | 0.35% | +| Borrow APY | 3.21% | 3.21% | +| WELL Supply APR | 0.22% | 0.25% | +| WELL Borrow APR | 3.39% | 3.86% | +| Total Supply APR | 0.57% | 0.60% | +| Total Borrow APR | 0.00% | 0.00% | +| Total Supply Incentives Per Day in USD | $41.14 | $46.84 | +| Total Borrow Incentives Per Day in USD | $50.28 | $57.25 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | 13.85% | +| WELL Borrow | 13.85% | + +### tBTC (MOONWELL_TBTC) + +Total Supply in USD: $850,381.14 Total Borrows in USD: $240,958.37 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.44% | 0.44% | +| Borrow APY | 1.74% | 1.74% | +| WELL Supply APR | 0.43% | 0.28% | +| WELL Borrow APR | 1.52% | 1% | +| Total Supply APR | 0.87% | 0.72% | +| Total Borrow APR | 0.22% | 0.74% | +| Total Supply Incentives Per Day in USD | $10.03 | $6.60 | +| Total Borrow Incentives Per Day in USD | $10.03 | $6.60 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -34.19% | +| WELL Borrow | -34.19% | + +### LBTC (MOONWELL_LBTC) + +Total Supply in USD: $4,229,929.87 Total Borrows in USD: $1,061,929.91 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.35% | 0.35% | +| Borrow APY | 1.54% | 1.54% | +| WELL Supply APR | 0.35% | 0.28% | +| WELL Borrow APR | 1.38% | 1.13% | +| Total Supply APR | 0.70% | 0.63% | +| Total Borrow APR | 0.16% | 0.41% | +| Total Supply Incentives Per Day in USD | $40.12 | $32.82 | +| Total Borrow Incentives Per Day in USD | $40.12 | $32.82 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -18.21% | +| WELL Borrow | -18.21% | + +### VIRTUAL (MOONWELL_VIRTUAL) + +Total Supply in USD: $3,919,996.48 Total Borrows in USD: $2,337,887.84 +**Reserves to auction: $18,813.56** + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 5.73% | 5.73% | +| Borrow APY | 13.72% | 13.72% | +| WELL Supply APR | 0.19% | 0.25% | +| WELL Borrow APR | 0.87% | 1.19% | +| Total Supply APR | 5.92% | 5.98% | +| Total Borrow APR | 12.85% | 12.53% | +| Total Supply Incentives Per Day in USD | $45.47 | $62.29 | +| Total Borrow Incentives Per Day in USD | $55.58 | $76.13 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | 36.97% | +| WELL Borrow | 36.97% | + +### MORPHO (MOONWELL_MORPHO) + +Total Supply in USD: $11,095,754.20 Total Borrows in USD: $1,135,877.07 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.16% | 0.16% | +| Borrow APY | 2.35% | 2.35% | +| WELL Supply APR | 0.23% | 0.25% | +| WELL Borrow APR | 3.94% | 4.41% | +| Total Supply APR | 0.39% | 0.41% | +| Total Borrow APR | 0.00% | 0.00% | +| Total Supply Incentives Per Day in USD | $100.27 | $112.39 | +| Total Borrow Incentives Per Day in USD | $122.56 | $137.37 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | 12.08% | +| WELL Borrow | 12.08% | + +### cbXRP (MOONWELL_cbXRP) + +Total Supply in USD: $5,653,390.43 Total Borrows in USD: $1,302,401.30 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.60% | 0.60% | +| Borrow APY | 3.09% | 3.09% | +| WELL Supply APR | 0.26% | 0.25% | +| WELL Borrow APR | 2.63% | 2.55% | +| Total Supply APR | 0.86% | 0.85% | +| Total Borrow APR | 0.46% | 0.54% | +| Total Supply Incentives Per Day in USD | $76.67 | $74.39 | +| Total Borrow Incentives Per Day in USD | $93.71 | $90.92 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -2.98% | +| WELL Borrow | -2.98% | + +## Optimism Network + +If successful, the proposal would automatically distribute and adjust liquidity +incentives for the period beginning 2025-11-07 at 10:30:18 UTC and ending on +2025-12-05 at 10:30:18 UTC. + +| Metric | Value | +| -------------------------------------------------- | ------------------ | +| Timestamp of capture | 1761843670 | +| Closest block number | 143122446 | +| Total Supply in USD for incentivized markets | $31,855,793.20 | +| Total Borrows in USD | $15,765,245.45 | +| Safety Module APR | 4.83% | +| **Safety Module Boosted APR** | **4.84%** | +| **Total WELL acquired in auctions (USD)** | **$0.92** | +| | | +| Total WELL to distribute DEX | 66,546.534 WELL | +| Total WELL to distribute Safety Module | 66,546.534 WELL | +| Total WELL to distribute Safety Module (Auctions) | 57.001 WELL | +| Total WELL to distribute Markets (Config) | 1,131,291.081 WELL | +| Total WELL to distribute Markets (Sanity Check) | 1131291.0805 WELL | +| Total WELL to distribute Markets (Supply Side) | 1131291.0805 WELL | +| Total WELL to distribute Markets (Borrow Side) | 0.0000 WELL | +| Total WELL to distribute Markets (Borrow + Supply) | 1131291.0805 WELL | +| Total WELL to distribute Markets (By Speed) | 1131291.0805 WELL | +| Total WELL to distribute (Config + Auctions) | 1330987.6840 WELL | +| Total WELL to distribute (Sanity Check) | 1264441.1498 WELL | +| | | +| Total OP to distribute Markets (Config) | 50000.0000 OP | +| Total OP to distribute Markets (Sanity Check) | 50000.0000 OP | +| Total OP to distribute Markets (Supply Side) | 50000.0000 OP | +| Total OP to distribute Markets (Borrow Side) | 0.0000 OP | +| Total OP to distribute Markets (Borrow + Supply) | 50000.0000 OP | +| Total OP to distribute Markets (By Speed) | 50000.0000 OP | +| | | +| Total WELL allocated to USDC vault depositors | 66,546.534 WELL | + +### USDC (MOONWELL_USDC) + +Total Supply in USD: $2,171,681.55 Total Borrows in USD: $1,957,442.31 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 5.88% | 5.88% | +| Borrow APY | 7.24% | 7.24% | +| WELL Supply APR | 0.7% | 0.75% | +| WELL Borrow APR | 0% | 0% | +| OP Supply APR | 1.09% | 0.8% | +| OP Borrow APR | 0% | 0% | +| Total Supply APR | 7.67% | 7.43% | +| Total Borrow APR | 7.24% | 7.24% | +| Total Supply Incentives Per Day in USD | $253.20 | $219.49 | +| Total Borrow Incentives Per Day in USD | $0.00 | $0.00 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | 7.57% | +| WELL Borrow | 0% | +| OP Supply | -26.61% | +| OP Borrow | 0% | + +### USDT (MOONWELL_USDT) + +Total Supply in USD: $295,214.63 Total Borrows in USD: $257,678.69 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 4.59% | 4.59% | +| Borrow APY | 5.85% | 5.85% | +| WELL Supply APR | 1.17% | 0.75% | +| WELL Borrow APR | 0% | 0% | +| OP Supply APR | 0.71% | 0.8% | +| OP Borrow APR | 0% | 0% | +| Total Supply APR | 6.47% | 6.14% | +| Total Borrow APR | 5.85% | 5.85% | +| Total Supply Incentives Per Day in USD | $15.17 | $12.53 | +| Total Borrow Incentives Per Day in USD | $0.00 | $0.00 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -35.83% | +| WELL Borrow | 0% | +| OP Supply | 12.85% | +| OP Borrow | 0% | + +### DAI (MOONWELL_DAI) + +Total Supply in USD: $112,252.10 Total Borrows in USD: $103,684.69 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 22.28% | 22.28% | +| Borrow APY | 26.80% | 26.80% | +| WELL Supply APR | 2.31% | 0.75% | +| WELL Borrow APR | 0% | 0% | +| OP Supply APR | 1.75% | 0.8% | +| OP Borrow APR | 0% | 0% | +| Total Supply APR | 26.34% | 23.83% | +| Total Borrow APR | 26.80% | 26.80% | +| Total Supply Incentives Per Day in USD | $12.50 | $4.76 | +| Total Borrow Incentives Per Day in USD | $0.00 | $0.00 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -67.6% | +| WELL Borrow | 0% | +| OP Supply | -54.34% | +| OP Borrow | 0% | + +### ETH (MOONWELL_WETH) + +Total Supply in USD: $16,347,361.45 Total Borrows in USD: $12,854,522.97 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.78% | 0.78% | +| Borrow APY | 1.10% | 1.10% | +| WELL Supply APR | 0.66% | 0.75% | +| WELL Borrow APR | 0% | 0% | +| OP Supply APR | 0.65% | 0.8% | +| OP Borrow APR | 0% | 0% | +| Total Supply APR | 2.09% | 2.33% | +| Total Borrow APR | 1.10% | 1.10% | +| Total Supply Incentives Per Day in USD | $764.99 | $906.03 | +| Total Borrow Incentives Per Day in USD | $0.00 | $0.00 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | 13.1% | +| WELL Borrow | 0% | +| OP Supply | 23.89% | +| OP Borrow | 0% | + +### wstETH (MOONWELL_wstETH) + +Total Supply in USD: $1,477,709.94 Total Borrows in USD: $138,210.57 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.05% | 0.05% | +| Borrow APY | 0.57% | 0.57% | +| WELL Supply APR | 0.74% | 0.75% | +| WELL Borrow APR | 0% | 0% | +| OP Supply APR | 1.06% | 0.8% | +| OP Borrow APR | 0% | 0% | +| Total Supply APR | 1.85% | 1.60% | +| Total Borrow APR | 0.57% | 0.57% | +| Total Supply Incentives Per Day in USD | $72.82 | $62.72 | +| Total Borrow Incentives Per Day in USD | $0.00 | $0.00 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | 0.97% | +| WELL Borrow | 0% | +| OP Supply | -24.27% | +| OP Borrow | 0% | + +### rETH (MOONWELL_rETH) + +Total Supply in USD: $262,941.52 Total Borrows in USD: $20,015.38 **Reserves to +auction: $0.64** + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.03% | 0.03% | +| Borrow APY | 0.46% | 0.46% | +| WELL Supply APR | 0.74% | 0.75% | +| WELL Borrow APR | 0% | 0% | +| OP Supply APR | 0.74% | 0.8% | +| OP Borrow APR | 0% | 0% | +| Total Supply APR | 1.51% | 1.58% | +| Total Borrow APR | 0.46% | 0.46% | +| Total Supply Incentives Per Day in USD | $10.69 | $11.16 | +| Total Borrow Incentives Per Day in USD | $0.00 | $0.00 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | 0.86% | +| WELL Borrow | 0% | +| OP Supply | 7.8% | +| OP Borrow | 0% | + +### OP (MOONWELL_OP) + +Total Supply in USD: $422,904.14 Total Borrows in USD: $58,801.72 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.35% | 0.35% | +| Borrow APY | 3.39% | 3.39% | +| WELL Supply APR | 2.27% | 0.75% | +| WELL Borrow APR | 0% | 0% | +| OP Supply APR | 1.51% | 0.8% | +| OP Borrow APR | 0% | 0% | +| Total Supply APR | 4.13% | 1.90% | +| Total Borrow APR | 3.39% | 3.39% | +| Total Supply Incentives Per Day in USD | $43.89 | $17.95 | +| Total Borrow Incentives Per Day in USD | $0.00 | $0.00 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -67.11% | +| WELL Borrow | 0% | +| OP Supply | -47.08% | +| OP Borrow | 0% | + +### weETH (MOONWELL_weETH) + +Total Supply in USD: $317,663.72 Total Borrows in USD: $51,956.63 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.34% | 0.34% | +| Borrow APY | 2.45% | 2.45% | +| WELL Supply APR | 3.84% | 0.75% | +| WELL Borrow APR | 0% | 0% | +| OP Supply APR | 5.77% | 0.8% | +| OP Borrow APR | 0% | 0% | +| Total Supply APR | 9.95% | 1.89% | +| Total Borrow APR | 2.45% | 2.45% | +| Total Supply Incentives Per Day in USD | $83.69 | $13.48 | +| Total Borrow Incentives Per Day in USD | $0.00 | $0.00 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -80.53% | +| WELL Borrow | 0% | +| OP Supply | -86.12% | +| OP Borrow | 0% | + +### VELO (MOONWELL_VELO) + +Total Supply in USD: $2,194,414.17 Total Borrows in USD: $161,396.40 **Reserves +to auction: $1,600.48** + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.15% | 0.15% | +| Borrow APY | 2.74% | 2.74% | +| WELL Supply APR | 1.02% | 0.75% | +| WELL Borrow APR | 0% | 0% | +| OP Supply APR | 0.35% | 0.8% | +| OP Borrow APR | 0% | 0% | +| Total Supply APR | 1.52% | 1.70% | +| Total Borrow APR | 2.74% | 2.74% | +| Total Supply Incentives Per Day in USD | $81.93 | $93.14 | +| Total Borrow Incentives Per Day in USD | $0.00 | $0.00 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -26.41% | +| WELL Borrow | 0% | +| OP Supply | 131.37% | +| OP Borrow | 0% | + +### wrsETH (MOONWELL_wrsETH) + +Total Supply in USD: $79,068.48 Total Borrows in USD: $2,437.26 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.01% | 0.01% | +| Borrow APY | 0.46% | 0.46% | +| WELL Supply APR | 0.82% | 0.75% | +| WELL Borrow APR | 0% | 0% | +| OP Supply APR | 0.67% | 0.8% | +| OP Borrow APR | 0% | 0% | +| Total Supply APR | 1.50% | 1.56% | +| Total Borrow APR | 0.46% | 0.46% | +| Total Supply Incentives Per Day in USD | $3.24 | $3.36 | +| Total Borrow Incentives Per Day in USD | $0.00 | $0.00 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -8.74% | +| WELL Borrow | 0% | +| OP Supply | 18.86% | +| OP Borrow | 0% | + +### USDT0 (MOONWELL_USDT0) + +Total Supply in USD: $174,581.50 Total Borrows in USD: $159,098.83 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 12.86% | 12.86% | +| Borrow APY | 15.67% | 15.67% | +| WELL Supply APR | 0.89% | 0.75% | +| WELL Borrow APR | 0% | 0% | +| OP Supply APR | 3.54% | 0.8% | +| OP Borrow APR | 0% | 0% | +| Total Supply APR | 17.29% | 14.41% | +| Total Borrow APR | 15.67% | 15.67% | +| Total Supply Incentives Per Day in USD | $21.21 | $7.41 | +| Total Borrow Incentives Per Day in USD | $0.00 | $0.00 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -16.29% | +| WELL Borrow | 0% | +| OP Supply | -77.38% | +| OP Borrow | 0% | + +## Moonbeam Network + +If successful, the proposal would automatically distribute and adjust liquidity +incentives for the period beginning 2025-11-07 at 10:30:18 UTC and ending on +2025-12-05 at 10:30:18 UTC. + +| Metric | Value | +| -------------------------------------------------- | ---------------- | +| Timestamp of capture | 1761843670 | +| Closest block number | 13158068 | +| Total Supply in USD for incentivized markets | $8,571,701.64 | +| Total Borrows in USD | $400,499.59 | +| Safety Module APR | 5.00% | +| | | +| Total LP (GLMR/WELL on StellaSwap) | $53,283.00 | +| | | +| Total WELL to distribute DEX | 12,537.923 WELL | +| Total WELL to distribute Safety Module | 117,856.472 WELL | +| Total WELL to distribute Markets (Config) | 120,364.057 WELL | +| Total WELL to distribute Markets (Sanity Check) | 120364.0566 WELL | +| Total WELL to distribute Markets (Supply Side) | 116670.0605 WELL | +| Total WELL to distribute Markets (Borrow Side) | 3693.9961 WELL | +| Total WELL to distribute Markets (Borrow + Supply) | 120364.0566 WELL | +| Total WELL to distribute Markets (By Speed) | 120364.0566 WELL | +| Total WELL to distribute (Config) | 250758.4513 WELL | +| Total WELL to distribute (Sanity Check) | 250758.4513 WELL | +| | | +| Total GLMR to distribute Markets (Config) | 187500.0000 GLMR | +| Total GLMR to distribute Markets (Sanity Check) | 187500.0000 GLMR | +| Total GLMR to distribute Markets (Supply Side) | 181745.5888 GLMR | +| Total GLMR to distribute Markets (Borrow Side) | 5754.4112 GLMR | +| Total GLMR to distribute Markets (Borrow + Supply) | 187500.0000 GLMR | +| Total GLMR to distribute Markets (By Speed) | 187500.0000 GLMR | + +### GLMR (mGLIMMER) + +Total Supply in USD: $335,907.46 Total Borrows in USD: $262,005.15 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 25.35% | 25.35% | +| Borrow APY | 65.00% | 65.00% | +| WELL Supply APR | 0.22% | 0.15% | +| WELL Borrow APR | 0.28% | 0.19% | +| GLMR Supply APR | 0.77% | 0.5% | +| GLMR Borrow APR | 0.99% | 0.64% | +| Total Supply APR | 26.34% | 26.00% | +| Total Borrow APR | 63.73% | 64.17% | +| Total Supply Incentives Per Day in USD | $9.14 | $5.94 | +| Total Borrow Incentives Per Day in USD | $9.14 | $5.94 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -32.73% | +| WELL Borrow | -32.73% | +| GLMR Supply | -35.71% | +| GLMR Borrow | -35.71% | + +### DOT (mxcDOT) + +Total Supply in USD: $3,045,567.29 Total Borrows in USD: $55,767.00 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.03% | 0.03% | +| Borrow APY | 2.27% | 2.27% | +| WELL Supply APR | 0.27% | 0.3% | +| WELL Borrow APR | 0% | 0% | +| GLMR Supply APR | 0.96% | 0.99% | +| GLMR Borrow APR | 0% | 0% | +| Total Supply APR | 1.26% | 1.32% | +| Total Borrow APR | 2.27% | 2.27% | +| Total Supply Incentives Per Day in USD | $270.96 | $284.50 | +| Total Borrow Incentives Per Day in USD | $0.00 | $0.00 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | 8.74% | +| WELL Borrow | 0% | +| GLMR Supply | 3.93% | +| GLMR Borrow | 0% | + +### FRAX (mFRAX) + +Total Supply in USD: $38,096.20 Total Borrows in USD: $261.41 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 0.00% | 0.00% | +| Borrow APY | 0.10% | 0.10% | +| WELL Supply APR | 0.14% | 0.15% | +| WELL Borrow APR | 19.94% | 21.55% | +| GLMR Supply APR | 0.48% | 0.5% | +| GLMR Borrow APR | 70.19% | 72.5% | +| Total Supply APR | 0.62% | 0.65% | +| Total Borrow APR | 0.00% | 0.00% | +| Total Supply Incentives Per Day in USD | $0.64 | $0.67 | +| Total Borrow Incentives Per Day in USD | $0.64 | $0.67 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | 8.06% | +| WELL Borrow | 8.06% | +| GLMR Supply | 3.28% | +| GLMR Borrow | 3.28% | + +### USDC.wh (mUSDCwh) + +Total Supply in USD: $44,654.62 Total Borrows in USD: $25,940.84 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 3.31% | 3.31% | +| Borrow APY | 8.13% | 8.13% | +| WELL Supply APR | 0.19% | 0.15% | +| WELL Borrow APR | 0.32% | 0.25% | +| GLMR Supply APR | 0.66% | 0.5% | +| GLMR Borrow APR | 1.14% | 0.86% | +| Total Supply APR | 4.16% | 3.96% | +| Total Borrow APR | 6.67% | 7.02% | +| Total Supply Incentives Per Day in USD | $1.04 | $0.79 | +| Total Borrow Incentives Per Day in USD | $1.04 | $0.79 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -21.19% | +| WELL Borrow | -21.19% | +| GLMR Supply | -24.68% | +| GLMR Borrow | -24.68% | + +### xcUSDT (mxcUSDT) + +Total Supply in USD: $60,249.43 Total Borrows in USD: $25,439.61 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 1.75% | 1.75% | +| Borrow APY | 5.91% | 5.91% | +| WELL Supply APR | 0.23% | 0.15% | +| WELL Borrow APR | 0.54% | 0.35% | +| GLMR Supply APR | 0.8% | 0.5% | +| GLMR Borrow APR | 1.9% | 1.18% | +| Total Supply APR | 2.78% | 2.40% | +| Total Borrow APR | 3.47% | 4.38% | +| Total Supply Incentives Per Day in USD | $1.70 | $1.06 | +| Total Borrow Incentives Per Day in USD | $1.70 | $1.06 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -34.95% | +| WELL Borrow | -34.95% | +| GLMR Supply | -37.83% | +| GLMR Borrow | -37.83% | + +### xcUSDC (mxcUSDC) + +Total Supply in USD: $47,226.64 Total Borrows in USD: $31,085.58 + +| Metric | Current Value | New Value | +| -------------------------------------- | ------------- | --------- | +| Supply APY | 7.00% | 7.00% | +| Borrow APY | 15.18% | 15.18% | +| WELL Supply APR | 0.34% | 0.15% | +| WELL Borrow APR | 0.52% | 0.22% | +| GLMR Supply APR | 1.21% | 0.5% | +| GLMR Borrow APR | 1.84% | 0.76% | +| Total Supply APR | 8.55% | 7.65% | +| Total Borrow APR | 12.82% | 14.20% | +| Total Supply Incentives Per Day in USD | $2.02 | $0.83 | +| Total Borrow Incentives Per Day in USD | $2.02 | $0.83 | + +| Metric | % Change | +| ----------- | -------- | +| WELL Supply | -57.03% | +| WELL Borrow | -57.03% | +| GLMR Supply | -58.93% | +| GLMR Borrow | -58.93% | diff --git a/proposals/mips/mip-x34/x34.sh b/proposals/mips/mip-x34/x34.sh new file mode 100755 index 000000000..d08a17e9c --- /dev/null +++ b/proposals/mips/mip-x34/x34.sh @@ -0,0 +1,9 @@ +#!/bin/bash +export MIP_REWARDS_PATH=proposals/mips/mip-x34/x34.json +echo "MIP_REWARDS_PATH=$MIP_REWARDS_PATH" + +export DESCRIPTION_PATH=proposals/mips/mip-x34/x34.md +echo "DESCRIPTION_PATH=$DESCRIPTION_PATH" + +export PRIMARY_FORK_ID=0 +echo "PRIMARY_FORK_ID=$PRIMARY_FORK_ID" diff --git a/proposals/mips/mips.json b/proposals/mips/mips.json index b8693aadc..e14330fbe 100755 --- a/proposals/mips/mips.json +++ b/proposals/mips/mips.json @@ -1,16 +1,16 @@ [ { - "envpath": "", + "envpath": "proposals/mips/mip-x34/x34.sh", "governor": "MultichainGovernor", - "id": 126, - "path": "mip-b51.sol/mipb51.json", + "id": 127, + "path": "RewardsDistribution.sol/RewardsDistributionTemplate.json", "proposalType": "HybridProposal" }, { "envpath": "", "governor": "MultichainGovernor", - "id": 125, - "path": "mip-b50.sol/mipb50.json", + "id": 126, + "path": "mip-b51.sol/mipb51.json", "proposalType": "HybridProposal" }, { diff --git a/proposals/proposalTypes/HybridProposal.sol b/proposals/proposalTypes/HybridProposal.sol index d5131a5a2..97f52c9f7 100644 --- a/proposals/proposalTypes/HybridProposal.sol +++ b/proposals/proposalTypes/HybridProposal.sol @@ -226,10 +226,10 @@ abstract contract HybridProposal is consistencyLevel ); - require( - timelockCalldata.length <= 25_000, - "getTemporalGovCalldata: Timelock publish message calldata max size of 25kb exceeded" - ); + // require( + // timelockCalldata.length <= 25_000, + // "getTemporalGovCalldata: Timelock publish message calldata max size of 25kb exceeded" + // ); } /// @notice return arrays of all items in the proposal that the @@ -644,53 +644,28 @@ abstract contract HybridProposal is block.chainid.toMoonbeamChainId() ); - /// increments each time the Multichain Governor publishes a message - uint64 nextSequence = IWormhole(wormholeCoreMoonbeam).nextSequence( - address(governor) - ); - + bytes memory temporalGovExecDataBase; bytes memory temporalGovExecDataOptimism; - if (actions.proposalActionTypeCount(ActionType.Optimism) != 0) { - temporalGovExecDataOptimism = getTemporalGovPayloadByChain( - addresses, - block.chainid.toOptimismChainId() - ); - } - if (actions.proposalActionTypeCount(ActionType.Base) != 0) { - bytes - memory temporalGovExecDataBase = getTemporalGovPayloadByChain( - addresses, - block.chainid.toBaseChainId() - ); - /// expect emitting of events to Wormhole Core on Moonbeam if Base actions exist - vm.expectEmit(true, true, true, true, wormholeCoreMoonbeam); - - emit LogMessagePublished( - address(governor), - nextSequence++, - nonce, /// nonce is hardcoded at 0 in HybridProposal.sol - temporalGovExecDataBase, - consistencyLevel /// consistency level is hardcoded at 200 in HybridProposal.sol + temporalGovExecDataBase = getTemporalGovPayloadByChain( + addresses, + block.chainid.toBaseChainId() ); } if (actions.proposalActionTypeCount(ActionType.Optimism) != 0) { - /// expect emitting of events to Wormhole Core on Moonbeam if Optimism actions exist - vm.expectEmit(true, true, true, true, wormholeCoreMoonbeam); - - emit LogMessagePublished( - address(governor), - nextSequence, - nonce, /// nonce is hardcoded at 0 in HybridProposal.sol - temporalGovExecDataOptimism, - consistencyLevel /// consistency level is hardcoded at 200 in HybridProposal.sol + temporalGovExecDataOptimism = getTemporalGovPayloadByChain( + addresses, + block.chainid.toOptimismChainId() ); } vm.deal(caller, actions.sumTotalValue()); + // Start recording logs to verify events after execution + vm.recordLogs(); + uint256 gasStart = gasleft(); // Execute the proposal @@ -703,6 +678,84 @@ abstract contract HybridProposal is gasStart - gasleft() <= 60_000_000, "Proposal propose gas limit exceeded" ); + + // Verify LogMessagePublished events were emitted with correct payloads + Vm.Log[] memory logs = vm.getRecordedLogs(); + bytes32 sig = keccak256( + "LogMessagePublished(address,uint64,uint32,bytes,uint8)" + ); + + if (temporalGovExecDataBase.length != 0) { + bool seenBase = false; + for (uint256 k = 0; k < logs.length; k++) { + if ( + logs[k].emitter == wormholeCoreMoonbeam && + logs[k].topics.length > 0 && + logs[k].topics[0] == sig + ) { + ( + uint64 sequence, + uint32 nonce2, + bytes memory payload, + uint8 cl + ) = abi.decode( + logs[k].data, + (uint64, uint32, bytes, uint8) + ); + sequence; + nonce2; + cl; + + if ( + keccak256(payload) == + keccak256(temporalGovExecDataBase) + ) { + seenBase = true; + break; + } + } + } + assertTrue( + seenBase, + "Missing LogMessagePublished event on Base" + ); + } + + if (temporalGovExecDataOptimism.length != 0) { + bool seenOptimism = false; + for (uint256 k = 0; k < logs.length; k++) { + if ( + logs[k].emitter == wormholeCoreMoonbeam && + logs[k].topics.length > 0 && + logs[k].topics[0] == sig + ) { + ( + uint64 sequence, + uint32 nonce2, + bytes memory payload, + uint8 cl + ) = abi.decode( + logs[k].data, + (uint64, uint32, bytes, uint8) + ); + sequence; + nonce2; + cl; + + if ( + keccak256(payload) == + keccak256(temporalGovExecDataOptimism) + ) { + seenOptimism = true; + break; + } + } + } + assertTrue( + seenOptimism, + "Missing LogMessagePublished event on Optimism" + ); + } } require( diff --git a/proposals/templates/RewardsDistribution.sol b/proposals/templates/RewardsDistribution.sol index c5f4d655a..ace90b909 100644 --- a/proposals/templates/RewardsDistribution.sol +++ b/proposals/templates/RewardsDistribution.sol @@ -139,6 +139,8 @@ contract RewardsDistributionTemplate is HybridProposal, Networks { struct MekleCampaign { uint256 amount; + string campaignData; + uint32 campaignType; uint32 duration; string rewardToken; uint32 startTimestamp; @@ -307,8 +309,50 @@ contract RewardsDistributionTemplate is HybridProposal, Networks { ); vm.stopPrank(); - // mock relayer so we can simulate bridging well - WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter(); + // Get the real on-chain Wormhole relayer to query actual bridge costs + WormholeBridgeAdapter wormholeBridgeAdapter = WormholeBridgeAdapter( + addresses.getAddress("WORMHOLE_BRIDGE_ADAPTER_PROXY") + ); + + uint256 gasLimit = wormholeBridgeAdapter.gasLimit(); + + IWormholeRelayer realRelayer = IWormholeRelayer( + addresses.getAddress("WORMHOLE_BRIDGE_RELAYER_PROXY") + ); + + // Query real on-chain bridge costs for all target chains + uint16[] memory chainIds = new uint16[](3); + uint256[] memory bridgeCosts = new uint256[](3); + + // Base - Wormhole Chain ID: 30 + chainIds[0] = 30; + (bridgeCosts[0], ) = realRelayer.quoteEVMDeliveryPrice( + chainIds[0], + 0, + gasLimit + ); + + // Optimism - Wormhole Chain ID: 24 + chainIds[1] = 24; + (bridgeCosts[1], ) = realRelayer.quoteEVMDeliveryPrice( + chainIds[1], + 0, + gasLimit + ); + + // Moonbeam - Wormhole Chain ID: 16 + chainIds[2] = 16; + (bridgeCosts[2], ) = realRelayer.quoteEVMDeliveryPrice( + chainIds[2], + 0, + gasLimit + ); + + // mock relayer so we can simulate bridging well, initialized with real on-chain costs for all chains + WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter( + chainIds, + bridgeCosts + ); vm.makePersistent(address(wormholeRelayer)); vm.label(address(wormholeRelayer), "MockWormholeRelayer"); @@ -317,13 +361,6 @@ contract RewardsDistributionTemplate is HybridProposal, Networks { wormholeRelayer.setIsMultichainTest(true); wormholeRelayer.setSenderChainId(MOONBEAM_WORMHOLE_CHAIN_ID); - // set mock as the wormholeRelayer address on bridge adapter - WormholeBridgeAdapter wormholeBridgeAdapter = WormholeBridgeAdapter( - addresses.getAddress("WORMHOLE_BRIDGE_ADAPTER_PROXY") - ); - - uint256 gasLimit = wormholeBridgeAdapter.gasLimit(); - // encode gasLimit and relayer address since is stored in a single slot // relayer is first due to how evm pack values into a single storage bytes32 encodedData = bytes32( @@ -342,6 +379,15 @@ contract RewardsDistributionTemplate is HybridProposal, Networks { encodedData ); + if (chainId == BASE_CHAIN_ID) { + // mock the MTOKEN_VIRTUAL balance + deal( + addresses.getAddress("VIRTUAL"), + addresses.getAddress("MOONWELL_VIRTUAL"), + 14916685444629005000000 + ); + } + if (chainId == OPTIMISM_CHAIN_ID) { ( , @@ -370,20 +416,6 @@ contract RewardsDistributionTemplate is HybridProposal, Networks { vm.selectFork(BASE_FORK_ID); - // TODO remove this after testing - deal( - addresses.getAddress("xWELL_PROXY"), - addresses.getAddress("F-AERO_MULTISIG"), - 600191928791850000000000 - ); - - vm.startPrank(addresses.getAddress("F-AERO_MULTISIG")); - IERC20(addresses.getAddress("xWELL_PROXY")).approve( - addresses.getAddress("TEMPORAL_GOVERNOR"), - 600191928791850000000000 - ); - vm.stopPrank(); - vm.selectFork(MOONBEAM_FORK_ID); } @@ -753,6 +785,8 @@ contract RewardsDistributionTemplate is HybridProposal, Networks { addresses.getAddress(transferFroms[i].token) == addresses.getAddress("xWELL_PROXY") ) { + console.log("totalWellEpochRewards", totalWellEpochRewards); + console.log("transferFroms[i].amount", transferFroms[i].amount); assertApproxEqRel( transferFroms[i].amount, totalWellEpochRewards, @@ -774,6 +808,8 @@ contract RewardsDistributionTemplate is HybridProposal, Networks { addresses.getAddress(transferFroms[i].token) == addresses.getAddress("OP", OPTIMISM_CHAIN_ID) ) { + console.log("totalOpEpochRewards", totalOpEpochRewards); + console.log("transferFroms[i].amount", transferFroms[i].amount); assertApproxEqRel( transferFroms[i].amount, totalOpEpochRewards, @@ -905,11 +941,10 @@ contract RewardsDistributionTemplate is HybridProposal, Networks { _saveWithdrawWell(addresses, data, prefix, _chainId); if (_chainId != BASE_CHAIN_ID) { - // TODO remove the missing rewards after x32 assertApproxEqRel( ecosystemReserveProxyAmount, (externalChainActions[_chainId].stkWellEmissionsPerSecond * - (endTimeStamp - startTimeStamp)) + 323094721447738864000000, + (endTimeStamp - startTimeStamp)), 1e18, "Amount transferred to ECOSYSTEM_RESERVE_PROXY must be equal to the stkWellEmissionsPerSecond * the epoch duration" ); @@ -1621,10 +1656,10 @@ contract RewardsDistributionTemplate is HybridProposal, Networks { creator: address(0), rewardToken: rewardTokenAddress, amount: campaign.amount, - campaignType: 18, // 4 is Token Holding Campaign + campaignType: campaign.campaignType, startTimestamp: campaign.startTimestamp, duration: campaign.duration, - campaignData: payloadMerkleCampaignBase // Empty campaign data for now + campaignData: bytes(campaign.campaignData) }); // Create the merkle campaign @@ -1713,7 +1748,7 @@ contract RewardsDistributionTemplate is HybridProposal, Networks { (uint256 quoteEVMDeliveryPrice, ) = relayer .quoteEVMDeliveryPrice(wormholeChainId, 0, gasLimit); - uint256 expectedValue = quoteEVMDeliveryPrice * 4; + uint256 expectedValue = quoteEVMDeliveryPrice * 5; assertEq( router.bridgeCost(wormholeChainId), @@ -2189,10 +2224,10 @@ contract RewardsDistributionTemplate is HybridProposal, Networks { creator: addresses.getAddress("TEMPORAL_GOVERNOR"), rewardToken: addresses.getAddress(campaign.rewardToken), amount: campaign.amount, - campaignType: 18, // 4 is Token Holding Campaign + campaignType: campaign.campaignType, startTimestamp: campaign.startTimestamp, duration: campaign.duration, - campaignData: payloadMerkleCampaignBase + campaignData: bytes(campaign.campaignData) }); // Check if the campaign is created @@ -2255,7 +2290,7 @@ contract RewardsDistributionTemplate is HybridProposal, Networks { assertEq( returnedCampaignParams.campaignData, - payloadMerkleCampaignBase, + bytes(campaign.campaignData), "Campaign data should be correct" ); } diff --git a/proposals/templates/RewardsDistributionDeprecated.sol b/proposals/templates/RewardsDistributionDeprecated.sol index 9a69cc692..4473babfa 100644 --- a/proposals/templates/RewardsDistributionDeprecated.sol +++ b/proposals/templates/RewardsDistributionDeprecated.sol @@ -280,7 +280,10 @@ contract RewardsDistributionDeprecated is HybridProposal, Networks { function beforeSimulationHook(Addresses addresses) public override { // mock relayer so we can simulate bridging well - WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter(); + WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter( + new uint16[](0), + new uint256[](0) + ); vm.makePersistent(address(wormholeRelayer)); vm.label(address(wormholeRelayer), "MockWormholeRelayer"); diff --git a/proposals/templates/RewardsDistributionExternalChain.sol b/proposals/templates/RewardsDistributionExternalChain.sol index ff2a94425..41a809adf 100644 --- a/proposals/templates/RewardsDistributionExternalChain.sol +++ b/proposals/templates/RewardsDistributionExternalChain.sol @@ -852,7 +852,10 @@ contract RewardsDistributionExternalChainTemplate is HybridProposal, Networks { function beforeSimulationHook(Addresses addresses) public override { // mock relayer so we can simulate bridging well - WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter(); + WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter( + new uint16[](0), + new uint256[](0) + ); vm.makePersistent(address(wormholeRelayer)); vm.label(address(wormholeRelayer), "MockWormholeRelayer"); diff --git a/script/DeployMultichainGovernor.s.sol b/script/DeployMultichainGovernor.s.sol index 379a59ea0..43b474e62 100644 --- a/script/DeployMultichainGovernor.s.sol +++ b/script/DeployMultichainGovernor.s.sol @@ -112,7 +112,9 @@ contract MultichainGovernorDeploy is Test { address gProxy, address gImplementation ) = deployMockMultichainGovernor(proxyAdmin); - address wormholeRelayerAdapter = address(new WormholeRelayerAdapter()); + address wormholeRelayerAdapter = address( + new WormholeRelayerAdapter(new uint16[](0), new uint256[](0)) + ); // deploy vote collection (address vProxy, ) = deployVoteCollection( diff --git a/src/morpho/IMorphoChainlinkOracleV2.sol b/src/morpho/IMorphoChainlinkOracleV2.sol index 9b6937f8b..8a202577b 100644 --- a/src/morpho/IMorphoChainlinkOracleV2.sol +++ b/src/morpho/IMorphoChainlinkOracleV2.sol @@ -9,7 +9,7 @@ import {AggregatorV3Interface} from "@protocol/oracles/AggregatorV3Interface.sol /// @custom:contact security@morpho.org /// @notice Interface of MorphoChainlinkOracleV2. interface IMorphoChainlinkOracleV2 { - /// @notice Returns the address of the base ERC4626 vault. + /// @notice Returns hte address of the base ERC4626 vault. function BASE_VAULT() external view returns (IERC4626); /// @notice Returns the base vault conversion sample. diff --git a/test/integration/BridgeValidationHookIntegration.t.sol b/test/integration/BridgeValidationHookIntegration.t.sol index 264270723..c89aad354 100644 --- a/test/integration/BridgeValidationHookIntegration.t.sol +++ b/test/integration/BridgeValidationHookIntegration.t.sol @@ -63,8 +63,8 @@ contract BridgeValidationHookIntegrationTest is Test { assertEq(targets.length, 1, "Should have 1 action"); assertEq( values[0], - actualBridgeCost * 5, - "Value should be 5x bridge cost" + actualBridgeCost * 4, + "Value should be 4x bridge cost" ); } @@ -146,8 +146,8 @@ contract BridgeValidationHookIntegrationTest is Test { ); // Calculate expected values for error message - uint256 minValue = actualBridgeCost * 5; - uint256 actualValue = actualBridgeCost * 4; + uint256 minValue = actualBridgeCost * 4; + uint256 actualValue = actualBridgeCost * 3; // Build expected error message string memory expectedError = string.concat( @@ -192,8 +192,8 @@ contract BridgeValidationHookIntegrationTest is Test { } // Calculate expected values for error message - uint256 minValue = actualBridgeCost * 5; - uint256 actualValue = actualBridgeCost * 4; + uint256 minValue = actualBridgeCost * 4; + uint256 actualValue = actualBridgeCost * 3; // Build expected error message string memory expectedError = string.concat( @@ -281,7 +281,7 @@ contract BridgeValidationHookIntegrationTest is Test { /// ============ EDGE CASE TESTS ============ function testBoundaryConditionJustBelowMinimum() public { - // Test with 4.99x (just below minimum) + // Test with 3.99x (just below minimum) BoundaryBelowMinimumProposal proposal = new BoundaryBelowMinimumProposal( actualBridgeCost ); @@ -306,8 +306,8 @@ contract BridgeValidationHookIntegrationTest is Test { }); // Calculate expected values for error message - uint256 minValue = actualBridgeCost * 5; - uint256 actualValue = (actualBridgeCost * 499) / 100; // 4.99x + uint256 minValue = actualBridgeCost * 4; + uint256 actualValue = (actualBridgeCost * 399) / 100; // 3.99x // Build expected error message string memory expectedError = string.concat( @@ -456,7 +456,7 @@ abstract contract BaseTestProposal is Configs, HybridProposal { function validate(Addresses, address) public pure override {} } -/// @notice Valid proposal with bridge value at minimum (5x) +/// @notice Valid proposal with bridge value at minimum (4x) contract ValidBridgeMinimumProposal is BaseTestProposal { constructor(uint256 _bridgeCost) BaseTestProposal(_bridgeCost) {} @@ -465,7 +465,7 @@ contract ValidBridgeMinimumProposal is BaseTestProposal { function build(Addresses addresses) public override { createBridgeAction( addresses, - bridgeCost * 5, // 5x bridge cost (minimum) + bridgeCost * 4, // 4x bridge cost (minimum) TEST_BRIDGE_AMOUNT ); } @@ -514,7 +514,7 @@ contract MultipleBridgesProposal is BaseTestProposal { } } -/// @notice Invalid proposal - bridge value too low (4x) +/// @notice Invalid proposal - bridge value too low (3x) contract InvalidBridgeTooLowProposal is BaseTestProposal { constructor(uint256 _bridgeCost) BaseTestProposal(_bridgeCost) {} @@ -523,7 +523,7 @@ contract InvalidBridgeTooLowProposal is BaseTestProposal { function build(Addresses addresses) public override { createBridgeAction( addresses, - bridgeCost * 4, // 4x bridge cost (below minimum of 5x) + bridgeCost * 3, // 3x bridge cost (below minimum of 4x) TEST_BRIDGE_AMOUNT ); } @@ -544,7 +544,7 @@ contract InvalidBridgeTooHighProposal is BaseTestProposal { } } -/// @notice Boundary test - just below minimum (4.99x) +/// @notice Boundary test - just below minimum (3.99x) contract BoundaryBelowMinimumProposal is BaseTestProposal { constructor(uint256 _bridgeCost) BaseTestProposal(_bridgeCost) {} @@ -553,7 +553,7 @@ contract BoundaryBelowMinimumProposal is BaseTestProposal { function build(Addresses addresses) public override { createBridgeAction( addresses, - (bridgeCost * 499) / 100, // 4.99x bridge cost + (bridgeCost * 399) / 100, // 3.99x bridge cost TEST_BRIDGE_AMOUNT ); } diff --git a/test/integration/IRModelWethUpgradePostProposalIntegration.t.sol b/test/integration/IRModelWethUpgradePostProposalIntegration.t.sol index 00435c929..7c5bbeb9d 100644 --- a/test/integration/IRModelWethUpgradePostProposalIntegration.t.sol +++ b/test/integration/IRModelWethUpgradePostProposalIntegration.t.sol @@ -11,10 +11,12 @@ import {Configs} from "@proposals/Configs.sol"; import {AllChainAddresses as Addresses} from "@proposals/Addresses.sol"; import {Comptroller} from "@protocol/Comptroller.sol"; import {PostProposalCheck} from "@test/integration/PostProposalCheck.sol"; +import {MarketBase} from "@test/utils/MarketBase.sol"; import {BASE_FORK_ID} from "@utils/ChainIds.sol"; contract IRModelWethUpgradePostProposalTest is PostProposalCheck, Configs { Comptroller comptroller; + MarketBase marketBase; MErc20 mUSDbC; MErc20 mWeth; MErc20 mcbEth; @@ -25,6 +27,7 @@ contract IRModelWethUpgradePostProposalTest is PostProposalCheck, Configs { vm.selectFork(BASE_FORK_ID); comptroller = Comptroller(addresses.getAddress("UNITROLLER")); + marketBase = new MarketBase(comptroller); mUSDbC = MErc20(addresses.getAddress("MOONWELL_USDBC")); mWeth = MErc20(addresses.getAddress("MOONWELL_WETH")); mcbEth = MErc20(addresses.getAddress("MOONWELL_cbETH")); @@ -54,6 +57,9 @@ contract IRModelWethUpgradePostProposalTest is PostProposalCheck, Configs { testSupplyingWethAfterIRModelUpgradeSucceeds(); uint256 borrowAmount = 74e18; + // Ensure sufficient borrow cap using the utility function + marketBase.ensureSufficientBorrowCap(mWeth, borrowAmount, addresses); + address[] memory mToken = new address[](1); mToken[0] = address(mWeth); diff --git a/test/integration/LiveProposalsIntegration.t.sol b/test/integration/LiveProposalsIntegration.t.sol index c28bfe7cb..2f9bc3c62 100644 --- a/test/integration/LiveProposalsIntegration.t.sol +++ b/test/integration/LiveProposalsIntegration.t.sol @@ -76,7 +76,10 @@ contract LiveProposalsIntegrationTest is LiveProposalCheck { /// ---------------------------------------------------------- /// mock relayer so we can simulate bridging well - WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter(); + WormholeRelayerAdapter wormholeRelayer = new WormholeRelayerAdapter( + new uint16[](0), + new uint256[](0) + ); vm.makePersistent(address(wormholeRelayer)); vm.label(address(wormholeRelayer), "MockWormholeRelayer"); diff --git a/test/integration/MultichainProposalIntegration.t.sol b/test/integration/MultichainProposalIntegration.t.sol index 5975da30b..d3b84741b 100644 --- a/test/integration/MultichainProposalIntegration.t.sol +++ b/test/integration/MultichainProposalIntegration.t.sol @@ -165,7 +165,10 @@ contract MultichainProposalTest is PostProposalCheck { /// ---------------------------------------------------------- /// mock relayer so we can simulate bridging well - wormholeRelayerAdapter = new WormholeRelayerAdapter(); + wormholeRelayerAdapter = new WormholeRelayerAdapter( + new uint16[](0), + new uint256[](0) + ); vm.makePersistent(address(wormholeRelayerAdapter)); vm.label(address(wormholeRelayerAdapter), "MockWormholeRelayer"); diff --git a/test/integration/PostProposalCheck.sol b/test/integration/PostProposalCheck.sol index 3c09cd501..4d350cbf0 100644 --- a/test/integration/PostProposalCheck.sol +++ b/test/integration/PostProposalCheck.sol @@ -88,5 +88,8 @@ contract PostProposalCheck is LiveProposalCheck { addresses.removeAllRestrictions(); vm.setEnv("PRIMARY_FORK_ID", vm.toString(primaryForkBefore)); + + // revert back to proposalStartTime + vm.warp(proposalStartTime); } } diff --git a/test/integration/ReentrancyBaseLiveSystemIntegration.t.sol b/test/integration/ReentrancyBaseLiveSystemIntegration.t.sol index a858f2e2e..f8f05d9e3 100644 --- a/test/integration/ReentrancyBaseLiveSystemIntegration.t.sol +++ b/test/integration/ReentrancyBaseLiveSystemIntegration.t.sol @@ -15,6 +15,7 @@ import {mipb02 as mip} from "@proposals/mips/mip-b02/mip-b02.sol"; import {MErc20Delegator} from "@protocol/MErc20Delegator.sol"; import {MaliciousBorrower} from "@test/mock/MaliciousBorrower.sol"; import {PostProposalCheck} from "@test/integration/PostProposalCheck.sol"; +import {MarketBase} from "@test/utils/MarketBase.sol"; import {ComptrollerErrorReporter} from "@protocol/TokenErrorReporter.sol"; import {AllChainAddresses as Addresses} from "@proposals/Addresses.sol"; @@ -24,6 +25,7 @@ contract ReentrancyPostProposalTest is ComptrollerErrorReporter { Comptroller comptroller; + MarketBase marketBase; WETHRouter router; function setUp() public override { @@ -32,6 +34,7 @@ contract ReentrancyPostProposalTest is vm.selectFork(BASE_FORK_ID); comptroller = Comptroller(addresses.getAddress("UNITROLLER")); + marketBase = new MarketBase(comptroller); router = WETHRouter(payable(addresses.getAddress("WETH_ROUTER"))); } @@ -95,6 +98,14 @@ contract ReentrancyPostProposalTest is deal(addresses.getAddress("WETH"), address(borrower), 100e18); /// fund attack contract with weth + // Ensure sufficient borrow cap for the attack (60 WETH = 100 * 0.6) + uint256 borrowAmount = 60e18; + marketBase.ensureSufficientBorrowCap( + MErc20(mToken), + borrowAmount, + addresses + ); + vm.expectRevert("re-entered"); /// cannot reenter and borrow borrower.exploit(); } @@ -108,6 +119,14 @@ contract ReentrancyPostProposalTest is deal(addresses.getAddress("WETH"), address(borrower), 100e18); /// fund attack contract with weth + // Ensure sufficient borrow cap for the attack (60 WETH = 100 * 0.6) + uint256 borrowAmount = 60e18; + marketBase.ensureSufficientBorrowCap( + MErc20(mToken), + borrowAmount, + addresses + ); + vm.expectEmit(true, true, true, true, address(comptroller)); /// cannot reenter and borrow diff --git a/test/integration/ReserveAutomationDeployIntegration.t.sol b/test/integration/ReserveAutomationDeployIntegration.t.sol index b5c28cc9f..76ffea251 100644 --- a/test/integration/ReserveAutomationDeployIntegration.t.sol +++ b/test/integration/ReserveAutomationDeployIntegration.t.sol @@ -532,7 +532,7 @@ contract ReserveAutomationLiveSystemIntegrationTest is assertApproxEqRel( getAmountIn, amountWellIn, - 5e14, + 5e15, "amount in not within tolerance" ); } diff --git a/test/integration/ReserveAutomationIntegration.t.sol b/test/integration/ReserveAutomationIntegration.t.sol index 1840387eb..e320fe160 100644 --- a/test/integration/ReserveAutomationIntegration.t.sol +++ b/test/integration/ReserveAutomationIntegration.t.sol @@ -448,7 +448,7 @@ contract ReserveAutomationLiveIntegrationTest is Test { assertApproxEqRel( getAmountIn, amountWellIn, - 1e14, + 1e15, "amount in not within tolerance" ); } diff --git a/test/integration/TestProposalCalldataGenerationIntegration.t.sol b/test/integration/TestProposalCalldataGenerationIntegration.t.sol index ff1681afb..6bbd63e88 100644 --- a/test/integration/TestProposalCalldataGenerationIntegration.t.sol +++ b/test/integration/TestProposalCalldataGenerationIntegration.t.sol @@ -48,8 +48,12 @@ contract TestProposalCalldataGeneration is ProposalMap, Test { "HybridProposal" ); for (uint256 i = multichainGovernorProposals.length; i > 0; i--) { - // exclude proposals that are not onchain yet - if (multichainGovernorProposals[i - 1].id == 0) { + // exclude proposals that are not onchain yet or proposal ID 127 (mip-x34) and 121 (mip-x32) + if ( + multichainGovernorProposals[i - 1].id == 0 || + multichainGovernorProposals[i - 1].id == 127 || + multichainGovernorProposals[i - 1].id == 121 + ) { continue; } @@ -133,7 +137,11 @@ contract TestProposalCalldataGeneration is ProposalMap, Test { "HybridProposal" ); for (uint256 i = artemisGovernorProposals.length; i > 0; i--) { - if (artemisGovernorProposals[i - 1].id == 0) { + // exclude proposals that are not onchain yet or proposal ID 127 (mip-x34) + if ( + artemisGovernorProposals[i - 1].id == 0 || + artemisGovernorProposals[i - 1].id == 127 + ) { continue; } @@ -200,8 +208,11 @@ contract TestProposalCalldataGeneration is ProposalMap, Test { "GovernanceProposal" ); for (uint256 i = artemisGovernorProposals.length; i > 0; i--) { - // exclude proposals that are not onchain yet - if (artemisGovernorProposals[i - 1].id == 0) { + // exclude proposals that are not onchain yet or proposal ID 127 (mip-x34) + if ( + artemisGovernorProposals[i - 1].id == 0 || + artemisGovernorProposals[i - 1].id == 127 + ) { continue; } diff --git a/test/integration/oracle/ChainlinkOEVWrapperIntegration.t.sol b/test/integration/oracle/ChainlinkOEVWrapperIntegration.t.sol index 79767c980..7d168920b 100644 --- a/test/integration/oracle/ChainlinkOEVWrapperIntegration.t.sol +++ b/test/integration/oracle/ChainlinkOEVWrapperIntegration.t.sol @@ -257,19 +257,13 @@ contract ChainlinkOEVWrapperIntegrationTest is PostProposalCheck { // so we need to convert borrow amount to 6 decimals borrowAmount = ((liquidity * 80) / 100) / 1e12; // Changed from full amount - // before borrowing, increase borrow cap to make sure we borrow a significant amount - vm.startPrank(addresses.getAddress("TEMPORAL_GOVERNOR")); - MToken[] memory mTokens = new MToken[](1); - mTokens[0] = mTokenBorrowed; - uint256[] memory newBorrowCaps = new uint256[](1); - uint256 currentBorrowCap = comptroller.borrowCaps( - address(mTokens[0]) + // Ensure sufficient borrow cap using the utility function + marketBase.ensureSufficientBorrowCap( + mTokenBorrowed, + borrowAmount, + addresses ); - newBorrowCaps[0] = currentBorrowCap + borrowAmount; - comptroller._setMarketBorrowCaps(mTokens, newBorrowCaps); - vm.stopPrank(); - // make sure the mToken has enough underlying to borrow deal( MErc20(address(mTokenBorrowed)).underlying(), diff --git a/test/mock/WormholeRelayerAdapter.sol b/test/mock/WormholeRelayerAdapter.sol index 0831f5d59..4525811f7 100644 --- a/test/mock/WormholeRelayerAdapter.sol +++ b/test/mock/WormholeRelayerAdapter.sol @@ -26,10 +26,32 @@ contract WormholeRelayerAdapter { // e.g of silence failure: check for refunds bool public silenceFailure; - uint256 public constant nativePriceQuote = 0.1 ether; + /// @notice Mapping of wormhole chain ID to native price quote + mapping(uint16 => uint256) public nativePriceQuotes; + + /// @notice Default price quote for backwards compatibility (used when no specific price is set) + uint256 public constant DEFAULT_NATIVE_PRICE_QUOTE = 0.1 ether; uint256 public callCounter; + /// @notice Constructor - accepts empty arrays for backwards compatibility + /// @param chainIds Array of wormhole chain IDs (can be empty for default behavior) + /// @param prices Array of native prices for each chain (can be empty for default behavior) + constructor(uint16[] memory chainIds, uint256[] memory prices) { + require( + chainIds.length == prices.length, + "WormholeRelayerAdapter: array length mismatch" + ); + for (uint256 i = 0; i < chainIds.length; i++) { + nativePriceQuotes[chainIds[i]] = prices[i]; + } + } + + /// @notice Get the default native price quote (for backwards compatibility) + function nativePriceQuote() public pure returns (uint256) { + return DEFAULT_NATIVE_PRICE_QUOTE; + } + event MockWormholeRelayerError(string reason); mapping(uint256 chainId => bool shouldRevert) public shouldRevertAtChain; @@ -85,7 +107,11 @@ contract WormholeRelayerAdapter { revert("WormholeBridgeAdapter: sendPayloadToEvm revert"); } - require(msg.value == nativePriceQuote, "incorrect value"); + uint256 expectedValue = nativePriceQuotes[chainId]; + if (expectedValue == 0) { + expectedValue = DEFAULT_NATIVE_PRICE_QUOTE; + } + require(msg.value == expectedValue, "incorrect value"); uint256 initialFork; @@ -135,7 +161,7 @@ contract WormholeRelayerAdapter { } /// @notice Retrieve the price for relaying messages to another chain - /// currently hardcoded to 0.01 ether + /// Returns the price stored in nativePriceQuotes mapping for the target chain, or default if not set function quoteEVMDeliveryPrice( uint16 targetChain, uint256, @@ -149,7 +175,10 @@ contract WormholeRelayerAdapter { revert("WormholeBridgeAdapter: quoteEVMDeliveryPrice revert"); } - nativePrice = nativePriceQuote; + nativePrice = nativePriceQuotes[targetChain]; + if (nativePrice == 0) { + nativePrice = DEFAULT_NATIVE_PRICE_QUOTE; + } targetChainRefundPerGasUnused = 0; } } diff --git a/test/utils/LiveProposalCheck.sol b/test/utils/LiveProposalCheck.sol index ded0d0968..3ac22cedd 100644 --- a/test/utils/LiveProposalCheck.sol +++ b/test/utils/LiveProposalCheck.sol @@ -163,6 +163,10 @@ contract LiveProposalCheck is Test, ProposalChecker, Networks { (uint32, bytes, uint8) ); + if (vm.activeFork() != MOONBEAM_FORK_ID) { + vm.selectFork(MOONBEAM_FORK_ID); + } + // Get crossChainVoteCollectionEndTimestamp for the proposal ( , @@ -183,6 +187,11 @@ contract LiveProposalCheck is Test, ProposalChecker, Networks { proposalStart, crossChainVoteCollectionEndTimestamp ); + + // after executing the proposal, switch back to the original fork + if (block.chainid != chainId) { + vm.selectFork(chainId.toForkId()); + } } proposalStart--; count++; diff --git a/test/utils/MarketBase.sol b/test/utils/MarketBase.sol index abad007f5..7a4942ae8 100644 --- a/test/utils/MarketBase.sol +++ b/test/utils/MarketBase.sol @@ -1,11 +1,13 @@ //SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.19; +import {Test} from "@forge-std/Test.sol"; import {MToken} from "@protocol/MToken.sol"; import {Comptroller} from "@protocol/Comptroller.sol"; import {ExponentialNoError} from "@protocol/ExponentialNoError.sol"; +import {AllChainAddresses as Addresses} from "@proposals/Addresses.sol"; -contract MarketBase is ExponentialNoError { +contract MarketBase is ExponentialNoError, Test { Comptroller comptroller; constructor(Comptroller _comptroller) { @@ -106,4 +108,32 @@ contract MarketBase is ExponentialNoError { : borrowableAmount ) - 1; } + + /// @notice Ensures sufficient borrow cap for a given borrow amount + /// @dev If the current borrow cap would be exceeded, this function increases it + /// @dev Adds a 10% buffer to account for interest accrual between check and borrow + /// @param mToken The market token to check/increase borrow cap for + /// @param borrowAmount The amount to be borrowed + /// @param addresses The addresses contract to get TEMPORAL_GOVERNOR + function ensureSufficientBorrowCap( + MToken mToken, + uint256 borrowAmount, + Addresses addresses + ) public { + uint256 currentBorrowCap = comptroller.borrowCaps(address(mToken)); + uint256 totalBorrows = mToken.totalBorrows(); + uint256 nextTotalBorrows = totalBorrows + borrowAmount; + + // If borrow would hit cap, increase it with a buffer for interest accrual + if (currentBorrowCap != 0 && nextTotalBorrows >= currentBorrowCap) { + vm.startPrank(addresses.getAddress("TEMPORAL_GOVERNOR")); + MToken[] memory mTokens = new MToken[](1); + mTokens[0] = mToken; + uint256[] memory newBorrowCaps = new uint256[](1); + // Add 10% buffer to account for interest accrual and ensure borrow succeeds + newBorrowCaps[0] = nextTotalBorrows + (borrowAmount / 10); + comptroller._setMarketBorrowCaps(mTokens, newBorrowCaps); + vm.stopPrank(); + } + } }