Skip to main content
Real-world, scenario-driven examples that walk you through every capability of the Oak Contracts SDK. Each scenario tells a story — a platform onboarding, a crowdfunding campaign, an e-commerce checkout — and implements it step by step with working code. Whether you are a developer integrating Oak into your product or a stakeholder evaluating the protocol, these examples show exactly how the SDK works in practice.
Getting startedYou need deployed contract addresses and testnet access. Contact support@oaknetwork.org to begin your onboarding.

How to Read These Examples

Each scenario in the source repo contains:
  • A README.md with the story, the roles involved, and a summary of each step
  • Numbered TypeScript files (01-..., 02-...) that you can read top-to-bottom like a tutorial
Start with Platform Enlistment if you are a new platform joining Oak Protocol. Start with All-or-Nothing or Keep-What’s-Raised if your platform is already onboarded and you want to launch a campaign.

Multi-token ERC-20 support

Oak is multi-token: GlobalParams stores currencyToTokens — seeded in initialize(currencies, tokensPerCurrency), then maintained by the protocol owner with addTokenToCurrency / removeTokenFromCurrency, readable via getTokensForCurrency(currency). Campaign creation copies that list onto CampaignInfo; treasuries check isTokenAccepted on every pledgeToken / paymentToken. In code, use globalParams.getTokensForCurrency(...) or campaign.getAcceptedTokens() to populate wallet UIs or validation. Balances, fees, refunds, and raised-amount reads are per token address, in native decimals (normalized where the protocol aggregates across tokens). The numbered examples use one stablecoin (e.g. USDC) so the files stay easy to read. In production, swap in any address from your campaign’s accepted-token list and match decimals when you build amounts.

Quick Start

Every example imports from @oaknetwork/contracts-sdk. The shared setup file shows the common client setup pattern used across all examples.
Then pick a scenario and follow the steps in order.

Roles

Four roles appear throughout these examples. Understanding who does what is key to following each scenario:
Platform OnboardingPlatform Onboarding is a coordinated process between the Protocol Admin and the Platform Admin. See Platform Enlistment for the complete walkthrough, or contact support@oaknetwork.org to get started.

Scenario Overview