Skip to content

Commit 78d2a05

Browse files
committed
Make exact staking amounts count for the higher tier
1 parent 03eed56 commit 78d2a05

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

contracts/vip/minter/src/contract.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ pub fn mint(
167167
let tiers = TIERS.load(deps.storage)?;
168168
let index = tiers
169169
.iter()
170-
.position(|&x| x >= staked_amount)
170+
.position(|&x| x > staked_amount)
171171
.unwrap_or(tiers.len().saturating_sub(1));
172172
let base_uri = BASE_URI.load(deps.storage)?;
173173
let token_uri = Some(format!("{}/{}", base_uri, index));
@@ -210,7 +210,7 @@ pub fn update(
210210
let tiers = TIERS.load(deps.storage)?;
211211
let index = tiers
212212
.iter()
213-
.position(|&x| x >= staked_amount)
213+
.position(|&x| x > staked_amount)
214214
.unwrap_or(tiers.len().saturating_sub(1));
215215

216216
let base_uri = BASE_URI.load(deps.storage)?;
@@ -339,7 +339,7 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
339339

340340
let index = tiers
341341
.iter()
342-
.position(|&x| x >= staked_amount)
342+
.position(|&x| x > staked_amount)
343343
.unwrap_or(tiers.len().saturating_sub(1));
344344

345345
Ok(to_json_binary(&TierResponse {

0 commit comments

Comments
 (0)