The TokenManager::tillIn() function forces users to use wrappedNativeToken (WETH) as the _tokenAddress when depositing ETH. This restriction prevents users from using WETH as collateral independently, as it inadvertently wraps ETH even when WETH is used directly.
The market supports ETH and WETH both:
Tokens:
- ETH
- WETH
- ERC20 (any token that follows the ERC20 standard)
The function TokenManager::tillIn() uses the wrappedNativeToken to represent the address of the native token, which is typically WETH on Ethereum. This function requires users to specify _tokenAddress as wrappedNativeToken to deposit the native token (ETH).
ETH as Collateral: When users wish to use ETH as collateral, they must specify WETH as the _tokenAddress to satisfy the condition _tokenAddress == wrappedNativeToken.
WETH as Collateral: When users attempt to use WETH as collateral, they approve the corresponding amount of WETH to the contract. The condition _tokenAddress == wrappedNativeToken is true as _tokenAddress is WETH, the transaction will be reverted since users will not deposit ETH in this case.
The inability to support WETH as collateral tokens.
vscode
Using an unique address to represent the native token.
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.