-
Notifications
You must be signed in to change notification settings - Fork 0
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
A gobbler can be burned for a legendary one before revealed resulting in loss of emission multiple #254
Comments
The warden has shown how, the current system for minting a legendary gobbler will allow burning non-revealed gobblers, with the negative result of getting no multiples from them. In a situation in which all burned gobblers are non-revealed, the legendary gobbler will have a 0 multiple. In judging this finding there's 2 key assumptions I'm making:
This to me means that while the finding is valid and correct, it requires the conditionality of the user burning its own gobblers of its own volition (similar to sending to 0xDead), while purposefully (or recklessly) getting a 0 multiple out of it. It may be ideal to ensure that the multiple achieved from minting the legendary gobbler is non-zero, however, the conditionality of the "sacrifice", as well as the loss of "yield" and not of the Legendary Gobbler, lead me to believe this is a Medium Severity finding. |
This is intended behaviour. The value of a legendary gobbler is not only the emission multiple increase, but also the fact that it's a very rare (max 10) token. We don't want to prevent the use of unrevealed gobblers because we believe in giving users the choice. Some may think it's worth it to lose some future emissions in order to ensure they can own a legendary. |
Will re-evaluate with the context provided by the Sponsor |
With the added information given by the sponsor I must agree that the loss of Gobbleer, Goo, etc.. can be worth it to get a Legendary Gobbler. Ultimately the protocol allows people to decide, and some may decide that getting the Legendary is worth loosing the emissions multiple. Given that perspective, I think the finding is still valid but I will downgrade to Low Severity. End users should be aware that they can burn their L |
Lines of code
https://github.com/code-423n4/2022-09-artgobblers/blob/d2087c5a8a6a4f1b9784520e7fe75afa3a9cbdbe/src/ArtGobblers.sol#L439
https://github.com/code-423n4/2022-09-artgobblers/blob/d2087c5a8a6a4f1b9784520e7fe75afa3a9cbdbe/src/ArtGobblers.sol#L662
Vulnerability details
Impact
A gobbler can be burned for a legendary one before its reveal. This will make the user lose his emission multiple, because it won't be added to the sum when it is calculated in the
ArtGobblers.mintLegendaryGobbler()
function.In addition, because the new owner of this gobbler will be the zero address, when the gobbler will be revealed the emission multiple, which will be added to the owner of the gobbler, will be added to the zero address, resulting in the zero address accumulating virtual goo balance. This is an unwanted behavior, since this goo balance will be locked and unreachable.
Proof of Concept
I wrote a PoC in foundry to show that it is possible for an innocent user to lose his emission multiple, and for the zero address to gain emission multiple. It uses some of the helpers from the
ArtGobblers.t.sol
file, so to test it easily you can simply add it to the contract in that file.Output:
Tools Used
Manual audit & foundry for the PoC
Recommended Mitigation Steps
Consider allowing the burn of only revealed token, or keep a record of the original owner to add the emission multiple to instead of adding to the current owner.
If the loss of emission multiple is a wanted behavior, the zero address accumulating virtual goo balance will still be a problem, which can be fixed by adding the emission multiple in the
revealGobblers
function only if the owner is not the zero address.The text was updated successfully, but these errors were encountered: