From 06cca150e907348da6b9894cc2a7b5a1985edd63 Mon Sep 17 00:00:00 2001 From: Kerber0x <94062656+kerber0x@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:18:37 +0000 Subject: [PATCH] chore: unlock LPs from incentives --- Cargo.lock | 2 +- .../pool-network/incentive/Cargo.toml | 2 +- .../incentive/src/execute/withdraw.rs | 17 +++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 833e8c71e..ad3f93ab7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -766,7 +766,7 @@ dependencies = [ [[package]] name = "incentive" -version = "1.0.7" +version = "1.0.8" 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 b5d34b0e2..28446bc89 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.7" +version = "1.0.8" 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 4e3f9c8de..0fbef6cd0 100644 --- a/contracts/liquidity_hub/pool-network/incentive/src/execute/withdraw.rs +++ b/contracts/liquidity_hub/pool-network/incentive/src/execute/withdraw.rs @@ -7,7 +7,7 @@ use crate::{ }; /// Withdraws LP tokens from the contract. -pub fn withdraw(deps: DepsMut, env: Env, info: MessageInfo) -> Result { +pub fn withdraw(deps: DepsMut, _env: Env, info: MessageInfo) -> Result { // counter of how many LP tokens we must return to use and the weight to remove let mut return_token_count = Uint128::zero(); @@ -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); - } + // unlocking LPs + //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)