Skip to content

Commit c68c259

Browse files
authored
Merge branch 'mip-x34' into mip-x36
2 parents b1f038c + e29864b commit c68c259

File tree

6 files changed

+38
-118
lines changed

6 files changed

+38
-118
lines changed

.github/workflows/optimism-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
retry_wait_seconds: 60
3232
timeout_minutes: 20
3333
max_attempts: 3
34-
command: time forge test --match-contract LiveSystem -vvvvv --ffi
34+
command: time forge test --match-contract LiveSystem -vvv --ffi
3535

3636
xwell-integration-tests:
3737
name: xWell Integration Test

proposals/mips/mip-x33/x33.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"market": "MOONWELL_cbXRP",
2020
"reserveFactor": 0.15e18
2121
}
22-
2322
],
2423
"irModels": [
2524
{

proposals/templates/RewardsDistribution.sol

Lines changed: 1 addition & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,6 @@ contract RewardsDistributionTemplate is HybridProposal, Networks {
183183
/// @notice Track reserve automation contract balances before proposal execution
184184
mapping(address => uint256) public reserveAutomationBalancesBefore;
185185

186-
/// @notice Track leftover xWELL balance in Temporal Governor on Base before proposal execution
187-
/// TODO: Remove this after x34 - this is a one-time cleanup for leftover funds
188-
uint256 public temporalGovernorLeftoverBalance;
189-
190-
/// @notice Track F-DEVGRANT's xWELL balance on Base before proposal execution
191-
/// TODO: Remove this after x34 - this is a one-time cleanup for leftover funds
192-
uint256 public devGrantBalanceBeforeBase;
193-
194186
bytes public constant payloadMerkleCampaignBase =
195187
hex"000000000000000000000000a88594d404727625a9437c3f886c7643872296ae00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
196188

@@ -238,21 +230,6 @@ contract RewardsDistributionTemplate is HybridProposal, Networks {
238230
);
239231
wellBalancesBefore[reserve] = xwell.balanceOf(reserve);
240232

241-
// On Base, check for leftover xWELL in Temporal Governor
242-
// TODO: Remove this after x34 - this is a one-time cleanup for leftover funds
243-
if (chainId == BASE_CHAIN_ID) {
244-
address temporalGovernor = addresses.getAddress(
245-
"TEMPORAL_GOVERNOR"
246-
);
247-
temporalGovernorLeftoverBalance = xwell.balanceOf(
248-
temporalGovernor
249-
);
250-
251-
// Also track F-DEVGRANT's balance on Base before the proposal
252-
address devGrant = addresses.getAddress("F-DEVGRANT");
253-
devGrantBalanceBeforeBase = xwell.balanceOf(devGrant);
254-
}
255-
256233
// Save initial balances for reserve automation contracts
257234
JsonSpecExternalChain memory spec = externalChainActions[
258235
chainId
@@ -439,20 +416,6 @@ contract RewardsDistributionTemplate is HybridProposal, Networks {
439416

440417
vm.selectFork(BASE_FORK_ID);
441418

442-
// TODO remove this after testing
443-
deal(
444-
addresses.getAddress("xWELL_PROXY"),
445-
addresses.getAddress("F-AERO_MULTISIG"),
446-
600191928791850000000000
447-
);
448-
449-
vm.startPrank(addresses.getAddress("F-AERO_MULTISIG"));
450-
IERC20(addresses.getAddress("xWELL_PROXY")).approve(
451-
addresses.getAddress("TEMPORAL_GOVERNOR"),
452-
600191928791850000000000
453-
);
454-
vm.stopPrank();
455-
456419
vm.selectFork(MOONBEAM_FORK_ID);
457420
}
458421

@@ -978,11 +941,10 @@ contract RewardsDistributionTemplate is HybridProposal, Networks {
978941
_saveWithdrawWell(addresses, data, prefix, _chainId);
979942

980943
if (_chainId != BASE_CHAIN_ID) {
981-
// TODO remove the missing rewards after x32
982944
assertApproxEqRel(
983945
ecosystemReserveProxyAmount,
984946
(externalChainActions[_chainId].stkWellEmissionsPerSecond *
985-
(endTimeStamp - startTimeStamp)) + 323094721447738864000000,
947+
(endTimeStamp - startTimeStamp)),
986948
1e18,
987949
"Amount transferred to ECOSYSTEM_RESERVE_PROXY must be equal to the stkWellEmissionsPerSecond * the epoch duration"
988950
);
@@ -1345,27 +1307,6 @@ contract RewardsDistributionTemplate is HybridProposal, Networks {
13451307
}
13461308
}
13471309

1348-
// On Base, return any leftover xWELL in Temporal Governor to F-DEVGRANT
1349-
// TODO: Remove this after x34 - this is a one-time cleanup for leftover funds
1350-
if (_chainId == BASE_CHAIN_ID && temporalGovernorLeftoverBalance > 0) {
1351-
address xwell = addresses.getAddress("xWELL_PROXY");
1352-
address devGrant = addresses.getAddress("F-DEVGRANT");
1353-
1354-
_pushAction(
1355-
xwell,
1356-
abi.encodeWithSignature(
1357-
"transfer(address,uint256)",
1358-
devGrant,
1359-
temporalGovernorLeftoverBalance
1360-
),
1361-
string.concat(
1362-
"Return leftover ",
1363-
vm.toString(temporalGovernorLeftoverBalance / 1e18),
1364-
" xWELL from Temporal Governor to F-DEVGRANT on Base"
1365-
)
1366-
);
1367-
}
1368-
13691310
for (uint256 i = 0; i < spec.setRewardSpeed.length; i++) {
13701311
SetMRDRewardSpeed memory setRewardSpeed = spec.setRewardSpeed[i];
13711312

@@ -2109,42 +2050,6 @@ contract RewardsDistributionTemplate is HybridProposal, Networks {
21092050
}
21102051
}
21112052

2112-
// Validate leftover xWELL transfer on Base
2113-
// TODO: Remove this after x34 - this is a one-time cleanup for leftover funds
2114-
if (_chainId == BASE_CHAIN_ID && temporalGovernorLeftoverBalance > 0) {
2115-
address temporalGovernor = addresses.getAddress(
2116-
"TEMPORAL_GOVERNOR"
2117-
);
2118-
address devGrant = addresses.getAddress("F-DEVGRANT");
2119-
IERC20 xwell = IERC20(addresses.getAddress("xWELL_PROXY"));
2120-
2121-
// Verify Temporal Governor balance is now zero (leftovers were sent out)
2122-
uint256 currentTempGovBalance = xwell.balanceOf(temporalGovernor);
2123-
assertApproxEqAbs(
2124-
currentTempGovBalance,
2125-
0,
2126-
1e18,
2127-
string.concat(
2128-
"Temporal Governor should have zero xWELL balance after returning leftover ",
2129-
vm.toString(temporalGovernorLeftoverBalance / 1e18),
2130-
" xWELL to F-DEVGRANT on Base"
2131-
)
2132-
);
2133-
2134-
// Verify F-DEVGRANT received the leftover amount on Base
2135-
uint256 expectedDevGrantBalance = devGrantBalanceBeforeBase +
2136-
temporalGovernorLeftoverBalance;
2137-
assertEq(
2138-
xwell.balanceOf(devGrant),
2139-
expectedDevGrantBalance,
2140-
string.concat(
2141-
"F-DEVGRANT on Base should have received leftover ",
2142-
vm.toString(temporalGovernorLeftoverBalance / 1e18),
2143-
" xWELL from Temporal Governor"
2144-
)
2145-
);
2146-
}
2147-
21482053
{
21492054
// validate emissions per second for the Safety Module
21502055
IStakedWell stkWell = IStakedWell(

test/integration/BridgeValidationHookIntegration.t.sol

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ contract BridgeValidationHookIntegrationTest is Test {
6363
assertEq(targets.length, 1, "Should have 1 action");
6464
assertEq(
6565
values[0],
66-
actualBridgeCost * 5,
67-
"Value should be 5x bridge cost"
66+
actualBridgeCost * 4,
67+
"Value should be 4x bridge cost"
6868
);
6969
}
7070

@@ -146,8 +146,8 @@ contract BridgeValidationHookIntegrationTest is Test {
146146
);
147147

148148
// Calculate expected values for error message
149-
uint256 minValue = actualBridgeCost * 5;
150-
uint256 actualValue = actualBridgeCost * 4;
149+
uint256 minValue = actualBridgeCost * 4;
150+
uint256 actualValue = actualBridgeCost * 3;
151151

152152
// Build expected error message
153153
string memory expectedError = string.concat(
@@ -192,8 +192,8 @@ contract BridgeValidationHookIntegrationTest is Test {
192192
}
193193

194194
// Calculate expected values for error message
195-
uint256 minValue = actualBridgeCost * 5;
196-
uint256 actualValue = actualBridgeCost * 4;
195+
uint256 minValue = actualBridgeCost * 4;
196+
uint256 actualValue = actualBridgeCost * 3;
197197

198198
// Build expected error message
199199
string memory expectedError = string.concat(
@@ -281,7 +281,7 @@ contract BridgeValidationHookIntegrationTest is Test {
281281
/// ============ EDGE CASE TESTS ============
282282

283283
function testBoundaryConditionJustBelowMinimum() public {
284-
// Test with 4.99x (just below minimum)
284+
// Test with 3.99x (just below minimum)
285285
BoundaryBelowMinimumProposal proposal = new BoundaryBelowMinimumProposal(
286286
actualBridgeCost
287287
);
@@ -306,8 +306,8 @@ contract BridgeValidationHookIntegrationTest is Test {
306306
});
307307

308308
// Calculate expected values for error message
309-
uint256 minValue = actualBridgeCost * 5;
310-
uint256 actualValue = (actualBridgeCost * 499) / 100; // 4.99x
309+
uint256 minValue = actualBridgeCost * 4;
310+
uint256 actualValue = (actualBridgeCost * 399) / 100; // 3.99x
311311

312312
// Build expected error message
313313
string memory expectedError = string.concat(
@@ -456,7 +456,7 @@ abstract contract BaseTestProposal is Configs, HybridProposal {
456456
function validate(Addresses, address) public pure override {}
457457
}
458458

459-
/// @notice Valid proposal with bridge value at minimum (5x)
459+
/// @notice Valid proposal with bridge value at minimum (4x)
460460
contract ValidBridgeMinimumProposal is BaseTestProposal {
461461
constructor(uint256 _bridgeCost) BaseTestProposal(_bridgeCost) {}
462462

@@ -465,7 +465,7 @@ contract ValidBridgeMinimumProposal is BaseTestProposal {
465465
function build(Addresses addresses) public override {
466466
createBridgeAction(
467467
addresses,
468-
bridgeCost * 5, // 5x bridge cost (minimum)
468+
bridgeCost * 4, // 4x bridge cost (minimum)
469469
TEST_BRIDGE_AMOUNT
470470
);
471471
}
@@ -514,7 +514,7 @@ contract MultipleBridgesProposal is BaseTestProposal {
514514
}
515515
}
516516

517-
/// @notice Invalid proposal - bridge value too low (4x)
517+
/// @notice Invalid proposal - bridge value too low (3x)
518518
contract InvalidBridgeTooLowProposal is BaseTestProposal {
519519
constructor(uint256 _bridgeCost) BaseTestProposal(_bridgeCost) {}
520520

@@ -523,7 +523,7 @@ contract InvalidBridgeTooLowProposal is BaseTestProposal {
523523
function build(Addresses addresses) public override {
524524
createBridgeAction(
525525
addresses,
526-
bridgeCost * 4, // 4x bridge cost (below minimum of 5x)
526+
bridgeCost * 3, // 3x bridge cost (below minimum of 4x)
527527
TEST_BRIDGE_AMOUNT
528528
);
529529
}
@@ -544,7 +544,7 @@ contract InvalidBridgeTooHighProposal is BaseTestProposal {
544544
}
545545
}
546546

547-
/// @notice Boundary test - just below minimum (4.99x)
547+
/// @notice Boundary test - just below minimum (3.99x)
548548
contract BoundaryBelowMinimumProposal is BaseTestProposal {
549549
constructor(uint256 _bridgeCost) BaseTestProposal(_bridgeCost) {}
550550

@@ -553,7 +553,7 @@ contract BoundaryBelowMinimumProposal is BaseTestProposal {
553553
function build(Addresses addresses) public override {
554554
createBridgeAction(
555555
addresses,
556-
(bridgeCost * 499) / 100, // 4.99x bridge cost
556+
(bridgeCost * 399) / 100, // 3.99x bridge cost
557557
TEST_BRIDGE_AMOUNT
558558
);
559559
}

test/integration/TestProposalCalldataGenerationIntegration.t.sol

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ contract TestProposalCalldataGeneration is ProposalMap, Test {
4848
"HybridProposal"
4949
);
5050
for (uint256 i = multichainGovernorProposals.length; i > 0; i--) {
51-
// exclude proposals that are not onchain yet
52-
if (multichainGovernorProposals[i - 1].id == 0) {
51+
// exclude proposals that are not onchain yet or proposal ID 127 (mip-x34) and 121 (mip-x32)
52+
if (
53+
multichainGovernorProposals[i - 1].id == 0 ||
54+
multichainGovernorProposals[i - 1].id == 127 ||
55+
multichainGovernorProposals[i - 1].id == 121
56+
) {
5357
continue;
5458
}
5559

@@ -133,7 +137,11 @@ contract TestProposalCalldataGeneration is ProposalMap, Test {
133137
"HybridProposal"
134138
);
135139
for (uint256 i = artemisGovernorProposals.length; i > 0; i--) {
136-
if (artemisGovernorProposals[i - 1].id == 0) {
140+
// exclude proposals that are not onchain yet or proposal ID 127 (mip-x34)
141+
if (
142+
artemisGovernorProposals[i - 1].id == 0 ||
143+
artemisGovernorProposals[i - 1].id == 127
144+
) {
137145
continue;
138146
}
139147

@@ -200,8 +208,11 @@ contract TestProposalCalldataGeneration is ProposalMap, Test {
200208
"GovernanceProposal"
201209
);
202210
for (uint256 i = artemisGovernorProposals.length; i > 0; i--) {
203-
// exclude proposals that are not onchain yet
204-
if (artemisGovernorProposals[i - 1].id == 0) {
211+
// exclude proposals that are not onchain yet or proposal ID 127 (mip-x34)
212+
if (
213+
artemisGovernorProposals[i - 1].id == 0 ||
214+
artemisGovernorProposals[i - 1].id == 127
215+
) {
205216
continue;
206217
}
207218

test/utils/LiveProposalCheck.sol

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ contract LiveProposalCheck is Test, ProposalChecker, Networks {
187187
proposalStart,
188188
crossChainVoteCollectionEndTimestamp
189189
);
190+
191+
// after executing the proposal, switch back to the original fork
192+
if (block.chainid != chainId) {
193+
vm.selectFork(chainId.toForkId());
194+
}
190195
}
191196
proposalStart--;
192197
count++;

0 commit comments

Comments
 (0)