File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -515,6 +515,13 @@ contract OneWayVault is
515515 if (_vaultState.pausedByStaleRate && msg .sender != owner ()) {
516516 revert ("Only owner can unpause if paused by stale rate " );
517517 }
518+ if (
519+ _vaultState.pausedByStaleRate
520+ && uint64 (block .timestamp ) - lastRateUpdateTimestamp > config.maxRateUpdateDelay
521+ ) {
522+ revert ("Cannot unpause while rate is stale " );
523+ }
524+
518525 delete vaultState;
519526 emit PausedStateChanged (false );
520527 }
Original file line number Diff line number Diff line change @@ -680,6 +680,11 @@ contract OneWayVaultTest is Test {
680680 vm.expectRevert ("Only owner can unpause if paused by stale rate " );
681681 vault.unpause ();
682682
683+ // If no update has happened, even owner can't unpause
684+ vm.prank (owner);
685+ vm.expectRevert ("Cannot unpause while rate is stale " );
686+ vault.unpause ();
687+
683688 // Update the rate so that owner can unpause and users can deposit again
684689 uint256 newRate = initialRate * 2 ; // Double the rate
685690 vm.prank (strategist);
You can’t perform that action at this time.
0 commit comments