-
Notifications
You must be signed in to change notification settings - Fork 6
t.aksoy - Users can lose rewards if they call claimRewards() before rewardsToken assigned #82
Comments
2 comment(s) were left on this issue during the judging contest. panprog commented:
MohammedRizwan commented:
|
Probably low severity, but we're going to fix it anyway, so should probably pay out some reward. Not sure of Sherlock's rules on that. |
I am closing the report because I think low severity would be more appropriate. It is also an admin mistake which is invalid according to Sherlock docs |
Fixed in aloelabs/aloe-ii#212 |
Mitigation Review: While this issue is not considered a valid High / Medium as per Sherlock's rules, the protocol team still decided to fix it. The issue is fixed since it's now required that |
t.aksoy
medium
Users can lose rewards if they call claimRewards() before rewardsToken assigned
Summary
users can lost rewards if they call
claimRewards()
before rewardsToken assignedVulnerability Detail
safeTransfer()
insolmate
library don't check the existence of code at the token address. Because of this ifsafeTransfer()
called on a token address that doesn't have a contract in it will always return success.rewardsRates and rewardsToken is initially zero. if the protocol intends to reward early users and sets the rewards rate before deploying the actual reward token, users begin accumulating rewards.
When a user checks their rewards using
lender.rewardsOf(address)
and attempts to claim those rewards usingclaimRewards()
, this wont fail. Because of thesafeTransfer()
function which returns true whenrewardsToken
is not set. As a result, users can lose their rewards.here is the POC:
Impact
User can lost their initial rewards
Code Snippet
https://github.com/sherlock-audit/2023-10-aloe/blob/b60c21af24738d517941f18f7caa8c7272f771c5/aloe-ii/core/src/Factory.sol#L242
Tool used
Manual Review
Recommendation
Add a check for rewardsToken in
claimRewards()
The text was updated successfully, but these errors were encountered: