-
Notifications
You must be signed in to change notification settings - Fork 525
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 next edition calculation for burned items #1126
Conversation
Workflow |
Workflow |
Workflow |
Workflow |
Workflow |
Burning an edition decreases the supply, which breaks the way Fixed Price Sale currently calculates the next edition number. this PR uses the passed in edition marker and finds the first available edition on that particular marker. It has to figure out which edition marker is passed in, in order to determine the correct edition number, so must do a loop deriving the edition marker PDAs and comparing them against what is passed in. For large edition numbers this might use up available compute units.
In addition, it adds a
buy_v2
that requires passing in the edition marker number in edition to the edition marker PDA. This allows a single derivation to be made to calculate the edition number, but would be a breaking change if applied tobuy
. Since the accounts are identical you continue to use theBuy
account struct and only use theBuyV2
instruction struct for the additional argument. This allows reducing code duplication.