The hook is intended to apply a 0% fee when users buy ReFi and a higher fee 0.30% when users sell ReFi.
Due to inverted logic in _isReFiBuy(), every swap does the exact opposite: buyers are charged 0.30% and sellers pay 0%, completely reversing the protocol’s intended economic model in all trades.
Likelihood:
Reason 1: _beforeInitialize function always intitializes the pool with ReFi token at key.currency1 , so IsReFiCurrency0 is always false inside _isReFibuy function, when the codition checked always the else block is checked (isReFicurrency0 = false). when zeroForOne = true (which means swappig key.currency0 to key.currency1), this means the user wants to to buy ReFi token, but the output of the function is !zerofForOne , which is false. when zeroForOne = false(which means swappig key.currency0 to key.currency1), this means the user wants to sell ReFi token, but the function returns !zeroForOne which is true. generally the isReFiBuy function returns true when user wants to sell and ` when the user wants to by , which opposite to what it supposed to do .
Impact:
Impact 1: The hook taxes ReFi buyers 0.30% and gives sellers 0% fee on every single swap,which is completely inverting the protocol’s core economic model and breaking its entire revenue mechanism through .
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.