Skip to content

Add ReplicaWhitelistHook hook on ethereum - #10544

Merged
Ponx merged 1 commit into
mainfrom
hooks/ethereum/0x0c3291d38f23042dab5a3f6c369488c77456c080
Oct 13, 2026
Merged

Ponx merged 1 commit into
mainfrom
hooks/ethereum/0x0c3291d38f23042dab5a3f6c369488c77456c080

Conversation

@hooklist-generator

Copy link
Copy Markdown
Contributor

Summary

A Uniswap v4 hook that restricts swaps to whitelisted addresses. It checks tx.origin against an external ISwapWhitelist contract in beforeSwap, reverting with SwapperNotWhitelisted for non-whitelisted callers. No modification to swap execution occurs beyond access control.

Flags

Flag Value
beforeInitialize false
afterInitialize false
beforeAddLiquidity false
afterAddLiquidity false
beforeRemoveLiquidity false
afterRemoveLiquidity false
beforeSwap true
afterSwap false
beforeDonate false
afterDonate false
beforeSwapReturnsDelta false
afterSwapReturnsDelta false
afterAddLiquidityReturnsDelta false
afterRemoveLiquidityReturnsDelta false

Properties

Property Value
dynamicFee false
upgradeable false
requiresCustomSwapData false
vanillaSwap true
swapAccess allowlist

Warnings

None

Closes #10543

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: hooks/ethereum/0x0c3291d38f23042dab5a3f6c369488c77456c080.json

Address Flags

Address ends in 0xc080 → lower 14 bits = 0b00_0000_1000_0000 → bit 7 set.

Flag Expected JSON
beforeSwap true true ✓
all others false false ✓

Confirmed by getHookPermissions() in source.

Source Code Analysis

_beforeSwap checks tx.origin against an external ISwapWhitelist contract. Reverts with SwapperNotWhitelisted for non-whitelisted callers. Returns ZERO_DELTA and fee 0 — no swap modification.

Properties

  • dynamicFee: false — returns fee 0, no updateDynamicLPFee() or lpFeeOverride. ✓
  • upgradeable: false — swapWhitelist is immutable; no proxy, no mutable implementation. ✓
  • requiresCustomSwapData: false — hookData parameter is unused. ✓
  • vanillaSwap: true — beforeSwap is pure revert-based access control; swap execution is unmodified. ✓
  • swapAccess: "allowlist" — gates on ISwapWhitelist.isWhitelisted(tx.origin). ✓

Metadata

  • name: ReplicaWhitelistHook matches contract name in source. ✓
  • description: Accurately describes the access control logic, tx.origin check, and revert behavior. ✓
  • verifiedSource: true — confirmed by source_meta.json. ✓
  • chainId: 1 — correct for Ethereum mainnet. ✓

All fields are correct. Approving.

@Ponx
Ponx merged commit be38795 into main Oct 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hook: ReplicaWhitelistHook

1 participant