|
1 |
| -# Sablier Deployments |
| 1 | +# Sablier Deployments 🚀 |
2 | 2 |
|
3 |
| -TODO: rewrite this |
| 3 | +Deployment data for the [Sablier Protocol](https://sablier.com), the token distribution protocol for Ethereum and |
| 4 | +EVM-compatible chains. |
4 | 5 |
|
5 |
| -This repository keeps track of Sablier deployment bundles, each of which includes: |
| 6 | +This package provides: |
6 | 7 |
|
7 |
| -1. Contract artifacts and ABIs. |
8 |
| -2. The [broadcast](https://book.getfoundry.sh/guides/scripting-with-solidity) directories generated by Foundry upon |
9 |
| - running the deploy scripts. |
| 8 | +- **Contract addresses** across all supported protocols and chains |
| 9 | +- **Release management** for multiple protocol versions |
| 10 | +- **Chain data** with RPC endpoints and explorer URLs |
| 11 | +- **TypeScript SDK** for accessing deployment data programmatically |
10 | 12 |
|
11 |
| -The deployments are indexed by: |
| 13 | +## Installation 📦 |
12 | 14 |
|
13 |
| -1. Repository ("lockup" or "flow") |
14 |
| -2. Version name (e.g. "v1.0.0") |
15 |
| -3. Artifacts |
16 |
| -4. Broadcasts, which in turn are indexed by chain name. |
| 15 | +```bash |
| 16 | +npm install @sablier/deployments |
| 17 | +# or |
| 18 | +yarn add @sablier/deployments |
| 19 | +# or |
| 20 | +bun add @sablier/deployments |
| 21 | +``` |
17 | 22 |
|
18 |
| -If you need the deployment addresses, you can find them in the [docs](https://docs.sablier.com). |
| 23 | +## Protocol Overview 🎯 |
19 | 24 |
|
20 |
| -## Background |
| 25 | +Sablier supports multiple protocols across versions: |
21 | 26 |
|
22 |
| -Sablier Protocols have been built, tested, formatted, and deployed with the [Foundry](https://getfoundry.sh) smart |
23 |
| -contract development toolchain. |
| 27 | +### Current Protocols |
24 | 28 |
|
25 |
| -To learn more about Foundry, see the [Foundry Book](https://book.getfoundry.sh). |
| 29 | +- **💧 Sablier Airdrops** - Merkle-based airdrop distributions with an optional vesting module |
| 30 | +- **🔒 Sablier Lockup** - Time-locked token vesting with cliffs |
| 31 | +- **🔄 Sablier Flow** - Token streaming with continuous payments |
| 32 | +- **⚡ Sablier Legacy** - Old release similar to Lockup, deployed between 2019-2021 |
26 | 33 |
|
27 |
| -To learn more about Sablier, see the [Sablier Docs](https://docs.sablier.com). |
| 34 | +### Supported Chains |
28 | 35 |
|
29 |
| -## Addresses |
| 36 | +**Mainnets**: Ethereum, Arbitrum, Optimism, Polygon, Base, BSC, Avalanche, and 20+ more. |
30 | 37 |
|
31 |
| -To view the deployment addresses, use the links below. |
| 38 | +**Testnets**: Sepolia, Base Sepolia, Optimism Sepolia, and more. |
32 | 39 |
|
33 |
| -- [Airdrops deployment addresses](https://docs.sablier.com/guides/airdrops/deployments) |
34 |
| -- [Lockup deployment addresses](https://docs.sablier.com/guides/lockup/deployments) |
35 |
| -- [Flow deployment addresses](https://docs.sablier.com/guides/flow/deployments) |
| 40 | +### Addresses |
36 | 41 |
|
37 |
| -### Packages |
| 42 | +The addresses are provided in this package, but you can also view the deployment addresses on the |
| 43 | +[Sablier Docs](https://docs.sablier.com) website: |
38 | 44 |
|
39 |
| -The contract artifacts and the ABIs are published as NPM packages: |
| 45 | +- [Sablier Airdrops addresses](https://docs.sablier.com/guides/airdrops/deployments) |
| 46 | +- [Sablier Lockup addresses](https://docs.sablier.com/guides/lockup/deployments) |
| 47 | +- [Sablier Flow addresses](https://docs.sablier.com/guides/flow/deployments) |
40 | 48 |
|
41 |
| -- [@sablier/airdrops](https://npmjs.com/package/@sablier/airdrops) |
42 |
| -- [@sablier/lockup](https://npmjs.com/package/@sablier/lockup) |
43 |
| -- [@sablier/flow](https://npmjs.com/package/@sablier/flow) |
| 49 | +## API Reference 📖 |
44 | 50 |
|
45 |
| -Older versions of Lockup (before v2.0.0) and Airdrops (before v1.3.0) have been published through these packages: |
| 51 | +### Chains |
46 | 52 |
|
47 |
| -- [@sablier/v2-core](https://npmjs.com/package/@sablier/v2-core) |
48 |
| -- [@sablier/v2-periphery](https://npmjs.com/package/@sablier/v2-periphery) |
| 53 | +Our chain types extend upon Viem's [Chain](https://viem.sh/docs/chains/introduction). |
49 | 54 |
|
50 |
| -## Scripts |
| 55 | +```typescript |
| 56 | +import { chains } from "@sablier/deployments"; |
51 | 57 |
|
52 |
| -The contracts have been deployed using these scripts: |
| 58 | +// Get by name |
| 59 | +const ethereum = chains.ethereum; |
53 | 60 |
|
54 |
| -- [airdrops/script](https://github.com/sablier-labs/airdrops/tree/main/script) |
55 |
| -- [lockup/script](https://github.com/sablier-labs/lockup/tree/main/script) |
56 |
| -- [flow/script](https://github.com/sablier-labs/flow/tree/main/script) |
| 61 | +// Get chain by ID |
| 62 | +const arbitrum = chains.queries.get({ chainId: 42161 }); |
57 | 63 |
|
58 |
| -Specifically, with the "DeployDeterministic" scripts, which rely upon this CREATE2 factory: |
| 64 | +// Get chain by slug |
| 65 | +const polygon = chains.queries.get({ slug: "polygon" }); |
59 | 66 |
|
60 |
| -- https://github.com/Arachnid/deterministic-deployment-proxy |
| 67 | +// Check if chain supports Sablier UI |
| 68 | +if (ethereum.isSupportedByUI) { |
| 69 | + console.log("Available on app.sablier.com"); |
| 70 | +} |
| 71 | +``` |
61 | 72 |
|
62 |
| -### Differentiation |
| 73 | +### Contracts |
63 | 74 |
|
64 |
| -The rationale for using CREATE2 is not to generate deterministic deployment addresses - quite the opposite. The goal is |
65 |
| -to have different addresses on each chain. By using CREATE2, we can systematically differentiate the contract addresses |
66 |
| -by passing a salt, whereas if we had used CREATE, the deployer's nonce would have impacted the resulting deployment |
67 |
| -address. |
| 75 | +```typescript |
| 76 | +import { releases, sablier } from "@sablier/deployments"; |
68 | 77 |
|
69 |
| -## Logging |
| 78 | +// Get contract by name and chain |
| 79 | +const lockup = sablier.contracts.get({ |
| 80 | + name: "SablierLockup", |
| 81 | + release: releases.lockup["v2.0"], |
| 82 | +}); |
| 83 | +``` |
70 | 84 |
|
71 |
| -This project uses Winston for logging. By default, logs are output to the console, but they can also be written to a |
72 |
| -file by setting the following environment variables: |
| 85 | +### Releases |
73 | 86 |
|
74 |
| -- `LOG_FILE_PATH`: Path to the log file (e.g., `./logs/deployments.log`). When set, logs will be written to this file in |
75 |
| - addition to the console. |
76 |
| -- `LOG_LEVEL`: Set the logging level (default: `info`). Valid values are: `error`, `warn`, `info`, `verbose`, `debug`, |
77 |
| - and `silly`. |
| 87 | +```typescript |
| 88 | +import { releases, sablier } from "@sablier/deployments"; |
78 | 89 |
|
79 |
| -Example usage: |
| 90 | +// Get specific releases |
| 91 | +const airdropsV1_3 = releases.airdrops["v1.3"]; |
| 92 | +const lockupV2_0 = releases.lockup["v2.0"]; |
| 93 | +const flowV1_1 = releases.flow["v1.1"]"; |
80 | 94 |
|
81 |
| -```bash |
82 |
| -# Log to both console and file |
83 |
| -LOG_FILE_PATH=./logs/deployments.log bun run build |
| 95 | +// Get all Lockup releases |
| 96 | +const allLockups = sablier.releases.getAll({ protocol: "lockup" }); |
| 97 | +``` |
| 98 | + |
| 99 | +## Data Structure 📊 |
| 100 | + |
| 101 | +### Release Object |
| 102 | + |
| 103 | +See the [types](./src/types.ts) for more information. |
84 | 104 |
|
85 |
| -# Set a custom log level |
86 |
| -LOG_LEVEL=debug LOG_FILE_PATH=./logs/debug.log bun run test |
| 105 | +```typescript |
| 106 | +interface Release { |
| 107 | + protocol: "flow" | "lockup" | "airdrops" | "legacy"; |
| 108 | + version: "v1.0" | "v1.1" | "v2.0" | ...; |
| 109 | + isLatest: boolean; |
| 110 | + contractNames: string[]; |
| 111 | + deployments: Deployment[]; |
| 112 | +} |
87 | 113 | ```
|
88 | 114 |
|
89 |
| -## License |
| 115 | +### Deployment Broadcasts |
| 116 | + |
| 117 | +The deployment broadcasts (generated with [Foundry](https://book.getfoundry.sh/reference/cheatcodes/broadcast/)) are |
| 118 | +located under the [`data`](./data) directory. |
| 119 | + |
| 120 | +Each deployment is stored as JSON with a structure like this, which is generated by Foundry: |
| 121 | + |
| 122 | +```json |
| 123 | +{ |
| 124 | + "transactions": [...], // Deployment transactions |
| 125 | + "receipts": [...], // Transaction receipts |
| 126 | + "libraries": [...], // Linked libraries |
| 127 | + "returns": { // Deployed contract addresses |
| 128 | + "flow": "0x...", |
| 129 | + "nftDescriptor": "0x..." |
| 130 | + }, |
| 131 | + "timestamp": 1738015038, // Deployment timestamp |
| 132 | + "chain": 1, // Chain ID |
| 133 | + "commit": "a0fa33d" // Git commit hash |
| 134 | +} |
| 135 | +``` |
| 136 | + |
| 137 | +## Contributing 🤝 |
| 138 | + |
| 139 | +We welcome contributions! |
| 140 | + |
| 141 | +- 🐛 [Bug reports](https://github.com/sablier-labs/deployments/issues/new) |
| 142 | +- 💬 [Discussions](https://github.com/sablier-labs/deployments/discussions/new) |
| 143 | +- 💬 [Discord](https://discord.gg/bSwRCwWRsT) |
| 144 | + |
| 145 | +For guidance on how to make PRs, see the [CONTRIBUTING](./CONTRIBUTING.md) guide. |
| 146 | + |
| 147 | +## Links 📚 |
| 148 | + |
| 149 | +- 📖 [Protocol Docs](https://docs.sablier.com) |
| 150 | +- 🔗 [API Reference](https://docs.sablier.com/api/overview) |
| 151 | +- ⏳ [Sablier App](https://app.sablier.com) |
| 152 | + |
| 153 | +## License 📄 |
90 | 154 |
|
91 |
| -This repo is licensed under GPL 3-0 or later. |
| 155 | +This project is licensed under [GPL-3.0-or-later](./LICENSE.md). |
0 commit comments