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