# SUMMER · Whitepaper

> **Eternal DeFi Summer · 永恒之夏 · 君のもの**  
> Forking the SUMMER of 2020, into FOREVER.
>
> **Version**: v1.0 · 2026-05-13  
> **Chain**: Ethereum Mainnet  
> **Architecture**: Uniswap V4 Hook · Fully on-chain · No admin · No upgrade

---

## 0 · TL;DR

SUMMER is a **deploy-and-relinquish** DeFi launch protocol built on Uniswap V4 hooks. The system runs four phases on autopilot. The only admin surface is a one-shot Phase 1 emergency-unlock-sell switch (deployer-only, callable while Phase 1 is locked, re-opens sell only) so user funds cannot get trapped if graduate stalls. **No upgrade path, no governance, no pause switch, no fee setter, no emission setter.** Every other rule is frozen the moment the contracts ship:

1. **Phase 1 · Bonding Curve** — buy and sell SUMMER on a linear price curve ($0.05 → $0.476), inside a 24-hour deadline, with anti-sniper and per-wallet caps
2. **Phase 2 · Graduate** — once Phase 1 locks (24h deadline + ≥ 50% sold, or 100% sellout in any window, or the post-deadline 315k cap filling), anyone can call `graduate()` and the protocol opens an ETH/SUMMER Uniswap V4 pool, mints initial LP, and locks it in UNCX for 365 days
3. **Phase 3 · LP Mining** — for four weeks, anyone may stake full-range LP positions to earn SUMMER emissions; the hook collects a 0.25% protocol fee on swaps
4. **Phase 4 · Sunset** — the hook fee permanently terminates after four weeks; the protocol becomes a fully community-owned meme

Multiple independent security review rounds covered both logic and mainnet-fork integration. Final result: **51 / 51 tests green · 0 open findings · GO for mainnet**.

---

## 1 · Origins · Why SUMMER

The summer of 2020 packed an entire era of DeFi into four months. Yield farming, Sushi's migration, Yearn, Curve, governance forks born and dying within weeks — a brief window when the rules were *the rules*, and no protocol team had the keys to change them later.

What followed has been a slow turn toward infrastructure. Uniswap V4 hooks are part of that turn: a programmable AMM layer that lets builders add custom logic to swaps and liquidity. Most projects use that programmability to *add* — more features, more parameters, more governance surface area.

SUMMER uses it the other way: to deliberately ship a **smaller** protocol that runs through four scripted phases and then permanently shuts down its admin surface. Everything is decided at deploy. There is no later. This is the tribute — to the 2020 spirit of "code is law, even when the law is inconvenient."

---

## 2 · Protocol Overview

```
[Phase 0]  Deploy + Etherscan verify
              ↓
[Phase 1]  launch() → 24-hour bonding curve
              ↓ sellout ≥ 50%
[Phase 2]  graduate() → V4 pool init + UNCX 365-day lock
              ↓
[Phase 3]  LP mining (4 weeks) + 0.25% hook fee → configured fee recipient
              ↓ 4 weeks elapsed
[Phase 4]  hook fee permanently = 0 · protocol self-runs · community meme
```

**Four core contracts plus one auxiliary preview hook**:

| Contract | Lines | Role |
|---|---:|---|
| `SummerToken.sol` | 104 | ERC20 SUMMER token, 21M cap, Phase 1 transfer lock |
| `SummerLaunchpad.sol` | 620 | Bonding curve · buy/sell · graduate entry |
| `SummerHook.sol` | 888 | V4 hook · LP staking · emissions · protocol fee |
| `SummerGenesisBadge.sol` | 613 | On-chain SVG founder NFT · ERC2981 royalty |
| `SummerPreviewHook.sol` | 57 | V4 indexer pre-launch signal (standalone, no protocol coupling) |

---

## 3 · Phase 1 · Bonding Curve Launch

**Core parameters**:

