RebateFiHook::TokensWithdrawn parameters 'to' and 'token' are swapped in the function RebateFiHook::withdrawTokens()It should emit the event TokensWithdrawn(token, to, amount)
In reality, it emits TokensWithdrawn(to, token, amount)
Likelihood:
This will occur, when the owner calls the RebateFiHook::withdrawTokens() function for withdraw tokens from the hook contract.
Impact:
The logs will show the addresses swapped: token= recepient address and to= token address. It may:
confuse the frontend or backend that listens to the event;
cause incorrect display of transaction history in the UI;
cause false positives in off-chain monitoring.
In this PoC, tokens are first transferred to the hook contract and then the RebateFiHook::withdrawTokens() function is called to withdraw tokens. This function emits the RebateFiHook::TokensWithdrawn event.
To demonstrate the problem, the expected and actual logs are displayed.
The assertions section below verifies that the parameters have been swapped.
You need to swap the 'to' and 'token' event parameters.
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.