-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ add toUint256(int256)
to SafeCastLib
#511
Comments
Wouldn't hurt to add function complementWad(uint256 x) internal pure returns (uint256 result) {
assembly {
result := mul(lt(x, WAD), sub(WAD, x))
}
} |
toUint256(int256)
and powWad(uint256, uint256)
to SafeCastLib
toUint256(int256)
to SafeCastLib
|
I think let's leave it as |
@Vectorized All of this is inspired by Balancer v2 arithmetic: Complement reference: Furthermore, for |
|
I think I'll let the people who need Licensing issue, and high risk of edge cases unaccounted for. |
Noticed both are missing:
Thinking we would check that each param is greater than zero:
The text was updated successfully, but these errors were encountered: