Skip to content

Commit

Permalink
allow airdrop in stars
Browse files Browse the repository at this point in the history
  • Loading branch information
jhernandezb committed Sep 29, 2023
1 parent fd9eef0 commit 4fc25b1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 66 deletions.
5 changes: 0 additions & 5 deletions contracts/factories/open-edition-factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ pub fn instantiate(
set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;
let params = msg.params;

ensure!(
params.extension.airdrop_mint_price.denom == params.min_mint_price.denom,
BaseContractError::InvalidDenom {}
);

ensure!(
params.creation_fee.denom == NATIVE_DENOM,
BaseContractError::InvalidDenom {}
Expand Down
62 changes: 1 addition & 61 deletions test-suite/src/open_edition_minter/tests/ibc_asset_mint.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use base_factory::ContractError as BaseContractError;
use cosmwasm_std::{coin, Addr, Coin, Decimal, Uint128};
use cw_multi_test::{BankSudo, Executor, SudoMsg};
use open_edition_factory::{
state::{OpenEditionMinterParams, ParamsExtension},
types::{NftData, NftMetadataType},
};
use open_edition_factory::state::{OpenEditionMinterParams, ParamsExtension};
use open_edition_minter::msg::ExecuteMsg;
use sg_std::{GENESIS_MINT_START_TIME, NATIVE_DENOM};

Expand Down Expand Up @@ -236,59 +232,3 @@ fn zero_mint_fee() {
let res = router.execute_contract(buyer, minter_addr, &mint_msg, &[mint_price]);
assert!(res.is_ok());
}

#[test]
fn denom_mismatch_creating_minter() {
// create factory w NATIVE_DENOM, then try creating a minter w different denom
let denom = "ibc/asset";
let mint_price = coin(MIN_MINT_PRICE_OPEN_EDITION, denom.to_string());
let mismatch_denom = coin(MIN_MINT_PRICE_OPEN_EDITION, NATIVE_DENOM);
let nft_data = NftData {
nft_data_type: NftMetadataType::OffChainMetadata,
token_uri: Some("ipfs://1234".to_string()),
extension: None,
};

let params_extension = ParamsExtension {
max_per_address_limit: 10,
airdrop_mint_fee_bps: 100,
airdrop_mint_price: Coin {
denom: mint_price.to_string(),
amount: Uint128::new(100_000_000u128),
},
dev_fee_address: DEV_ADDRESS.to_string(),
};
let per_address_limit_minter = Some(2);
let init_msg = init_msg(
nft_data,
per_address_limit_minter,
None,
None,
Some(mint_price.clone()),
);
let custom_minter_params = OpenEditionMinterParams {
code_id: 1,
allowed_sg721_code_ids: vec![1, 2, 3, 5, 6],
frozen: false,
creation_fee: coin(CREATION_FEE, NATIVE_DENOM),
min_mint_price: mint_price,
mint_fee_bps: MINT_FEE_FAIR_BURN,
max_trading_offset_secs: 60 * 60 * 24 * 7,
extension: ParamsExtension {
max_per_address_limit: 10,
airdrop_mint_fee_bps: 100,
dev_fee_address: DEV_ADDRESS.to_string(),
airdrop_mint_price: mismatch_denom,
},
};

let vt =
open_edition_minter_ibc_template(params_extension, init_msg, custom_minter_params).unwrap();
let err = vt.collection_response_vec[0]
.error
.as_ref()
.unwrap()
.root_cause()
.to_string();
assert_eq!(err, BaseContractError::InvalidDenom {}.to_string());
}

0 comments on commit 4fc25b1

Please sign in to comment.