The constructor should defensively validate critical addresses (like the designated ReFi token) to prevent deploying the hook in an unusable or dangerous configuration. At minimum, it should reject address(0) and optionally verify that the address looks like an ERC‑20 (e.g., non‑zero totalSupply() or decimals() check), or defer stricter checks to initialization paths.
The hook’s constructor stores the ReFi token address exactly as provided, with no validation. Passing address(0) (or an unintended address) will make subsequent logic (buy/sell detection, pool checks) behave incorrectly and may brick deployments or cause swaps to be misclassified.
Likelihood: Medium
Occurs during deployments, tests, or upgrade scripts when a parameter is misconfigured, unset, or read from an environment variable that defaults to 0x000...000.
Also likely in multi-chain setups where addresses differ per network and human/operator error is common.
Impact: Medium
Functional breakage / DoS. _beforeInitialize and buy/sell detection rely on comparing pool currencies to ReFi. With ReFi == address(0), the hook may incorrectly treat native currency or unrelated tokens as the target, causing pool initialization to revert or pass erroneously.
Misclassification & wrong fees. _isReFiBuy uses ReFi to decide whether a swap is a buy or sell. A bad ReFi address leads to wrong fee application, unexpected charges, or near‑zero fees where premium fees were intended.
A minimal test that shows the constructor accepting a zero address and causing incorrect behavior:
Add explicit validation in the constructor:
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.