-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(iro): refacor IRO creation fee #1632
Conversation
iroTokenBalance := k.BK.GetBalance(ctx, k.AK.GetModuleAddress(types.ModuleName), plan.TotalAllocation.Denom) | ||
err := k.BK.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(iroTokenBalance)) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// claim the fee token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we claim the tokens on creation instead
otherwise we need to handle the scenario where creationFee param changed
@@ -91,7 +87,8 @@ func validateCreationFee(i interface{}) error { | |||
return fmt.Errorf("invalid parameter type: %T", i) | |||
} | |||
|
|||
if !v.IsPositive() { | |||
// creation fee must be a positive integer greater than 1^18 (1 Rollapp token) | |||
if v.LT(math.NewIntWithDecimal(1, 18)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validation that creation fee is > 1
x/iro/keeper/create_plan.go
Outdated
return "", errorsmod.Wrap(gerrc.ErrInvalidArgument, "invalid cost for fee charge") | ||
} | ||
|
||
fee := sdk.NewCoin(appparams.BaseDenom, cost) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feeAmt and fee refer to 2 different things which I think is confusing.
Description
Closes #XXX
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.
PR review checkboxes:
I have...
Unreleased
section inCHANGELOG.md
godoc
commentsSDK Checklist
map
time.Now()
sendCoin
and notSendCoins
Full security checklist here
For Reviewer:
After reviewer approval: