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

s0x0mtee - Risk of Fund Loss Due to Unexpected Withdrawals #1015

Open
sherlock-admin2 opened this issue Nov 25, 2024 · 0 comments
Open

s0x0mtee - Risk of Fund Loss Due to Unexpected Withdrawals #1015

sherlock-admin2 opened this issue Nov 25, 2024 · 0 comments

Comments

@sherlock-admin2
Copy link

sherlock-admin2 commented Nov 25, 2024

s0x0mtee

High

Risk of Fund Loss Due to Unexpected Withdrawals

Summary

In the provided contract, users risk losing funds due to an issue in the deposit function where the require statement relies on balance checks after transferring tokens. If another user or transaction initiates a withdrawal or reduces the contract’s balance before the balanceAfter is read, the balance difference may fall below the expected amount, causing the require statement to fail. This failure reverts the transaction and rolls back any state changes within the contract, but does not revert the external token transfer, as it is executed by the external ERC20 token contract. As a result, the tokens transferred into the contract during safeTransferFrom remain locked, leaving the sender unable to recover them unless a specific recovery mechanism exists.

https://github.com/sherlock-audit/2024-11-debita-finance-v3/blob/main/Debita-V3-Contracts/contracts/Non-Fungible-Receipts/TaxTokensReceipts/TaxTokensReceipt.sol#L59-L89

Root Cause

No response

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

No response

PoC

No response

Mitigation

No response

@sherlock-admin3 sherlock-admin3 changed the title Broad Ash Cougar - Risk of Fund Loss Due to Unexpected Withdrawals s0x0mtee - Risk of Fund Loss Due to Unexpected Withdrawals Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant