Skip to content

Add EulerSwap hook on ethereum - #7155

Merged
Ponx merged 1 commit into
mainfrom
hooks/ethereum/0xfc171fd20e6fdca8e6b53e7286a1a21dc73928a8
Sep 16, 2026
Merged

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

Conversation

@hooklist-generator

Copy link
Copy Markdown
Contributor

Summary

A Uniswap v4 hook implementing a custom AMM backed by Euler Finance vault positions. In beforeSwap, it computes swap amounts using a custom bonding curve (CurveLib), deposits input tokens into and withdraws output tokens from Euler vaults (FundsLib), and returns a BeforeSwapDelta to handle all swap accounting outside of standard pool math. Native concentrated liquidity, initialization by non-factory callers, and donations are intentionally blocked.

Flags

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

Properties

Property Value
dynamicFee false
upgradeable false
requiresCustomSwapData false
vanillaSwap false
swapAccess none

Warnings

  • Submitter did not provide a name. Using AI-derived "EulerSwap".
  • Submitter did not provide a description. Using AI-generated description.

Closes #7128

@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/0xfc171fd20e6fdca8e6b53e7286a1a21dc73928a8.json

Address Flags

Address 0xfc171fd20e6fdca8e6b53e7286a1a21dc73928a8 — last 14 bits are 0x28a8 & 0x3FFF = 0x28a8 (decimal 10408):

Bit Flag Expected File
13 beforeInitialize true true ✓
12 afterInitialize false false ✓
11 beforeAddLiquidity true true ✓
10 afterAddLiquidity false false ✓
9 beforeRemoveLiquidity false false ✓
8 afterRemoveLiquidity false false ✓
7 beforeSwap true true ✓
6 afterSwap false false ✓
5 beforeDonate true true ✓
4 afterDonate false false ✓
3 beforeSwapReturnsDelta true true ✓
2 afterSwapReturnsDelta false false ✓
1 afterAddLiquidityReturnsDelta false false ✓
0 afterRemoveLiquidityReturnsDelta false false ✓

All flags match the address bitmask and are confirmed by getHookPermissions() in src_UniswapHook.sol.

Properties

dynamicFee: false ✓_beforeSwap returns fee override as 0 (literal zero, not OVERRIDE_FEE_FLAG). No calls to poolManager.updateDynamicLPFee() anywhere in the hook.

upgradeable: false ✓source_meta.json reports "proxy": false. The hook instances use delegatecall into this fixed implementation contract (a code-size pattern), but the implementation itself has no admin-controlled upgrade mechanism, no mutable implementation slot, and no SELFDESTRUCT. The EVC address and pool manager address are both immutable.

requiresCustomSwapData: false ✓_beforeSwap declares bytes calldata but never reads or decodes it; all swap logic derives from CtxLib.getParams() and params (the SwapParams struct). Swaps work with empty hookData.

vanillaSwap: false ✓beforeSwapReturnsDelta is true and _beforeSwap computes its own custom AMM curve (CurveLib), deposits input tokens into Euler vaults (FundsLib.depositAssets), withdraws output tokens from Euler vaults (FundsLib.withdrawAssets), and returns a non-zero BeforeSwapDelta. The swap does not execute via standard pool math at all.

swapAccess: "none" ✓_beforeSwap has no caller access control. The only revert conditions are the reentrancy lock and the curve invariant check (CurveLib.verify); neither gates by caller identity, time, or admin flag.

Metadata

  • verifiedSource: true ✓ — confirmed by source_meta.json ("verified": true).
  • chainId: 1 ✓ — matches chains.json for ethereum.
  • name: "EulerSwap" ✓ — matches contractName in source_meta.json.
  • description ✓ — accurately describes the on-chain behavior: custom bonding curve via CurveLib, Euler vault deposits/withdrawals via FundsLib, BeforeSwapDelta accounting, and intentional reverts on beforeInitialize (non-factory callers), beforeAddLiquidity (CLAMM positions), and beforeDonate (irrecoverable funds). No promotional, audit, or safety language.

All fields are correct.

@Ponx Ponx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Bot review verified; bitmask/flags/properties check out. LGTM.

@Ponx
Ponx merged commit 87b87c3 into main Sep 16, 2026
5 checks passed
@Ponx
Ponx deleted the hooks/ethereum/0xfc171fd20e6fdca8e6b53e7286a1a21dc73928a8 branch September 16, 2026 23:05
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: 0xfc171fd20e6fdca8e6b53e7286a1a21dc73928a8 on ethereum

1 participant