HomelanderUniV4Plugin on Base
Uniswap v4 Hook Contract 0xb91ca876220674c2efc20ced68de110a075250c0 on Base · MEV protection · Verified contract
- Volume (24h)
- $1.44K
- Value locked (TVL)
- $10.03K
- All-time volume
- $1.44K
- Pools using this hook
- 2
- Swaps (24h)
- 78 (39 traders)
- Total swaps
- 14,436
What it does
A Uniswap v4 hook that waives the LP fee for its own MEV-X arbitrage executor and, after ordinary swaps, attempts an onchain arbitrage routed through MEV-X and distributes any profit to a configurable distributor.
How it works step by step
- Sets the pool's LP fee on each swap: the configured default fee for normal traders and zero for the MEV-X executor address.
- On pool initialization, notifies the MEV-X router of the new Uniswap v4 pool and its parameters via a gas-capped external call.
- After each non-executor swap, checks the MEV-X router for an arbitrage opportunity in the opposite direction of the swap.
- If an opportunity exists, requests an arbitrage route from the router and asks the executor to execute it, sending profit to the profit distributor.
- Calls the profit distributor after execution to distribute profit under the configured config ID, all wrapped in try/catch so failures do not revert swaps.
- Exposes owner-only setters for config ID, router, executor, profit distributor, gas threshold and call gas budget, each with bounded values where applicable.
- Swap behaviour
- beforeSwap charges the default dynamic fee to normal traders and zero fee to the MEV-X executor; afterSwap runs a best-effort arbitrage check and execution via the MEV-X router and executor for non-executor swaps.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Uses a dynamic-fee flag with an immutable default fee; beforeSwap overrides the LP fee to the default fee for normal swappers and to 0 when the sender is the mevxExecutor contract, so the executor pays no LP fee. Fee is not otherwise adjusted and no fee revenue is shared by the hook itself.
- Owner & admin controls
- Owner (Ownable2Step, renounce disabled) can change configId, profitDistributor, mevxExecutor, mevxRouter, minGasLeft (capped at 2.5M) and callGasBudget (capped at 5M); ownership can be transferred in two steps. No pause or upgrade mechanism found.
Enabled Uniswap v4 callbacks
afterInitialize, beforeSwap, afterSwap
afterInitialize notifies the MEV-X router of the new pool via an external call; beforeSwap sets the override fee (zero for the executor, default otherwise); afterSwap triggers a best-effort arbitrage attempt through the MEV-X router and executor after each swap that is not initiated by the executor.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The owner can repoint the router, executor and profit distributor to arbitrary addresses, which would redirect arbitrage execution and profit flows for all pools using this hook. The owner can also change minGasLeft and callGasBudget, affecting whether swaps revert or arbitrage runs. Ownership cannot be renounced, so the privileged key is permanent.
Risk to user funds: The hook does not custody tokens or take return deltas, so it cannot directly hold user funds. Indirectly, post-swap arbitrage executed through the owner-configurable executor and router can move pool-related value, and the owner can route profits to a chosen distributor; the owner can also make swaps revert via the gas threshold.
Security findings
- [high] Owner can redirect profit and execution targets: setProfitDistributor, setMevxExecutor and setMevxRouter let the owner point arbitrage profit flows and execution to any non-zero address, so a malicious or compromised owner could divert profits from swaps.
- [medium] Owner-set gas requirement can block swaps: afterSwap requires gasleft() >= minGasLeft for non-executor senders, so an owner setting minGasLeft high can cause ordinary swaps to revert.
- [low] Silent external call failures: Router initialization and arbitrage calls are low-level calls whose failures are swallowed, so failures in the external MEV-X contracts are silent and do not revert swaps.
- [info] Fee exemption for the executor: The executor is charged a zero LP fee while other swappers pay the default fee, so the MEV-X executor path gets preferential pricing by design.
- [info] Ownership cannot be renounced: renounceOwnership is overridden to always revert, so the owner cannot be removed and the hook retains admin control permanently.
Contract details
- Verified source
- Yes (HomelanderUniV4Plugin)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 6,218 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, mev-protection, ownable
Pools using HomelanderUniV4Plugin
- Cake / USDC (Dynamic fee) — 24h volume $1.44K, TVL $10.03K, 78 swaps today
- STONKEX / USDC (7.0102% fee) — 24h volume $0, TVL $0, 0 swaps today