Art Gobblers contest - Chom's results

Experimental Decentralized Art Factory By Justin Roiland and Paradigm.

General Information

Platform: Code4rena

Start Date: 20/09/2022

Pot Size: $100,000 USDC

Total HM: 4

Participants: 109

Period: 7 days

Judge: GalloDaSballo

Id: 163

League: ETH

Art Gobblers

Findings Distribution

Researcher Performance

Rank: 64/109

Findings: 1

Award: $55.20

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2022-09-artgobblers/blob/d2087c5a8a6a4f1b9784520e7fe75afa3a9cbdbe/src/ArtGobblers.sol#L432-L442 https://github.com/code-423n4/2022-09-artgobblers/blob/d2087c5a8a6a4f1b9784520e7fe75afa3a9cbdbe/src/ArtGobblers.sol#L866-L868

Vulnerability details

Impact

Minting legendary gobblers not clearing burned gobblers emissionMultiple (and other properties). getGobblerEmissionMultiple also returns the old emission rate although it is burned. Contracts that use getGobblerEmissionMultiple may be impacted by duplicated emission rates.

Proof of Concept

for (uint256 i = 0; i < cost; ++i) { id = gobblerIds[i]; if (id >= FIRST_LEGENDARY_GOBBLER_ID) revert CannotBurnLegendary(id); require(getGobblerData[id].owner == msg.sender, "WRONG_FROM"); burnedMultipleTotal += getGobblerData[id].emissionMultiple; emit Transfer(msg.sender, getGobblerData[id].owner = address(0), id); }

This block of code is responsible for burning gobbler. It never reset emissionMultiple and other properties of gobbler except owner.

It is still queryable here and can be used in any other part of code although it is burned

function getGobblerEmissionMultiple(uint256 gobblerId) external view returns (uint256) { return getGobblerData[gobblerId].emissionMultiple; }

You should delete getGobblerData[id] after it has been burned

for (uint256 i = 0; i < cost; ++i) { id = gobblerIds[i]; if (id >= FIRST_LEGENDARY_GOBBLER_ID) revert CannotBurnLegendary(id); require(getGobblerData[id].owner == msg.sender, "WRONG_FROM"); burnedMultipleTotal += getGobblerData[id].emissionMultiple; emit Transfer(msg.sender, getGobblerData[id].owner = address(0), id); delete getGobblerData[id]; }

#0 - Shungy

2022-09-28T18:07:26Z

This is informational as there is no harm in not deleting that variables.

#1 - GalloDaSballo

2022-10-09T18:32:43Z

I agree with the above, a burned token may still have properties for informational purposes.

The finding is correct in the sense that it may be desiderable to return a different value when a gobbler is burned, however this is a informational level finding

NC

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter