SafeCast

Contains methods for safely casting between types

Functions

toUint160

  function toUint160(
    uint256 y
  ) internal pure returns (uint160 z)

Cast a uint256 to a uint160, revert on overflow

Parameters:

Return Values:

toInt128

  function toInt128(
    int256 y
  ) internal pure returns (int128 z)

Cast a int256 to a int128, revert on overflow or underflow

Parameters:

Return Values:

toInt256

  function toInt256(
    uint256 y
  ) internal pure returns (int256 z)

Cast a uint256 to a int256, revert on overflow

Parameters:

Return Values:

Last updated