Add GoldenGoalHook hook on xlayer#1057
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Review: hooks/xlayer/0x742d6c5ec8eca72096c24a1287f5ef0efd0c50c4.json
Address Flags
Address 0x...50c4 → 0x50c4 & 0x3FFF = 0x10c4 = 0001 0000 1100 0100:
| Bit | Flag | Expected | JSON |
|---|---|---|---|
| 13 | beforeInitialize | false | false ✓ |
| 12 | afterInitialize | true | true ✓ |
| 11 | beforeAddLiquidity | false | false ✓ |
| 10 | afterAddLiquidity | false | false ✓ |
| 9 | beforeRemoveLiquidity | false | false ✓ |
| 8 | afterRemoveLiquidity | false | false ✓ |
| 7 | beforeSwap | true | true ✓ |
| 6 | afterSwap | true | true ✓ |
| 5 | beforeDonate | false | false ✓ |
| 4 | afterDonate | false | false ✓ |
| 3 | beforeSwapReturnsDelta | false | false ✓ |
| 2 | afterSwapReturnsDelta | true | true ✓ |
| 1 | afterAddLiquidityReturnsDelta | false | false ✓ |
| 0 | afterRemoveLiquidityReturnsDelta | false | false ✓ |
All flags match the address bitmask. getHookPermissions() in source returns identical values.
Properties
-
dynamicFee: true ✓ —
_beforeSwapreturnsfee | LPFeeLibrary.OVERRIDE_FEE_FLAGwith a phase-variable fee (Kickoff=3000, Live=5000, ExtraTime=10000, FinalWhistle=5000)._afterInitializealso callspoolManager.updateDynamicLPFee(key, fee). -
upgradeable: false ✓ — Immutable contract (NatSpec: "@dev Immutable"). No proxy pattern,
delegatecall, or mutable implementation pointer.source_meta.jsonconfirmsproxy: false. -
requiresCustomSwapData: false ✓ —
_beforeSwapignores hookData entirely. In_afterSwap, hookData is optional: if 32 bytes, decodes a trader address for point attribution; otherwise falls back totx.origin/sender. Swaps function correctly with empty hookData. -
vanillaSwap: false ✓ — Correctly false:
dynamicFee=true,afterSwapReturnsDelta=true, and_afterSwaptakes a skim fee viapoolManager.take()returned as a delta all independently mandate non-vanilla behavior. -
swapAccess: "temporal" ✓ —
_enforceAntiSnipegates large buys onblock.timestamp > antiSnipeUntil. This is a configurable time-window restriction (anti-snipe on pool launch), correctly classified as temporal.
Metadata
- verifiedSource: true ✓ —
source_meta.jsonconfirmsverified: true. - chainId: 196 ✓ — Matches
xlayerinchains.json. - name: "GoldenGoalHook" ✓ — Matches the Solidity contract name exactly. No promotional language.
- description ✓ — All claims are substantiated by source: match-phase fees (
phaseFee[_phase]), goal points accumulation (_points[trader]), skim split to pot/buyback (_takeSkim), anti-snipe window (_enforceAntiSnipe), pro-rata pot claims (claimPot()). No audit claims, safety guarantees, or marketing language.
All checks pass.
marktoda
left a comment
There was a problem hiding this comment.
Bot review verified. GoldenGoalHook — dynamic-fee hook on xlayer. Bitmask 0x10c4 → afterInitialize, beforeSwap, afterSwap, afterSwapReturnsDelta. Desc length 320/500 OK. dynamicFee=true, swapAccess=temporal per bot review. LGTM.
Summary
A Uniswap v4 hook implementing a sports-themed trading arena: applies match-phase dynamic fees, accumulates per-swap goal points, takes configurable skim fees split between a communal prize pot and GOAL token buyback-and-burn, enforces a temporal anti-snipe buy limit window, and allows pro-rata pot claims at match end.
Flags
Properties
Warnings
Closes #1056