Skip to content

Commit

Permalink
chore: refactor funds validation
Browse files Browse the repository at this point in the history
  • Loading branch information
kerber0x committed Apr 11, 2024
1 parent ca44eef commit dfe1e54
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,8 @@ pub fn withdraw_liquidity(
let mut pair = get_pair_by_identifier(&deps.as_ref(), &pair_identifier)?;
let liquidity_token = pair.lp_denom.clone();
// Verify that the LP token was sent
if info.funds.is_empty() || info.funds[0].denom != liquidity_token {
return Err(ContractError::Unauthorized {});
}
cw_utils::must_pay(&info, &liquidity_token)?;

// Get the total share of the pool
let total_share = get_total_share(&deps.as_ref(), liquidity_token.clone())?;

Expand Down

0 comments on commit dfe1e54

Please sign in to comment.