Skip to content

Commit

Permalink
Correct rounding behavior in previewWithdraw (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVF authored May 28, 2024
1 parent 95b3443 commit c05ad1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/ExponentialStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ contract ExponentialStaking is ERC20Votes {
}
uint256 fullDuration = end - block.timestamp;
(uint256 fullPoints,) = previewPoints(1e18, fullDuration);
(uint256 currentPoints,) = previewPoints(1e36, 0); // 1e36 saves a later multiplication
return amount * ((currentPoints / fullPoints)) / 1e18;
(uint256 currentPoints,) = previewPoints(1e18, 0);
return amount * currentPoints / fullPoints;
}

/// @notice Returns the total number of lockups the user has
Expand Down

0 comments on commit c05ad1c

Please sign in to comment.