The ReFiSwapRebateHook contract applies dynamic fees for ReFi token swaps and allows the owner to withdraw tokens and adjust fees. The ReFi token itself is mintable by the owner.
Issues Identified:
Owner Fee Control: The owner can arbitrarily set buy and sell fees to extreme values, potentially capturing user funds or blocking trades.
Unlimited Minting: The ReFi token contract allows the owner to mint unlimited tokens, which can dilute all holders and manipulate liquidity pools.
Pool Validation Bug: _beforeInitialize checks currency1 twice instead of both currency0 and currency1, potentially misconfiguring the pool.
Likelihood: High
Owner functions (ChangeFee and mint) can be executed at any time.
Impact: High
Users can lose funds via excessive fees.
Token holders can be diluted via unlimited minting.
Economic abuse could occur without mitigation.
Scope
Affected Files/Contracts:
ReFiSwapRebateHook.sol — fee logic and pool hooks
ReFi.sol — mintable token contract
Actors Impacted:
Owner: Has administrative control over fees and token supply.
Swappers/Users: Subject to dynamic fees and potential economic manipulation.
Severity:
High — centralized control over fees and minting can result in direct financial loss or market manipulation.
#Proof of Concept
This PoC demonstrates how the hook’s unrestricted fee‑setting authority, token minting mechanics, and incorrect pool‑validation logic can all be triggered during a normal swap flow. Because the owner has unlimited control and the hook enforces fee logic on every swap, a misconfigured or malicious owner can (1) set extreme fee values, (2) mint arbitrary amounts of the ReFi token, and (3) cause pools to behave unpredictably due to faulty token‑pair validation. The following test scenario shows a combined execution path that reproduces the observed issues in a single sequence.
#Recommended Mitigation
The recommended mitigations aim to limit owner powers, prevent economic abuse, and fix functional bugs. Setting maximum fees and introducing governance or timelocks prevents confiscatory swaps. Capping token minting protects holders from dilution. Correcting pool validation ensures pools initialize correctly, and logging critical actions increases transparency and auditability. Together, these changes reduce risk and protect user funds.
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.