52254 sc high arctoken theft beyond unclaimed yield during distribution
Description
Brief / Intro
Vulnerability Details
function distributeYieldWithLimit(
uint256 totalAmount,
uint256 startIndex,
uint256 maxHolders
)
external
onlyRole(YIELD_DISTRIBUTOR_ROLE)
nonReentrant
returns (uint256 nextIndex, uint256 totalHolders, uint256 amountDistributed)
{
// ...
for (uint256 i = 0; i < batchSize; i++) {
uint256 holderIndex = startIndex + i;
address holder = $.holders.at(holderIndex);
if (!_isYieldAllowed(holder)) {
continue;
}
uint256 holderBalance = balanceOf(holder); // <----- no balances snapshot
if (holderBalance > 0) {
uint256 share = (totalAmount * holderBalance) / effectiveTotalSupply;
if (share > 0) {
yToken.safeTransfer(holder, share);
amountDistributed += share;
}
}
}
// ...
}Impact Details
Proof of Concept
References
Previous51992 sc high dust accumulation in arctoken during yield distribution Next51989 sc low event restrictionscreated always emits msg sender as owner
Was this helpful?