Skip to content

Commit

Permalink
chore: unlock LPs from incentives
Browse files Browse the repository at this point in the history
  • Loading branch information
kerber0x authored Nov 26, 2024
1 parent a96fecb commit 06cca15
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/liquidity_hub/pool-network/incentive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "incentive"
version = "1.0.7"
version = "1.0.8"
authors = ["kaimen-sano <[email protected]>"]
edition.workspace = true
description = "An incentive manager for an LP token"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
};

/// Withdraws LP tokens from the contract.
pub fn withdraw(deps: DepsMut, env: Env, info: MessageInfo) -> Result<Response, ContractError> {
pub fn withdraw(deps: DepsMut, _env: Env, info: MessageInfo) -> Result<Response, ContractError> {
// counter of how many LP tokens we must return to use and the weight to remove
let mut return_token_count = Uint128::zero();

Expand All @@ -21,13 +21,14 @@ pub fn withdraw(deps: DepsMut, env: Env, info: MessageInfo) -> Result<Response,
let position = &closed_positions[i];

// if unbonding timestamp is in the past, it's possible to withdraw
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);
}
// 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)
Expand Down

0 comments on commit 06cca15

Please sign in to comment.