31077 - [SC - Critical] RevenueHandler counts unclaimed tokens as new r...
Description
Brief/Intro
Vulnerability Details
uint256 thisBalance = IERC20(token).balanceOf(address(this));
// If poolAdapter is set, the revenue token is an alchemic-token
if (tokenConfig.poolAdapter != address(0)) {
// Treasury only receives revenue if the token is an alchemic-token
treasuryAmt = (thisBalance * treasuryPct) / BPS;
IERC20(token).safeTransfer(treasury, treasuryAmt);
// Only melt if there is an alchemic-token to melt to
amountReceived = _melt(token);
// Update amount of alchemic-token revenue received for this epoch
epochRevenues[currentEpoch][tokenConfig.debtToken] += amountReceived;
} else {
// If the revenue token doesn't have a poolAdapter, it is not an alchemic-token
amountReceived = thisBalance;
// Update amount of non-alchemic-token revenue received for this epoch
epochRevenues[currentEpoch][token] += amountReceived;
}Impact Details
References
Proof of Concept
Previous31076 - [SC - Critical] checkpointTotalSupply can checkpoint before a t...Next31078 - [SC - High] withdraw doesnt claim all rewards before burnin...
Last updated
Was this helpful?