Skip to content

Commit

Permalink
fix sender issue & rm whitelist check for lp contract
Browse files Browse the repository at this point in the history
  • Loading branch information
quasisamurai committed Feb 27, 2024
1 parent 7ae0225 commit e86b087
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions contracts/vesting-lp-pcl/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn receive_cw20(
if !is_sender_whitelisted(
deps.storage,
&config,
&deps.api.addr_validate(sender.as_str())?,
&deps.api.addr_validate(cw20_msg.sender.as_str())?,
) || token_asset_info(sender.clone()) != vesting_token
{
return Err(ContractError::Unauthorized {});
Expand All @@ -102,7 +102,10 @@ fn receive_cw20(
user_address_raw,
user_vesting_info,
} => {
if !is_sender_xyk_vesting_lp(deps.storage, &sender) {
if !is_sender_xyk_vesting_lp(
deps.storage,
&deps.api.addr_validate(cw20_msg.sender.as_str())?,
) {
return Err(ContractError::Unauthorized {});
}
handle_migrate_xyk_liquidity(deps, env, user_address_raw, user_vesting_info)
Expand All @@ -114,10 +117,6 @@ fn is_sender_whitelisted(store: &mut dyn Storage, config: &Config, sender: &Addr
if *sender == config.owner {
return true;
}
let xyk_vesting_lp_contract = XYK_VESTING_LP_CONTRACT.load(store).unwrap();
if *sender == xyk_vesting_lp_contract {
return true;
}
if VESTING_MANAGERS.has(store, sender.clone()) {
return true;
}
Expand Down

0 comments on commit e86b087

Please sign in to comment.