Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "fix edge case where t1 = type(int256).min"
This reverts commit 32fbe53.
  • Loading branch information
Amxx committed Jan 19, 2024
commit 5d9bcb5bd798071317201d4a24f5062a58d7fada
4 changes: 1 addition & 3 deletions contracts/utils/math/Math.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

pragma solidity ^0.8.20;

import "./SignedMath.sol";

/**
* @dev Standard math utilities missing in the Solidity language.
*/
Expand Down Expand Up @@ -241,7 +239,7 @@ library Math {
(t1, t2, r2, r1) = (t2, t1 - t2 * int256(q), r1, r2 - r1 * q);
}
if (r2 != 1) return 0;
return t1 < 0 ? p - SignedMath.abs(-t1) : uint256(t1);
return t1 < 0 ? (p - uint256(-t1)) : uint256(t1);
}
}

Expand Down