The enterPeopleWhoLikeRam
function in the Dussehra
contract lacks time constraints, allowing participants to enter even after the event has concluded. This can lead to funds being permanently locked in the contract and participants paying for an event that has already ended.
Dussehra::enterPeopleWhoLikeRam
function allows anyone to enter the event and mint Ram NFT for entrance fee. Problem arises because function does not have any limitations when it can be called, so people could enter event even after it's finished and all funds will be stuck forever in contract. Also people could think they entered the event but then realize event is finished and their money is wasted.
Two players mint their Ram NFTs.
Organiser calls ChoosingRam::selectRamIfNotSelected
function and selects one of player as selected Ram.
Random caller calls Dussehra::killRavana
function to kill Ravana.
Selected Ram calls Dussehra::withdraw
function to withdraw his reward. Event is finished.
Warp into future. Player3 can still enter the event by calling Dussehra::enterPeopleWhoLikeRam
function.
Assert that player3 spent money for entrance fee.
Place the following test into Dussehra.t.sol
.
When participants enter the event after event is finished, funds will be stuck forever in contract. Also it would confuse people because they could think they entered the event correctly but then realize event is finished and they can't be selected Ram.
Manual review
Add modifier RamIsNotSelected
to Dussehra::enterPeopleWhoLikeRam
function to prevent that function can be called after event is finished.
It is the user's responsibility to check the date of the event.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.