Art Gobblers contest - tonisives'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: 34/109

Findings: 2

Award: $525.56

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
duplicate
2 (Med Risk)

Awards

470.3582 USDC - $470.36

External Links

Lines of code

https://github.com/code-423n4/2022-09-artgobblers/blob/main/src/ArtGobblers.sol/#L562

Vulnerability details

Impact

If VRF sunsets/becomes unresponsive while you are in the middle of waiting for a seed, the Random Provider can never be upgraded. This means you can never call revealGobblers again, because gobblerRevealsData.waitingForSeed is stuck in true state.

POC

upgradeRandProvider requires gobblerRevealsData.waitingForSeed to be false.

function upgradeRandProvider(RandProvider newRandProvider) external onlyOwner {
    // Revert if waiting for seed, so we don't interrupt requests in flight.
    if (gobblerRevealsData.waitingForSeed) revert SeedPending();
    ...

gobblerRevealsData.waitingForSeed can only be set to false in acceptRandomSeed. This method requires that the caller is the randomness provider.

function acceptRandomSeed(bytes32, uint256 randomness) external {
    // The caller must be the randomness provider, revert in the case it's not.
    if (msg.sender != address(randProvider)) revert NotRandProvider();

    ...

This means that if the VRF sunsets while you are waiting for a random seed, you can never upgrade your random provider. acceptRandomSeed will never be called and waitingForSeed will never be set to false.

It is possible that VRF1 will stop accepting randomness requests when sunsetting. However, ChainLink is a third party, and should not be relied upon for the functioning of this project.

ChainLink could also have issues where their system stops working and they need to upgrade their contracts. Then the ArtGobblers will also be stuck, because you need to upgrade the ChainlinkV1RandProvider. This could not be done because the waitingForSeed is stuck in true state.

Tools used

vscode

Remove if (gobblerRevealsData.waitingForSeed) revert SeedPending(); in upgradeRandProvider (https://github.com/code-423n4/2022-09-artgobblers/blob/main/src/ArtGobblers.sol/#L562)

Other option is to add a delay (24 hours for example), after which random provider can be upgraded, even if gobblerRevealsData is waiting for a seed.

#0 - GalloDaSballo

2022-10-06T19:27:36Z

claimGobbler - team needs to make 300 extra wallets to claim their tokens

Teams has the reserve

consider adding update Chainlink fee method

Good idea but I think it's invalid as there's a wrapper contract that enables dealing with it

VRF1 is deprecated

See above

disable PagesERC721.approve/setApprovalForAll , since it is not used in the transferFrom function

R

disable gobbling of ERC1155

R

I'd assume if they wanted to force only gobbling of pages, they'd hardcode the address

Neat report with good intentions, lacks nuance and more findings, good start

#1 - GalloDaSballo

2022-10-06T19:27:43Z

2R

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