Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: low
Invalid

use of payable(address).transfer makes the application incompatible with smart contract wallets

Relevant Links

Summary

The application uses payable(address).transfer for ETH transfers. Perhaps because we wanted to avoid creating reentrancy vulnerabilities by calling into the contract payable(address).call{value: value_here}(""). This however, makes the application incompatible with smart contract wallets which might have some code run in their receive function. For example Gnosis Safe.

Impact

We can't withdraw ( TokenManager.withdraw ) or rescue ( Rescuable.rescue ) funds to smart contract wallets.

Tools Used

Manual review

Recommendations

  1. rather use payable(address).call{value: amount_to_transfer}("") for eth transfer and add the necessary checks-effects-interractions pattern and modifier to prevent reentrancy vulnerabilities.

  2. To completely eliminate the possibility of any reentrancy vulnerability through the transfer of eth, switch all the withdraw methods that implement payable(address).transfer to instead withdraw the wrapped native token which is an ERC20 token. For example WETH in the case of ethereum or wrapped matic in the Polygon. Switch all the methods that act as a currency ( Eth in the case of ethereum or matic in the case of polygon) deposit methods to receive the currency and convert it to the wrapped asset version before effectively depositing it with the appropriate accounting in the application. Highly recommended.

Updates

Lead Judging Commences

0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

[invalid] finding-TokenManager-withdraw-transfer-2300-gas

Invalid, known issues [Medium-2](https://github.com/Cyfrin/2024-08-tadle/issues/1)

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.