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

Fix budget issue with Nested NFTs #23

Merged
merged 1 commit into from
Dec 14, 2022
Merged

Conversation

HashWarlock
Copy link

Description

There are 2 problems with the current Budget trait:

  1. NFTs are currently allowed to mint and send NFTs to a parent NFT that can meet up to the threshold of NestingBudget::get() + 1. This allows for NFTs queries like lookup_root_owner to return errors like TooManyRecursions. Having this error is okay, but the NFTs should be prevented from being minted to or sent to a parent NFT if the Budget threshold is met.

  2. Currently the code will do a calculation on functions like burn_nft and this will perform an arithmetic subtraction at the end of the function, but this should be added as a field in the Value type & implement a function from Budget to get the budget that has been consumed and budget that is left.

Target

  • Fix minting/sending NFTs that exceed the threshold of NestingBudget::get() value.
  • Add fields names budget_consumed and budget_left` to track & through errors is an overflow is detected.
  • Add functions in Budget trait to get the 2 new fields.

@HashWarlock
Copy link
Author

@Index0011 how does this look? Think it is okay to merge now?

@HashWarlock HashWarlock merged commit dca6475 into polkadot-v0.9.33 Dec 14, 2022
@Index0011
Copy link

LGTM,I think

@HashWarlock HashWarlock deleted the fix-budget branch December 20, 2022 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants