Skip to content
This repository was archived by the owner on Jan 12, 2025. It is now read-only.

NoOne - Missing check for zero amount #475

Closed
sherlock-admin2 opened this issue Jul 15, 2024 · 0 comments
Closed

NoOne - Missing check for zero amount #475

sherlock-admin2 opened this issue Jul 15, 2024 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A Medium severity issue. Reward A payout will be made for this issue

Comments

@sherlock-admin2
Copy link

sherlock-admin2 commented Jul 15, 2024

NoOne

Medium

Missing check for zero amount

Summary

In the documentation, it is mentioned that Any type of ERC20 token. Pools are permissionless. So users can open pools even with weird tokens. Some tokens (e.g. LEND) revert when transferring a zero value amount. example: RevertZero.sol. This introduces a risk related to revert on 0 amount

Vulnerability Detail

Impact

Revert on Zero Amount: When balance is zero, the safeTransfer and safeTransferFrom method from most ERC20 token contracts will revert. This behavior is intended to prevent unintentional transfers of zero tokens, which could be seen as an error in many token implementations.

Code Snippet

emergencyWithdraw

emergencyWithdraw

fundAndBribe

Tool used

Manual Review

Recommendation

To handle revert on zero amount , modify the functions to check the actual amount before safeTransfer and safeTransferFrom

Duplicate of #545

@github-actions github-actions bot added duplicate Medium A Medium severity issue. labels Jul 21, 2024
@sherlock-admin2 sherlock-admin2 added the Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label label Jul 22, 2024
@sherlock-admin4 sherlock-admin4 changed the title Blurry White Orca - Missing check for zero amount NoOne - Missing check for zero amount Jul 29, 2024
@sherlock-admin4 sherlock-admin4 added the Reward A payout will be made for this issue label Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A Medium severity issue. Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

2 participants