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
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.
The text was updated successfully, but these errors were encountered:
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
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 therequire
statement relies on balance checks after transferring tokens. If another user or transaction initiates a withdrawal or reduces the contract’s balance before thebalanceAfter
is read, the balance difference may fall below the expectedamount
, causing therequire
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 externalERC20
token contract. As a result, the tokens transferred into the contract duringsafeTransferFrom
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
The text was updated successfully, but these errors were encountered: