The current implementation in the token transfer logic(tillIn
function in TokenManager
contract) does not allow users to use Wrapped Ether (WETH) when tokenAddress
is equal to wrappedNativeToken
. Instead, the contract expects the user to send Ether (ETH) directly. This limitation forces users to convert WETH back to ETH before making transactions, which can be cumbersome and inconvenient, particularly in scenarios where users prefer to work with WETH.
The contract logic requires users to convert their WETH to ETH when tokenAddress
is equal to wrappedNativeToken
. If the user holds WETH and attempts to send it directly, the contract will not accept it, as it expects ETH instead of WETH. Users may be confused by the need to convert WETH to ETH, especially if they are not familiar with the difference between the two. This could result in failed transactions, as users might not understand why their WETH was rejected by the contract.
As it can be seen in below snippet, if _tokenAddress
is wrappedNativeToken
, the contract assumes that equivalent amount of native tokens
needs to be transferred.
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/TokenManager.sol#L79-L99
No suppport of wrappedNativeToken
by the protocol.
Manual
The fixed snippet can be:
Valid medium severity, given it is noted in contest READ.ME that any standard ERC20 tokens should be supported. Although arguably could be low severity, given users can simply unwrap WETH to native ETH and perform the deposits via `tillIn()`, I will leave open for discussions, but taking READ.ME as the source of truth, I believe medium severity is appropriate, given it is explicitly noted that this token should be compatible#9##. The fix would be to utilize a zero address or equivalent to represent native ETH when wrapping to WETH. > Tokens: - ETH - WETH - ERC20 (any token that follows the ERC20 standard)
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.