All ETH withdraws from the TokenManager will fail because the TokenManager will try to call the approve function in the CapitalPool contract sending the TokenManager address which would cause a revert in the transaction as the TokenManager contract doesn't have any approve function, this would block all ETH withdraws from the users.
When a user wants to withdraw his tokens (ETH, USDC, or any ERC20 accepted) from the tadle protocol, they have to call the withdraw function in the TokenManager contract, so the token manager contract can send the tokens to the user.
If a user tries to withdraw ETH from the TokenManager contract they have to send the address of the wrapped ETH, and then the withdraw function will try to transfer the WETH from the Capital Pool to the Token Manager, so later it can convert the WETH to ETH and send it to the user, but this flow has a problem in the internal _transfer function that will cause a revert and block all the ETH withdrawals from any user.
let's see the problem:
1.- First, the User tries to withdraw his ETH from the protocol and calls the withdraw function sending the WETH address as the token address.
2.- Then the withdraws function calls the internal _transfer function sending this data.
3.- if the TokenManager contract doesn't have an allowance, it will try to call the approve function in the CapitalPool contract, but it will send the address(this) instead of the WETH address to approve the TokenManager to transfer from the CapitalPool.
this mistake will cause a revert as the TokenManager doesn't have any approve function to be called, so the Tx will fail and block the ETH withdrawal from any user.
To show the bug I modified the test_ask_offer_turbo_eth test in the PreMarkets.t.sol contract adding a call to the TokenManager - withdraw function and add some console logs to the contracts to show the status of the contracts during the revert of the withdraw function call.
and this is the result of the function showing the call to withdraw revert with the ApproveFailed error blocking the ETH of the users in the platform.
Users can't withdraw ETH from the platform, because the Withdraw function of the TokenManager will revert and lock the user's ETH in the contract.
Manual Code Review
correct the call to the CapitalPool Approve function sending the correct address of the token to approve instead of the address of the TokenManager
If we consider the correct permissioned implementation for the `approve()` function within `CapitalPool.sol`, this would be a critical severity issue, because the withdrawal of funds will be permanently blocked and must be rescued by the admin via the `Rescuable.sol` contract, given it will always revert [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/CapitalPool.sol#L36-L38) when attempting to call a non-existent function selector `approve` within the TokenManager contract. The argument up in the air is since the approval function `approve` was made permisionless, the `if` block within the internal `_transfer()` function will never be invoked if somebody beforehand calls approval for the TokenManager for the required token, so the transfer will infact not revert when a withdrawal is invoked. I will leave open for escalation discussions, but based on my first point, I believe high severity is appropriate.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.