The _beforeInitialize function contains a critical logic error where it checks key.currency1 twice instead of checking both currency0 and currency1. This allows pools that don't contain the ReFi token to use the hook, completely bypassing the intended validation. The duplicate check on line 117 should be checking key.currency0, but instead checks key.currency1 again, making the validation ineffective.
Likelihood:
This would likely be exploited within hours or days of deployment. The bug is too obvious and the exploit too profitable to remain unexploited.
Impact:
Attackers can deploy the hook on pools that don't contain the ReFi token, potentially manipulating fee structures on arbitrary token pairs and bypassing the entire security model of the protocol. This could lead to unexpected fee applications on unrelated tokens.
POC
Recommended Mitigation
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.