You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2023. It is now read-only.
github-actionsbot opened this issue
Mar 1, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
Some ERC20 token implementations have a fee that is charged on each token transfer. This means that the transferred amount isn't exactly what the receiver will get.
The protocol currently uses these tokens:
ERC20: [whitelisted - current list of supported assets: USDC, DAI, ALCX, BAL, CRV, ICHI, SUSHI, WBTC, WETH]
If one of this tokens will start charge fee on transfers, the logic will be broken.
Vulnerability Detail
Many of these tokens use proxy pattern (and USDT too). It's quite probably that in one day one of the tokens will start charge fees. Or you would like to add one more token to whitelist and the token will be with fees.
Impact
Malicious users can drain the tokens in the contract by constantly creating and canceling trades.
Improve support for fee on transfer type of ERC20. When pulling funds from the user using safeTransferFrom and safeTransfer the usual approach is to compare balances pre/post transfer, like so:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
tsvetanovv
medium
Some ERC20 tokens deduct a fee on transfer
Summary
Some ERC20 token implementations have a fee that is charged on each token transfer. This means that the transferred amount isn't exactly what the receiver will get.
The protocol currently uses these tokens:
If one of this tokens will start charge fee on transfers, the logic will be broken.
Vulnerability Detail
Many of these tokens use proxy pattern (and USDT too). It's quite probably that in one day one of the tokens will start charge fees. Or you would like to add one more token to whitelist and the token will be with fees.
Impact
Malicious users can drain the tokens in the contract by constantly creating and canceling trades.
Code Snippet
https://github.com/sherlock-audit/2023-02-blueberry/blob/main/contracts/BlueBerryBank.sol#L22
Tool used
Manual Review
Recommendation
Improve support for fee on transfer type of ERC20. When pulling funds from the user using
safeTransferFrom
andsafeTransfer
the usual approach is to compare balances pre/post transfer, like so:Duplicate of #153
The text was updated successfully, but these errors were encountered: