Skip to content

Commit 0fbe196

Browse files
committed
docs(README): update readme and make it more concise
The readme has become a bit outdated. This commit removes outdated information and makes the document more evergreen.
1 parent 4ebb8e2 commit 0fbe196

File tree

1 file changed

+42
-137
lines changed

1 file changed

+42
-137
lines changed

status-network-contracts/README.md

Lines changed: 42 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,76 @@
1-
# Staking Protocol [![Github Actions][gha-badge]][gha] [![Codecov][codecov-badge]][codecov] [![Foundry][foundry-badge]][foundry]
1+
# Status Network Contracts
22

3-
[gha]: https://github.com/vacp2p/staking-reward-streamer/actions
4-
[gha-badge]: https://github.com/vacp2p/staking-reward-streamer/actions/workflows/test.yml/badge.svg
5-
[codecov]: https://codecov.io/gh/vacp2p/staking-reward-streamer
6-
[codecov-badge]: https://codecov.io/gh/vacp2p/staking-reward-streamer/graph/badge.svg
7-
[foundry]: https://getfoundry.sh/
8-
[foundry-badge]: https://img.shields.io/badge/Built%20with-Foundry-FFDB1C.svg
3+
Smart contracts for Status Network's Karma reputation system, which enables gasless transactions.
94

10-
## 🧭 Overview
5+
## Overview
116

12-
The **Staking Reward Streamer Protocol** enables secure token staking with dynamic reward calculation on Ethereum. Built with modularity and upgradability in mind, the system includes core components to manage stake deposits, reward calculations, time-based locking, and contract migration through user consent.
7+
This repository contains the core smart contracts that power the Status Network's reputation and reward system. The system is built with modularity and upgradability in mind.
138

14-
---
9+
### Main Components
1510

16-
## 🧩 Core Contracts
11+
- **Karma Token**: An ERC20 reputation token used throughout the Status Network ecosystem. Karma enables free transactions and access to network features.
12+
- **Karma NFT**: A non-transferable ERC721 token that visually represents an account's Karma level.
13+
- **Reward Distributors**: Contracts that implement custom reward distribution logic, including the staking reward distributor and simple distributor variants.
14+
- **Staking System**: Allows users to stake SNT tokens to earn Karma rewards.
15+
- **Karma Airdrop**: Merkle tree-based airdrop mechanism for distributing Karma to accounts.
1716

18-
### 🛠️ `StakeManager`
17+
For a comprehensive overview of the system architecture, see [System Overview](docs/system-overview.md).
1918

20-
- Handles staking logic, tracks stakes and reward epochs.
21-
- Calculates APY via **Multiplier Points**, which increase over time.
22-
- Validates vaults using codehash verification for added safety.
23-
- Upgradeable via proxy; users can opt out of migrations.
19+
## Documentation
2420

25-
### 🔐 `StakeVault`
21+
Detailed documentation is available in the [`docs`](docs) folder:
2622

27-
- A vault owned by the user, used to store and manage staked tokens.
28-
- Interacts directly with `StakeManager` for staking and unstaking operations.
29-
- Ensures only the owner can execute critical actions.
30-
- Verifies contract code via codehash to ensure safety.
23+
- [System Overview](docs/system-overview.md) - Architecture and component interactions
24+
- [Karma Token](docs/karma.md) - Token mechanics and features
25+
- [Staking Reward Distributor](docs/staking-reward-distributor/overview.md) - How staking and rewards work
26+
- [Reward Distributors](docs/reward-distributors.md) - Custom reward distribution logic
27+
- [Deployment Guide](docs/deployment.md) - How to deploy the contracts
28+
- [Security](SECURITY.md) - Security considerations and audit information
3129

32-
---
30+
## Getting Started
3331

34-
## ✨ Features
32+
### Prerequisites
3533

