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.
- 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
- Foundry
- Solidity ^0.8.22
- Clone the repository:
git clone https://github.com/oak-network/contracts.git
cd contracts- Install dependencies:
forge install- Copy environment template:
cp .env.example .env- Configure your
.envfile following the template in.env.example
Comprehensive documentation is available in the docs/ folder:
- Technical specifications
- Contract interfaces
- Deployment guides
- Development setup instructions
To view the documentation:
cd docsforge build# Run all tests
forge test
# Run specific test
forge test --match-test testFunctionName
# Run tests with more verbose output
forge test -vvv# Start local blockchain
anvil
# Deploy to local network
forge script script/DeployAll.s.sol:DeployAll --rpc-url http://localhost:8545 --private-key $PRIVATE_KEY --broadcast# Deploy to any configured network
forge script script/DeployAll.s.sol:DeployAll --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcastIf 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.
# Example: deploy and setup PaymentTreasury
forge script script/DeployAllAndSetupPaymentTreasury.s.sol:DeployAllAndSetupPaymentTreasury \
--rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcastThese scripts read configuration from
.env(e.g.PLATFORM_NAME,PROTOCOL_FEE_PERCENT,PLATFORM_FEE_PERCENT,CURRENCIES/TOKENS_PER_CURRENCY, and optionalPLATFORM_ADAPTER_ADDRESSfor meta-txs).
GlobalParams: Protocol-wide parameter managementCampaignInfoFactory: Campaign creation and managementTreasuryFactory: Treasury contract deployment
AllOrNothing: Funds refunded if campaign goal not metKeepWhatsRaised: 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 bylaunchTime → deadline + bufferTime
TestTokenis a mock ERC20 token used only for testing and development purposes.- It is located in the
mocks/directory and should not be included in production deployments.
At a high level:
- Deploy
GlobalParams(UUPS proxy + implementation) - Deploy
TreasuryFactory(UUPS proxy + implementation) - Deploy
CampaignInfoFactory(UUPS proxy + implementation) - Configure currencies/tokens + data registry keys + platforms (and optional platform adapters)
- Register and approve treasury implementations per platform, then deploy treasuries per campaign
For local testing or development, the
TestTokenmock token needs to be deployed before interacting with contracts requiring an ERC20 token.
Key environment variables to configure in .env:
PRIVATE_KEY: Deployment wallet private keyRPC_URL: Network RPC endpoint (can be configured for any network)SIMULATE: Toggle simulation mode- Contract address variables for reuse
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 audit reports can be found in the audits/ folder. We regularly conduct security audits to ensure the safety and reliability of the protocol.
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
- Submit pull requests to improve the codebase
- Improve documentation to make the project more accessible
Before contributing, please read our detailed Contributing Guidelines for comprehensive information on:
- Development workflow
- Coding standards
- Testing requirements
- Pull request process
- Smart contract security considerations
Join our community on Discord for questions and discussions.
Read our Code of Conduct to keep our community approachable and respectful.
Made with contrib.rocks.
This project is licensed under the MIT License.