Add EulerSwap hook on ethereum - #7147
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Review: hooks/ethereum/0x5ecf6c62d1368ea8de372296951d3f5ed1a9a8a8.json
Flag Verification
Address 0x5ecf6c62d1368ea8de372296951d3f5ed1a9a8a8 — lowest 14 bits: 0xa8a8 & 0x3FFF = 0x28A8 = 10 1000 1010 1000 binary.
All 14 flags match the getHookPermissions() return in src_UniswapHook.sol exactly:
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 Verification
-
dynamicFee: false ✓ —
_beforeSwapreturns a hardcoded fee of0as the third return value. No calls toupdateDynamicLPFee()anywhere in hook code. -
upgradeable: false ✓ — The source comment notes instances are delegatecall proxies, but the implementation address is fixed at deployment (immutable). There is no admin-configurable implementation storage or upgrade mechanism in the source. This is a factory-clone pattern, not an upgradeable proxy.
-
requiresCustomSwapData: false ✓ — In
_beforeSwap, thebytes calldataparameter is unnamed and completely unused. Swaps work correctly without any hookData. -
vanillaSwap: false ✓ — Correctly false:
beforeSwapReturnsDeltais true and the hook fully bypasses Uniswap concentrated liquidity by computing its own AMM curve, depositing input into Euler vaults, and withdrawing output from Euler vaults. -
swapAccess: "none" ✓ —
_beforeSwapcontains no access control on the caller. The only gate is thenonReentrantHookreentrancy guard, which is not identity-based.
Metadata Verification
- verifiedSource: true ✓ — Confirmed by
source_meta.json("verified": true). - chainId: 1 ✓ — Ethereum mainnet.
- name: "EulerSwap" ✓ — Matches
contractNamefrom Etherscan ("contractName": "EulerSwap"). - description ✓ — Accurately describes the custom-curve AMM routing through Euler lending vaults. The
_beforeSwaplogic confirms: it computes a quote viaQuoteLib, takes input tokens to an Euler vault (FundsLib.depositAssets), withdraws output from another vault (FundsLib.withdrawAssets), and returns aBeforeSwapDelta.beforeAddLiquidityreverts to block standard LP positions. No promotional or audit language present.
All checks pass.
Ponx
left a comment
There was a problem hiding this comment.
Bot review verified; bitmask/flags/properties check out. LGTM.
Summary
A custom-curve AMM hook that routes swaps entirely through Euler lending vaults. In beforeSwap, it computes a quote against a configurable bonding curve, takes input tokens into an Euler vault, withdraws output tokens from another vault, and returns a BeforeSwapDelta to handle all accounting—bypassing Uniswap concentrated liquidity entirely. Standard LP positions are blocked.
Flags
Properties
Warnings
Closes #7129