MEV protection hook on BNB Chain
Uniswap v4 Hook Contract 0x0596eea18c4df2845263b9f4f754f80e13a9b0c0 on BNB Chain · MEV protection
- Volume (24h)
- $564
- Value locked (TVL)
- $2.58K
- All-time volume
- $12.26K
- Pools using this hook
- 3
- Swaps (24h)
- 153 (26 traders)
- Total swaps
- 3,262
What it does
A proxied Uniswap v4 hook that sets swap fees and may route profit and arbitrage activity to external MEV executor and distributor contracts, with fees and execution addresses controlled by an owner.
This read was written for the hook 0xa258…70c0 on Robinhood Chain and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.
How it works step by step
- Records pool keys and initial state in beforeInitialize and afterInitialize
- Sets swap fees via a default fee or a tick-indexed fee mapping in beforeSwap
- Updates swap-related state and possibly distributes profit in afterSwap
- Runs arbitrage logic through runArbitrage using a configured MEV executor
- Routes profit to a configured profit distributor and may send LP tax to a wallet
- Owner manages fee managers, router and executor addresses, and gas parameters
- Swap behaviour
- beforeSwap computes or applies a fee (default or per-tick), and afterSwap updates state and may distribute profit or run arbitrage through the configured executor.
- Liquidity behaviour
- No liquidity callbacks are enabled in the hook permissions (beforeAddLiquidity and beforeRemoveLiquidity are present in the dispatch table but not enabled in the address permissions).
- Fee behaviour
- Fees can be a default fee set by the owner (setDefaultFee) or a per-tick fee mapping (getFee/c2b7698c). Fee-manager addresses are allowed to set fees. Non-rate details are not determinable from bytecode alone.
- Owner & admin controls
- Owner-gated functions (renounceOwnership, transferOwnership, acceptOwnership implied by pendingOwner) control fee manager assignment (setFeeManager), default fee (setDefaultFee), MEV executor and router addresses (setMevxExecutor, setMevxRouter), profit distributor (setProfitDistributor), LP tax wallet (updateLpTaxWallet), min gas left and call gas budget (setMinGasLeft, setCallGasBudget), and a fee-to-tick mapping via c2b7698c. The proxy implementation is upgradeable by its admin, so logic can change.
Enabled Uniswap v4 callbacks
beforeInitialize, afterInitialize, beforeSwap, afterSwap
beforeInitialize and afterInitialize record pool keys and initial state; beforeSwap reads fee and tick data to compute fees; afterSwap updates swap-related state, possibly distributing profit and running arbitrage logic through runArbitrage.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: The owner can change the default fee, the MEV executor and router, the profit distributor, fee managers, and gas parameters. A compromised owner key could redirect profit distribution, change fees, or point execution at malicious contracts. The upgradeable proxy adds further admin power to change the implementation entirely.
Risk to user funds: The hook can trigger token transfers and donations to external distributor and executor contracts, and fees are owner-controlled, so user swap outcomes and pool balances depend on privileged configuration and the upgradeable implementation.
Security findings
- [high] Upgradeable proxy: The hook is deployed behind a proxy whose implementation can be changed by its admin, so the logic that users interact with is not fixed.
- [medium] Owner-set fees: The owner can set the default fee and tick-based fees, which directly change what swappers pay. The exact bounds were not determinable from bytecode.
- [medium] Hook moves tokens and donations: The hook calls distributeProfit and transfers tokens via transfer and donate, so it can move pool and hook-held funds to the profit distributor and MEV executor addresses.
- [info] No verified source: Without verified source, function semantics, bounds and access checks cannot be confirmed; analysis relies on selectors and storage only.
Contract details
- Verified source
- No
- Bytecode size
- 2,739 bytes
- Upgradeable proxy
- Yes
- Detected patterns
- donates, erc20, ownable, upgradeable
Pools using MEV protection hook
- Cake / USDT (Dynamic fee) — 24h volume $240, TVL $859, 64 swaps today
- Cake / USDT (Dynamic fee) — 24h volume $184, TVL $858, 50 swaps today
- Cake / USDT (Dynamic fee) — 24h volume $140, TVL $858, 39 swaps today