Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eeyore - Fee on transfer tokens will break the deposit process #157

Closed
sherlock-admin4 opened this issue Jun 27, 2024 · 0 comments
Closed
Labels
Non-Reward This issue will not receive a payout Sponsor Disputed The sponsor disputed this issue's validity

Comments

@sherlock-admin4
Copy link
Contributor

sherlock-admin4 commented Jun 27, 2024

eeyore

Medium

Fee on transfer tokens will break the deposit process

Summary

The project has mentioned that in the future, USDT might be used as an underlying token. Deposits are currently accounted for by the intended amount, not the actual amount transferred via the safeTransferFrom() function.

Vulnerability Detail

Example:

  1. USDT updates its fee-on-transfer setting to 0.03%.
  2. Alice deposits 10,000 USDT.
  3. Alice's deposit is accounted for as 10,000 USDT, but in reality, only 9,997 USDT is transferred.

Impact

While this is a highly unlikely scenario, if USDT turn-on its fee or any other token with a fee-on-transfer mechanism is used in the future, the deposit() function will work incorrectly.

Code Snippet

https://github.com/sherlock-audit/2024-06-mellow/blob/main/mellow-lrt/src/Vault.sol#L328-L334

Tool used

Manual Review

Recommendation

Deposits should be accounted on the amount excluding the fee, i.e., the amount the contract actually receives. This can be done by subtracting the pre-contract balance from the post-contract balance.

Duplicate of #129

@sherlock-admin3 sherlock-admin3 changed the title Genuine Rosewood Beaver - Wrong amount used in _stethToWsteth would cause revert due to stEth's 1-2 wei less edge case. Fee on transfer tokens will break the deposit process Jun 28, 2024
@sherlock-admin3 sherlock-admin3 added the Sponsor Disputed The sponsor disputed this issue's validity label Jun 30, 2024
@github-actions github-actions bot changed the title Fee on transfer tokens will break the deposit process Square Mint Ape - Fee on transfer tokens will break the deposit process Jul 6, 2024
@github-actions github-actions bot closed this as completed Jul 6, 2024
@github-actions github-actions bot added the Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label label Jul 6, 2024
@sherlock-admin3 sherlock-admin3 changed the title Square Mint Ape - Fee on transfer tokens will break the deposit process eeyore - Fee on transfer tokens will break the deposit process Jul 15, 2024
@sherlock-admin3 sherlock-admin3 added Non-Reward This issue will not receive a payout and removed Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Non-Reward This issue will not receive a payout Sponsor Disputed The sponsor disputed this issue's validity
Projects
None yet
Development

No branches or pull requests

2 participants