Tadle

Tadle
DeFi
30,000 USDC
View results
Submission Details
Severity: medium
Valid

TokenManager does not accept WETH directly

Summary

In the contest details it is explicitly stated that the system must be compatible with WETH. Unfortunately, the tillIn() function on TokenManager will not accept WETH as a form of payment but only native currency ETH.

Vulnerability Details

if (_tokenAddress == wrappedNativeToken) {
/**
* @dev token is native token
* @notice check msg value
* @dev if msg value is less than _amount, revert
* @dev wrap native token and transfer to capital pool
*/
if (msg.value < _amount) {
revert Errors.NotEnoughMsgValue(msg.value, _amount);
}
IWrappedNativeToken(wrappedNativeToken).deposit{value: _amount}();
_safe_transfer(wrappedNativeToken, capitalPoolAddr, _amount);
}

This snippet expects the code to send the wrappedNativeToken address when sending native ETH. This inables WETH as a form of payment.

Impact

System does not accept WETH tokens.

Tools Used

Manual review

Recommendations

Use another address such as address(0x0) to recognize native ETH payments.

Updates

Lead Judging Commences

0xnevi Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-TokenManager-tillin-wrapper-inconsistent

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)

Support

FAQs

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