diff --git a/contracts/minters/open-edition-minter-merkle-wl/src/contract.rs b/contracts/minters/open-edition-minter-merkle-wl/src/contract.rs index 0c3fb847d..886f78249 100644 --- a/contracts/minters/open-edition-minter-merkle-wl/src/contract.rs +++ b/contracts/minters/open-edition-minter-merkle-wl/src/contract.rs @@ -1086,9 +1086,23 @@ pub fn query_status(deps: Deps) -> StdResult { fn query_mint_count_per_address(deps: Deps, address: String) -> StdResult { let addr = deps.api.addr_validate(&address)?; let mint_count = (MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let standard_wl_count = + (WHITELIST_MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let tiered_wl_count = (WHITELIST_FS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_SS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_TS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0); Ok(MintCountResponse { address: addr.to_string(), - count: mint_count, + count: mint_count + standard_wl_count + tiered_wl_count, }) } diff --git a/contracts/minters/open-edition-minter-wl-flex/src/contract.rs b/contracts/minters/open-edition-minter-wl-flex/src/contract.rs index b96cf7f7f..753cb1c96 100644 --- a/contracts/minters/open-edition-minter-wl-flex/src/contract.rs +++ b/contracts/minters/open-edition-minter-wl-flex/src/contract.rs @@ -1067,12 +1067,25 @@ pub fn query_status(deps: Deps) -> StdResult { fn query_mint_count_per_address(deps: Deps, address: String) -> StdResult { let addr = deps.api.addr_validate(&address)?; let mint_count = (MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); - let whitelist_mint_count = + let standard_wl_count = (WHITELIST_MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let tiered_wl_count = (WHITELIST_FS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_SS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_TS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0); + Ok(MintCountResponse { address: addr.to_string(), count: mint_count, - whitelist_count: whitelist_mint_count, + whitelist_count: standard_wl_count + tiered_wl_count, }) } diff --git a/contracts/minters/open-edition-minter/src/contract.rs b/contracts/minters/open-edition-minter/src/contract.rs index aaad8dfc1..9965615f5 100644 --- a/contracts/minters/open-edition-minter/src/contract.rs +++ b/contracts/minters/open-edition-minter/src/contract.rs @@ -1057,9 +1057,24 @@ pub fn query_status(deps: Deps) -> StdResult { fn query_mint_count_per_address(deps: Deps, address: String) -> StdResult { let addr = deps.api.addr_validate(&address)?; let mint_count = (MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let standard_wl_count = + (WHITELIST_MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let tiered_wl_count = (WHITELIST_FS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_SS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_TS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0); + Ok(MintCountResponse { address: addr.to_string(), - count: mint_count, + count: mint_count + standard_wl_count + tiered_wl_count, }) } diff --git a/contracts/minters/vending-minter-featured/src/contract.rs b/contracts/minters/vending-minter-featured/src/contract.rs index b44e4532b..01709a927 100644 --- a/contracts/minters/vending-minter-featured/src/contract.rs +++ b/contracts/minters/vending-minter-featured/src/contract.rs @@ -1256,9 +1256,24 @@ pub fn query_status(deps: Deps) -> StdResult { fn query_mint_count(deps: Deps, address: String) -> StdResult { let addr = deps.api.addr_validate(&address)?; let mint_count = (MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let standard_wl_count = + (WHITELIST_MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let tiered_wl_count = (WHITELIST_FS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_SS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_TS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0); + Ok(MintCountResponse { address: addr.to_string(), - count: mint_count, + count: mint_count + standard_wl_count + tiered_wl_count, }) } 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 b53fab09b..d2e4e237e 100644 --- a/contracts/minters/vending-minter-merkle-wl-featured/src/contract.rs +++ b/contracts/minters/vending-minter-merkle-wl-featured/src/contract.rs @@ -1295,9 +1295,23 @@ pub fn query_status(deps: Deps) -> StdResult { fn query_mint_count(deps: Deps, address: String) -> StdResult { let addr = deps.api.addr_validate(&address)?; let mint_count = (MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let standard_wl_count = + (WHITELIST_MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let tiered_wl_count = (WHITELIST_FS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_SS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_TS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0); Ok(MintCountResponse { address: addr.to_string(), - count: mint_count, + count: mint_count + standard_wl_count + tiered_wl_count, }) } diff --git a/contracts/minters/vending-minter-merkle-wl/src/contract.rs b/contracts/minters/vending-minter-merkle-wl/src/contract.rs index 91c160744..6e5e94e13 100644 --- a/contracts/minters/vending-minter-merkle-wl/src/contract.rs +++ b/contracts/minters/vending-minter-merkle-wl/src/contract.rs @@ -1294,9 +1294,23 @@ pub fn query_status(deps: Deps) -> StdResult { fn query_mint_count(deps: Deps, address: String) -> StdResult { let addr = deps.api.addr_validate(&address)?; let mint_count = (MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let standard_wl_count = + (WHITELIST_MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let tiered_wl_count = (WHITELIST_FS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_SS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_TS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0); Ok(MintCountResponse { address: addr.to_string(), - count: mint_count, + count: mint_count + standard_wl_count + tiered_wl_count, }) } diff --git a/contracts/minters/vending-minter-wl-flex-featured/src/contract.rs b/contracts/minters/vending-minter-wl-flex-featured/src/contract.rs index 11f7a2cfa..e4525002f 100644 --- a/contracts/minters/vending-minter-wl-flex-featured/src/contract.rs +++ b/contracts/minters/vending-minter-wl-flex-featured/src/contract.rs @@ -1224,12 +1224,24 @@ pub fn query_status(deps: Deps) -> StdResult { fn query_mint_count(deps: Deps, address: String) -> StdResult { let addr = deps.api.addr_validate(&address)?; let mint_count = (MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); - let whitelist_mint_count = + let standard_wl_count = (WHITELIST_MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let tiered_wl_count = (WHITELIST_FS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_SS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_TS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0); Ok(MintCountResponse { address: addr.to_string(), count: mint_count, - whitelist_count: whitelist_mint_count, + whitelist_count: standard_wl_count + tiered_wl_count, }) } diff --git a/contracts/minters/vending-minter-wl-flex/src/contract.rs b/contracts/minters/vending-minter-wl-flex/src/contract.rs index 17694f855..4d0d1cc05 100644 --- a/contracts/minters/vending-minter-wl-flex/src/contract.rs +++ b/contracts/minters/vending-minter-wl-flex/src/contract.rs @@ -1223,12 +1223,26 @@ pub fn query_status(deps: Deps) -> StdResult { fn query_mint_count(deps: Deps, address: String) -> StdResult { let addr = deps.api.addr_validate(&address)?; let mint_count = (MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); - let whitelist_mint_count = + + let standard_wl_count = (WHITELIST_MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let tiered_wl_count = (WHITELIST_FS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_SS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_TS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0); + Ok(MintCountResponse { address: addr.to_string(), count: mint_count, - whitelist_count: whitelist_mint_count, + whitelist_count: standard_wl_count + tiered_wl_count, }) } diff --git a/contracts/minters/vending-minter/src/contract.rs b/contracts/minters/vending-minter/src/contract.rs index ee9d77e17..05d0975eb 100644 --- a/contracts/minters/vending-minter/src/contract.rs +++ b/contracts/minters/vending-minter/src/contract.rs @@ -1254,9 +1254,23 @@ pub fn query_status(deps: Deps) -> StdResult { fn query_mint_count(deps: Deps, address: String) -> StdResult { let addr = deps.api.addr_validate(&address)?; let mint_count = (MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let standard_wl_count = + (WHITELIST_MINTER_ADDRS.key(&addr).may_load(deps.storage)?).unwrap_or(0); + let tiered_wl_count = (WHITELIST_FS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_SS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0) + + (WHITELIST_TS_MINTER_ADDRS + .key(&addr) + .may_load(deps.storage)?) + .unwrap_or(0); Ok(MintCountResponse { address: addr.to_string(), - count: mint_count, + count: mint_count + standard_wl_count + tiered_wl_count, }) } diff --git a/test-suite/src/vending_minter/tests/whitelist.rs b/test-suite/src/vending_minter/tests/whitelist.rs index 80486ab2b..436725720 100644 --- a/test-suite/src/vending_minter/tests/whitelist.rs +++ b/test-suite/src/vending_minter/tests/whitelist.rs @@ -321,14 +321,21 @@ fn whitelist_mint_count_query() { assert_eq!(res.count, 3); assert_eq!(res.address, buyer.to_string()); - // Mint fails + // Public Mint let mint_msg = ExecuteMsg::Mint {}; + let _res = router.execute_contract( + buyer.clone(), + minter_addr.clone(), + &mint_msg, + &coins(100_000_000, NATIVE_DENOM), + ); + // Next Mint fails let err = router .execute_contract( buyer.clone(), minter_addr.clone(), &mint_msg, - &coins(WHITELIST_AMOUNT, NATIVE_DENOM), + &coins(100_000_000, NATIVE_DENOM), ) .unwrap_err(); assert_eq!( @@ -346,7 +353,7 @@ fn whitelist_mint_count_query() { }, ) .unwrap(); - assert_eq!(res.count, 3); + assert_eq!(res.count, 4); assert_eq!(res.address, buyer.to_string()); }