|
| 1 | +--- |
| 2 | +id: "ids" |
| 3 | +sidebar_position: 3 |
| 4 | +title: "Identifiers" |
| 5 | +--- |
| 6 | + |
| 7 | +## Stream IDs |
| 8 | + |
| 9 | +### Contracts |
| 10 | + |
| 11 | +Onchain, each Lockup and Flow contract assigns a [`streamId`](/reference/lockup/contracts/abstracts/abstract.SablierLockupBase#nextstreamid) to each stream, which is the same as the ERC-721 [`tokenId`](https://docs.openzeppelin.com/contracts/5.x/api/token/erc721) (each stream is tokenized as an ERC-721). |
| 12 | + |
| 13 | +The `streamId`/ `tokenId` in the contract is a simple numerical value (a `uint256`). For example, number `42` is a valid `streamId`/ `tokenId`. |
| 14 | + |
| 15 | +You will always need this value when interacting with Sablier via a JSON-RPC endpoint because it is required by every contract method associated with a stream, e.g. [`streamedAmountOf`](/reference/lockup/contracts/interfaces/interface.ISablierLockupBase#streamedamountof). |
| 16 | + |
| 17 | +### Indexers |
| 18 | + |
| 19 | +Offchain, in the GraphQL schema, we need to be able to identify streams across different EVM chains and different contract versions. Additionally, it would be nice to have short, easily readable aliases. Thus, we have come up with the following identifiers: |
| 20 | + |
| 21 | +| Identifier | Format | Example | |
| 22 | +| ------------ | --------------------------------------- | ---------------------------------------------------------------- | |
| 23 | +| Stream ID | `{contractAddress}-{chainId}-{tokenId}` | <nobr>`0xe0bfe071da104e571298f8b6e0fce44c512c1ff4-137-21`</nobr> | |
| 24 | +| Stream Alias | `{contractAlias}-{chainId}-{tokenId}` | <nobr>`LK-137-21`</nobr> | |
| 25 | + |
| 26 | +Both examples from the table above translate to: \*\*a stream on Polygon (chain ID `137`) created via the Lockup v2.0 |
| 27 | +contract at address `0xe0bfe071da104e571298f8b6e0fce44c512c1ff4`, with the token ID `21`. |
| 28 | + |
| 29 | +#### Contract Aliases |
| 30 | + |
| 31 | +Here's a table with the full list of contract aliases. |
| 32 | + |
| 33 | +| Alias | Contract Name | Release | |
| 34 | +| ----- | ------------------------------ | ------------- | |
| 35 | +| FL | SablierFlow | Flow v1.0 | |
| 36 | +| FL2 | SablierFlow | Flow v1.1 | |
| 37 | +| LD | SablierV2LockupDynamic | Lockup v1.0 | |
| 38 | +| LD2 | SablierV2LockupDynamic | Lockup v1.1 | |
| 39 | +| LD3 | SablierV2LockupDynamic | Lockup v1.2 | |
| 40 | +| LK | SablierLockup | Lockup v2.0 | |
| 41 | +| LL | SablierV2LockupLinear | Lockup v1.0 | |
| 42 | +| LL2 | SablierV2LockupLinear | Lockup v1.1 | |
| 43 | +| LL3 | SablierV2LockupLinear | Lockup v1.2 | |
| 44 | +| LT3 | SablierV2LockupTranched | Lockup v1.2 | |
| 45 | +| MSF2 | SablierV2MerkleStreamerFactory | Airdrops v1.1 | |
| 46 | +| MSF3 | SablierV2MerkleLockupFactory | Airdrops v1.2 | |
| 47 | +| MSF4 | SablierMerkleFactory | Airdrops v1.3 | |
| 48 | + |
| 49 | +## Airdrop IDs |
| 50 | + |
| 51 | +### Contracts |
| 52 | + |
| 53 | +Airdrops do not have any onchain IDs because every airdrop is a separate contract deployed by one of the Merkle Factory contracts. |
| 54 | + |
| 55 | +### Indexers |
| 56 | + |
| 57 | +The ID for an airdrop is the chain ID concatenated with the contract address of the airdrop contract: |
| 58 | + |
| 59 | +| Identifier | Format | Example | |
| 60 | +| ---------- | ----------------------------- | ------------------------------------------------------------- | |
| 61 | +| Airdrop ID | `{contractAddress}-{chainId}` | <nobr>`0xf50760d8ead9ff322631a1f3ebf26cc7891b3708-137`</nobr> | |
| 62 | + |
| 63 | +The example from the table above translates to: **_an airdrop on Polygon (chain ID `137`), with the contract |
| 64 | +address `0xf50760d8ead9ff322631a1f3ebf26cc7891b3708`_**. |
| 65 | + |
| 66 | +:::info |
| 67 | + |
| 68 | +We have decided not to generate aliases for Airdrops, but this may change in the future. |
| 69 | + |
| 70 | +::: |
0 commit comments