#42388 [SC-Insight] Discrepancy between number of Yeetback winners in contract and documentation
Description
Brief/Intro
function draftWinners(uint256 randomNumber, uint256 round) private {
uint256 potValue = potForRound[round];
uint256 nrOfYeets = yeetsInRound[round].length;
uint256 nrOfWinners = 10;
uint256 winnings = potValue / nrOfWinners;
amountToWinners[round] = winnings;
for (uint256 i; i < nrOfWinners; i++) {
uint256 randomDataNumber = uint256(keccak256(abi.encodePacked(randomNumber, i)));
uint256 winningYeetIndex = randomDataNumber % nrOfYeets; // index of the winning yeet
address winnerAddress = yeetsInRound[round][winningYeetIndex];
// Update amountToWinners and amountOfWins
amountOfWins[round][winnerAddress] += 1;
emit YeetbackWinner(round, winnerAddress, winnings, winningYeetIndex);
}
}Vulnerability Details
Impact Details
References
Proof of Concept
Proof of Concept
Previous#42382 [SC-Critical] Calling `StakeV2::executeRewardDistributionYeet` by manager during an ongoing unstaking period for stakers can result in them being unable to unstake permanentlyNext#42407 [SC-Low] Updating MAX_CAP_PER_WALLET_PER_EPOCH_FACTOR impacts unclaimed rewards of past epochs
Was this helpful?