Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 38 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Zora Protocol
# Niche Protocol

[![Contracts](https://github.com/ourzora/zora-protocol/actions/workflows/contracts.yml/badge.svg)](https://github.com/ourzora/zora-protocol/actions/workflows/contracts.yml)

This repository is a monorepo for the Zora Protocol.
This repository is a monorepo for the Niche Protocol - a customized implementation of the Zora Protocol using the Niche coin as the backing currency for creator coins.

## Key Differences

- **Backing Currency**: Uses Niche coin (`0x5ab1a8dbb78c272540d3652dac9c46d9cbfcecbf`) instead of ZORA token
- **Branding**: Updated to "Niche" throughout documentation and UI
- **Creator Coins**: All creator coins are backed by Niche token instead of ZORA

In it you will find:

Expand All @@ -18,9 +24,16 @@ In it you will find:

- [Legacy Contracts](./legacy) - Contains legacy contract packages (1155-contracts, erc20z, sparks, cointags, protocol-sdk, etc.)

## Official docs
## Documentation

View the Niche documentation (deployed on branch `claude/niche-clanker-app-011CV492FfwRDh9PmXRaV3gm`)

**Niche Coin Details:**

[View the official docs](https://docs.zora.co/docs/smart-contracts/creator-tools/intro)
- Contract Address: `0x5ab1a8dbb78c272540d3652dac9c46d9cbfcecbf`
- Network: Base (Chain ID: 8453)
- Token: Niche
- [View on Rainbow](https://rainbow.me/token/base/0x5ab1a8dbb78c272540d3652dac9c46d9cbfcecbf)

## Setup

Expand All @@ -44,6 +57,7 @@ For JavaScript/TypeScript development and wagmi consumption:
pnpm build:js

This command:

- Builds only the JavaScript/TypeScript artifacts needed for client applications
- Generates wagmi-compatible type definitions and ABIs
- Skips full Solidity compilation for faster builds
Expand All @@ -56,6 +70,7 @@ For complete contract development and testing:
pnpm build

This command:

- Performs full Solidity compilation with all optimizations
- Generates all contract artifacts (out/, abis/, dist/)
- Required for contract development, testing, and deployment
Expand Down Expand Up @@ -86,6 +101,7 @@ Format and lint code:
### When to Use Which Build

- **Use `pnpm build:js`** when:

- Developing frontend applications with wagmi
- Working with the SDK packages
- You only need TypeScript definitions and ABIs
Expand All @@ -97,6 +113,22 @@ Format and lint code:
- Preparing for deployment
- You need all contract artifacts

## Bug Bounty
## About This Fork

This is a customized fork of the Zora Protocol adapted for the Niche ecosystem. The core protocol functionality remains the same, with the primary difference being the use of Niche coin as the backing currency for creator coins.

### Modified Files

Key files that reference the Niche coin:

- `packages/coins/src/libs/CoinConstants.sol` - Updated `CREATOR_COIN_CURRENCY`
- `packages/coins-sdk/src/utils/poolConfigUtils.ts` - Updated token address constants
- `docs/vocs.config.ts` - Updated branding to "Niche Docs"
- Documentation and test files updated throughout

### Original Protocol

This protocol is based on the Zora Protocol. For the original implementation, visit:

Report security vulnerabilities and learn about our Bug Bounty Program [here](https://docs.zora.co/bug-bounty/bug-bounty-program).
- [Original Zora Protocol Repository](https://github.com/ourzora/zora-protocol)
- [Zora Documentation](https://docs.zora.co)
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dev": "vocs dev",
"build": "tsc --noEmit",
"build:site": "playwright install --with-deps chromium && vocs build",
"build:vercel": "playwright install --with-deps chromium && vocs build",
"preview": "vocs preview",
"copy-changelog": "tsx scripts/copy-changelogs.ts",
"generate-uml": "tsx scripts/generateUml.ts"
Expand Down
42 changes: 24 additions & 18 deletions docs/pages/coins/contracts/architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ classDiagram
+swap()
+take()
}

%% Factory Package
class ZoraFactoryImpl {
+deploy(payoutRecipient, owners, uri, name, symbol, poolConfig, platformReferrer, postDeployHook, postDeployHookData, coinSalt)
+deployCreatorCoin(payoutRecipient, owners, uri, name, symbol, poolConfig, platformReferrer, coinSalt)
+coinAddress(msgSender, name, symbol, poolConfig, platformReferrer, coinSalt)
+coinImpl()
}

%% Coins Package
class BaseCoinV4 {
<<abstract>>
Expand All @@ -30,19 +30,19 @@ classDiagram
+migrateLiquidity()
+getPayoutSwapPath()
}

class CreatorCoin {
-currency: ZORA
-currency: NICHE
-vestingSchedule: VestingSchedule
+claimVesting()
+getClaimableAmount()
}

class ContentCoin {
-backingCurrency: CreatorCoin
+rewardsDistributionMethodology()
}

%% Hooks Package
class ZoraV4CoinHook {
+afterInitialize()
Expand All @@ -51,53 +51,56 @@ classDiagram
-mintLpReward()
+_distributeMarketRewards()
}
class ZORAToken {
ZORA Token

class NicheToken {
NICHE Token
}

%% Inheritance relationships
BaseCoinV4 <|-- CreatorCoin
BaseCoinV4 <|-- ContentCoin
%% Unified hook - no subclassing per coin type

%% Factory relationships
ZoraFactoryImpl ..> CreatorCoin : creates
ZoraFactoryImpl ..> ContentCoin : creates

%% Hook relationships
ZoraV4CoinHook --> IPoolManager : uses
ZoraV4CoinHook --> BaseCoinV4 : manages rewards

%% Pool Manager relationships
BaseCoinV4 --> IPoolManager : integrates with
CreatorCoin --> ZoraV4CoinHook : uses hook
ContentCoin --> ZoraV4CoinHook : uses hook

%% Currency relationships
ContentCoin --> CreatorCoin : backed by
CreatorCoin --> ZORAToken : backed by
CreatorCoin --> NicheToken : backed by
```

*Visual overview of how contracts work together in the Zora Coins system*
_Visual overview of how contracts work together in the Niche Coins system_

## Core Components

### Coins Contracts

**BaseCoinV4 (Abstract)**

- Base implementation for both coin types
- Integrates with Uniswap V4 PoolManager
- Handles liquidity migration between hook versions
- Manages pool key and basic coin functionality

**CreatorCoin**
- One per creator, backed by ZORA tokens

- One per creator, backed by NICHE tokens
- 1 billion total supply with 5-year vesting schedule
- 500M tokens vest to creator, 500M available for trading
- Simpler reward distribution (creator + protocol)

**ContentCoin**

- Multiple per creator, backed by creator's coin
- 1 billion total supply with instant creator allocation
- 10M tokens to creator immediately, 990M available for trading
Expand All @@ -106,12 +109,14 @@ classDiagram
### Factory Contract

**ZoraFactoryImpl**

- Deploys new coins with deterministic addresses
- Supports custom pool configurations and post-deployment hooks
- Creates Uniswap V4 pools automatically with appropriate hook contracts
- Provides address prediction before deployment

Key functions:

- `deploy()` - General coin deployment with full customization
- `deployCreatorCoin()` - Simplified Creator Coin deployment
- `coinAddress()` - Predict deployment address before deploying
Expand All @@ -121,16 +126,17 @@ Key functions:
The protocol uses a unified hook architecture:

**BaseZoraV4CoinHook (Abstract)**

- Contains all shared hook functionality for both coin types
- Implements Uniswap V4 hook interface (`afterSwap`, `afterInitialize`)
- Handles pool initialization, fee collection, and currency conversion
- Supports migration to new hook versions while preserving liquidity

Core functionality:

- Collects trading fees from liquidity positions
- Splits fees between LP rewards and market rewards
- Converts fees to backing currency via multi-hop swaps
- Distributes rewards based on coin type via unified logic

> History: Prior to v2.3.0 the protocol used two hooks (`ContentCoinHook` and `CreatorCoinHook`). This was consolidated into `ZoraV4CoinHook` for a single, unified implementation.

Loading