TokensWithdrawn Event Data due to Parameter SwapThe TokensWithdrawn event is intended to signal the withdrawal of a specific token to a designated to address with a certain amount.
However, within the withdrawTokens function, the parameters token (the ERC20 token address being withdrawn) and to (the recipient address) are swapped when emitting the TokensWithdrawn event. This leads to incorrect and misleading on-chain event data.
Likelihood:
This logical error occurs every time the withdrawTokens function is successfully called by the contract owner.
Impact:
The primary impact is the corruption of on-chain event data but no users or protocol fund loss.
Running the existing test test_WithdrawTokens_Success confirms this. The trace shows the event being emitted with the token and to parameters reversed relative to their intended meaning in the withdrawTokens function and the event definition:
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.