Skip to content

Commit 524f5ef

Browse files
authored
Merge pull request #16 from oak-network/revert-13-feature/integration-flows
Revert "docs: add comprehensive integration flow guides"
2 parents 2291432 + 2bc8c21 commit 524f5ef

12 files changed

Lines changed: 69 additions & 1939 deletions

docs/contracts-sdk/integration-flow.md

Lines changed: 0 additions & 508 deletions
This file was deleted.

docs/contracts-sdk/overview.md

Lines changed: 0 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ sidebar_label: Overview
66

77
The `@oaknetwork/contracts-sdk` package is a TypeScript SDK for interacting with Oak Network smart contracts. It provides a type-safe client with full read/write access to all Oak protocol contracts, built on top of [viem](https://viem.sh).
88

9-
import MermaidDiagram from '@site/src/components/MermaidDiagram';
10-
119
:::tip Testnet first
1210
Start by pointing the SDK at Celo Sepolia testnet (`CHAIN_IDS.CELO_TESTNET_SEPOLIA`) to experiment without risking real funds.
1311
:::
@@ -16,58 +14,6 @@ Start by pointing the SDK at Celo Sepolia testnet (`CHAIN_IDS.CELO_TESTNET_SEPOL
1614
You need deployed contract addresses to use this SDK — including factory addresses (for example `CampaignInfoFactory`, `TreasuryFactory`) and any protocol contracts you call through the client. The SDK interacts with Oak Network smart contracts that must already be deployed on-chain. To get your contract addresses and sandbox environment access, contact our team at [support@oaknetwork.org](mailto:support@oaknetwork.org).
1715
:::
1816

19-
## Smart Contract Architecture
20-
21-
<MermaidDiagram title="Contract Architecture">
22-
23-
```mermaid
24-
flowchart TB
25-
subgraph Protocol["Protocol Level (Oak Network)"]
26-
GP[GlobalParams<br/>Protocol fees, token addresses]
27-
end
28-
29-
subgraph Factories["Factory Contracts"]
30-
CIF[CampaignInfoFactory<br/>Creates campaigns]
31-
TF[TreasuryFactory<br/>Creates treasuries]
32-
end
33-
34-
subgraph Campaign["Campaign Level"]
35-
CI[CampaignInfo<br/>Campaign metadata, state]
36-
Treasury[Treasury Contract<br/>AllOrNothing / BaseTreasury]
37-
end
38-
39-
subgraph Actions["User Actions"]
40-
Pledge[pledgeForAReward]
41-
Refund[claimRefund]
42-
Withdraw[withdraw]
43-
DisburseF[disburseFees]
44-
end
45-
46-
GP --> CIF
47-
GP --> TF
48-
CIF -->|createCampaign| CI
49-
TF -->|deploy| Treasury
50-
CI <-->|linked| Treasury
51-
52-
Treasury --> Pledge
53-
Treasury --> Refund
54-
Treasury --> Withdraw
55-
Treasury --> DisburseF
56-
```
57-
58-
</MermaidDiagram>
59-
60-
| Contract | Purpose | Deployed By |
61-
|---|---|---|
62-
| **GlobalParams** | Protocol-level configuration (fees, tokens) | Oak Network |
63-
| **CampaignInfoFactory** | Creates CampaignInfo clones | Oak Network |
64-
| **TreasuryFactory** | Deploys treasury contracts | Oak Network |
65-
| **CampaignInfo** | Campaign metadata and state | Platform (via factory) |
66-
| **BaseTreasury** | Abstract treasury base class | Not deployed directly |
67-
| **AllOrNothing** | Refund-if-failed treasury model | Platform (via factory) |
68-
69-
---
70-
7117
## Highlights
7218

7319
- **Flexible signers** — simple keyed client, read-only RPC client, per-entity or per-call signer overrides, or full viem `PublicClient` / `WalletClient` setup including [Privy](https://www.privy.io/) embedded wallets (see [Client Configuration](/docs/contracts-sdk/client))
@@ -164,76 +110,6 @@ import { getPlatformStats, getCampaignSummary, getTreasuryReport } from '@oaknet
164110

165111
> See the full [Metrics](/docs/contracts-sdk/metrics) guide.
166112
167-
## Campaign Lifecycle
168-
169-
<MermaidDiagram title="Campaign Lifecycle">
170-
171-
```mermaid
172-
sequenceDiagram
173-
participant Creator
174-
participant CIF as CampaignInfoFactory
175-
participant CI as CampaignInfo
176-
participant TF as TreasuryFactory
177-
participant Treasury as AllOrNothing Treasury
178-
participant Backer
179-
participant Protocol as Protocol Admin
180-
181-
rect rgb(40, 40, 60)
182-
Note over Creator,Treasury: Phase 1: Campaign Setup
183-
Creator->>CIF: createCampaign(data)
184-
CIF->>CI: Clone & initialize
185-
CI-->>CIF: Campaign address
186-
CIF-->>Creator: Campaign created
187-
188-
Creator->>TF: deploy(campaignInfo, implementationId)
189-
TF->>Treasury: Clone & initialize
190-
Treasury-->>TF: Treasury address
191-
TF->>CI: setPlatformInfo(treasury)
192-
TF-->>Creator: Treasury deployed
193-
194-
Creator->>Treasury: addRewards(rewards)
195-
Treasury-->>Creator: Rewards configured
196-
end
197-
198-
rect rgb(40, 60, 40)
199-
Note over Creator,Backer: Phase 2: Campaign Active
200-
Note over CI: Launch time reached
201-
202-
Backer->>Treasury: pledgeForAReward(rewardId, amount, shipping)
203-
Treasury->>Treasury: Transfer tokens from backer
204-
Treasury->>Treasury: Mint NFT receipt
205-
Treasury-->>Backer: Token ID returned
206-
207-
Note over Treasury: More backers pledge...
208-
end
209-
210-
rect rgb(60, 60, 40)
211-
Note over Creator,Protocol: Phase 3a: Campaign Succeeds
212-
Note over CI: Deadline reached, goal met
213-
214-
Creator->>Treasury: disburseFees()
215-
Treasury->>Protocol: Transfer protocol fee
216-
Treasury->>CI: Transfer platform fee
217-
Treasury-->>Creator: Fees disbursed
218-
219-
Creator->>Treasury: withdraw()
220-
Treasury-->>Creator: Remaining funds transferred
221-
end
222-
223-
rect rgb(60, 40, 40)
224-
Note over Creator,Backer: Phase 3b: Campaign Fails
225-
Note over CI: Deadline reached, goal NOT met
226-
227-
Backer->>Treasury: claimRefund(tokenId)
228-
Treasury->>Treasury: Burn NFT
229-
Treasury-->>Backer: Pledge amount returned
230-
end
231-
```
232-
233-
</MermaidDiagram>
234-
235-
---
236-
237113
## Entry points
238114

239115
| Import path | Contents |

docs/contracts-sdk/quickstart.md

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
11
# Quickstart
22

3-
Deploy your first on-chain crowdfunding campaign using Oak Network's Contracts SDK. This guide walks you from zero to a working contract interaction in under 5 minutes.
4-
5-
import MermaidDiagram from '@site/src/components/MermaidDiagram';
6-
7-
<MermaidDiagram title="Campaign Lifecycle">
8-
9-
```mermaid
10-
flowchart LR
11-
Create[Create Campaign] --> Deploy[Deploy Treasury]
12-
Deploy --> Rewards[Add Rewards]
13-
Rewards --> Launch[Campaign Launches]
14-
Launch --> Pledge[Backers Pledge]
15-
Pledge --> Settle[Settle or Refund]
16-
```
17-
18-
</MermaidDiagram>
19-
20-
---
3+
This guide walks you from zero to a working contract interaction in under 5 minutes.
214

225
## 1. Install the package
236

@@ -213,23 +196,8 @@ If Privy does not include your chain in its default networks, register it in the
213196

214197
> For per-entity and per-call signers, browser wallets, and the full list of patterns, see [Client Configuration](/docs/contracts-sdk/client).
215198
216-
---
217-
218-
## Key Concepts
219-
220-
| Concept | Description |
221-
|---|---|
222-
| **CampaignInfo** | Stores campaign metadata (goal, deadline, platforms) |
223-
| **Treasury** | Holds funds, manages rewards, handles settlements |
224-
| **AllOrNothing** | Treasury type where backers get refunds if goal isn't met |
225-
| **NFT Receipt** | ERC721 token proving a backer's pledge |
226-
| **Reward Tier** | Minimum pledge amount to receive specific rewards |
227-
228-
---
229-
230199
## What to read next
231200

232-
- [Integration Flow](/docs/contracts-sdk/integration-flow) — campaign creation, backer interactions, settlement, security, and contract reference
233201
- [Client Configuration](/docs/contracts-sdk/client) — all setup patterns, per-entity and per-call signers, resolution order, and browser wallets
234202
- [GlobalParams](/docs/contracts-sdk/global-params) — protocol-wide configuration reads and writes
235203
- [CampaignInfoFactory](/docs/contracts-sdk/campaign-info-factory) — deploying new campaigns

docs/guides/integration-overview.md

Lines changed: 0 additions & 154 deletions
This file was deleted.

docs/intro.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ Comprehensive documentation, SDKs, and integration guides to get you started qui
4343

4444
## Quick Links
4545

46-
- [Choose Your Integration Path](/docs/guides/integration-overview) - Find the right integration approach
4746
- [Create Your First Campaign](/docs/guides/create-campaign) - Get started in minutes
48-
- [Payment SDK Quickstart](/docs/sdk/quickstart) - 6-step fiat payment integration
49-
- [Contracts SDK Quickstart](/docs/contracts-sdk/quickstart) - Deploy crypto-native campaigns
5047
- [Core Concepts](/docs/concepts/overview) - Understand the protocol
48+
- [Integration Guides](/docs/guides/create-campaign) - Integrate Oak Network
5149
- [Smart Contracts](/docs/contracts/overview) - Technical reference
5250
- [Security](/docs/security/overview) - Security architecture and audits
5351

5452
## Get Started
5553

56-
Ready to build? Start with [Choose Your Integration Path](/docs/guides/integration-overview) to find the right approach for your platform, or jump straight into [Create Your First Campaign](/docs/guides/create-campaign) to get started in minutes.
54+
Ready to build? Check out our [Create Your First Campaign](/docs/guides/create-campaign) guide or explore our [Platform Integration](/docs/guides/platform-integration) documentation.

0 commit comments

Comments
 (0)