The TokensWithdrawn event is designed to log token withdrawal operations, emitting the token address, recipient address, and amount. Off-chain systems like block explorers, analytics dashboards, and monitoring tools rely on correct event indexing to track protocol activity.
The event is emitted with swapped parameters: to and token are passed in reverse order compared to the event declaration. This causes indexed event data to be incorrect — the token address is logged as the recipient and vice versa.
Likelihood:
Every token withdrawal triggers this incorrectly ordered event
The bug is deterministic and occurs 100% of the time
Impact:
Off-chain indexers will record incorrect data
Block explorers will display the recipient address as the token and vice versa
Monitoring and alerting systems may fail to detect withdrawals of specific tokens
Audit trails and accounting become unreliable
Incident response teams may be misled during security investigations
The issue can be verified by examining event logs after a withdrawal:
When examining raw logs:
Expected: topic1 = reFiToken address, topic2 = recipient address
Actual: topic1 = recipient address, topic2 = reFiToken address
Swap the parameters in the emit statement to match the event declaration order:
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.