CDXRHook on Ethereum

Uniswap v4 Hook Contract 0x7c677602980f8186eebd1ce555ee1926e906c080 on Ethereum · Access control · Verified contract

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$4.24K
Pools using this hook
2
Swaps (24h)
0 (0 traders)
Total swaps
78

What it does

Gates CDXR sells in the pool behind a pausable, allowlisted permission check, while leaving buys of CDXR open to everyone.

How it works step by step

  • Reverts all swaps when the permission module reports the pool is paused
  • Restricts CDXR sells (zeroForOne=true) to addresses approved by the permission module
  • Reads the swapper address from the first 20 bytes of hookData, falling back to the sender
  • Records sell amounts via checkAndRecordSwap so the module can enforce limits
  • Leaves CDXR buys open to anyone
  • Implements all other IHooks callbacks as no-op stubs returning their selectors
Swap behaviour
On every swap the hook reverts if the permission module reports paused. For sells of CDXR (zeroForOne=true) it identifies the swapper from the first 20 bytes of hookData (or the sender if absent) and calls checkAndRecordSwap, which reverts if the swapper is not allowed or over limit. Buys of CDXR (zeroForOne=false) are unrestricted.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Uses the pool's static fee; returns zero delta and no fee override.
Owner & admin controls
Owner (set at deployment to msg.sender) can replace the permissionModule address via setPermissionModule, which controls pause status and sell allowlisting; owner can renounce or transfer ownership. poolManager is immutable.

Enabled Uniswap v4 callbacks

beforeSwap

beforeSwap is the only enabled callback; it checks pause status and, for CDXR sells (zeroForOne=true), calls the permission module to verify the swapper is allowlisted and within limits before the swap proceeds.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: The owner can point permissionModule at any contract, which can then block all swaps by reporting paused or reject individual sellers; the owner can effectively freeze or censor CDXR sales at will.

Risk to user funds: The hook holds no funds and returns zero deltas, so it cannot directly move pool tokens; however it can block sells and buys indirectly through pause and allowlist checks, which can trap sellers from exiting positions.

Security findings

  • [medium] Swaps can be paused by the permission module: beforeSwap calls permissionModule.isPaused() on every swap, so the owner or the module operator can halt all trading in the pool.
  • [medium] Owner can replace the permission module instantly: setPermissionModule has no timelock or validation of the new address, so the owner can swap in an arbitrary module that approves or rejects any sell.
  • [low] Swapper identity taken from unverified hookData: For zeroForOne swaps the swapper identity is read from the first 20 bytes of hookData, which is caller-supplied; the sender fallback is only used when hookData is shorter than 20 bytes, so the allowlist relies on routers passing honest data.
  • [info] No direct fund custody: The hook returns a zero delta and takes no tokens, so it cannot directly custody or move pool funds.

Contract details

Verified source
Yes (CDXRHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
2,563 bytes
Upgradeable proxy
No
Detected patterns
ownable

Pools using CDXRHook