From af42fefefd6e8d66edae2e45fbadbb45bb8a2589 Mon Sep 17 00:00:00 2001 From: n3wbie Date: Mon, 18 Mar 2024 12:22:55 +0900 Subject: [PATCH] GSW-959 fix: change package deploy path --- _lib_package/big/int256/gno.mod | 2 +- _lib_package/big/int256/int256.gno | 2 +- _lib_package/big/uint256/gno.mod | 2 +- .../gnoswap/common/liquidity_amounts.gno | 2 +- _lib_realm/gnoswap/common/tick_math.gno | 4 +-- pool/_GET_no_receiver.gno | 4 +-- pool/_GET_receiver.gno | 4 +-- pool/_RPC_dry.gno | 4 +-- pool/_TEST_pool_multi_token_test.gnoa | 2 +- pool/_TEST_pool_single_lp_test.gnoa | 2 +- pool/bit_math.gno | 2 +- pool/liquidity_math.gno | 4 +-- pool/pool.gno | 4 +-- pool/pool_manager.gno | 2 +- pool/position.gno | 4 +-- pool/position_modify.gno | 2 +- pool/position_update.gno | 2 +- pool/sqrt_price_math.gno | 4 +-- pool/swap_math.gno | 4 +-- pool/tick.gno | 4 +-- pool/tick_bitmap.gno | 2 +- pool/type.gno | 4 +-- pool/utils.gno | 2 +- pool/withdrawal_fee.gno | 2 +- position/_GET_no_receiver.gno.gno | 2 +- position/_RPC_api.gno | 2 +- position/_RPC_dry.gno | 4 +-- position/liquidity_management.gno | 2 +- position/position.gno | 26 +++++++++---------- position/sqrt_price_math.gno | 4 +-- position/type.gno | 2 +- router/_RPC_api.gno | 2 +- router/comptue_routes.gno | 2 +- router/router.gno | 4 +-- router/router_dry.gno | 4 +-- router/swap_inner.gno | 4 +-- router/swap_multi.gno | 4 +-- router/swap_single.gno | 2 +- router/type.gno | 2 +- staker/_GET_no_receiver.gno | 2 +- staker/_RPC_api_stake.gno | 2 +- staker/reward_fee.gno | 2 +- staker/reward_math.gno | 2 +- staker/staker.gno | 2 +- staker/type.gno | 2 +- 45 files changed, 74 insertions(+), 74 deletions(-) diff --git a/_lib_package/big/int256/gno.mod b/_lib_package/big/int256/gno.mod index 727a5b2f..50a8442d 100644 --- a/_lib_package/big/int256/gno.mod +++ b/_lib_package/big/int256/gno.mod @@ -1 +1 @@ -module gno.land/p/big/int256 \ No newline at end of file +module gno.land/p/demo/big/int256 \ No newline at end of file diff --git a/_lib_package/big/int256/int256.gno b/_lib_package/big/int256/int256.gno index 79554914..00572807 100644 --- a/_lib_package/big/int256/int256.gno +++ b/_lib_package/big/int256/int256.gno @@ -3,7 +3,7 @@ package int256 import ( - "gno.land/p/big/uint256" + "gno.land/p/demo/big/uint256" ) var one = uint256.NewUint(1) diff --git a/_lib_package/big/uint256/gno.mod b/_lib_package/big/uint256/gno.mod index 39a64d3f..be07c081 100644 --- a/_lib_package/big/uint256/gno.mod +++ b/_lib_package/big/uint256/gno.mod @@ -1 +1 @@ -module gno.land/p/big/uint256 \ No newline at end of file +module gno.land/p/demo/big/uint256 \ No newline at end of file diff --git a/_lib_realm/gnoswap/common/liquidity_amounts.gno b/_lib_realm/gnoswap/common/liquidity_amounts.gno index 6a8eb765..7e9afa63 100644 --- a/_lib_realm/gnoswap/common/liquidity_amounts.gno +++ b/_lib_realm/gnoswap/common/liquidity_amounts.gno @@ -3,7 +3,7 @@ package common import ( "gno.land/r/gnoswap/consts" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) // toAscendingOrder checkes if the first value is greater than diff --git a/_lib_realm/gnoswap/common/tick_math.gno b/_lib_realm/gnoswap/common/tick_math.gno index 651f3037..accef849 100644 --- a/_lib_realm/gnoswap/common/tick_math.gno +++ b/_lib_realm/gnoswap/common/tick_math.gno @@ -1,8 +1,8 @@ package common import ( - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) var tickRatioMap = map[int32]*u256.Uint{ diff --git a/pool/_GET_no_receiver.gno b/pool/_GET_no_receiver.gno index 1db6cd37..c698fd28 100644 --- a/pool/_GET_no_receiver.gno +++ b/pool/_GET_no_receiver.gno @@ -3,8 +3,8 @@ package pool import ( "gno.land/p/demo/ufmt" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) func PoolGetSlot0SqrtPriceX96(poolPath string) *u256.Uint { diff --git a/pool/_GET_receiver.gno b/pool/_GET_receiver.gno index ea9b760d..5eec3739 100644 --- a/pool/_GET_receiver.gno +++ b/pool/_GET_receiver.gno @@ -3,8 +3,8 @@ package pool import ( "gno.land/p/demo/ufmt" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) // PoolGetPoolList returns a list of all pool paths diff --git a/pool/_RPC_dry.gno b/pool/_RPC_dry.gno index cefdc5db..5ca9948e 100644 --- a/pool/_RPC_dry.gno +++ b/pool/_RPC_dry.gno @@ -7,8 +7,8 @@ import ( "gno.land/r/gnoswap/consts" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) // DrySwap simulates a swap and returns the amount0, amount1 that would be received and a boolean indicating if the swap is possible diff --git a/pool/_TEST_pool_multi_token_test.gnoa b/pool/_TEST_pool_multi_token_test.gnoa index 4aa9c137..4036ce6c 100644 --- a/pool/_TEST_pool_multi_token_test.gnoa +++ b/pool/_TEST_pool_multi_token_test.gnoa @@ -13,7 +13,7 @@ import ( "gno.land/r/demo/gns" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) var ( diff --git a/pool/_TEST_pool_single_lp_test.gnoa b/pool/_TEST_pool_single_lp_test.gnoa index d9716c2a..b1598af5 100644 --- a/pool/_TEST_pool_single_lp_test.gnoa +++ b/pool/_TEST_pool_single_lp_test.gnoa @@ -12,7 +12,7 @@ import ( "gno.land/r/gnoswap/consts" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) var ( diff --git a/pool/bit_math.gno b/pool/bit_math.gno index ceefe07a..46595c0b 100644 --- a/pool/bit_math.gno +++ b/pool/bit_math.gno @@ -3,7 +3,7 @@ package pool import ( "gno.land/r/gnoswap/consts" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) type bitShift struct { diff --git a/pool/liquidity_math.gno b/pool/liquidity_math.gno index 5cca0d53..f212946b 100644 --- a/pool/liquidity_math.gno +++ b/pool/liquidity_math.gno @@ -1,8 +1,8 @@ package pool import ( - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) func liquidityMathAddDelta(x *u256.Uint, y *i256.Int) *u256.Uint { diff --git a/pool/pool.gno b/pool/pool.gno index 47ad8152..d7e40112 100644 --- a/pool/pool.gno +++ b/pool/pool.gno @@ -10,8 +10,8 @@ import ( gv "gno.land/r/demo/gov" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) // Mint creates a new position and mints liquidity tokens then return amount0, amount1 in string diff --git a/pool/pool_manager.gno b/pool/pool_manager.gno index 73f65bac..32b0dfbf 100644 --- a/pool/pool_manager.gno +++ b/pool/pool_manager.gno @@ -11,7 +11,7 @@ import ( "gno.land/r/demo/gns" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) var ( diff --git a/pool/position.gno b/pool/position.gno index c13908c8..ce18cf48 100644 --- a/pool/position.gno +++ b/pool/position.gno @@ -7,8 +7,8 @@ import ( "gno.land/p/demo/ufmt" "gno.land/r/gnoswap/consts" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) func positionGetKey( diff --git a/pool/position_modify.gno b/pool/position_modify.gno index 5035f1cc..2fbb60d8 100644 --- a/pool/position_modify.gno +++ b/pool/position_modify.gno @@ -3,7 +3,7 @@ package pool import ( "gno.land/r/gnoswap/common" - i256 "gno.land/p/big/int256" + i256 "gno.land/p/demo/big/int256" ) func (pool *Pool) modifyPosition(params ModifyPositionParams) (PositionInfo, *i256.Int, *i256.Int) { diff --git a/pool/position_update.gno b/pool/position_update.gno index fb8872f0..0be821fe 100644 --- a/pool/position_update.gno +++ b/pool/position_update.gno @@ -3,7 +3,7 @@ package pool import ( "std" - i256 "gno.land/p/big/int256" + i256 "gno.land/p/demo/big/int256" ) func (pool *Pool) updatePosition( diff --git a/pool/sqrt_price_math.gno b/pool/sqrt_price_math.gno index 7d02baa9..792ebb44 100644 --- a/pool/sqrt_price_math.gno +++ b/pool/sqrt_price_math.gno @@ -3,8 +3,8 @@ package pool import ( "gno.land/r/gnoswap/consts" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) func sqrtPriceMathGetNextSqrtPriceFromAmount0RoundingUp( diff --git a/pool/swap_math.gno b/pool/swap_math.gno index d7372f8a..d715c461 100644 --- a/pool/swap_math.gno +++ b/pool/swap_math.gno @@ -1,8 +1,8 @@ package pool import ( - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) func swapMathComputeSwapStep( diff --git a/pool/tick.gno b/pool/tick.gno index 5c9e567f..3718c2ba 100644 --- a/pool/tick.gno +++ b/pool/tick.gno @@ -3,8 +3,8 @@ package pool import ( "gno.land/r/gnoswap/consts" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) func tickTickSpacingToMaxLiquidityPerTick(tickSpacing int32) *u256.Uint { diff --git a/pool/tick_bitmap.gno b/pool/tick_bitmap.gno index 68a6a66c..8f3510df 100644 --- a/pool/tick_bitmap.gno +++ b/pool/tick_bitmap.gno @@ -4,7 +4,7 @@ import ( "gno.land/p/demo/ufmt" "gno.land/r/gnoswap/consts" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) func tickBitmapPosition(tick int32) (int16, uint8) { diff --git a/pool/type.gno b/pool/type.gno index 272dea77..0437909f 100644 --- a/pool/type.gno +++ b/pool/type.gno @@ -3,8 +3,8 @@ package pool import ( "std" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) type Slot0 struct { diff --git a/pool/utils.gno b/pool/utils.gno index 7d6e4eb1..e744875e 100644 --- a/pool/utils.gno +++ b/pool/utils.gno @@ -8,7 +8,7 @@ import ( "gno.land/r/gnoswap/consts" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) func checkTicks(tickLower, tickUpper int32) { diff --git a/pool/withdrawal_fee.gno b/pool/withdrawal_fee.gno index c12272c7..2007e56b 100644 --- a/pool/withdrawal_fee.gno +++ b/pool/withdrawal_fee.gno @@ -8,7 +8,7 @@ import ( "gno.land/p/demo/ufmt" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) // withdrawalFee is the fee that is charged when a user withdraws their collected fees diff --git a/position/_GET_no_receiver.gno.gno b/position/_GET_no_receiver.gno.gno index f4ee6321..9bf97702 100644 --- a/position/_GET_no_receiver.gno.gno +++ b/position/_GET_no_receiver.gno.gno @@ -3,7 +3,7 @@ package position import ( "std" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) // type Position diff --git a/position/_RPC_api.gno b/position/_RPC_api.gno index 9cd0a657..37a8baba 100644 --- a/position/_RPC_api.gno +++ b/position/_RPC_api.gno @@ -12,7 +12,7 @@ import ( pl "gno.land/r/demo/pool" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) type RpcPosition struct { diff --git a/position/_RPC_dry.gno b/position/_RPC_dry.gno index e31ae2c1..1ef3047d 100644 --- a/position/_RPC_dry.gno +++ b/position/_RPC_dry.gno @@ -3,8 +3,8 @@ package position import ( "gno.land/r/gnoswap/common" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) // DryMint simulates a mint and returns the amount0, amount1 that would be minted diff --git a/position/liquidity_management.gno b/position/liquidity_management.gno index 71452e20..7b4715f0 100644 --- a/position/liquidity_management.gno +++ b/position/liquidity_management.gno @@ -7,7 +7,7 @@ import ( pl "gno.land/r/demo/pool" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) func addLiquidity(params AddLiquidityParams) (*u256.Uint, *u256.Uint, *u256.Uint) { // uint128, uint256, uint256 diff --git a/position/position.gno b/position/position.gno index 6e307f1e..c1354c6c 100644 --- a/position/position.gno +++ b/position/position.gno @@ -7,7 +7,7 @@ import ( "gno.land/r/demo/gnft" "gno.land/r/demo/wugnot" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" "gno.land/r/gnoswap/common" "gno.land/r/gnoswap/consts" @@ -412,23 +412,23 @@ func decreaseLiquidity(params DecreaseLiquidityParams) (uint64, *u256.Uint, *u25 if !params.unwrapResult { return params.tokenId, liquidityToRemove, fee0, fee1, amount0, amount1, position.poolKey } - + var ( - unwrapAmount uint64 - unwrapFee uint64 + unwrapAmount uint64 + unwrapFee uint64 ) switch { case pToken0 == consts.WRAPPED_WUGNOT: unwrapAmount = amount0.Uint64() - unwrapFee = fee0.Uint64() - case pToken1 == consts.WRAPPED_WUGNOT: - unwrapAmount = amount1.Uint64() - unwrapFee = fee1.Uint64() - } - unwrap(unwrapAmount) - unwrap(unwrapFee) - - return params.tokenId, liquidityToRemove, fee0, fee1, amount0, amount1, position.poolKey + unwrapFee = fee0.Uint64() + case pToken1 == consts.WRAPPED_WUGNOT: + unwrapAmount = amount1.Uint64() + unwrapFee = fee1.Uint64() + } + unwrap(unwrapAmount) + unwrap(unwrapFee) + + return params.tokenId, liquidityToRemove, fee0, fee1, amount0, amount1, position.poolKey } // CollectFee collects swap fee from the position diff --git a/position/sqrt_price_math.gno b/position/sqrt_price_math.gno index 85aa1d11..591751ac 100644 --- a/position/sqrt_price_math.gno +++ b/position/sqrt_price_math.gno @@ -3,8 +3,8 @@ package position import ( "gno.land/r/gnoswap/consts" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) func sqrtPriceMathGetNextSqrtPriceFromAmount0RoundingUp( diff --git a/position/type.gno b/position/type.gno index d41ab890..77d04108 100644 --- a/position/type.gno +++ b/position/type.gno @@ -3,7 +3,7 @@ package position import ( "std" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) type Position struct { diff --git a/router/_RPC_api.gno b/router/_RPC_api.gno index e8a3144b..a7124932 100644 --- a/router/_RPC_api.gno +++ b/router/_RPC_api.gno @@ -11,7 +11,7 @@ import ( pl "gno.land/r/demo/pool" "gno.land/r/gnoswap/consts" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) type TokenRatio struct { diff --git a/router/comptue_routes.gno b/router/comptue_routes.gno index 94788bec..b60875d4 100644 --- a/router/comptue_routes.gno +++ b/router/comptue_routes.gno @@ -5,7 +5,7 @@ import ( pl "gno.land/r/demo/pool" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) // PoolWithMeta is a struct that contains poolPath, token0Path, token1Path, fee, tokenPair, and liquidity diff --git a/router/router.gno b/router/router.gno index 3fd634dd..8b39c87b 100644 --- a/router/router.gno +++ b/router/router.gno @@ -10,8 +10,8 @@ import ( "gno.land/r/gnoswap/common" "gno.land/r/gnoswap/consts" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" "gno.land/r/demo/wugnot" ) diff --git a/router/router_dry.gno b/router/router_dry.gno index b235053a..2c8489bc 100644 --- a/router/router_dry.gno +++ b/router/router_dry.gno @@ -6,8 +6,8 @@ import ( "gno.land/p/demo/ufmt" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) // DrySwapRoute simulates the swap route and returns the result amount diff --git a/router/swap_inner.gno b/router/swap_inner.gno index d8586eb4..ca2f451a 100644 --- a/router/swap_inner.gno +++ b/router/swap_inner.gno @@ -9,8 +9,8 @@ import ( "gno.land/r/gnoswap/consts" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) func _swap( diff --git a/router/swap_multi.gno b/router/swap_multi.gno index c5de3aff..e2517746 100644 --- a/router/swap_multi.gno +++ b/router/swap_multi.gno @@ -5,8 +5,8 @@ import ( "gno.land/r/gnoswap/consts" - i256 "gno.land/p/big/int256" - u256 "gno.land/p/big/uint256" + i256 "gno.land/p/demo/big/int256" + u256 "gno.land/p/demo/big/uint256" ) func multiSwap(params SwapParams, currentPoolIndex, numPools int, swapPath string) (*u256.Uint, *u256.Uint) { // firstAmountIn, lastAmountOut diff --git a/router/swap_single.gno b/router/swap_single.gno index 6d657e85..b76ecbb8 100644 --- a/router/swap_single.gno +++ b/router/swap_single.gno @@ -3,7 +3,7 @@ package router import ( "std" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) func singleSwap(params SingleSwapParams) (*u256.Uint, *u256.Uint) { // amountIn, amountOut diff --git a/router/type.gno b/router/type.gno index 44b68776..4f4e37a4 100644 --- a/router/type.gno +++ b/router/type.gno @@ -3,7 +3,7 @@ package router import ( "std" - i256 "gno.land/p/big/int256" + i256 "gno.land/p/demo/big/int256" ) // SWAP TYPE diff --git a/staker/_GET_no_receiver.gno b/staker/_GET_no_receiver.gno index f83c7da0..05e4170d 100644 --- a/staker/_GET_no_receiver.gno +++ b/staker/_GET_no_receiver.gno @@ -5,7 +5,7 @@ import ( "gno.land/p/demo/ufmt" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) // Incentive diff --git a/staker/_RPC_api_stake.gno b/staker/_RPC_api_stake.gno index b00cc2c8..97bfe84d 100644 --- a/staker/_RPC_api_stake.gno +++ b/staker/_RPC_api_stake.gno @@ -7,7 +7,7 @@ import ( "gno.land/p/demo/ufmt" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) type LpTokenReward struct { diff --git a/staker/reward_fee.gno b/staker/reward_fee.gno index 77ae01fc..d55af256 100644 --- a/staker/reward_fee.gno +++ b/staker/reward_fee.gno @@ -6,7 +6,7 @@ import ( "gno.land/p/demo/ufmt" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) var ( diff --git a/staker/reward_math.gno b/staker/reward_math.gno index fa8effc0..751333d4 100644 --- a/staker/reward_math.gno +++ b/staker/reward_math.gno @@ -8,7 +8,7 @@ import ( "gno.land/p/demo/ufmt" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" pos "gno.land/r/demo/position" ) diff --git a/staker/staker.gno b/staker/staker.gno index d8cdfe1a..050be708 100644 --- a/staker/staker.gno +++ b/staker/staker.gno @@ -15,7 +15,7 @@ import ( pl "gno.land/r/demo/pool" pn "gno.land/r/demo/position" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) var ( diff --git a/staker/type.gno b/staker/type.gno index 7c33430a..c74172a8 100644 --- a/staker/type.gno +++ b/staker/type.gno @@ -3,7 +3,7 @@ package staker import ( "std" - u256 "gno.land/p/big/uint256" + u256 "gno.land/p/demo/big/uint256" ) type Incentive struct {