From b3e6c244a4dd6e1af904c47addeb77fa3f6f5b96 Mon Sep 17 00:00:00 2001 From: Kerber0x Date: Wed, 6 Sep 2023 15:15:00 +0100 Subject: [PATCH] fix: unlock incentives so people can withdraw before the unlocking time finishes --- Cargo.lock | 2 +- .../pool-network/incentive/Cargo.toml | 2 +- .../incentive/src/execute/withdraw.rs | 15 ++++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 71a7e425..efecf0ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -661,7 +661,7 @@ dependencies = [ [[package]] name = "incentive" -version = "1.0.3" +version = "1.0.4" dependencies = [ "anyhow", "cosmwasm-schema", diff --git a/contracts/liquidity_hub/pool-network/incentive/Cargo.toml b/contracts/liquidity_hub/pool-network/incentive/Cargo.toml index b3d05b9a..266de667 100644 --- a/contracts/liquidity_hub/pool-network/incentive/Cargo.toml +++ b/contracts/liquidity_hub/pool-network/incentive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "incentive" -version = "1.0.3" +version = "1.0.4" authors = ["kaimen-sano "] edition.workspace = true description = "An incentive manager for an LP token" diff --git a/contracts/liquidity_hub/pool-network/incentive/src/execute/withdraw.rs b/contracts/liquidity_hub/pool-network/incentive/src/execute/withdraw.rs index 68045344..2afdd4fd 100644 --- a/contracts/liquidity_hub/pool-network/incentive/src/execute/withdraw.rs +++ b/contracts/liquidity_hub/pool-network/incentive/src/execute/withdraw.rs @@ -21,13 +21,14 @@ pub fn withdraw(deps: DepsMut, env: Env, info: MessageInfo) -> Result position.unbonding_timestamp { - // add return tokens to sum - return_token_count = return_token_count.checked_add(position.amount)?; - - // remove position - closed_positions.remove(i); - } + // let people out of jail in this version, done for specific pools where liquidity is being transferred + //if env.block.time.seconds() > position.unbonding_timestamp { + // add return tokens to sum + return_token_count = return_token_count.checked_add(position.amount)?; + + // remove position + closed_positions.remove(i); + //} } Ok(closed_positions)