ChoosingRam::isRamSelected bool is not updated in the increaseValuesOfParticipants function. Because of this, Ram can never call Dussehra::killRavana or Dussehra::withdraw functions and the organiser will overwrite the address of selectedRam with a new value.Description: By calling the ChoosingRam::increaseValuesOfParticipants function, users can change the characteristics of their NFTs. When an NFT has all the bools in the RamNFT::CharacteristicsOfRam set to true, the address of the owner of that NFT is designated as the ChoosingRam::selectedRam.
The problem here is that this function does not set the bool public isRamSelected; to true once this happens, therefore the contract's state is inconsistent.
Impact: A winner that has his address set as the selectedRam won't be able to call the Dussehra::killRavana or Dussehra::withdraw functions to claim his prize because the RamIsSelected modifier will always revert. Furthermore, once block.timestamp will exceed 1728691200, the organiser is able to call the ChoosingRam::selectRamIfNotSelected function, which will override the value of selectedRam.
Proof of Concepts: Input the test below in the Dussehra.t.sol file.
Test output
Recommended mitigation: Update the isRamSelected bool inside the ChoosingRam::increaseValuesOfParticipants when the address of selectedRam is set.
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.