| Parameter | Value |
|---|---|
| Curve supply | 630,000 SUMMER (= 3% of MAX_SUPPLY) |
| Start price | 1.667e13 wei/SUMMER (≈ $0.05 at ETH=$3000) |
| End price | 1.587e14 wei/SUMMER (≈ $0.476) |
| Curve shape | Linear |
| **Phase 1 window** | **24 hours** from `launch()` |
| Anti-sniper sprint | First 10 minutes, cumulative ≤ 0.1 ETH per wallet |
| Per-wallet cap | 21,000 SUMMER (≈ 0.1% MAX_SUPPLY), cumulative, sells do not refund quota |
| Buy fee | 1% → configured fee recipient (immutable, baked at deploy) |
| Sell fee | 1% → configured fee recipient (immutable, baked at deploy) |
| User-to-user transfer | **Disabled until graduate** (prevents OTC frontrunning) |

**Two branches after the 24-hour window**:

- **If sellout ≥ 50%** — the curve locks, trading halts, anyone can call `graduate()` to enter Phase 2
- **If sellout < 50%** — effective cap shrinks from 100% to 50%; trading stays open and once the smaller cap is hit, the same lock + graduate path fires

Reaching 50% or 100% sellout inside the 24-hour window also triggers the lock immediately.

**Sell stays open until graduate**. Even if Phase 1 underperforms, holders can always refund their ETH back through the curve (symmetric 1% fee). No one gets stuck — but the protocol's 1% buy fee already taken does not refund.

**Caller reward**: the first EOA to broadcast `graduate()` earns 2,000 SUMMER (≈ 0.01% of MAX_SUPPLY). This makes graduation permissionless and competitive — no designated party needs to call it.

---

## 4 · Phase 2 · Graduate to Uniswap V4

`graduate()` is **permissionless** — any EOA may call it when:

```solidity
soldSupply >= MIN_SELLOUT_TO_GRADUATE (= 315,000 SUMMER = 50%)
```

The call executes **atomically**:

