-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[token] fix collection supply underflow #5096
Conversation
destroy_collection_data(table::remove(&mut collections.collection_data, collection_data.name)); | ||
if (collection_data.maximum > 0) { | ||
collection_data.supply = collection_data.supply - 1; | ||
// delete the collection data if the collection supply equals 0 |
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.
Does it make sense to delete the collection? This would force the creator to have to re-create it later if they want to mint the tokens, which costs a lot more gas.
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.
create collection only create a collectData, which is about 0.002 APT as well. we probably want to be more proactive in cleaning unused data now since there is no rent
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.
That's a good point.
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.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
Description
Test Plan
This change is