Skip to content

Commit

Permalink
update vending minter flex to use ibc fair burn
Browse files Browse the repository at this point in the history
  • Loading branch information
jhernandezb committed Oct 11, 2023
1 parent 5a9d9be commit 2167f21
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions contracts/minters/vending-minter-wl-flex/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ use cw_utils::{may_pay, maybe_addr, nonpayable, parse_reply_instantiate_data};
use rand_core::{RngCore, SeedableRng};
use rand_xoshiro::Xoshiro128PlusPlus;
use semver::Version;
use sg1::checked_fair_burn;
use sg1::{checked_fair_burn, ibc_denom_fair_burn};
use sg2::query::Sg2QueryMsg;
use sg4::{MinterConfig, Status, StatusResponse, SudoMsg};
use sg721::{ExecuteMsg as Sg721ExecuteMsg, InstantiateMsg as Sg721InstantiateMsg};
use sg_std::{StargazeMsgWrapper, GENESIS_MINT_START_TIME};
use sg_std::{StargazeMsgWrapper, GENESIS_MINT_START_TIME, NATIVE_DENOM};
use sg_whitelist_flex::msg::{
ConfigResponse as WhitelistConfigResponse, HasMemberResponse, Member,
QueryMsg as WhitelistQueryMsg,
Expand Down Expand Up @@ -641,7 +641,19 @@ fn _execute_mint(
Decimal::bps(factory_params.mint_fee_bps)
};
let network_fee = mint_price.amount * mint_fee;
checked_fair_burn(&info, network_fee.u128(), None, &mut res)?;
// use ibc_denom_fair_burn for non native denoms
if mint_price.denom != NATIVE_DENOM {

Check warning on line 645 in contracts/minters/vending-minter-wl-flex/src/contract.rs

View check run for this annotation

Codecov / codecov/patch

contracts/minters/vending-minter-wl-flex/src/contract.rs#L645

Added line #L645 was not covered by tests
// only send non-zero amounts
if !network_fee.is_zero() {

Check warning on line 647 in contracts/minters/vending-minter-wl-flex/src/contract.rs

View check run for this annotation

Codecov / codecov/patch

contracts/minters/vending-minter-wl-flex/src/contract.rs#L647

Added line #L647 was not covered by tests
ibc_denom_fair_burn(
coin(network_fee.u128(), mint_price.clone().denom),
None,

Check warning on line 650 in contracts/minters/vending-minter-wl-flex/src/contract.rs

View check run for this annotation

Codecov / codecov/patch

contracts/minters/vending-minter-wl-flex/src/contract.rs#L649-L650

Added lines #L649 - L650 were not covered by tests
&mut res,
)?;
}
} else {
checked_fair_burn(&info, network_fee.u128(), None, &mut res)?;

Check warning on line 655 in contracts/minters/vending-minter-wl-flex/src/contract.rs

View check run for this annotation

Codecov / codecov/patch

contracts/minters/vending-minter-wl-flex/src/contract.rs#L655

Added line #L655 was not covered by tests
}

let mintable_token_mapping = match token_id {
Some(token_id) => {
Expand Down

0 comments on commit 2167f21

Please sign in to comment.