Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

Not possible to select the Ram if token counter is 0

Vulnerability Details

In the function 'selectRamIfNotSelected' in the contract 'ChoosingRam' if 'ramNFT.tokenCounter' is 0, the call will be reverted because is not possible in solidity to utilize modules with 0.

##PoC

function test_cantSelectRamIfNotSelected_tokenIdIs0() public {
vm.startPrank(address(this));
ramNft.setChoosingRamContract(address(choosingRam));
vm.warp(1728691200);
vm.expectRevert();
choosingRam.selectRamIfNotSelected();
}

Impact

If 'ramNFT.tokenCounter' is 0 the function 'selectRamIfNotSelected' will reverts, if this will revert this mean will be not possible to set correctly the ram (in any way) and will not possible to continue with the protocol.

Tools Used

Manual Review

Recommendations

Add a logic in the contract 'ChoosingRam' that allows to continue with the protocol also if the ram can't be selected. (For example add a function that allows the organizer to emit an event that says if the event is finished or not and if there has been a winner / selected ram).

Updates

Lead Judging Commences

bube Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.