The ram
field of the RamNFT::CharacteristicsOfRam
struct is not updated when an NFT is transferred from one user to another using ERC721
functions.
The ram
field of the RamNFT::CharacteristicsOfRam
struct is supposed to hold the address of the owner of the NFT. This field is first populated when an NFT is minted via Dussehra::enterPeopleWhoLikeRam
, and is then used at several other places:
in ChoosingRam::increaseValuesOfParticipants
, to specify the selected Ram,
in ChoosingRam::selectRamIfNotSelected
, to specify the selected Ram,
indirectly in Dussehra::withdraw
, which is accessible only for the selected Ram.
However, the protocol does not take into account that users can sell/buy or transfer Ram NFTs between each other, and does not update the CharacteristicsOfRam.ram
field when ownership changes.
This is demonstarted by the following test:
If userA
calls Dussehra::enterPeopleWhoLikeRam
and gets a Ram NFT with tokenId = x
, but then sells/transfers this NFT to userB
, then
userA
can still call ChooseRam::increaseValuesOfParticipants
as if the NFT with tokenId = x
was still his,
if tokenId = x
gets selected as Ram, userA
will get 50% of the prize pool, not userB
.
Manual review, Foundry.
Ensure that CharacteristicsOfRam.ram
is modified on transfers by modifying RamNFT
as follows:
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.