NoYield.sol
Tokens with fee on transfer are not supported
#142
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
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Handle
WatchPug
Vulnerability details
There are ERC20 tokens that charge fee for every
transfer()
ortransferFrom()
.In the current implementation,
NoYield.sol#lockTokens()
assumes that the received amount is the same as the transfer amount, and uses it to calculatesharesReceived
amounts.As a result, in
unlockTokens()
, later users may not be able to successfully withdraw their tokens, as it may revert at L141 for insufficient balance.https://github.com/code-423n4/2021-12-sublime/blob/9df1b7c4247f8631647c7627a8da9bdc16db8b11/contracts/yield/NoYield.sol#L93-L106
https://github.com/code-423n4/2021-12-sublime/blob/9df1b7c4247f8631647c7627a8da9bdc16db8b11/contracts/yield/NoYield.sol#L134-L144
Recommendation
Consider comparing before and after balance to get the actual transferred amount.
The text was updated successfully, but these errors were encountered: