Christmas Dinner

First Flight #31
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: medium
Invalid

Missing Zero-Address Validation

Description: The constructor doesn't validate if the token addresses are zero addresses. The actual vulnerability is found here:

constructor (address _WBTC, address _WETH, address _USDC) {
host = msg.sender;
i_WBTC = IERC20(_WBTC);
whitelisted[_WBTC] = true;
i_WETH = IERC20(_WETH);
whitelisted[_WETH] = true;
i_USDC = IERC20(_USDC);
whitelisted[_USDC] = true;
}

Impact: Deploying with zero addresses for tokens would break core contract functionality.

Recommended Mitigation: Add zero-address checks:

constructor (address _WBTC, address _WETH, address _USDC) {
require(_WBTC != address(0), "WBTC cannot be zero address");
require(_WETH != address(0), "WETH cannot be zero address");
require(_USDC != address(0), "USDC cannot be zero address");
host = msg.sender;
i_WBTC = IERC20(_WBTC);
whitelisted[_WBTC] = true;
i_WETH = IERC20(_WETH);
whitelisted[_WETH] = true;
i_USDC = IERC20(_USDC);
whitelisted[_USDC] = true;
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
0xtimefliez Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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