SafeCast
Last updated
Last updated
Contains methods for safely casting between types
Cast a uint256 to a uint160, revert on overflow
Parameters:
y
uint256
The uint256 to be downcasted
Return Values:
z
uint160
The downcasted integer, now type uint160
Cast a int256 to a int128, revert on overflow or underflow
Parameters:
y
int256
The int256 to be downcasted
z
int128
The downcasted integer, now type int128
Cast a uint256 to a int256, revert on overflow
y
uint256
The uint256 to be casted
z
int256
The casted integer, now type int256
Return Values:
Parameters:
Return Values: