Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
ac7280d
Add `KeepWhatsRaised` treasury abstract contract
mahabubAlahi Apr 29, 2025
0c2bfae
Add `pledge` functionality in `KeepWhatsRaised` treasury
mahabubAlahi Apr 30, 2025
9cb7fc7
WIP: Add `withdraw` functionality in `KeepWhatsRaised` treasury
mahabubAlahi Apr 30, 2025
bdda8d9
Update configuration and fee keys setup in `KeepWhatsRaised` treasury
mahabubAlahi May 2, 2025
89b3ee9
Update withdraw functionality
mahabubAlahi May 2, 2025
ccfb169
Add disburse fee functionality
mahabubAlahi May 2, 2025
632f1b2
Add claim tip functionality
mahabubAlahi May 2, 2025
58afe26
Add claim refund functionality
mahabubAlahi May 5, 2025
2c4bf40
Add admin fund claim functionality; Update claim tip
mahabubAlahi May 5, 2025
44390a2
Update success condition; Remove abstract keyword
mahabubAlahi May 5, 2025
a466fa3
Add custom campaign configurations in treasury
mahabubAlahi May 5, 2025
7c6ce30
Add update deadline and goal amount functionality
mahabubAlahi May 5, 2025
805e699
Fix the refund and fund claiming time logic
mahabubAlahi May 6, 2025
757e2e1
Update claim refund
mahabubAlahi May 6, 2025
8958d70
Fix withdrawal fee calculation
mahabubAlahi May 6, 2025
7fdfa65
Fix withdrawal; Add NatSpec doc; Add `getAvailableRaisedAmount` func…
mahabubAlahi May 6, 2025
fb8199e
Fix refund, tip, and fund claiming time logic
mahabubAlahi May 6, 2025
2ad54e2
Update `KeepWhatsRaised` treasury
mahabubAlahi May 7, 2025
9f5aa88
Add deployment scripts for `KeepWhatsRaised` treasury
mahabubAlahi May 8, 2025
ff97499
Fix `KeepWhatsRaised` deployment script
mahabubAlahi May 27, 2025
7ac353e
Update `KeepWhatsRaised` treasury imports; Update license identifier
mahabubAlahi May 27, 2025
fe16c44
Update docs
mahabubAlahi May 28, 2025
b4cf08b
Update `KeepWhatsRaised` treasury
mahabubAlahi Jun 17, 2025
f3cef36
Update `KeepWhatsRaised` deployment script
mahabubAlahi Jun 17, 2025
7ba93df
Add payment gateway fee calculation
mahabubAlahi Jun 18, 2025
df8a737
Update doc
mahabubAlahi Jun 18, 2025
c1008fa
Fix `KeepWhatsRaised` deployment issue
mahabubAlahi Jun 23, 2025
1cce474
Add non-refundable fee feature
mahabubAlahi Jun 23, 2025
81772c5
Remove time limit restriction for disbursement fee period
mahabubAlahi Jun 25, 2025
3ab694b
Update Colombian creator tax calculation to apply at withdrawal time
mahabubAlahi Jun 25, 2025
50f853a
Fix variable naming
mahabubAlahi Jun 25, 2025
e44a2d3
Update `KeepWhatsRaised` contract doc
mahabubAlahi Jun 25, 2025
ef41702
Add tests for KeepWhatsRaised (#4)
adnanhq Aug 4, 2025
8555972
Fix `AllOrNothing` treasury test failures (#22)
mahabubAlahi Aug 4, 2025
c350b01
Add Campaign Payment Treasury Implementation (#21)
mahabubAlahi Aug 4, 2025
bc745fa
Immunefi audit fixes (#23)
mahabubAlahi Aug 8, 2025
b9815f2
Enhance KeepWhatsRaised audit test coverage and update deployment scr…
adnanhq Aug 8, 2025
b25c241
Update contracts doc
mahabubAlahi Aug 12, 2025
8e8c727
Update Payment Treasury (#28)
mahabubAlahi Aug 19, 2025
a39e001
Add updated payment treasury tests (#29)
mahabubAlahi Aug 19, 2025
6024472
Add Phantom Balances Fix for PaymentTreasury (#30)
adnanhq Oct 7, 2025
0cfb877
Refactor admin rights transfer in deployment scripts (#31)
mahabubAlahi Oct 17, 2025
bd7ad75
Implement UUPS Upgradeability with Multi-Token Support (#33)
adnanhq Oct 19, 2025
70a90d3
Add TimeConstrainedPaymentTreasury and batch payment support to Payme…
mahabubAlahi Oct 20, 2025
b5f7011
Fix data registry storage read issue (#36)
adnanhq Oct 24, 2025
dffcc78
Add time constraints for campaign creation (#37)
adnanhq Nov 10, 2025
52e1ed9
Add Lock Mechanism in `CampaignInfo` Contract (#40)
mahabubAlahi Nov 10, 2025
e398868
Add PledgeNFT module and integrate into treasuries (#39)
adnanhq Nov 12, 2025
43b9948
Refactor/campaign raised amount getters (#41)
adnanhq Nov 12, 2025
fbdbad1
Add Line Item Support, External Fees Data, Claim Expire Funds Functio…
mahabubAlahi Nov 12, 2025
de4ca27
Update contract documentation (#43)
mahabubAlahi Nov 12, 2025
520b31f
Clarify Payment Treasury Metadata and Lifetime Totals and Updated the…
mahabubAlahi Nov 12, 2025
a4103d3
Update deployment scripts (#45)
mahabubAlahi Dec 2, 2025
75eceea
Immunefi audit fixes v2 (#57)
mahabubAlahi Dec 2, 2025
559989b
Add Immunefi Audit Report for Creative Crowdfunding v1.0 (#59)
mahabubAlahi Dec 2, 2025
79d3466
Add non-ASCII validation for NFT name (#60)
adnanhq Dec 5, 2025
7245eec
Add events for treasury implementation registrations and approvals (#61)
adnanhq Dec 5, 2025
330a4d7
Enhance launch time validation in CampaignInfo contract (#62)
mahabubAlahi Dec 5, 2025
44048e7
Add new deployment scripts (#63)
adnanhq Dec 8, 2025
1f9f897
Update readme.md
rayedsikder Jan 2, 2026
0ce055a
Merge branch 'main' into 2.0-rc
mahabubAlahi Jan 2, 2026
b1a0b56
Update documentation and references to reflect project rebranding fro…
mahabubAlahi Jan 2, 2026
0c0c794
Update README.md
adnanhq Jan 2, 2026
54b79aa
Update test.yml
adnanhq Jan 2, 2026
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
6 changes: 0 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ jobs:
ls -la
cat foundry.toml

- name: Install dependencies
run: |
# Install OpenZeppelin contracts version 5.3.0
forge install OpenZeppelin/openzeppelin-contracts@v5.3.0
ls -la lib/

- name: Run Forge build
run: |
forge remappings
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
/lib
.env
.deps
.temp
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
51 changes: 38 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
# Creative Crowdfunding Protocol (CC Protocol) Smart Contracts
# Oak Network Smart Contracts

## Overview

CC Protocol 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 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.

## 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

1. Clone the repository:

```bash
git clone https://github.com/ccprotocol/ccprotocol-contracts.git
cd ccprotocol-contracts
git clone https://github.com/oak-network/contracts.git
cd contracts
```

2. Install dependencies:
Expand Down Expand Up @@ -94,6 +98,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 +121,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 +132,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,6 +153,8 @@ 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
Expand All @@ -138,7 +163,7 @@ Security audit reports can be found in the [`audits/`](./audits/) folder. We reg

## Contributing

We welcome all contributions to the Creative Crowdfunding Protocol. If you're interested in helping, here's how you can contribute:
We welcome all contributions to the Oak Network. If you're interested in helping, here's how you can contribute:

- **Report bugs** by opening issues
- **Suggest enhancements** or new features
Expand All @@ -154,18 +179,18 @@ Before contributing, please read our detailed [Contributing Guidelines](./CONTRI

### Community

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

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

## Contributors

<a href="https://github.com/ccprotocol/ccprotocol-contracts/graphs/contributors">
<img src="https://contrib.rocks/image?repo=ccprotocol/ccprotocol-contracts" />
<a href="https://github.com/oak-network/contracts/graphs/contributors">
<img src="https://contrib.rocks/image?repo=oak-network/contracts" />
</a>

Made with [contrib.rocks](https://contrib.rocks).

## License

This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ no-section-label = true
additional-js = ["solidity.min.js"]
additional-css = ["book.css"]
mathjax-support = true
git-repository-url = "https://github.com/ccprotocol/ccprotocol-contracts"
git-repository-url = "https://github.com/oak-network/contracts"

[output.html.fold]
enable = true
18 changes: 9 additions & 9 deletions docs/src/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Creative Crowdfunding Protocol (CC Protocol) Smart Contracts
# Oak Network Smart Contracts

## Overview

CC Protocol 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 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.

## Features

Expand All @@ -21,8 +21,8 @@ CC Protocol is a decentralized crowdfunding protocol designed to help creators l
1. Clone the repository:

```bash
git clone https://github.com/ccprotocol/ccprotocol-contracts.git
cd ccprotocol-contracts
git clone https://github.com/oak-network/contracts.git
cd contracts
```

2. Install dependencies:
Expand Down Expand Up @@ -138,7 +138,7 @@ Security audit reports can be found in the [`audits/`](./audits/) folder. We reg

## Contributing

We welcome all contributions to the Creative Crowdfunding Protocol. If you're interested in helping, here's how you can contribute:
We welcome all contributions to the Oak Network. If you're interested in helping, here's how you can contribute:

- **Report bugs** by opening issues
- **Suggest enhancements** or new features
Expand All @@ -154,18 +154,18 @@ Before contributing, please read our detailed [Contributing Guidelines](./CONTRI

### Community

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

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

## Contributors

<a href="https://github.com/ccprotocol/ccprotocol-contracts/graphs/contributors">
<img src="https://contrib.rocks/image?repo=ccprotocol/ccprotocol-contracts" />
<a href="https://github.com/oak-network/contracts/graphs/contributors">
<img src="https://contrib.rocks/image?repo=oak-network/contracts" />
</a>

Made with [contrib.rocks](https://contrib.rocks).

## License

This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).
13 changes: 13 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
# Summary
- [Home](README.md)
# src
- [❱ constants](src/constants/README.md)
- [DataRegistryKeys](src/constants/DataRegistryKeys.sol/library.DataRegistryKeys.md)
- [❱ interfaces](src/interfaces/README.md)
- [ICampaignData](src/interfaces/ICampaignData.sol/interface.ICampaignData.md)
- [ICampaignInfo](src/interfaces/ICampaignInfo.sol/interface.ICampaignInfo.md)
- [ICampaignInfoFactory](src/interfaces/ICampaignInfoFactory.sol/interface.ICampaignInfoFactory.md)
- [ICampaignPaymentTreasury](src/interfaces/ICampaignPaymentTreasury.sol/interface.ICampaignPaymentTreasury.md)
- [ICampaignTreasury](src/interfaces/ICampaignTreasury.sol/interface.ICampaignTreasury.md)
- [IGlobalParams](src/interfaces/IGlobalParams.sol/interface.IGlobalParams.md)
- [IItem](src/interfaces/IItem.sol/interface.IItem.md)
- [IReward](src/interfaces/IReward.sol/interface.IReward.md)
- [ITreasuryFactory](src/interfaces/ITreasuryFactory.sol/interface.ITreasuryFactory.md)
- [❱ storage](src/storage/README.md)
- [AdminAccessCheckerStorage](src/storage/AdminAccessCheckerStorage.sol/library.AdminAccessCheckerStorage.md)
- [CampaignInfoFactoryStorage](src/storage/CampaignInfoFactoryStorage.sol/library.CampaignInfoFactoryStorage.md)
- [GlobalParamsStorage](src/storage/GlobalParamsStorage.sol/library.GlobalParamsStorage.md)
- [TreasuryFactoryStorage](src/storage/TreasuryFactoryStorage.sol/library.TreasuryFactoryStorage.md)
- [❱ treasuries](src/treasuries/README.md)
- [AllOrNothing](src/treasuries/AllOrNothing.sol/contract.AllOrNothing.md)
- [KeepWhatsRaised](src/treasuries/KeepWhatsRaised.sol/contract.KeepWhatsRaised.md)
- [PaymentTreasury](src/treasuries/PaymentTreasury.sol/contract.PaymentTreasury.md)
- [TimeConstrainedPaymentTreasury](src/treasuries/TimeConstrainedPaymentTreasury.sol/contract.TimeConstrainedPaymentTreasury.md)
- [❱ utils](src/utils/README.md)
- [AdminAccessChecker](src/utils/AdminAccessChecker.sol/abstract.AdminAccessChecker.md)
- [BasePaymentTreasury](src/utils/BasePaymentTreasury.sol/abstract.BasePaymentTreasury.md)
- [BaseTreasury](src/utils/BaseTreasury.sol/abstract.BaseTreasury.md)
- [CampaignAccessChecker](src/utils/CampaignAccessChecker.sol/abstract.CampaignAccessChecker.md)
- [Counters](src/utils/Counters.sol/library.Counters.md)
- [FiatEnabled](src/utils/FiatEnabled.sol/abstract.FiatEnabled.md)
- [ItemRegistry](src/utils/ItemRegistry.sol/contract.ItemRegistry.md)
- [PausableCancellable](src/utils/PausableCancellable.sol/abstract.PausableCancellable.md)
- [PledgeNFT](src/utils/PledgeNFT.sol/abstract.PledgeNFT.md)
- [TimestampChecker](src/utils/TimestampChecker.sol/abstract.TimestampChecker.md)
- [CampaignInfo](src/CampaignInfo.sol/contract.CampaignInfo.md)
- [CampaignInfoFactory](src/CampaignInfoFactory.sol/contract.CampaignInfoFactory.md)
Expand Down
Loading