Skip to content

Commit

Permalink
chore: apply tlin suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
r3v4s committed Dec 26, 2024
1 parent 72017da commit 227ea1e
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions launchpad/launchpad_deposit.gno
Original file line number Diff line number Diff line change
Expand Up @@ -482,22 +482,23 @@ func checkDepositConditions(project Project) {
for _, condition := range project.conditions {
if condition.minAmount == 0 {
continue
}

// check balance
var balance uint64
if condition.tokenPath == consts.GOV_XGNS_PATH {
balance = xgns.BalanceOf(a2u(caller))
} else {
// check balance
var balance uint64
if condition.tokenPath == consts.GOV_XGNS_PATH {
balance = xgns.BalanceOf(a2u(caller))
} else {
balance = common.BalanceOf(condition.tokenPath, caller)
}
if balance < condition.minAmount {
panic(addDetailToError(
errNotEnoughBalance,
ufmt.Sprintf("launchpad_deposit.gno__checkDepositConditions() || insufficient balance(%d) for token(%s)", balance, condition.tokenPath),
))
}
balance = common.BalanceOf(condition.tokenPath, caller)
}
if balance < condition.minAmount {
panic(addDetailToError(
errNotEnoughBalance,
ufmt.Sprintf("launchpad_deposit.gno__checkDepositConditions() || insufficient balance(%d) for token(%s)", balance, condition.tokenPath),
))
}
}

}

func checkProjectActive(project Project) bool {
Expand Down

0 comments on commit 227ea1e

Please sign in to comment.