Root + Impact
Event emission is incorrect, leading to off-chain functions potentially malfunctioning.
Description
When the `TokensWithdrawn` event is emitted in the `ReFiSwapRebateHook::withdrawTokens` function, it logs values in an incorrect order. The `token` should go in the first parameter position, whereas the `to` should go in the second parameter position.
function withdrawTokens(address token, address to, uint256 amount) external onlyOwner {
IERC20(token).transfer(to, amount);
@> emit TokensWithdrawn(to, token , amount);
}
Risk
Likelihood:
Impact:
Proof of Concept
Recommended Mitigation
emit the event with parameters in an appropriate positions.
- emit TokensWithdrawn(to, token , amount);
+ event TokensWithdrawn(address indexed token, address indexed to, uint256 amount);