The transferErcTokens function
in the TokenDivider.sol contract contains a redundant check for the to address being zero. The check if(to == address(0))
is performed twice, line 190 and line 200 which is unnecessary and can be optimized
While this redundancy does not introduce a security vulnerability, it does lead to inefficient code and can affect readability. Redundant checks can also increase the gas cost of executing the function, albeit minimally.
POC:
Deploy the TokenDivider contract.
Call the transferErcTokens function with any valid parameters.
Observe that the check for to == address(0) is performed twice.
manual review
Remove the redundant check for to == address(0)
to improve code efficiency and readability. Ensure that the check is performed only once.
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.