Skip to content

Commit

Permalink
Update docs for V2.1 (#115)
Browse files Browse the repository at this point in the history
* feat: add transferable documentation

feat: add parameters tables in Types section
refactor: update core accordingly to 2.1 changes
perf: overall improve hyperlinks
fix: use release branch to cite from github

* feat: add Merkle Streamer documentation in periphery

feat: remove proxy documentation in periphery

* feat: add LOCKUP

* feat: include in sender in the withdraw multiple acces control

* feat: remove sender hook guides

* feat: add batch create streams section

feat: remove proxy architecture section
feat: add more snippets
refactor: remove ERC20Spets snippet
refactor: use constants in guides

* refactor: update overview to not reference proxy system

feat: add note in Flash Loans

* feat: add a new page for older deployments

feat: reference the old deployment page in the latest version

* perf: improve wording in older deployments page

* feat: reference examples in stream types section

feat: remove outdated contracts and interfaces
refactor: use yarn to install sablier Node.js packages
chore: correct typos

* feat: remove sender hook in protocol concepts

* fix: correct reference hyperlinks

perf: mention ISablierV2MerkleStreamer documentation
chore: remove unnecessary word

* feat: add airstream campaigns page in concepts

feat: remove flashloans page in concepts
feat: add diagram for airstream campaign

* feat: add diagram image

* chore: polish airstream campaign page

* refactor: update sender/recipient permissions

* refactor: update airstream concept page

* perf: polish airstream concept page

perf: improve airstream diagram
refactore: remove png diagram from technical reference

* refactor: update SablierV2NFTDescriptor contract

* refactor: segregate v2.0 and v2.1 deployments

feat: add v2.1 deployment addresses for Sepolia

* feat: add v2.1 deployments

* refactor: older deployments

* feat: add Mainnet Periphery

* fix: use correct hyperlink for aribtrum sepolia contracts

* refactor: remove Avalanche addresses

* refactor: update v2.1 deployment addresses

* fix: correct comptroller address on arbitrum sepolia

* refactor: move isWarm and isCold to SablierV2Lockup

* refactor: use yarn instead of pnpm in local-environment

* refactor: use new deployed addresses in guides

* refactor: reference blob/release instead of tree/release

* fix: correct arbitrum one dynamic address

* refactor: remove proxy and permit paragraphs from frontend guide page

---------

Co-authored-by: Paul Razvan Berg <[email protected]>
Co-authored-by: maxdesalle <[email protected]>
  • Loading branch information
3 people authored Dec 20, 2023
1 parent d2c1e90 commit ed052d2
Show file tree
Hide file tree
Showing 80 changed files with 2,093 additions and 2,965 deletions.
16 changes: 8 additions & 8 deletions docs/apps/02-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ on your payouts. Remember, you can always be both a sender and a recipient.
We've mapped the most important utilities from the V2 contracts into in-app features. Interact with streams that
reference you as a key participant (e.g. sender, recipient) directly from the interfaces.

| Feature | Recipient | Sender |
| ---------------------- | :-------: | :----: |
| Create Streams | | |
| Renounce Cancelability | | |
| Cancel | | |
| Cancel Multiple | | |
| Transfer | | |
| Withdraw | | |
| Feature | Sender | Recipient |
| ---------------------- | :----: | :-------: |
| Create Streams | | |
| Renounce Cancelability | | |
| Cancel || |
| Cancel Multiple || |
| Transfer | | |
| Withdraw || |

## Stream from your Safe multisig

Expand Down
7 changes: 7 additions & 0 deletions docs/concepts/protocol/02-stream-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ These streams are powered by a number of user-provided "segments", which we will
important to note here is that with Lockup Dynamic, Sablier has evolved into a universal streaming engine, capable of
supporting any custom streaming curve.

:::note

If you are interested in learning how to programmatically create the curves shown below in Solidity, check out the
[examples](https://github.com/sablier-labs/examples/blob/main/v2/core/LockupDynamicCurvesCreator.sol) repository.

:::

### Exponential

A fantastic use case for Lockup Dynamic is Exponential streams, a streaming model under which the recipient receives
Expand Down
79 changes: 79 additions & 0 deletions docs/concepts/protocol/07-airstreams.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
id: "airstreams"
sidebar_position: 7
title: "Airstreams"
---

:::note

Please refer to the [airdrop section](/concepts/use-cases#airdrops) of our use-cases page for an explanation regarding
why streaming an airdrop makes sense.

:::

## Why Airstreams?

The gist of Airstreams is that instead of airdropping the entirety of the tokens all at once, airdrop recipients receive
a fraction of the tokens every second through a token stream.

The beauty of it is that airdrop recipients are forced to think long-term and keep the project’s future as their first
and foremost priority. They are forced to, because instead of receiving all the tokens at once, they receive them over
time in the gorgeous Airstreams [interface](app.sablier.com/airstreams).

:::info

An airstream can have claim period of a few days, months, years or even no expiration, you get to chose. You could, for
example, configure the airdrop of your new token to vest over years, but the recipients will receive the streaming
tokens only if a claim is made in the interval set.

:::

Airstreams not only create the right incentives for token holders, but also prevents them from dumping their tokens on
day one, as has been the case for many airdrops in the past.

With Airstreams, airdrop recipients only receive a fraction of the tokens every second, only after they claim a stream
and have to withdraw the tokens which are getting streamed.

## How It Works

Thanks to our battle-tested token streaming and distribution protocol, you can quickly create Airstreams for thousands
of recipients in a few clicks using our interface. Recipients and their respective airdrop allocations can be added by
uploading a simple CSV spreadsheet to the [interface](app.sablier.com/airstreams).

Our spreadsheet feature is the perfect fit for airstreams: it allows you to upload a CSV file with tens of thousands of
recipients and the interface will automatically create a new airstream for each of these recipients.

Another great advantage, is that creating an Airstream campaign with thousands of recipients won't ruin you in terms of
gas fees, on the contrary. When launching a campaign, a contract is deployed, and Airstreams are only created when they
are claimed by the Airstream recipients. This is made possible by a system called _Merkle Distributor_, which is backed
by a Merkle Tree, a data structure used for efficiently summarizing and verifying the integrity of large sets of data.

:::note

The contract that implements an Airstream Campaign is called `MerkleStreamer`. For those interested in the technical
part, [click here](/contracts/v2/reference/periphery/contract.SablierV2MerkleStreamerLL).

:::

When you create an Airstream campaign, all you are really doing is deploying a contract that allows for the recipients
you put in to prove that they are eligible, and create a stream if they are. That's all it is.

Additionally, you don't have to immediately fund the Airstream contract. You can first create the contract, and at a
later date fund it with the tokens to be streamed over.

**This has three great implications:**

- **Recipients pay for the gas fees themselves to create the stream**, when they claim (the claim action creates the
stream). Creating a campaign with thousands of recipients would be incredibly costly if the campaign creator had to
pay for all the gas fees.
- **You keep full control over unclaimed Airstream token allocations**. If a recipient doesn't claim their Airstream,
it's not created, and you remain in full control over that token allocation.
- This is the case only if the campaign itself has an expiration date. If the campaign has no expiration date, the
recipients can claim their Airstreams at any time in the future.
- **You don't have to fund the campaign directly in order to deploy it**. You can deploy the campaign contract now, and
fund it at a later date when you feel comfortable doing so. There is no rush.

Once the Airstream campaign is launched, recipients who have claimed can withdraw the tokens which have already been
streamed at any time using our interface. The deployment page, the last step when launching an Airstream campaign.

![](/img/diagram-airstream-campaign.png)
55 changes: 0 additions & 55 deletions docs/concepts/protocol/07-flash-loans.mdx

This file was deleted.

18 changes: 1 addition & 17 deletions docs/concepts/protocol/08-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ title: "Hooks"
---

In Sablier, hooks are arbitrary functions that get automatically executed by the protocol in response to specific
events. Their purpose is to programmatically notify the recipient when the sender interacts with a stream, and vice
versa.
events. Their purpose is to programmatically notify the recipient when the sender interacts with a stream.

Hooks can only be written in smart contracts, so typical EOAs cannot implement them. However, they are entirely
optional. You can interact with the Sablier Protocol without implementing any hooks.
Expand Down Expand Up @@ -38,21 +37,6 @@ flowchart LR
LL -- "onStreamWithdrawn" --> R
```

### Recipient side

If the sender is not a smart contract, the hook will not be run.

```mermaid
flowchart LR
R((Recipient))
subgraph Core
LL[LockupLinear]
end
S((Sender))
R -- "cancel" --> LL
LL -- "onStreamCanceled" --> S
```

## Example scenario

Suppose you have created an NFT lending marketplace and wish to integrate Sablier. As a first step, you would typically
Expand Down
4 changes: 2 additions & 2 deletions docs/contracts/v2/01-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For a deeper dive, read through the [technical reference](./reference/overview).

# Resources

- [V2 Core](https://github.com/sablier-labs/v2-core)
- [V2 Periphery](https://github.com/sablier-labs/v2-periphery)
- [V2 Core](https://github.com/sablier-labs/v2-core/tree/release)
- [V2 Periphery](https://github.com/sablier-labs/v2-periphery/tree/release)
- [V2 Integration Template](https://github.com/sablier-labs/sablier-v2-integration-template)
- [Foundry Book](https://book.getfoundry.sh/)
Loading

0 comments on commit ed052d2

Please sign in to comment.