1package consts23import (4 i256 "gno.land/p/gnoswap/int256/v1"5 u256 "gno.land/p/gnoswap/uint256/v1"6)78// u256.Uint and i256.Int are little-endian [4]uint64:9// {arr[0]=least significant, arr[1], arr[2], arr[3]=most significant}.1011// MaxUint256 returns 2^256 - 1.12//13// Returns:14// - value: a fresh Uint equal to 2^256-115func MaxUint256() *u256.Uint {16 return &u256.Uint{18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615}17}1819// MaxUint128 returns 2^128 - 1, the maximum uint128 value.20//21// Returns:22// - value: a fresh Uint equal to 2^128-123func MaxUint128() *u256.Uint {24 return &u256.Uint{18446744073709551615, 18446744073709551615, 0, 0}25}2627// MaxInt256 returns 2^255 - 1, the maximum int256 value, as an unsigned u256.28//29// Returns:30// - value: a fresh Uint equal to 2^255-131func MaxInt256() *u256.Uint {32 return &u256.Uint{18446744073709551615, 18446744073709551615, 18446744073709551615, 9223372036854775807}33}3435// Q96 returns 2^96, the Q64.96 fixed-point scaling factor.36//37// Returns:38// - value: a fresh Uint equal to 2^96, the Q64.96 scale39func Q96() *u256.Uint {40 return &u256.Uint{0, 4294967296, 0, 0}41}4243// Q128 returns 2^128, the Q128.128 fixed-point scaling factor.44//45// Returns:46// - value: a fresh Uint equal to 2^128, the Q128.128 scale47func Q128() *u256.Uint {48 return &u256.Uint{0, 0, 1, 0}49}5051// Q192 returns 2^192.52//53// Returns:54// - value: a fresh Uint equal to 2^19255func Q192() *u256.Uint {56 return &u256.Uint{0, 0, 0, 1}57}5859// Max160 returns 2^160 - 1, the maximum value representable in 160 bits.60//61// Returns:62// - value: a fresh Uint equal to 2^160-163func Max160() *u256.Uint {64 return &u256.Uint{18446744073709551615, 18446744073709551615, 4294967295, 0}65}6667// MinSqrtRatio returns the minimum valid sqrt price ratio (4295128739),68// equal to TickMathGetSqrtRatioAtTick(minTick).69//70// Returns:71// - value: a fresh Uint equal to the minimum valid sqrt-price ratio72func MinSqrtRatio() *u256.Uint {73 return &u256.Uint{4295128739, 0, 0, 0}74}7576// MaxSqrtRatio returns the upper bound of the valid sqrt price range77// (1461446703485210103287273052203988822378723970342), equal to78// TickMathGetSqrtRatioAtTick(maxTick). TickMathGetTickAtSqrtRatio treats this79// boundary as exclusive and accepts values in [MinSqrtRatio, MaxSqrtRatio).80//81// Returns:82// - value: a fresh Uint equal to the exclusive upper sqrt-price boundary83func MaxSqrtRatio() *u256.Uint {84 return &u256.Uint{6743328256752651558, 17280870778742802505, 4294805859, 0}85}8687// MaxInt128I256 returns 2^127 - 1, the maximum int128 value, as a signed i256.88//89// Returns:90// - value: a fresh signed Int equal to 2^127-191func MaxInt128I256() *i256.Int {92 return &i256.Int{18446744073709551615, 9223372036854775807, 0, 0}93}9495// MaxInt64I256 returns 2^63 - 1, the maximum int64 value, as a signed i256.96//97// Returns:98// - value: a fresh signed Int equal to 2^63-199func MaxInt64I256() *i256.Int {100 return &i256.Int{9223372036854775807, 0, 0, 0}101}102103// MinInt64I256 returns -2^63, the minimum int64 value, as a signed i256.104//105// Returns:106// - value: a fresh signed Int equal to -2^63107func MinInt64I256() *i256.Int {108 return &i256.Int{9223372036854775808, 18446744073709551615, 18446744073709551615, 18446744073709551615}109}110Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.