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

`MartenitsaVoting:voteForMartenitsa` user can vote even startvoting is not started from the genesis block to the 86400 blocks.

Summary

MartenitsaVoting:voteForMartenitsa user can vote even startvoting is not started from the genesis block to the 86400 blocks, what represent approximatively 14 days.

Vulnerability Details

In MartenitsaVoting contract even if startVoteTime == 0 ; instead of startVoteTime = block.timestamp; it's possible for users to pass the require control structure in MartenitsaVoting:voteForMartenitsa during the first 86400 blocks (~14days).

/**
* @notice Function to vote for martenitsa of the sale list.
* @param tokenId The tokenId of the martenitsa.
*/
function voteForMartenitsa(uint256 tokenId) external {
require(!hasVoted[msg.sender], "You have already voted");
require(block.timestamp < startVoteTime + duration, "The voting is no longer active");
list = _martenitsaMarketplace.getListing(tokenId);
require(list.forSale, "You are unable to vote for this martenitsa");
hasVoted[msg.sender] = true;
voteCounts[tokenId] += 1;
_tokenIds.push(tokenId);
}

Impact

Users can vote during the first 14 days even if voting is not started

Tools Used

Manuel review

Recommendations

Add a second check in require structure control in MartenitsaVoting:voteForMartenitsa

require(startVoteTime != 0 && block.timestamp < startVoteTime + duration, "The voting is no longer active");
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.