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
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to CC Protocol
# Contributing to Oak Network

Thank you for your interest in contributing to the Creative Crowdfunding Protocol! This document provides detailed guidelines to help you contribute effectively.
Thank you for your interest in contributing to the Oak Network smart contracts! This document provides detailed guidelines to help you contribute effectively.

## Table of Contents

Expand Down Expand Up @@ -34,14 +34,14 @@ Please read our [Code of Conduct](./CODE_OF_CONDUCT.md) to understand the behavi

If you want to add or modify the content of this project:

1. [Search if an issue already exists](https://github.com/ccprotocol/ccprotocol-contracts/issues)
1. [Search if an issue already exists](https://github.com/oak-network/contracts/issues)
2. If a related issue doesn't exist, create a new issue using the appropriate template
3. Discuss the proposed changes with the community before starting work
4. Wait for issue assignment or approval before submitting a PR

#### Solve an Issue

Scan through our [existing issues](https://github.com/ccprotocol/ccprotocol-contracts/issues) to find one that interests you. You can use labels to filter issues:
Scan through our [existing issues](https://github.com/oak-network/contracts/issues) to find one that interests you. You can use labels to filter issues:

- `good first issue`: Suitable for newcomers
- `bug`: Issues with the existing code
Expand All @@ -54,12 +54,12 @@ Scan through our [existing issues](https://github.com/ccprotocol/ccprotocol-cont
1. Fork the repository
2. Clone your fork:
```bash
git clone https://github.com/YOUR_USERNAME/ccprotocol-contracts.git
cd ccprotocol-contracts
git clone https://github.com/YOUR_USERNAME/contracts.git
cd contracts
```
3. Add the original repository as upstream:
```bash
git remote add upstream https://github.com/ccprotocol/ccprotocol-contracts.git
git remote add upstream https://github.com/oak-network/contracts.git
```
4. Install development dependencies:
```bash
Expand Down Expand Up @@ -190,8 +190,8 @@ All code changes must include appropriate tests:
- **Discord**: For quick questions and community discussions
- **Pull Requests**: For code review discussions

Join our community on [Discord](https://discord.gg/4tR9rWc3QE).
Join our community on [Discord](https://discord.gg/NnPKaB2Qdr).

## License

By contributing to CC Protocol, you agree that your contributions will be licensed under the project's [MIT License](./LICENSE).
By contributing to Oak Network, you agree that your contributions will be licensed under the project's [MIT License](https://opensource.org/licenses/MIT).
98 changes: 98 additions & 0 deletions DEPLOYMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Deployments

Canonical record of Oak Network contract deployments per network.

> **Integrators:** always use the proxy addresses. Implementation addresses change on upgrades; the proxies are the stable entry points.

## Celo Mainnet (chain ID 42220)

Deployed from commit [`8280e7e`](https://github.com/oak-network/contracts/commit/8280e7e).

### Core Contracts

Upgradeable via UUPS — the proxy is the address you interact with; the implementation sits behind it.

| Contract | Proxy | Current implementation |
| --- | --- | --- |
| `GlobalParams` | [`0xA92F7fd92c562a3B1Db45EF15B388C11b5b89975`](https://celoscan.io/address/0xA92F7fd92c562a3B1Db45EF15B388C11b5b89975) | [`0x109635d81914b3b6F763f63c85f14d7C44b9bb31`](https://celoscan.io/address/0x109635d81914b3b6F763f63c85f14d7C44b9bb31) |
| `TreasuryFactory` | [`0xf18D315bc26c3dcaaD20ba2723AA6A9A774fc68b`](https://celoscan.io/address/0xf18D315bc26c3dcaaD20ba2723AA6A9A774fc68b) | [`0x48172EB631febc990c33D9F6111ccc48F5601e27`](https://celoscan.io/address/0x48172EB631febc990c33D9F6111ccc48F5601e27) |
| `CampaignInfoFactory` | [`0x82921bdd594E56ddC2722a0a1d6FC13F5c15eEf4`](https://celoscan.io/address/0x82921bdd594E56ddC2722a0a1d6FC13F5c15eEf4) | [`0x5bFEdc8151a99BD6F82A266d6d79AC5FB4BbA5DB`](https://celoscan.io/address/0x5bFEdc8151a99BD6F82A266d6d79AC5FB4BbA5DB) |

### Implementation Contracts

Master copies deployed as clones per campaign; individual campaign and treasury clones are not listed here — they are discoverable through factory events.

| Contract | Address | Notes |
| --- | --- | --- |
| `CampaignInfo` | [`0x7092D62d094305d58900aE339557DDBc892411a5`](https://celoscan.io/address/0x7092D62d094305d58900aE339557DDBc892411a5) | cloned per campaign via `CampaignInfoFactory` |
| `PaymentTreasury` | [`0x871BF839e48fD91cBA7ccF37a3119F84adb54584`](https://celoscan.io/address/0x871BF839e48fD91cBA7ccF37a3119F84adb54584) | treasury model; registered and approved per platform in `TreasuryFactory` |

### Enlisted Platforms

| Platform | Platform hash | Platform admin |
| --- | --- | --- |
| Oak Client | `0x380d02de444b5e73657867182cb87a6a68439ff83f5861ee08812ad27b97ac07` | [`0x08D59f5C0c2e6923fFcA216F3A1941b87E283b67`](https://celoscan.io/address/0x08D59f5C0c2e6923fFcA216F3A1941b87E283b67) |

### Roles

| Role | Address |
| --- | --- |
| Protocol admin | [`0xeAF297815Ec765eecdA15E3fD3509D5B2aCAA272`](https://celoscan.io/address/0xeAF297815Ec765eecdA15E3fD3509D5B2aCAA272) |

### Supported Tokens

| Token | Address |
| --- | --- |
| USDC | [`0xcebA9300f2b948710d2653dD7B07f33A8B32118C`](https://celoscan.io/address/0xcebA9300f2b948710d2653dD7B07f33A8B32118C) |
| USDT | [`0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e`](https://celoscan.io/address/0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e) |

## Celo Sepolia (chain ID 11142220)

Testnet deployment. Deployed from commit [`8280e7e`](https://github.com/oak-network/contracts/commit/8280e7e), built with `via_ir` disabled — so the on-chain `CampaignInfo` runtime bytecode differs from a default build (the repo's `foundry.toml` sets `via_ir = true`), though the source and compiler metadata are identical to mainnet.

### Core Contracts

Upgradeable via UUPS — the proxy is the address you interact with; the implementation sits behind it.

| Contract | Proxy | Current implementation |
| --- | --- | --- |
| `GlobalParams` | [`0x11D9CdF0634Fd278922024C9addd93C7aE85748a`](https://sepolia.celoscan.io/address/0x11D9CdF0634Fd278922024C9addd93C7aE85748a) | [`0x28fe5C5E5A9A0156Aa3bADbd3844eD646bF5791f`](https://sepolia.celoscan.io/address/0x28fe5C5E5A9A0156Aa3bADbd3844eD646bF5791f) |
| `TreasuryFactory` | [`0x982DA9430A62907c38483C5d24F929729D515688`](https://sepolia.celoscan.io/address/0x982DA9430A62907c38483C5d24F929729D515688) | [`0x7f705d7cda588013b15e4a59Ec7B116f68d17bC3`](https://sepolia.celoscan.io/address/0x7f705d7cda588013b15e4a59Ec7B116f68d17bC3) |
| `CampaignInfoFactory` | [`0xFd1cD536876E382F8405Cce5A42525Ce9E37f2d3`](https://sepolia.celoscan.io/address/0xFd1cD536876E382F8405Cce5A42525Ce9E37f2d3) | [`0x1024cbBDd2367c073014A09FceB5Ef8859A0eC18`](https://sepolia.celoscan.io/address/0x1024cbBDd2367c073014A09FceB5Ef8859A0eC18) |

### Implementation Contracts

Master copies cloned per campaign / per treasury; individual clones are discoverable through factory events. The ID column is the implementation's registration index in `TreasuryFactory`.

| Contract | ID | Address |
| --- | --- | --- |
| `CampaignInfo` | – | [`0xdBaEf75a3447237eF83f85206D31e459D88Ad5F5`](https://sepolia.celoscan.io/address/0xdBaEf75a3447237eF83f85206D31e459D88Ad5F5) |
| `PaymentTreasury` | 0 | [`0x7A408ffDcA74ff10D24dbDA887422EE276f40154`](https://sepolia.celoscan.io/address/0x7A408ffDcA74ff10D24dbDA887422EE276f40154) |
| `AllOrNothing` | 1 | [`0xB3593319cE75577b4AD96194413e20CBa49bFECb`](https://sepolia.celoscan.io/address/0xB3593319cE75577b4AD96194413e20CBa49bFECb) |
| `KeepWhatsRaised` | 2 | [`0x325f96E96a12129554A9e02BC7B25CB6071ecC95`](https://sepolia.celoscan.io/address/0x325f96E96a12129554A9e02BC7B25CB6071ecC95) |

### Enlisted Platforms

| Platform | Platform hash | Platform admin |
| --- | --- | --- |
| Test Platform | `0x99888fd9c3c0b13fb80891dd6fa3fa47dd3cbaec59b30606d472475963977e11` | [`0x115bA891fB8F455873a6A89D5d495503f7328F5E`](https://sepolia.celoscan.io/address/0x115bA891fB8F455873a6A89D5d495503f7328F5E) |

No platform adapter (trusted forwarder) is configured on this deployment — ERC-2771 meta-transactions are disabled.

### Roles

| Role | Address |
| --- | --- |
| Protocol admin | [`0x115bA891fB8F455873a6A89D5d495503f7328F5E`](https://sepolia.celoscan.io/address/0x115bA891fB8F455873a6A89D5d495503f7328F5E) |

### Supported Tokens

| Token | Address |
| --- | --- |
| USD (`TestToken` — testnet mock, **not** a real stablecoin) | [`0x7b46288d8A6349710Da17c3c913B188053ee06f3`](https://sepolia.celoscan.io/address/0x7b46288d8A6349710Da17c3c913B188053ee06f3) |

## Upgrade History

| Date | Network | Contract | Old implementation | New implementation | Notes |
| --- | --- | --- | --- | --- | --- |
| – | – | – | – | – | no upgrades yet |
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ For a complete list of variables, refer to `.env.example`.

> Tip: `script/` contains deployment, setup, and upgrade scripts for each treasury type (including UUPS upgrade scripts).

## Deployments

Deployed contract addresses per network are tracked in [`DEPLOYMENTS.md`](./DEPLOYMENTS.md).

## Security

### Audits
Expand All @@ -167,7 +171,7 @@ The protocol has undergone multiple independent security reviews. Full reports l

| Date | Auditor | Scope | Report |
| --- | --- | --- | --- |
| Jun 17, 2026 | OpenZeppelin | Full protocol (commit `479241c`) | [PDF](./audits/OpenZeppelin%20-%20%2301%20-%20Smart%20Contracts%20Audit-report.pdf) |
| Jul 31, 2026 | OpenZeppelin | Full protocol (commit `479241c`) | [PDF](./audits/OpenZeppelin%20-%20%2301%20-%20Smart%20Contracts%20Audit-report.pdf) |
| Dec 10, 2025 | Immunefi (Neplox) | `PaymentTreasury` | [PDF](./audits/ImmuneFi-Audit-Report-OakNetwork-PaymentTreasury.pdf) |
| Aug 5, 2025 | Immunefi (Neplox) | Creative Crowdfunding Protocol v1.0 | [PDF](./audits/Immunefi-Audit-Report-CreativeCrowdfunding_v1.0.pdf) |
| May 20, 2025 | PeckShield | Creative Crowdfunding Protocol v1.0 | [PDF](./audits/PeckShield-Audit-Report-CreativeCrowdfunding_v1.0.pdf) |
Expand Down
Binary file modified audits/OpenZeppelin - #01 - Smart Contracts Audit-report.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions audits/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ This folder contains the independent security audit reports for the Oak Network

| Date | Auditor | Scope | Report |
| --- | --- | --- | --- |
| Jun 17, 2026 | OpenZeppelin | Full protocol at commit [`479241c`](https://github.com/oak-network/contracts/commit/479241c) | [PDF](./OpenZeppelin%20-%20%2301%20-%20Smart%20Contracts%20Audit-report.pdf) |
| Jul 31, 2026 | OpenZeppelin | Full protocol at commit [`479241c`](https://github.com/oak-network/contracts/commit/479241c) | [PDF](./OpenZeppelin%20-%20%2301%20-%20Smart%20Contracts%20Audit-report.pdf) · [live](https://www.openzeppelin.com/news/oak-network-smart-contracts-audit) |
| Dec 10, 2025 | Immunefi (Neplox) | `PaymentTreasury` | [PDF](./ImmuneFi-Audit-Report-OakNetwork-PaymentTreasury.pdf) |
| Aug 5, 2025 | Immunefi (Neplox) | Creative Crowdfunding Protocol v1.0 | [PDF](./Immunefi-Audit-Report-CreativeCrowdfunding_v1.0.pdf) |
| May 20, 2025 | PeckShield | Creative Crowdfunding Protocol v1.0 | [PDF](./PeckShield-Audit-Report-CreativeCrowdfunding_v1.0.pdf) |

---

## OpenZeppelin — Oak Network Smart Contracts Audit (June 17, 2026)
## OpenZeppelin — Oak Network Smart Contracts Audit (July 31, 2026)

### At a Glance

| | |
| --- | --- |
| **Auditor** | OpenZeppelin Security |
| **Audit window** | January 5, 2026 – February 4, 2026 |
| **Published** | June 17, 2026 |
| **Published** | July 31, 2026 ([live report](https://www.openzeppelin.com/news/oak-network-smart-contracts-audit)) |
| **Audited commit** | [`479241c`](https://github.com/oak-network/contracts/commit/479241c) |
| **Scope** | All core contracts under `src/`: `CampaignInfo`, `CampaignInfoFactory`, `GlobalParams`, `TreasuryFactory`, constants, interfaces, storage libraries, the four treasuries (`AllOrNothing`, `KeepWhatsRaised`, `PaymentTreasury`, `TimeConstrainedPaymentTreasury`), and shared utils (`AdminAccessChecker`, `BasePaymentTreasury`, `BaseTreasury`, `CampaignAccessChecker`, `Counters`, `FiatEnabled`, `ItemRegistry`, `PausableCancellable`, `PledgeNFT`, `TimestampChecker`) |

Expand Down
50 changes: 43 additions & 7 deletions docs/src/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
# Oak Network Smart Contracts

[![Audited by OpenZeppelin](https://img.shields.io/badge/audited%20by-OpenZeppelin-4E5EE4?logo=openzeppelin&logoColor=white)](./audits/OpenZeppelin%20-%20%2301%20-%20Smart%20Contracts%20Audit-report.pdf)
[![Audited by Immunefi](https://img.shields.io/badge/audited%20by-Immunefi-E11D74)](./audits/ImmuneFi-Audit-Report-OakNetwork-PaymentTreasury.pdf)
[![Audited by PeckShield](https://img.shields.io/badge/audited%20by-PeckShield-2E7CF6)](./audits/PeckShield-Audit-Report-CreativeCrowdfunding_v1.0.pdf)

## Overview

Oak Network is a decentralized crowdfunding protocol designed to help creators launch and manage campaigns across multiple platforms. By providing a standardized infrastructure, the protocol simplifies the process of creating, funding, and managing crowdfunding initiatives in web3 across different platforms.
Oak Network is programmable commerce and escrow infrastructure — an on-chain backbone for creating and managing conditional payment flows. Each flow is defined once on-chain and shared across platforms, while funds are held and settled by interchangeable treasury models.

## Features

- Cross-listable campaign creation
- Multiple treasury models
- Secure fund management
- Customizable protocol parameters
- Currency-based multi-token campaigns
- Campaign-level Pledge NFTs (one ERC721 collection per campaign)
- ERC-2771 meta-transactions for platform admin operations using multisig wallets
- UUPS upgradeability for core protocol contracts

## Prerequisites

- [Foundry](https://book.getfoundry.sh/)
- Solidity ^0.8.20
- Solidity ^0.8.22

## Installation

Expand Down Expand Up @@ -94,6 +102,18 @@ forge script script/DeployAll.s.sol:DeployAll --rpc-url http://localhost:8545 --
forge script script/DeployAll.s.sol:DeployAll --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast
```

#### Deploy core + setup a specific treasury model

If you want a one-shot script that deploys the protocol (UUPS proxies), configures `GlobalParams`, and registers + approves a treasury implementation for a platform, you can run one of the `DeployAllAndSetup*.s.sol` scripts.

```bash
# Example: deploy and setup PaymentTreasury
forge script script/DeployAllAndSetupPaymentTreasury.s.sol:DeployAllAndSetupPaymentTreasury \
--rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast
```

> These scripts read configuration from `.env` (e.g. `PLATFORM_NAME`, `PROTOCOL_FEE_PERCENT`, `PLATFORM_FEE_PERCENT`, `CURRENCIES`/`TOKENS_PER_CURRENCY`, and optional `PLATFORM_ADAPTER_ADDRESS` for meta-txs).

## Contract Architecture

### Core Contracts
Expand All @@ -105,6 +125,9 @@ forge script script/DeployAll.s.sol:DeployAll --rpc-url $RPC_URL --private-key $
### Treasury Models

- `AllOrNothing`: Funds refunded if campaign goal not met
- `KeepWhatsRaised`: Flexible treasury that keeps funds regardless of goal achievement (tips, configurable fees, withdrawal gating)
- `PaymentTreasury`: Payment-style treasury (off-chain payment creation + on-chain confirmation, line items, optional NFT mint)
- `TimeConstrainedPaymentTreasury`: PaymentTreasury variant gated by `launchTime → deadline + bufferTime`

### Notes on Mock Contracts

Expand All @@ -113,9 +136,13 @@ forge script script/DeployAll.s.sol:DeployAll --rpc-url $RPC_URL --private-key $

## Deployment Workflow

1. Deploy `GlobalParams`
2. Deploy `TreasuryFactory`
3. Deploy `CampaignInfoFactory`
At a high level:

1. Deploy `GlobalParams` (UUPS proxy + implementation)
2. Deploy `TreasuryFactory` (UUPS proxy + implementation)
3. Deploy `CampaignInfoFactory` (UUPS proxy + implementation)
4. Configure currencies/tokens + data registry keys + platforms (and optional platform adapters)
5. Register and approve treasury implementations per platform, then deploy treasuries per campaign

> For local testing or development, the `TestToken` mock token needs to be deployed before interacting with contracts requiring an ERC20 token.

Expand All @@ -130,11 +157,20 @@ Key environment variables to configure in `.env`:

For a complete list of variables, refer to `.env.example`.

> Tip: `script/` contains deployment, setup, and upgrade scripts for each treasury type (including UUPS upgrade scripts).

## Security

### Audits

Security audit reports can be found in the [`audits/`](./audits/) folder. We regularly conduct security audits to ensure the safety and reliability of the protocol.
The protocol has undergone multiple independent security reviews. Full reports live in the [`audits/`](./audits/) folder; see the [audit index](./audits/README.md) for per-finding status and remediation details.

| Date | Auditor | Scope | Report |
| --- | --- | --- | --- |
| Jun 17, 2026 | OpenZeppelin | Full protocol (commit `479241c`) | [PDF](./audits/OpenZeppelin%20-%20%2301%20-%20Smart%20Contracts%20Audit-report.pdf) |
| Dec 10, 2025 | Immunefi (Neplox) | `PaymentTreasury` | [PDF](./audits/ImmuneFi-Audit-Report-OakNetwork-PaymentTreasury.pdf) |
| Aug 5, 2025 | Immunefi (Neplox) | Creative Crowdfunding Protocol v1.0 | [PDF](./audits/Immunefi-Audit-Report-CreativeCrowdfunding_v1.0.pdf) |
| May 20, 2025 | PeckShield | Creative Crowdfunding Protocol v1.0 | [PDF](./audits/PeckShield-Audit-Report-CreativeCrowdfunding_v1.0.pdf) |

## Contributing

Expand All @@ -154,7 +190,7 @@ Before contributing, please read our detailed [Contributing Guidelines](./CONTRI

### Community

Join our community on [Discord](https://discord.gg/tnBhVxSDDS) for questions and discussions.
Join our community on [Discord](https://discord.gg/NnPKaB2Qdr) for questions and discussions.

Read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community approachable and respectful.

Expand Down
7 changes: 7 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# src
- [❱ constants](src/constants/README.md)
- [DataRegistryKeys](src/constants/DataRegistryKeys.sol/library.DataRegistryKeys.md)
- [❱ errors](src/errors/README.md)
- [ProtocolErrors](src/errors/ProtocolErrors.sol/library.ProtocolErrors.md)
- [TreasuryErrors](src/errors/TreasuryErrors.sol/library.TreasuryErrors.md)
- [❱ interfaces](src/interfaces/README.md)
- [ICampaignData](src/interfaces/ICampaignData.sol/interface.ICampaignData.md)
- [ICampaignInfo](src/interfaces/ICampaignInfo.sol/interface.ICampaignInfo.md)
Expand All @@ -11,6 +14,10 @@
- [ICampaignTreasury](src/interfaces/ICampaignTreasury.sol/interface.ICampaignTreasury.md)
- [IGlobalParams](src/interfaces/IGlobalParams.sol/interface.IGlobalParams.md)
- [IItem](src/interfaces/IItem.sol/interface.IItem.md)
- [IEIP712](src/interfaces/IPermit2.sol/interface.IEIP712.md)
- [ISignatureTransfer](src/interfaces/IPermit2.sol/interface.ISignatureTransfer.md)
- [IPermit2](src/interfaces/IPermit2.sol/interface.IPermit2.md)
- [PermitData](src/interfaces/IPermit2.sol/struct.PermitData.md)
- [IReward](src/interfaces/IReward.sol/interface.IReward.md)
- [ITreasuryFactory](src/interfaces/ITreasuryFactory.sol/interface.ITreasuryFactory.md)
- [❱ storage](src/storage/README.md)
Expand Down
Loading
Loading