30814 - [SC - Critical] Wrong calculation of boost amount in Voterpoke
Description
Brief/Intro
Vulnerability Details
/// @inheritdoc IVoter
function poke(uint256 _tokenId) public {
// Previous boost will be taken into account with weights being pulled from the votes mapping
uint256 _boost = 0;
if (msg.sender != admin) {
require(IVotingEscrow(veALCX).isApprovedOrOwner(msg.sender, _tokenId), "not approved or owner");
}
address[] memory _poolVote = poolVote[_tokenId];
uint256 _poolCnt = _poolVote.length;
uint256[] memory _weights = new uint256[](_poolCnt);
for (uint256 i = 0; i < _poolCnt; i++) {
_weights[i] = votes[_tokenId][_poolVote[i]];
}
_vote(_tokenId, _poolVote, _weights, _boost);
}Recommendation
Proof of Concept
Previous30800 - [SC - Critical] Stealing FLUX by claiming then merging position...Next30818 - [SC - Low] division before multiplication in theamountToRa...
Last updated
Was this helpful?