The TokenManager::initialize function allows the contract owner to set the wrappedNativeToken address. However, there is no validation to ensure that the provided address is valid and not the zero address. This oversight can lead to potential issues where the contract is unable to properly handle wrapped native tokens.
The initialize function is defined as follows:
This function allows the owner to set the wrappedNativeToken variable to a specified address. However, there is no check to verify that _wrappedNativeToken is a valid address and not the zero address (address(0x0)).
If the owner mistakenly passes the zero address to this function, the contract will set wrappedNativeToken to address(0x0), leading to several issues:
The absence of a zero address check in the initialize function could lead to:
Manual Code Review
To prevent the issues associated with setting wrappedNativeToken to an invalid address, the following mitigation should be implemented:
Add a Zero Address Check
Before setting the wrappedNativeToken variable, add a check to ensure that _wrappedNativeToken is not the zero address. If the check fails, the function should revert with an appropriate error message.
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.