Locking.sol does not handle Fee-on-transfer tokens #5
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
insufficient quality report
This report is not of sufficient quality
🤖_primary
AI based primary recommendation
🤖_05_group
AI based duplicate group recommendation
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2024-10-loopfi/blob/main/src/Locking.sol#L59-L66
Vulnerability details
Impact
If the underlying token for Locking.sol is a Fee-on-transfer token, the protocol would not work as expected. Users may be unable to withdraw their tokens.
Bug Description
Note: This is a new issue that was introduced by the latest code diff (Doesn't exist in the 2024-07 Loopfi contest).
When users are calling
deposit()
, thedeposits[msg.sender]
is updated with the_amount
that user passed in. However,_amount
may not be the exact amount of tokens the protocol received, due to fee-on-transfer.This means for each user, the accounting of his token is larger than expected. This would be an issue when user tries to withdraw tokens.
Proof of Concept
N/A
Tools Used
Manual Review
Recommended Mitigation Steps
Assessed type
ERC20
The text was updated successfully, but these errors were encountered: