Skip to content

Commit

Permalink
fix(wExp): update values
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Nov 11, 2023
1 parent 7f09d96 commit 948db52
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libraries/MathLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ library MathLib {
/// @dev ln(1e-18).
int256 internal constant LN_WEI_INT = -41.446531673892822312 ether;

/// @dev Above this bound, `wExp` is clipped to avoid overflows.
/// @dev Above this bound, `wExp` is clipped to avoid overflowing when multiplied with 1 ether.
/// @dev This upper bound corresponds to: ln(type(uint256).max / 1e36) - ln(2) (scaled by WAD, floored).
int256 internal constant WEXP_UPPER_BOUND = 93.859467695000409276 ether;

/// @dev The value of wExp(WEXP_UPPER_BOUND).
uint256 internal constant WEXP_UPPER_VALUE = 57896044618658097668566176065831614062208.180255716851497386 ether;
/// @dev The value of wExp(`WEXP_UPPER_BOUND`).
uint256 internal constant WEXP_UPPER_VALUE = 57716089161559221271663333261689707872312.488815486643994624 ether;

/// @dev Returns an approximation of exp.
function wExp(int256 x) internal pure returns (uint256) {
Expand Down

0 comments on commit 948db52

Please sign in to comment.