36-
- **Secure, user-owned staking vaults**
37-
- **Dynamic APY via Multiplier Points**
38-
- **Stake locking to boost rewards**
39-
- **ERC20-compatible (via OpenZeppelin)**
40-
- **Proxy upgradeability with opt-in/opt-out support**
41-
- **Epoch-based reward streaming**
34+
- [Foundry](https://getfoundry.sh/) - Ethereum development toolkit
35+
- [pnpm](https://pnpm.io/) - Package manager
4236

43-
---
37+
### Installation
4438

45-
## 🚀 Getting Started
46-
47-
### 📦 Install Dependencies
48-
49-
```bash
39+
```sh
5040
pnpm install
5141
```
5242

53-
---
54-
55-
## ⚙️ Usage
56-
57-
### 📄 Deployment Flow
58-
59-
1. **Deploy `StakeManager`**
60-
2. **Deploy a sample `StakeVault` (e.g., on a devnet or testnet)**
61-
3. **Configure codehash** in `StakeManager`:
62-
63-
```solidity
64-
stakeManager.setTrustedCodehash(<vault_codehash>, true);
65-
```
66-
67-
---
68-
69-
### 💰 Staking
70-
71-
1. **Approve** the `StakeVault` to spend your tokens:
72-
73-
```solidity
74-
erc20.approve(stakeVaultAddress, amount);
75-
```
76-
77-
2. **Stake** your tokens:
78-
79-
```solidity
80-
stakeVault.stake(amount, secondsToLock);
81-
```
82-
83-
> ⚠️ Do not transfer tokens directly to the `StakeVault`. Always use `approve` + `stake`.
84-
85-
Minimum stake amount and lock duration are enforced via contract settings. Epochs are automatically processed on stake actions.
86-
87-
---
88-
89-
### 🔓 Unstaking
90-
91-
```solidity
92-
stakeVault.unstake(amount);
93-
```
94-
95-
- Only available for unlocked balances.
96-
- Reduces stake proportionally based on amount and duration.
97-
98-
---
99-
100-
### 🔁 Migration (Opt-In/Out)
101-
102-
Users may opt-in to a new `StakeManager` implementation or leave:
103-
104-
```solidity
105-
stakeVault.acceptMigration(); // opt-in
106-
stakeVault.leave(); // opt-out
107-
```
108-
109-
> Migration triggers automatic reward claiming. Locked balances can still opt out.
110-
111-
---
112-
113-
## 📬 Deployed Contracts
114-
115-
These are the official contract deployments on the **Sepolia testnet** (via [Status Network Explorer](https://sepoliascan.status.network)):
116-
117-
| Contract | Address |
118-
|---------------------|-----------------------------------------------------------------------------------------------------|
119-
| **StakeManagerProxy** | [0x2C09141e66970A71862beAcCbDb816ec01D6B676](https://sepoliascan.status.network/address/0x2C09141e66970A71862beAcCbDb816ec01D6B676?tab=contract) |
120-
| **StakeManager** | [0xa2432fB545829f89E172ddE2DeD6D289c7ee125F](https://sepoliascan.status.network/address/0xa2432fB545829f89E172ddE2DeD6D289c7ee125F?tab=contract) |
121-
| **VaultFactory** | [0xA6300Bd8aF26530D399a1b24B703EEf2c48a71Be](https://sepoliascan.status.network/address/0xA6300Bd8aF26530D399a1b24B703EEf2c48a71Be) |
122-
| **KarmaProxy** | [0x486Ac0F5Eb7079075dE26739E1192D41F278a8db](https://sepoliascan.status.network/address/0x486Ac0F5Eb7079075dE26739E1192D41F278a8db) |
123-
| **Karma** | [0xE9413C84eFF6B08E4F614Efe69EB7eb9a1Ca1180](https://sepoliascan.status.network/address/0xE9413C84eFF6B08E4F614Efe69EB7eb9a1Ca1180?tab=contract) |
124-
| **KarmaNFT** | [0xdE5592e1001f52380f9EDE01aa6725F469A8e46F](https://sepoliascan.status.network/address/0xdE5592e1001f52380f9EDE01aa6725F469A8e46F?tab=contract) |
125-
126-
---
127-
128-
## 🧪 Development
129-
130-
### 🏗️ Build Contracts
43+
### Build
13144

13245
```sh
13346
forge build
13447
```
13548

136-
### 🧹 Clean Build Artifacts
137-
138-
```sh
139-
forge clean
140-
```
141-
142-
### 🧪 Run Tests
49+
### Test
14350

14451
```sh
14552
forge test
14653
```
14754

148-
### 🧮 Coverage
55+
### Coverage
14956

15057
```sh
15158
forge coverage
15259
```
15360

154-
### 🚀 Deploy Locally (Anvil)
61+
## Development
62+
63+
### Linting
15564

15665
```sh
157-
forge script script/Deploy.s.sol --broadcast --fork-url http://localhost:8545
66+
pnpm lint
15867
```
15968

160-
> Requires `MNEMONIC` env variable.
161-
162-
---
69+
### Formatting
16370

164-
## 📊 Gas & Linting
71+
```sh
72+
forge fmt
73+
```
16574

16675
### Gas Reports
16776

@@ -170,21 +79,17 @@ pnpm gas-report
17079
forge snapshot
17180
```
17281

173-
### Linting
17482

175-
```sh
176-
pnpm lint
177-
```
83+
## Deployment
17884

179-
### Formatting
85+
The recommended way to deploy the full protocol is using the `DeployProtocol` script:
18086

18187
```sh
182-
forge fmt
88+
MNEMONIC=$YOUR_MNEMONIC forge script script/DeployProtocol.s.sol --rpc-url $RPC_URL --broadcast
18389
```
18490

185-
### Commit preparing command
91+
For detailed deployment instructions, including verification and network configuration, see the [Deployment Guide](docs/deployment.md).
18692

187-
```sh
188-
pnpm adorno
189-
```
93+
## License
19094

95+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

0 commit comments

Comments
 (0)