Users may lose rewards to other users if rewards are given as fee-on-transfer tokens #176
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Lines of code
https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/ExtraRewardsDistributor.sol#L87-L98
Vulnerability details
Impact
If rewards are given in fee-on-transfer tokens, users may get no rewards, breaking functionality
Med: Assets not at direct risk, but the function of the protocol or its availability could be impacted, or :::leak value with a hypothetical attack path with stated assumptions:::, but external requirements.
(emphasis mine)
The underlying BAL protocol support fee-on-transfer tokens, so so should Aura
Proof of Concept
https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/ExtraRewardsDistributor.sol#L87-L98
If a fee is charged the total amount available to be transferred later will be less than the
_amount
passed in.Consider the following scenario:
User A holds 98% of the total supply of vlBAL (the system is being bootstrapped)
User B holds 1%
User C holds 1%
_token
is given out as a reward. It is a fee-on-transfer token with a fee of 2%https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/ExtraRewardsDistributor.sol#L87-L98
Tools Used
Code inspection
Recommended Mitigation Steps
Measure the contract balance before and after the transfer, and use the difference as the amount, rather than the stated amount
The text was updated successfully, but these errors were encountered: