code-423n4 / 2021-11-streaming-findings

0 stars 0 forks source link

balance(dust) rewardsTokens may be unclaimable after endRewardLock #271

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

hubble

Vulnerability details

Impact

After endRewardLock, when all receipt token holders claim their rewardTokens, there may still be some balance(or dust) rewardTokens left, which will be NON-claimable by anyone. The mismatch in balance is because of the reward calculation accuracy, and virtualBalances used.

Proof of Concept

File :Locke.sol Contract / Function : Stream / earned Line : 469 function earned(TokenStream storage ts, uint256 currCumRewardPerToken) internal view returns (uint112) {

Contract / Function : Stream / rewardPerToken Line : 343 function rewardPerToken() public view returns (uint256) {

Tools Used

Manual review

Recommended Mitigation Steps

Similar to function claimFees, the governance contract of the factory can send the balance(dust) rewardTokens to the stream Creator after checking all the users ts.rewards == 0

brockelmore commented 2 years ago

this issue lacks detail - if its a dust issue, we are fine with it