Skip to content
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

MintFT of x/collection overwrite the minted amount of to account #1104

Closed
4 tasks
zemyblue opened this issue Aug 31, 2023 · 1 comment
Closed
4 tasks

MintFT of x/collection overwrite the minted amount of to account #1104

zemyblue opened this issue Aug 31, 2023 · 1 comment
Assignees
Labels
A: bug Something isn't working C:x/collection
Milestone

Comments

@zemyblue
Copy link
Member

Summary of Bug

Even if we mint a to account with MintFT of x/collection multiple times, only the last minted amount is queried as the final balance. This is because the MintFT of x/collection overwrite a balance of the to account.

func (k Keeper) mintFT(ctx sdk.Context, contractID string, to sdk.AccAddress, classID string, amount sdk.Int) {
tokenID := collection.NewFTID(classID)
k.setBalance(ctx, contractID, to, tokenID, amount)
// update statistics
supply := k.GetSupply(ctx, contractID, classID)
k.setSupply(ctx, contractID, classID, supply.Add(amount))
minted := k.GetMinted(ctx, contractID, classID)
k.setMinted(ctx, contractID, classID, minted.Add(amount))
}

Version

v0.47.2
v0.48.0-rc2

Steps to Reproduce


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@zemyblue
Copy link
Member Author

zemyblue commented Sep 4, 2023

related in #1106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: bug Something isn't working C:x/collection
Projects
None yet
Development

No branches or pull requests

2 participants