1. Read UNCX flat fee at runtime (currently 0.1 ETH on mainnet)
2. Subtract that fee from raised ETH; remaining ETH plus matching SUMMER (priced at the curve's spot price at graduate moment) becomes the initial LP
3. Initialize the V4 pool with `fee = 2500`, `tickSpacing = 50`, hook flags `0x2844`
4. Mint a full-range LP NFT through V4 PositionManager (SUMMER transfer happens via Permit2)
5. Call UNCX `lockNFTPosition` with a 365-day unlock date
6. Transfer the UNCX lock-receipt NFT to the configured fee recipient address (immutable, set at deploy)
7. Notify the hook (`onGraduate`) — emission schedule starts here

**LP is full-range only** — meaning liquidity exists at every price tick, so no JIT (just-in-time) concentrated-range strategy can capture pool fees from the locked initial liquidity.

**The UNCX lock receipt lives in the configured recipient address**. Throughout the 365-day lock, that address continues to receive the V4 pool's 0.25% LP fee on the locked initial position (LP fee revenue, separate from the hook protocol fee). After 365 days the lock receipt may be burned to redeem the underlying LP NFT.

---

## 5 · Phase 3 · LP Mining + Hook Fee

Once graduate completes, the community may participate in LP mining:

1. Create an ETH/SUMMER **full-range** (mandatory) LP position on the V4 pool
2. `safeTransferFrom` the LP NFT to SummerHook to stake
3. Hook accrues SUMMER rewards according to the mining schedule

Reward distribution:
- **25% immediately claimable**
- **75% linearly vests over 4 weeks**

**Emission budget** = `MAX_SUPPLY − totalSupply(graduate moment)`. Whatever wasn't sold on the curve, plus future emission, all draws from this fixed budget.

**LP-depth throttle (dampener, not a guarantee)**: emission rate is scaled by `min(totalLiquidity, 4 × initialLpLiquidity) / (4 × initialLpLiquidity)`. Any emission that would be released beyond this cap is permanently phantom-burned. This is a soft brake against thin-liquidity scenarios — not absolute protection against coordinated bulk-dump.

**Early exit** (mid-vest): user keeps 25% of unvested, 50% burns, 25% recycles back to the mining pool.

**Hook protocol fee 0.25%** (Phase 3 only):
- Charged on the unspecified side of each swap (25 bps)
- Accrues separately into `protocolFeeEth` and `protocolFeeSummer` counters
- Anyone can call `flushProtocolFee()` / `flushProtocolFeeEth()` / `flushProtocolFeeSummer()` to forward the accumulated balance to the configured recipient address (immutable, set at deploy)

---

## 6 · Phase 4 · Hook Fee Sunset

At `graduateTime + 4 weeks`:

```solidity
hook.feeSunsetActive() → true (permanent)
hook._afterSwap → return zero fee
```

- The hook permanently stops collecting any swap fee
- The V4 pool's own 0.25% LP fee continues unchanged (paid to LP holders; the UNCX-locked initial position routes to its configured collector address per UNCX standard)
- Already-accumulated but unflushed protocol fee remains flushable to the configured recipient address
- No function can re-enable the hook fee: `HOOK_FEE_BPS` is `constant`, the sunset gate is driven by `block.timestamp` against an immutable constant

**What Phase 4 means**: the protocol enters fully self-running mode. No new fee accrues to any party after the sunset (the passive LP fee on the 365-day-locked initial LP continues until the lock itself expires at year-end, after which that revenue stream also terminates). SUMMER becomes a community meme with a forever-existing liquidity pool, no admin behind it.

---

## 7 · Genesis Badge · On-chain Founder NFT

Every wallet that net-buys (buys − sells > 0) on the Phase 1 curve may, after graduate, call `mintMyBadge()` to claim a unique Genesis Badge NFT:

| Field | Value |
|---|---|
| Name | Summer Genesis Badge |
| Symbol | GENESIS |
| Standard | ERC721 + ERC2981 (5% royalty) |
| Transferable | Yes (not soulbound) |
| Per-wallet limit | 1 (once minted, transferring it away does not let the wallet mint another) |
| Metadata | **Fully on-chain**, base64 SVG, no IPFS / no API |
| Royalty | 5% of secondary-market proceeds → configured royalty receiver (immutable) |

**Generation algorithm (on-chain)**:
```
seed = keccak256(founder, tokenId, chainId, badge_contract)
```

→ deterministic palette / celestial body / palm count / aura presence / star pattern → renders a 1000 × 1000 SVG entirely from contract bytecode.

**Founders Pool entitlement follows the NFT**:
- The wallet's Phase 1 net-buys snapshot freezes into `shareOf[tokenId]` at mint
- During Phase 3, 20% of every emission auto-accrues to the Founders Pool
- The badge **holder** (not original minter) calls `claimFoundersForBadge(tokenId)` to collect their share (25% immediate / 75% vest 4 weeks)
- Sell the badge on OpenSea → buyer inherits future claims; seller keeps whatever they sold for

---

## 8 · Token Economics

| Item | Value |
|---|---|
| **MAX_SUPPLY** | 21,000,000 SUMMER (hard cap, immutable) |
| **Curve supply (Phase 1)** | 630,000 (= 3% MAX) |
| **Phase 1 wallet cap** | 21,000 (= 0.1% MAX) |
| **Initial V4 LP (Phase 2)** | computed from raisedEth at graduate (≥ 16.4 ETH at 50% sellout) |
| **Phase 3 emission budget** | `MAX_SUPPLY − totalSupply(graduate moment)` (~20M) |
| **Caller reward** | 2,000 (one-time, paid to graduate() caller) |
| **Founders Pool** | 20% of every emission slice (automatic) |
| **Buy/sell fee** | 1% → configured recipient (immutable) |
| **Hook protocol fee** | 0.25% (Phase 3 only) → configured recipient |
| **V4 LP fee** | 0.25% (permanent, to LP holders; UNCX-locked initial LP routes to its configured collector) |
| **Badge royalty** | 5% of secondary sales (ERC2981, to configured royalty receiver) |

**Mint authority**:
- Phase 1 — only SummerLaunchpad can mint (selling the curve)
- Phase 2+ — only SummerHook can mint (emissions)
- No admin / multisig / governance / backdoor mint path exists

**Burn authority**:
- Phase 1 sell — Launchpad burns the SUMMER the user submits
- Phase 3 early-exit — Hook burns 50% of unvested rewards

---

## 9 · Security Architecture

### 9.1 No admin · No upgrade · No pause

- No OpenZeppelin Ownable / AccessControl inheritance
- No `setFee` / `setRouter` / `pause` / `upgrade` functions exist
- Critical addresses (EOA / Hook / Token / Launchpad) are all `immutable`
- No proxy / delegatecall upgrade pattern

After deploy, the protocol is **deploy-and-relinquish from contract level on** — no admin function exists to invoke.

### 9.2 Review history and test coverage

Multiple independent security review rounds covered:
- Phases 1–12: contract logic + economic invariants
- Round 13: engineering layer — dependency pinning, real `forge build`, mainnet-fork integration tests against actual Uniswap V4 PoolManager / PositionManager / Permit2 / UNCX V4 locker
- Round 14: child constructor refactor + auxiliary preview hook addition + residual finding closure

**Final severity tally**: 0 Critical · 0 High · 0 Medium · 0 Low · 0 Informational — all findings resolved before publication.

**Test coverage (46 / 46 passing)**:
- 25 unit tests (constructor guards, wire correctness, buy/sell edge cases, Phase 1 gate, graduate gate, sunset gate)
- 9 invariant tests (256 fuzz seeds × 128k handler calls each = ~2.3M total executions)
- 10 mainnet-fork integration tests (real V4 + Permit2 + UNCX V4 ABIs)
- 2 preview hook tests (confirms zero LP-injection path)

Full security review report: [/audits/index.html](audits/index.html)

### 9.3 Known risks (transparent disclosure)

**Economic layer**:
1. **Bulk-dump scenario** — a concentrated holder accumulating SUMMER through Phase 1 buys + Phase 3 LP-mining rewards could dump in a single tx. The LP-depth throttle is a dampener, not absolute protection. Anti-concentration relies on Phase 1's multi-wallet structure plus off-chain monitoring.
2. **Sybil attack** — splitting capital across many wallets can circumvent the per-wallet cap. Detailed cost/payoff analysis in the security review.
3. **Cold-start failure** — if the Phase 1 24-hour window plus the reduced cap extension both fail to reach 50% sellout, the protocol stays permanently in Phase 1. Holders can still sell back via the curve, but the 1% buy fees already paid do not refund.

**External dependency layer**:
4. **Uniswap V4 PoolManager / PositionManager** upgrade or deprecation could break graduate flow
5. **Permit2 disruption** would impact graduate's V4 LP injection step
6. **UNCX V4 locker** upgrade could affect lock / unlock behavior

All external dependencies are industry-standard mainstream deployments, but they remain attack-surface in principle.

---

## 10 · External Dependencies (Mainnet Addresses)

| Dependency | Mainnet Address | Role |
|---|---|---|
| Uniswap V4 PoolManager | `0x000000000004444c5dc75cB358380D2e3dE08A90` | V4 pool container |
| Uniswap V4 PositionManager | `0xbD216513d74C8cf14cf4747E6AaA6420FF64ee9e` | LP NFT issuance |
| Permit2 | `0x000000000022D473030F116dDEE9F6B43aC78BA3` | V4 token pull proxy |
| UNCX V4 LP Locker | `0x147AECa171a79466Fe9E2c03f21b45155Ff403F8` | 365-day LP lock |

All four addresses are public, verified, and active.

---

## 11 · Participation Flow

### During Phase 1
1. Visit [defi-summer.com](https://defi-summer.com)
2. Connect wallet → enter Phase 1 buy interface
3. Submit ETH (first 10 minutes: max 0.1 ETH per wallet; afterward no per-buy cap but total wallet purchase still ≤ 21,000 SUMMER cumulative)
4. Change your mind? Sell back to the curve (symmetric 1% fee)

### Phase 2 (graduate trigger)
- Anyone can call `graduate()` and pocket the 2,000 SUMMER caller reward
- After graduate, Phase 1 closes and the V4 pool opens for free swap

### Phase 3 (LP mining)
- Create an ETH/SUMMER **full-range** (mandatory) LP position
- `safeTransferFrom` the LP NFT to SummerHook
- Wait for emissions to accrue; call `claim(tokenId)` / `claimVested(idx)` to collect
- To exit: call `unstake(tokenId)` or `unstakeTo(tokenId, recipient)` to retrieve the LP NFT

### Genesis Badge
- After graduate, call `mintMyBadge()` to mint your founder badge
- Holding the badge entitles you to call `claimFoundersForBadge(tokenId)` for Founders Pool emissions
- To transfer: standard ERC721 — list on OpenSea, send to a vault, gift to a friend; new holder inherits future claims

---

## 12 · Resources

| Resource | Link |
|---|---|
| Main site | [https://defi-summer.com](https://defi-summer.com) |
| Genesis Badge generative preview | [/genesis-preview.html](genesis-preview.html) |
| Public security review | [/audits/index.html](audits/index.html) |
| Verified source code (Etherscan) | populated after mainnet deploy |

**Contract addresses (filled in after mainnet deploy)**:
- SummerToken: `0x...` (TBD)
- SummerLaunchpad: `0x...` (TBD)
- SummerHook: `0x...2844` (TBD; low 14 bits must equal `0x2844` V4 flag bits)
- SummerGenesisBadge: `0x...` (TBD)
- SummerPreviewHook: `0x...2800` (TBD; low 14 bits = `0x2800`)

---

## 13 · Disclaimer

SUMMER is an open-source, **no-admin / no-upgrade** DeFi protocol. This whitepaper is technical and mechanical documentation only. It is **not** an offer to sell securities, financial advice, or a compliance statement. Anyone interacting with the protocol bears the following risks themselves:

- **Smart contract risk** — even with extensive review, undiscovered vulnerabilities remain possible
- **Economic model risk** — see Section 9.3
- **External protocol dependency risk** — see Section 10
- **Regulatory risk** — varies by jurisdiction

Once deployed, **no party — including the deployer — can**:
- Pause the protocol
- Modify any parameter
- Upgrade any contract
- Recover any deployed contract
- Confiscate user funds

Per the immutable on-chain configuration baked at deploy, the **fee recipient address visible on `SummerLaunchpad.EOA()`** is entitled to (all values verifiable on-chain):
- The Phase 1 / 2 / 3 fee streams (buy & sell fee + hook protocol fee + LP fee on the locked initial LP)
- Eligibility to burn the UNCX lock receipt and redeem the underlying initial LP NFT after the 365-day lock expires
- The 5% ERC2981 Genesis Badge royalty on secondary sales (where the marketplace honors ERC2981)

These flows are emitted as on-chain events; any interested party can audit them directly from the verified contract source.

---

## 14 · Acknowledgements

- All participants of DeFi Summer 2020 — the era this protocol references
- Uniswap team and the V4 hook architecture
- The independent security reviewers who repeatedly pushed back over fourteen rounds and made this version possible
- The eternal contract rule: **Once deployed, only the code rules.**

---

```
☀️🌴  SUMMER · FOREVER YOURS · 君のもの
     FORKING · 2020 · INTO · FOREVER
```
