Skip to content

Commit

Permalink
fix: equality (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
sogipec authored Jun 20, 2024
1 parent aa2b0ef commit 3c05295
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/tokenWrappers/StakedToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ contract StakedToken is ERC4626 {
stakerCooldown[to] = getNextCooldownTimestamp(0, amount, to, balanceOf(to));
} else if (to == address(0)) {
uint256 cooldownEndTimestamp = stakerCooldown[from] + COOLDOWN_SECONDS;
if (block.timestamp > cooldownEndTimestamp) revert InsufficientCooldown();
if (block.timestamp - cooldownEndTimestamp <= UNSTAKE_WINDOW) revert UnstakeWindowFinished();
if (block.timestamp <= cooldownEndTimestamp) revert InsufficientCooldown();
if (block.timestamp > cooldownEndTimestamp + UNSTAKE_WINDOW) revert UnstakeWindowFinished();
} else if (from != to) {
uint256 previousSenderCooldown = stakerCooldown[from];
stakerCooldown[to] = getNextCooldownTimestamp(previousSenderCooldown, amount, to, balanceOf(to));
Expand Down

0 comments on commit 3c05295

Please sign in to comment.