diff --git a/contracts/minters/vending-minter-merkle-wl-featured/src/contract.rs b/contracts/minters/vending-minter-merkle-wl-featured/src/contract.rs index 008ff1cb5..6a5f4b752 100644 --- a/contracts/minters/vending-minter-merkle-wl-featured/src/contract.rs +++ b/contracts/minters/vending-minter-merkle-wl-featured/src/contract.rs @@ -219,9 +219,10 @@ pub fn execute( ) -> Result { match msg { ExecuteMsg::Mint { + stage, proof_hashes, allocation, - } => execute_mint_sender(deps, env, info, proof_hashes, allocation), + } => execute_mint_sender(deps, env, info, stage, proof_hashes, allocation), ExecuteMsg::Purge {} => execute_purge(deps, env, info), ExecuteMsg::UpdateMintPrice { price } => execute_update_mint_price(deps, env, info, price), ExecuteMsg::UpdateStartTime(time) => execute_update_start_time(deps, env, info, time), @@ -498,6 +499,7 @@ pub fn execute_mint_sender( deps: DepsMut, env: Env, info: MessageInfo, + stage: Option, proof_hashes: Option>, allocation: Option, ) -> Result { @@ -505,7 +507,7 @@ pub fn execute_mint_sender( let action = "mint_sender"; // If there is no active whitelist right now, check public mint - let is_public_mint = is_public_mint(deps.as_ref(), &info, proof_hashes, allocation)?; + let is_public_mint = is_public_mint(deps.as_ref(), &info, stage, proof_hashes, allocation)?; // Check if after start_time if is_public_mint && (env.block.time < config.extension.start_time) { return Err(ContractError::BeforeMintStartTime {}); @@ -530,6 +532,7 @@ pub fn execute_mint_sender( fn is_public_mint( deps: Deps, info: &MessageInfo, + stage: Option, proof_hashes: Option>, allocation: Option, ) -> Result { @@ -554,9 +557,13 @@ fn is_public_mint( deps.querier.query_wasm_smart( whitelist, &WhitelistMtreeQueryMsg::HasMember { - member: match allocation { - Some(allocation) => format!("{}{}", info.sender, allocation), - None => info.sender.to_string(), + member: match (stage, allocation) { + (None, Some(allocation)) => format!("{}{}", info.sender, allocation), + (Some(stage), None) => format!("{}{}", stage, info.sender), + (Some(stage), Some(allocation)) => { + format!("{}{}{}", stage, info.sender, allocation) + } + (None, None) => info.sender.to_string(), }, proof_hashes: proof_hashes.unwrap(), }, diff --git a/contracts/minters/vending-minter-merkle-wl-featured/src/msg.rs b/contracts/minters/vending-minter-merkle-wl-featured/src/msg.rs index 44bc33ebf..10f268ed1 100644 --- a/contracts/minters/vending-minter-merkle-wl-featured/src/msg.rs +++ b/contracts/minters/vending-minter-merkle-wl-featured/src/msg.rs @@ -11,6 +11,7 @@ pub struct InstantiateMsg { #[cw_serde] pub enum ExecuteMsg { Mint { + stage: Option, proof_hashes: Option>, allocation: Option, }, diff --git a/contracts/minters/vending-minter-merkle-wl/src/contract.rs b/contracts/minters/vending-minter-merkle-wl/src/contract.rs index 4e7ea5770..23e42755b 100644 --- a/contracts/minters/vending-minter-merkle-wl/src/contract.rs +++ b/contracts/minters/vending-minter-merkle-wl/src/contract.rs @@ -219,9 +219,10 @@ pub fn execute( ) -> Result { match msg { ExecuteMsg::Mint { + stage, proof_hashes, allocation, - } => execute_mint_sender(deps, env, info, proof_hashes, allocation), + } => execute_mint_sender(deps, env, info, stage, proof_hashes, allocation), ExecuteMsg::Purge {} => execute_purge(deps, env, info), ExecuteMsg::UpdateMintPrice { price } => execute_update_mint_price(deps, env, info, price), ExecuteMsg::UpdateStartTime(time) => execute_update_start_time(deps, env, info, time), @@ -498,6 +499,7 @@ pub fn execute_mint_sender( deps: DepsMut, env: Env, info: MessageInfo, + stage: Option, proof_hashes: Option>, allocation: Option, ) -> Result { @@ -505,7 +507,7 @@ pub fn execute_mint_sender( let action = "mint_sender"; // If there is no active whitelist right now, check public mint - let is_public_mint = is_public_mint(deps.as_ref(), &info, proof_hashes, allocation)?; + let is_public_mint = is_public_mint(deps.as_ref(), &info, stage, proof_hashes, allocation)?; // Check if after start_time if is_public_mint && (env.block.time < config.extension.start_time) { return Err(ContractError::BeforeMintStartTime {}); @@ -530,6 +532,7 @@ pub fn execute_mint_sender( fn is_public_mint( deps: Deps, info: &MessageInfo, + stage: Option, proof_hashes: Option>, allocation: Option, ) -> Result { @@ -554,9 +557,13 @@ fn is_public_mint( deps.querier.query_wasm_smart( whitelist, &WhitelistMtreeQueryMsg::HasMember { - member: match allocation { - Some(allocation) => format!("{}{}", info.sender, allocation), - None => info.sender.to_string(), + member: match (stage, allocation) { + (None, Some(allocation)) => format!("{}{}", info.sender, allocation), + (Some(stage), None) => format!("{}{}", stage, info.sender), + (Some(stage), Some(allocation)) => { + format!("{}{}{}", stage, info.sender, allocation) + } + (None, None) => info.sender.to_string(), }, proof_hashes: proof_hashes.unwrap(), }, diff --git a/contracts/minters/vending-minter-merkle-wl/src/msg.rs b/contracts/minters/vending-minter-merkle-wl/src/msg.rs index 44bc33ebf..10f268ed1 100644 --- a/contracts/minters/vending-minter-merkle-wl/src/msg.rs +++ b/contracts/minters/vending-minter-merkle-wl/src/msg.rs @@ -11,6 +11,7 @@ pub struct InstantiateMsg { #[cw_serde] pub enum ExecuteMsg { Mint { + stage: Option, proof_hashes: Option>, allocation: Option, },