You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usual dust buildup from distributing to usual* will be stuck in the Distribution module
Summary
The amount of Usual tokens minted by the distributionModule to distribute to UsualSP will always be slightly higher than the actual amount of Usual token taken by the UsualSP contract. The reason for this is that UualSP adjusts the amount before transferring the tokens from the distribution module.
Hence , there'll be a dust buildup of minted Usual tokens in the distribution module.
Root Cause
In RewardAccrualBase::_startRewardDistribution we see that the rewardAmount is adjusted (i.e. adjustedAmount = amount / duration * duration) before transferring the tokens into the contract. Due to this adjustment not all the Usual tokens minted by the distributionModule will be distributed by UsualSP.
The Usual token is a standard ERC20 so the dust(rewardAmount - adjustedAmount) will be little for a single ddistribution, however, given the distribution frequency(daily) this amount can accumulate over time and will be stuck in the distribution module.
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
Medium - dust buildup of Usual tokens will be stuck in the distribution module
PoC
No response
Mitigation
Amount should be adjusted in the DistributionModule in _distributeToUsualStarBucket before minting the Usual tokens
There can be a sweep functionality to sweep the dust.
After minting the tokens startRewardDistribution can be called with usual.balanceOf(address(this)) as the rewardAmount to account for previously undistributed tokens. This approach will also distribute donations though
The text was updated successfully, but these errors were encountered:
sherlock-admin4
changed the title
Lively Coffee Fish - Usual dust buildup from distributing to usual* will be stuck in the Distribution module
Honour - Usual dust buildup from distributing to usual* will be stuck in the Distribution module
Nov 19, 2024
Honour
Medium
Usual dust buildup from distributing to usual* will be stuck in the Distribution module
Summary
The amount of Usual tokens minted by the distributionModule to distribute to UsualSP will always be slightly higher than the actual amount of Usual token taken by the UsualSP contract. The reason for this is that UualSP adjusts the amount before transferring the tokens from the distribution module.
Hence , there'll be a dust buildup of minted Usual tokens in the distribution module.
Root Cause
In
RewardAccrualBase::_startRewardDistribution
we see that the rewardAmount is adjusted (i.e. adjustedAmount = amount / duration * duration) before transferring the tokens into the contract. Due to this adjustment not all the Usual tokens minted by the distributionModule will be distributed by UsualSP.The Usual token is a standard ERC20 so the dust(rewardAmount - adjustedAmount) will be little for a single ddistribution, however, given the distribution frequency(daily) this amount can accumulate over time and will be stuck in the distribution module.
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
Medium - dust buildup of Usual tokens will be stuck in the distribution module
PoC
No response
Mitigation
_distributeToUsualStarBucket
before minting the Usual tokensstartRewardDistribution
can be called with usual.balanceOf(address(this)) as the rewardAmount to account for previously undistributed tokens. This approach will also distribute donations thoughThe text was updated successfully, but these errors were encountered: