Skip to content

Commit 7c7dec3

Browse files
committed
refactor: make RAGE_QUIT_COOLDOWN_CHANGE_DELAY in MSLV
1 parent 2842e12 commit 7c7dec3

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/core/MultistrategyLockedVault.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ contract MultistrategyLockedVault is MultistrategyVault, IMultistrategyLockedVau
146146

147147
/// @notice Grace period delay for cooldown changes
148148
/// @dev 14 days in seconds. Users have this time to rage quit under old terms
149-
uint256 public constant RAGE_QUIT_COOLDOWN_CHANGE_DELAY = 14 days;
149+
uint256 private constant RAGE_QUIT_COOLDOWN_CHANGE_DELAY = 14 days;
150150

151151
/**
152152
* @dev Modifier to restrict access to regen governance only

test/proof-of-fixes/cantina-competition-september-2025/Finding231Fix.t.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ contract Finding231Fix is Test {
1919
address internal governance = address(0x1);
2020
address internal feeRecipient = address(0x2);
2121
uint256 internal constant DEFAULT_PROFIT_MAX_UNLOCK = 7 days;
22+
uint256 internal constant RAGE_QUIT_COOLDOWN_CHANGE_DELAY = 14 days;
2223
uint256 internal constant MAX_INT = type(uint256).max;
2324

2425
function setUp() public {
@@ -51,7 +52,7 @@ contract Finding231Fix is Test {
5152
vault.proposeRageQuitCooldownPeriodChange(newPeriod);
5253

5354
uint256 proposedAt = vault.rageQuitCooldownPeriodChangeTimestamp();
54-
uint256 cancelTime = proposedAt + vault.RAGE_QUIT_COOLDOWN_CHANGE_DELAY() - 1;
55+
uint256 cancelTime = proposedAt + RAGE_QUIT_COOLDOWN_CHANGE_DELAY - 1;
5556
vm.warp(cancelTime);
5657

5758
vm.expectEmit(false, false, false, true);
@@ -72,7 +73,7 @@ contract Finding231Fix is Test {
7273
vault.proposeRageQuitCooldownPeriodChange(newPeriod);
7374

7475
uint256 proposedAt = vault.rageQuitCooldownPeriodChangeTimestamp();
75-
vm.warp(proposedAt + vault.RAGE_QUIT_COOLDOWN_CHANGE_DELAY());
76+
vm.warp(proposedAt + RAGE_QUIT_COOLDOWN_CHANGE_DELAY);
7677

7778
vm.expectRevert(IMultistrategyLockedVault.RageQuitCooldownPeriodChangeDelayElapsed.selector);
7879
vault.cancelRageQuitCooldownPeriodChange();

test/unit/core/multistrategyvault/LockedVaultTest.t.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ contract LockedVaultTest is Test {
2323
address public fish = address(0x2);
2424
address public feeRecipient = address(0x3);
2525
address constant ZERO_ADDRESS = address(0);
26+
uint256 internal constant RAGE_QUIT_COOLDOWN_CHANGE_DELAY = 14 days;
2627

2728
uint256 public fishAmount = 10_000e18;
2829
uint256 public defaultProfitMaxUnlockTime = 7 days;
@@ -86,7 +87,7 @@ contract LockedVaultTest is Test {
8687
assertEq(vault.pendingRageQuitCooldownPeriod(), cooldownPeriod, "Pending period should be set");
8788

8889
// Fast forward past delay period
89-
vm.warp(block.timestamp + vault.RAGE_QUIT_COOLDOWN_CHANGE_DELAY() + 1);
90+
vm.warp(block.timestamp + RAGE_QUIT_COOLDOWN_CHANGE_DELAY + 1);
9091

9192
vault.finalizeRageQuitCooldownPeriodChange();
9293
assertEq(vault.rageQuitCooldownPeriod(), cooldownPeriod, "Rage quit cooldown period should be updated");
@@ -351,7 +352,7 @@ contract LockedVaultTest is Test {
351352
vm.stopPrank();
352353
vm.startPrank(gov);
353354
vault.proposeRageQuitCooldownPeriodChange(newCooldown);
354-
vm.warp(block.timestamp + vault.RAGE_QUIT_COOLDOWN_CHANGE_DELAY() + 1);
355+
vm.warp(block.timestamp + RAGE_QUIT_COOLDOWN_CHANGE_DELAY + 1);
355356
vault.finalizeRageQuitCooldownPeriodChange();
356357
vm.stopPrank();
357358

0 commit comments

Comments
 (0)