51658 sc high yield distribution in batches let the same tokens collect rewards in multiple batches stealing yield from other users
Description
Brief / Intro
Vulnerability Details
// arc/ArcToken.sol L530-L546
for (uint256 i = 0; i < batchSize; i++) {
uint256 holderIndex = startIndex + i;
address holder = $.holders.at(holderIndex);
if (!_isYieldAllowed(holder)) {
continue;
}
uint256 holderBalance = balanceOf(holder);
if (holderBalance > 0) {
uint256 share = (totalAmount * holderBalance) / effectiveTotalSupply;
if (share > 0) {
yToken.safeTransfer(holder, share);
amountDistributed += share;
}
}
}Impact Details
Proof of Concept
Previous51912 sc high mismatched rounding rules in reward logic library results in two fold loss of earningsNext52084 sc high unstaking before reward token removal leads to incorrect reward accrual on re addition
Was this helpful?