Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UNTOLL hook

A Uniswap v4 hook launchpad where the bonding curve IS the pool: zero-LP fair-launch price discovery on-curve, then graduate in place into a normal AMM on the same PoolId with no migration event. The hook stays attached as a value-recycling fee-splitter.

Status: testnet-bound. The contracts compile and the test suite is green (130 tests across 18 suites on a cleared cache). A formal security review precedes mainnet, and two settlement seams are still to be authored (docs/ARCHITECTURE.md Section 7). Compiling is not reviewed; testnet is not mainnet. No value should sit behind the hook until an external review of the graduate-in-place core is clean.

The proof is the invariant suite

The design is only as good as the properties it holds, so the security model is written down as 25 invariants and exercised by the test suite before anything else. The index is contracts/test/Invariants.t.sol; the prose overview and severity taxonomy are in docs/INVARIANTS.md. The load-bearing ones:

  • No rug (6, 24): no withdraw / sweep / rescue path reaches POL, curve reserves, user funds, the reward pool, or the creator accrual. POL is owned by the hook, never held as pullable LP tokens.
  • Split conservation (14): the four bucket shares sum exactly to the fee; rounding dust routes deterministically to the treasury, never minted, never lost.
  • Accrue-only swap path (15): the swap touches no external contract, so a reverting / blocklisting / gas-griefing recipient can never brick a swap. Every recipient PULLS.
  • Flip atomicity (3): graduation is all-or-nothing inside the crossing swap, guarded by a transient all-entry-point lock; any revert leaves the launch in Bonding with zero mutation.
  • Params immutable post-init (9) and mint renounced at graduation (2, 11).

See docs/TESTING.md for what is proven end-to-end today versus gated behind the two settlement seams (those tests assert the seam boundary so they never read as a false pass).

The value-recycling flywheel

Every trade fee (bonding and post-graduation) splits atomically into four buckets: ops/treasury, a perpetual creator cut, activity-metered participation rewards, and an optional buyback (the exact split is a PROPOSED parameter, pending the sustainability sim). The split is accrue-only on the swap hot path with pull-based recipients. Model A first: fees recycle in the fee asset (ETH/USDC), no platform token at launch. Rewards are for active on-chain participation, never a promised yield.

Layout

  • contracts/ : Solidity (Foundry). The hook, factory, token clone, fee router, curve, tests.
  • runtime/ : off-chain services (subgraph + indexer) for the UI. Pre-deployment scaffold.
  • client/ : one-click launch/trade frontend (live curve, graduation state). Pre-deployment scaffold.
  • docs/ : architecture, invariants, testing.

Build

cd contracts
forge install        # vendor deps; see docs/TESTING.md for the pinned commits
forge build
forge test

Target

Robinhood Chain first (v4 PoolManager at 0x8366a39cc670b4001a1121b8f6a443a643e40951), code chain-agnostic, Base as a later fast-follow. The anti-sniper reads the L2 block height via ArbSys on the Arbitrum stack and falls back to block.number elsewhere.

Built on / acknowledgements

Generous credit where it is due; the original work here is the graduate-in-place core, the four-bucket splitter, the anti-sniper module, and the bonding curve.

  • Uniswap v4-core / v4-periphery: the PoolManager, the hook interface, and the periphery math (LiquidityAmounts, TickMath, HookMiner).
  • OpenZeppelin uniswap-hooks (MIT): the hook extends BaseCustomCurve / BaseHook and uses CurrencySettler for the bonding-phase swap-override plumbing.
  • Saucepoint: the v4 hook beforeSwap return-delta patterns (v4-template lineage) that the custom-curve plumbing builds on.
  • OpenZeppelin contracts: ERC20Upgradeable, Initializable, Clones (the EIP-1167 token clone).

Hard constraints

Non-custodial end to end (no admin drain/redirect of funds, POL, or reward pool; pause-only emergency power, bounded and auto-expiring). Rewards are for active participation, never a promised yield. No securities / returns framing.

License

MIT. See LICENSE.

About

a uniswap v4 hook: the bonding curve is the pool, graduate-in-place on the same poolid, no migration. protocol-owned liquidity, no withdraw/sweep/rescue path. deployed and source-verified on robinhood testnet.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages