Beginner FriendlyFoundryGameFi
100 EXP
View results
Submission Details
Severity: medium
Valid

Matenitsa tokens can be sold during voting period

Summary

Winner of the voting will receive health tokens..

Vulnerability Details

voteForMartenitsa() function does not check if the NFT is listed for sale or not.

Anyone can check the NFT with highest voting and can buy it.

Impact

function testStartVotingSellDuringVotingPeriod() public listMartenitsa {
vm.warp(block.timestamp);
voting.startVoting();
assert(voting.startVoteTime() == 1);
vm.prank(bob);
voting.voteForMartenitsa(0);
vm.prank(chasy);
martenitsaEvent.approve(address(marketplace), 0);
vm.prank(bob);
marketplace.buyMartenitsa{value: 1 wei}(0);
assert(martenitsaEvent.ownerOf(0) == bob);
assert(martenitsaEvent.getCountMartenitsaTokensOwner(bob) == 1);
assert(martenitsaEvent.getCountMartenitsaTokensOwner(chasy) == 0);
assert(voting.getVoteCount(0) == 1);
}

Tools Used

foundry

Recommendations

It's recommended to add check in the function for the NFTs which are on the sale list.

Updates

Lead Judging Commences

bube Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Unable to receive reward

Support

FAQs

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