31425 - [SC - Medium] Users can call reset on their token even if the...
Previous31420 - [SC - Insight] No array lengths check in VotersolclaimBribesNext31430 - [SC - Insight] QA
Last updated
Was this helpful?
Was this helpful?
require(poolVote[_tokenId].length > 0, "No active votes");function testBlockVotingForBuyers() public {
// Admin creates lock
uint256 tokenId = createVeAlcx(admin, TOKEN_1, MAXTIME, false);
// Admin calls reset on his own token
vm.prank(admin);
voter.reset(tokenId);
// token's `lastVoted` is now, this is wrong as there's no active vote
assertEq(voter.lastVoted(tokenId), block.timestamp);
// Admin sends/sells the token to beef
vm.prank(admin);
veALCX.safeTransferFrom(admin, beef, tokenId);
address[] memory pools = new address[](1);
pools[0] = alUsdPoolAddress;
uint256[] memory weights = new uint256[](1);
weights[0] = 5000;
// Beef votes revert as he can't vote in this epoch (last voted was updated in `reset`)
vm.prank(beef);
vm.expectRevert(abi.encodePacked("TOKEN_ALREADY_VOTED_THIS_EPOCH"));
voter.vote(tokenId, pools, weights, 0);
}