diff --git a/contracts/poap/src/execute.rs b/contracts/poap/src/execute.rs index 261539c6..6190eeff 100644 --- a/contracts/poap/src/execute.rs +++ b/contracts/poap/src/execute.rs @@ -26,7 +26,7 @@ where env: Env, info: MessageInfo, msg: InstantiateMsg, - ) -> StdResult> { + ) -> Result, ContractError> { // Instantiate the base cw721 that we are extending. let cw721_instantiate_msg = Cw721BaseInstantiateMsg { name: msg.name, @@ -50,6 +50,14 @@ where self.is_transferable .save(deps.storage, &msg.is_transferable)?; self.is_mintable.save(deps.storage, &msg.is_mintable)?; + + if msg.mint_start_time.is_some() + && msg.mint_end_time.is_some() + && msg.mint_start_time.unwrap() >= msg.mint_end_time.unwrap() + { + return Err(ContractError::InvalidTimestampValues {}); + } + self.mint_start_time .save(deps.storage, &msg.mint_start_time)?; self.mint_end_time.save(deps.storage, &msg.mint_end_time)?; diff --git a/contracts/poap/src/lib.rs b/contracts/poap/src/lib.rs index 2a0ebefc..a6b5bebe 100644 --- a/contracts/poap/src/lib.rs +++ b/contracts/poap/src/lib.rs @@ -43,7 +43,7 @@ pub mod entry { env: Env, info: MessageInfo, msg: InstantiateMsg, - ) -> StdResult { + ) -> Result { cw2::set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?; let tract = PoapContract::::default();