SafeCast
Last updated
Last updated
Author: Trader Joe
This library contains functions to safely cast uint256 to different uint types.
Returns x on uint248 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint248
The value as an uint248
Returns x on uint240 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint240
The value as an uint240
Returns x on uint232 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint232
The value as an uint232
Returns x on uint224 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint224
The value as an uint224
Returns x on uint216 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint216
The value as an uint216
Returns x on uint208 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint208
The value as an uint208
Returns x on uint200 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint200
The value as an uint200
Returns x on uint192 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint192
The value as an uint192
Returns x on uint184 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint184
The value as an uint184
Returns x on uint176 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint176
The value as an uint176
Returns x on uint168 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint168
The value as an uint168
Returns x on uint160 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint160
The value as an uint160
Returns x on uint152 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint152
The value as an uint152
Returns x on uint144 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint144
The value as an uint144
Returns x on uint136 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint136
The value as an uint136
Returns x on uint128 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint128
The value as an uint128
Returns x on uint120 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint120
The value as an uint120
Returns x on uint112 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint112
The value as an uint112
Returns x on uint104 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint104
The value as an uint104
Returns x on uint96 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint96
The value as an uint96
Returns x on uint88 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint88
The value as an uint88
Returns x on uint80 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint80
The value as an uint80
Returns x on uint72 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint72
The value as an uint72
Returns x on uint64 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint64
The value as an uint64
Returns x on uint56 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint56
The value as an uint56
Returns x on uint48 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint48
The value as an uint48
Returns x on uint40 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint40
The value as an uint40
Returns x on uint32 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint32
The value as an uint32
Returns x on uint24 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint24
The value as an uint24
Returns x on uint16 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint16
The value as an uint16
Returns x on uint8 and check that it does not overflow
Parameters
x
uint256
The value as an uint256
Returns
y
uint8
The value as an uint8