library CastU256U128 {
    /// @dev Safely cast an uint256 to an uint128
    function u128(uint256 x) internal pure returns (uint128 y) {
        require (x <= type(uint128).max, "Cast overflow");
        y = uint128(x);
    }
}
function u128(uint256 x) internal pure returns (uint128 y) {
    require (x <= type(uint128).max, "Cast overflow");
    y = uint128(x);
}

/// @dev Safely cast an uint256 to an uint128