Add EulerSwap hook on ethereum - #7163
Conversation
There was a problem hiding this comment.
Review: hooks/ethereum/0x0844aedb1b2e022222e22214156a10ff1d86e8a8.json
Flags
Address suffix 0xe8a8 decodes to 1110 1000 1010 1000 (binary). The lowest 14 bits:
| Bit | Flag | Address | File |
|---|---|---|---|
| 13 | beforeInitialize | 1 | true ✓ |
| 12 | afterInitialize | 0 | false ✓ |
| 11 | beforeAddLiquidity | 1 | true ✓ |
| 10 | afterAddLiquidity | 0 | false ✓ |
| 9 | beforeRemoveLiquidity | 0 | false ✓ |
| 8 | afterRemoveLiquidity | 0 | false ✓ |
| 7 | beforeSwap | 1 | true ✓ |
| 6 | afterSwap | 0 | false ✓ |
| 5 | beforeDonate | 1 | true ✓ |
| 4 | afterDonate | 0 | false ✓ |
| 3 | beforeSwapReturnsDelta | 1 | true ✓ |
| 2 | afterSwapReturnsDelta | 0 | false ✓ |
| 1 | afterAddLiquidityReturnsDelta | 0 | false ✓ |
| 0 | afterRemoveLiquidityReturnsDelta | 0 | false ✓ |
All flags match getHookPermissions() in src_UniswapHook.sol.
Properties
-
dynamicFee: false ✓ —
_beforeSwapreturns fee override of0. Pool initialized with a fixed fee derived fromp.fee / 1e12(a static pips value). NoupdateDynamicLPFee()calls anywhere in source. -
upgradeable: false ✓ — The hook is deployed via EIP-3448 MetaProxy (minimal proxy with trailing calldata parameters via
CtxLib.getParams()). The implementation address is fixed in the proxy bytecode at creation time and cannot be changed by any admin.source_meta.jsonalso lists"proxy": false(Etherscan does not classify this as an upgradeable proxy). This is a deployment-time code pattern, not an upgrade path. -
requiresCustomSwapData: false ✓ —
_beforeSwap'sbytes calldatahookData parameter is entirely unused (not decoded). Swaps function correctly with empty hookData. -
vanillaSwap: false ✓ — Correct.
beforeSwapReturnsDeltais true, and the hook takes full control of swap execution: it withdraws input tokens from PoolManager, deposits them into Euler vaults, withdraws output from Euler vaults, and returns aBeforeSwapDeltaoverriding the standard AMM calculation. This is explicitly non-vanilla behavior. -
swapAccess: "none" ✓ —
_beforeSwaphas no access control checks. Any address can swap through the pool.
Metadata
- verifiedSource: true ✓ — Confirmed by
source_meta.json("verified": true). - chainId: 1 ✓ — Matches
chains.jsonentry for"ethereum". - name: "EulerSwap" ✓ — Matches
contractName: "EulerSwap"from source metadata. - description ✓ — Accurately describes the on-chain logic: swaps fully handled in beforeSwap via Euler vault deposits/withdrawals, pricing via CurveLib, concentrated liquidity blocked by beforeAddLiquidity/beforeDonate reverts, and single-LP architecture. No promotional or audit language.
All fields are correct.
Ponx
left a comment
There was a problem hiding this comment.
Bot review verified; bitmask/flags/properties check out. LGTM.
Summary
A Uniswap v4 hook implementing a custom AMM backed by Euler Finance lending vaults. Swaps are fully handled in beforeSwap: input tokens are deposited into Euler vaults and output tokens are withdrawn, with pricing enforced by a configurable bonding curve (CurveLib). Standard concentrated liquidity operations are blocked; a single LP provides liquidity exclusively through Euler vaults.
Flags
Properties
Warnings
Closes #7154