RebateFi Hook

First Flight #53
Beginner FriendlyDeFi
100 EXP
View results
Submission Details
Impact: medium
Likelihood: low
Invalid

Missing Zero Address Validation in Constructor

Description:
The ReFiSwapRebateHook constructor accepts the ReFi token address _ReFi and stores it in an immutable variable without validating it.
If _ReFi is accidentally passed as the zero address, the hook will treat address(0) as the designated ReFi token.
In Uniswap v4, Currency.wrap(address(0)) is often used to represent the native token (ETH). This means misconfiguring _ReFi as address(0) causes the hook to:

  • Treat the native currency as the “ReFi token” for fee logic; and

  • Fail to correctly enforce the desired buy/sell fee asymmetry for the real ReFi ERC-20 token.

Because ReFi is immutable, this misconfiguration cannot be fixed after deployment except by deploying a new hook.

Impact:

  • Configuration risk: A deployment with _ReFi = address(0) silently succeeds and permanently binds the hook to an invalid ReFi token address.

  • The hook’s ReFi-specific fee logic will then apply to the native currency instead of the actual ReFi ERC-20, breaking protocol expectations and potentially confusing integrators.

  • Since the error happens at deployment, there is no way for downstream users to detect this purely on-chain without reading constructor arguments or verifying the address off-chain.

Mitigation:
Add an input validation check in the constructor to prevent zero address configuration:

constructor(IPoolManager _poolManager, address _ReFi)
BaseHook(_poolManager)
Ownable(msg.sender)
{
require(_ReFi != address(0), "ReFi address cannot be zero");
ReFi = _ReFi;
}
Updates

Lead Judging Commences

chaossr Lead Judge 12 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!