Closed sherlock-admin2 closed 1 year ago
2 comment(s) were left on this issue during the judging contest.
panprog commented:
low, because this is the developers choice and the issue of courier being unable to claim rewards is documented and known beforehand, so if user is enrolled as courier he is assumed to know the possible problem
MohammedRizwan commented:
low severity as its a user mistake and user must understand before calling any function
bitsurfer
medium
enrollCourier
lack of share check open for user owning share to loss their rewardSummary
User's reward may lost due to change status from a regular user (or address) to courier
Vulnerability Detail
by design, couriers cannot claim rewards due to accounting issue, as described in the following function:
but in reality, there is open for possibility for a user (or address) who holds shares at somepoint intend to be a couriers. Noted that when they become a courier they can't claim rewards due to accounting issue. But, since they holds a share, before enrolling as Courier, they need be a way to ensure they already claim their rewards. This may seems like a user's mistakes not 'claimRewards' before
In short, when performing
enrollCourier
, the function need to check whether the proposed address holds some shares, if yes, then need to return their reward first before finally assign them as Courier.Impact
User's reward may lost due to change status from a regular user (or address) to courier
Code Snippet
https://github.com/sherlock-audit/2023-10-aloe/blob/main/aloe-ii/core/src/Factory.sol#L254-L266
Tool used
Manual Review
Recommendation
Add a check on
enrollCourier
if they have shares, they reward need to be distributed first before changing their status to be a courierDuplicate of #134