Skip to content

Commit

Permalink
flow status and nft
Browse files Browse the repository at this point in the history
  • Loading branch information
smol-ninja committed Oct 16, 2024
1 parent d9f71aa commit 22439a6
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 38 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
branch = "release"
path = "repos/lockup/v2-periphery"
url = "https://github.com/sablier-labs/v2-periphery"
[submodule "repos/flow"]
branch = "main"
path = "repos/flow"
url = "https://github.com/sablier-labs/flow"
8 changes: 4 additions & 4 deletions docs/apps/features/01-vesting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: "Vesting"

# Vesting

import NFTSVG from "@site/static/img/nft.svg";
import LockupNFTSVG from "@site/static/img/lockup-nft.svg";

The Sablier Interface has been redesigned from the ground up to support all the new features of the protocol, and then
some. Start exploring at [app.sablier.com](https://app.sablier.com).
Expand Down Expand Up @@ -38,9 +38,9 @@ Each stream in wrapped in an ERC-721 non-fungible token (NFT), making the stream

Thus streams can be transferred, traded, and used as collateral in NFT lending protocols.

| |
| ----------------------------------- |
| <NFTSVG height={500} width={500} /> |
| |
| ----------------------------------------- |
| <LockupNFTSVG height={500} width={500} /> |

## Dashboard for your streams

Expand Down
67 changes: 34 additions & 33 deletions docs/concepts/06-nft.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,35 @@ title: "NFTs"

import Link from "@docusaurus/Link";
import { links } from "@site/src/constants";
import NFTGalleryURL from "@site/static/img/nft-gallery.png";
import NFTSVG from "@site/static/img/nft.svg";
import FlowNFTSVG from "@site/static/img/flow-nft.svg";
import LockupNFTGalleryURL from "@site/static/img/lockup-gallery.png";
import LockupNFTSVG from "@site/static/img/lockup-nft.svg";

Both Lockup and Flow Protocols wrap every stream in an ERC-721 non-fungible token (NFT), making the stream recipient the
owner of the NFT. The recipient can transfer the NFT to another address, and this also transfers the right to withdraw
funds from the stream, including any funds already streamed.

## Lockup NFT

Sablier Lockup streams are represented as unique onchain generated hourglass SVGs, which change their color and content
based on user data. Here's an example for a stream that is 42.35% way through:

<LockupNFTSVG height={500} width={500} />

### Gallery of Multiple Sablier NFT SVGs

<img src={LockupNFTGalleryURL} height={500} width={500} />

If you prefer the granularity of a blockchain explorer, you can also view the stream NFTs on
[Etherscan](https://etherscan.io/token/0xB10daee1FCF62243aE27776D7a92D39dC8740f95). See the
[Deployments](/guides/lockup/deployments) page for the full list of addresses.

## Flow NFT

Unlike Lockup streams, the first release of Flow streams are represented by Sablier Logo.

<FlowNFTSVG height={500} width={500} />

## Integrations

The transferability of the NFT makes Sablier streams tradable and usable as collateral in DeFi. Imagine an NFT lending
Expand All @@ -22,7 +44,7 @@ their future income). Or a decentralized exchange that allows users to trade str
:::note

Not all Sablier streams are transferable. The stream creator can choose to make the stream non-transferable. You can
find more details on it in the [Lockup guide](/guides/lockup/guides/stream-management/transfer).
find more details on it in the [Transferability](/concepts/transferability) section.

:::

Expand All @@ -35,6 +57,13 @@ will try to respond as soon as possible.

## Marketplaces

:::caution

Be careful when buying NFTs that represent cancelable stream. When these streams are canceled, the unstreamed amount is
returned to the sender.

:::

Thanks to adhering to the ERC-721 standard, Sablier streams can be traded and viewed on any NFT marketplace. Here are
some of the marketplaces that support Sablier streams:

Expand All @@ -44,42 +73,14 @@ some of the marketplaces that support Sablier streams:
- [SuperRare](https://superrare.com)
- [LooksRare](https://looksrare.org)

## Lockup NFT

:::caution

Be careful when buying NFTs that represent cancelable stream. When these streams are canceled, the unstreamed amount is
returned to the sender.

:::

### Caching
## Caching

The SVG artwork is generated using certain real-time values, such as the current time on the blockchain. However, NFT
marketplaces cache the NFT metadata, and this may cause the SVGs might not always be up to date.

The Lockup Protocol triggers [ERC-4906](https://eips.ethereum.org/EIPS/eip-4906) events whenever there's an update in a
Sablier Protocols trigger [ERC-4906](https://eips.ethereum.org/EIPS/eip-4906) events whenever there's an update in a
stream (for instance, when a withdrawal is made). However, it's worth noting that some streams might remain unchanged
for an extended period.

To ensure you're viewing the most recent version of the NFT SVG, it's recommended to check the stream directly via the
[Sablier Interface](https://app.sablier.com).

## Hourglass SVG

Sablier Lockup streams are represented as unique onchain generated hourglass SVGs, which change their color and content
based on user data. Here's an example for a stream that is 42.35% way through:

<NFTSVG height={500} width={500} />

### Gallery of Multiple Sablier NFT SVGs

<img src={NFTGalleryURL} height={500} width={500} />

If you prefer the granularity of a blockchain explorer, you can also view the stream NFTs on
[Etherscan](https://etherscan.io/token/0xB10daee1FCF62243aE27776D7a92D39dC8740f95). See the
[Deployments](/guides/lockup/deployments) page for the full list of addresses.

## Flow NFT

Coming soon.
80 changes: 80 additions & 0 deletions docs/concepts/flow/02-statuses.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
id: "statuses"
sidebar_position: 2
title: "Statuses"
---

# Stream Statuses

A Flow stream can have one of five distinct statuses:

| Status | Description |
| ------------------- | ----------------------------------------------------------------------------------- |
| STREAMING_SOLVENT | Active stream with total debt <ins>not exceeding</ins> stream balance. |
| STREAMING_INSOLVENT | Active stream with total debt <ins>exceeding</ins> stream balance. |
| PAUSED_SOLVENT | Paused stream with total debt <ins>not exceeding</ins> stream balance. |
| PAUSED_INSOLVENT | Paused stream with total debt <ins>exceeding</ins> stream balance. |
| VOIDED | Paused stream that can no longer be restarted and has forfeited its uncovered debt. |

## Stream characteristics

A stream can have the following characteristics:

| Characteristic | Statuses | Description |
| :------------- | :---------------------------------------- | :------------------------------------------------------ |
| Streaming | STREAMING_SOLVENT, STREAMING_INSOLVENT | Non-zero rps. |
| Paused | PAUSED_SOLVENT, PAUSED_INSOLVENT, VOIDED | Zero rps. |
| Solvent | STREAMING_SOLVENT, PAUSED_SOLVENT, VOIDED | Total debt <ins>not exceeding</ins> the stream balance. |
| Insolvent | STREAMING_INSOLVENT, PAUSED_INSOLVENT | Total debt <ins>exceeding</ins> the stream balance. |

## Diagram

The following diagram illustrates the statuses and the allowed transitions between them:

```mermaid
flowchart LR
N[NULL]
V[VOIDED]
subgraph Paused
direction RL
PS[PAUSED_SOLVENT]
PI[PAUSED_INSOLVENT]
PI -- "deposit" --> PS
end
subgraph Streaming
direction LR
SS[STREAMING_SOLVENT]
SI[STREAMING_INSOLVENT]
SI -- "deposit" --> SS
SS -- "time" --> SI
end
Streaming -- pause --> Paused
Streaming -- void --> V
Paused -- restart --> Streaming
Paused -- void --> V
N -- create (rps > 0) --> Streaming
N -- create (rps = 0) --> Paused
```

## Q&A

### Q: What is a null stream?

A: An id that does not reference a created stream. Trying to interact with a null stream will result in a revert.

### Q: What to do with a stream status?

A: Knowing the status of a stream can inform your decision making. For example, if a stream is `STREAMING_INSOLVENT`,
that means the stream is active but has insufficient balance. As a sender, you should deposit into the stream so that
your recipient can withdraw the streamed amount without any hiccups. And if you don't want to continue the stream, you
can pause it.

### Q: Who can make a stream `VOIDED`?

A: Both sender and recipient can void the stream. This is especially useful when either party wants to stop the stream
immediately. Once a stream is voided, it cannot be restarted. If there is uncovered debt, it will be reset to 0. So to
ensure that your recipient does not lose on any streamed amount, you can deposit into the stream before voiding it.
4 changes: 3 additions & 1 deletion docs/concepts/lockup/07-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ flowchart LR

## Next steps

Looking to get on the allowlist? Reach out to us on [Discord](https://discord.sablier.com).
If you are interested into using Sablier hooks into your protocol, please check the
[Hook guide](http://localhost:3000/guides/lockup/guides/hooks). if you looking to get on the allowlist, reach out to us
on [Discord](https://discord.sablier.com).
3 changes: 3 additions & 0 deletions static/img/flow-nft.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes

0 comments on commit 22439a6

Please sign in to comment.