Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that collection is tradable when instantiating pair #28

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion contracts/infinity-pair/src/instantiate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use cw2::set_contract_version;
use cw_utils::must_pay;
use infinity_global::{load_global_config, load_min_price};
use infinity_shared::InfinityError;
use sg_marketplace_common::nft::only_tradable;
use sg_std::Response;
use stargaze_fair_burn::append_fair_burn_msg;
use stargaze_royalty_registry::fetch_or_set_royalties;
Expand All @@ -23,7 +24,7 @@ use cosmwasm_std::entry_point;
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn instantiate(
deps: DepsMut,
_env: Env,
env: Env,
info: MessageInfo,
msg: InstantiateMsg,
) -> Result<Response, ContractError> {
Expand All @@ -46,6 +47,8 @@ pub fn instantiate(
let min_price = load_min_price(&deps.querier, &infinity_global, &pair.immutable.denom)?
.ok_or(InfinityError::InvalidInput("denom not supported".to_string()))?;

only_tradable(&deps.querier, &env.block, &pair.immutable.collection)?;

let (royalty_entry, mut response) = fetch_or_set_royalties(
deps.as_ref(),
&global_config.royalty_registry,
Expand Down