diff --git a/docs/concepts/11-governance.mdx b/docs/concepts/11-governance.mdx index 840a21e1..53336b0d 100644 --- a/docs/concepts/11-governance.mdx +++ b/docs/concepts/11-governance.mdx @@ -9,9 +9,11 @@ import ComptrollersTable from "@site/src/components/organisms/ComptrollersTable" ## Comptroller -The Sablier Protocol uses a Comptroller smart contract architecture for governance. The Comptroller acts as an -intermediary that has exclusive access to specific protocol functions. This design provides a more flexible and -centralized accross all protocols access control model while maintaining security. +The Sablier Comptroller is a smart contract that acts as an intermediary between the protocols and the admin. It has +exclusive access to specific protocol functions. This design provides a more flexible approach to access control across +all protocols while maintaining security. + +Admin addresses that control the Comptroller are listed in the [Admin Addresses](#admin-addresses) section. @@ -28,9 +30,9 @@ Comptroller has the following permissions on each chain where `Lockup` is deploy TODO: Add links when reference pages are created -## MerkleFactory +## Merkle Factory -Comptroller has the following permission on each chain where the factories are deployed: +Comptroller has the following permission on each chain where the Merkle Factories are deployed: | Permission | Function | | ---------------- | ---------------- | @@ -52,14 +54,13 @@ TODO: Add links when reference pages are created ## Admin Addresses -Before the introduction of the Comptroller architecture, we used a direct "Admin" role for -governance. These admin accounts had the same authority as the current Comptroller contract, with direct access to -specific protocol functions. More concretely, the Admin is a collection of multisig wallets and EOAs currently in control of Sablier Labs. +The Comptroller is introduced in Lockup v3.0, Airdrops v2.0 and Flow v2.0. For earlier versions, we use a direct "Admin" +role for governance. These admin accounts have the same authority as the current Comptroller contract, with direct +access to specific protocol functions. More concretely, the Admin is a collection of multisig wallets and EOAs currently +in control of Sablier Labs. -**PR NOTE:** I didn't add functions for the previous versions, since we won't have contract references for them. - ## Trustlessness Despite having an admin, the Sablier Protocol remains trustless. Here's why: diff --git a/docs/guides/airdrops/02-deployments.mdx b/docs/guides/airdrops/02-deployments.mdx index 22749d06..b161041c 100644 --- a/docs/guides/airdrops/02-deployments.mdx +++ b/docs/guides/airdrops/02-deployments.mdx @@ -6,17 +6,15 @@ title: "Deployment Addresses" import DeploymentsV2_0 from "../../../src/autogen/airdrops/_table-deployments-v2.0.mdx"; import ReleaseHistoryAirdrops from "../../../src/snippets/_release-history-airdrops.mdx"; +import DeploymentNote from "../../../src/snippets/_deployment-note.mdx"; # Merkle Airdrops Deployments -This section contains the deployment addresses for the v2.0 release of -[@sablier/airdrops](https://npmjs.com/package/@sablier/airdrops). +[latest]: https://npmjs.com/package/@sablier/airdrops -A few noteworthy details about the deployments: +This section contains the deployment addresses for the v2.0 release of [@sablier/airdrops][latest]. -- The addresses are final -- All contracts are non-upgradeable -- The source code is verified on Etherscan across all chains + ## Versions @@ -26,10 +24,6 @@ Came here looking for the previous deployments? Click below to see other version -This repository is the successor of [Lockup Periphery](https://github.com/sablier-labs/v2-periphery), which has been -discontinued. For previous deployments, please refer to the -[Lockup v1.2 deployments](/guides/lockup/previous-deployments/v1.2) page. - :::info Stay up to date with any new releases by [subscribing](https://x.com/Sablier/status/1821220784661995627) to the official diff --git a/docs/guides/airdrops/previous-deployments/_category_.json b/docs/guides/airdrops/previous-deployments/_category_.json index 7d407683..9f700851 100644 --- a/docs/guides/airdrops/previous-deployments/_category_.json +++ b/docs/guides/airdrops/previous-deployments/_category_.json @@ -1,6 +1,5 @@ { + "collapsed": true, "label": "Previous Deployments", - "position": 3, - "collapsible": true, - "collapsed": false + "position": 3 } diff --git a/docs/guides/airdrops/previous-deployments/v1.3.mdx b/docs/guides/airdrops/previous-deployments/v1.3.mdx index a2ae31b2..ba88e9ae 100644 --- a/docs/guides/airdrops/previous-deployments/v1.3.mdx +++ b/docs/guides/airdrops/previous-deployments/v1.3.mdx @@ -5,21 +5,20 @@ title: "v1.3" --- import DeploymentsV1_3 from "../../../../src/autogen/airdrops/_table-deployments-v1.3.mdx"; +import DeploymentNote from "../../../../src/snippets/_deployment-note.mdx"; # Merkle Airdrops v1.3 -This section contains the deployment addresses for the v1.3 release of -[@sablier/airdrops](https://npmjs.com/package/@sablier/airdrops). +[v1.3.0]: https://npmjs.com/package/@sablier/airdrops/v/1.3.0 -A few noteworthy details about the deployments: +This section contains the deployment addresses for the v1.3 release of [@sablier/airdrops@1.3.0][v1.3.0]. -- The addresses are final -- All contracts are non-upgradeable -- The source code is verified on Etherscan across all chains + :::info -This is an outdated version of the Merkle Airdrops protocol. See the latest version [here](/guides/airdrops/deployments). +This is an outdated version of the Merkle Airdrops protocol. See the latest version +[here](/guides/airdrops/deployments). ::: diff --git a/docs/guides/flow/02-deployments.mdx b/docs/guides/flow/02-deployments.mdx index ec5371fb..348a652a 100644 --- a/docs/guides/flow/02-deployments.mdx +++ b/docs/guides/flow/02-deployments.mdx @@ -6,17 +6,15 @@ title: "Deployment Addresses" import DeploymentsV2_0 from "../../../src/autogen/flow/_table-deployments-v2.0.mdx"; import ReleaseHistoryFlow from "../../../src/snippets/_release-history-flow.mdx"; +import DeploymentNote from "../../../src/snippets/_deployment-note.mdx"; # Flow Deployments -This section contains the deployment addresses for the v2.0 release of -[@sablier/flow](https://npmjs.com/package/@sablier/flow). +[latest]: https://npmjs.com/package/@sablier/flow -A few noteworthy details about the deployments: +This section contains the deployment addresses for the v2.0 release of [@sablier/flow][latest]. -- The addresses are final -- All contracts are non-upgradeable -- The source code is verified on Etherscan across all chains + ## Versions diff --git a/docs/guides/flow/previous-deployments/v1.0.mdx b/docs/guides/flow/previous-deployments/v1.0.mdx index 49a5b69b..3833a345 100644 --- a/docs/guides/flow/previous-deployments/v1.0.mdx +++ b/docs/guides/flow/previous-deployments/v1.0.mdx @@ -5,17 +5,15 @@ title: "v1.0" --- import DeploymentsV1_0 from "../../../../src/autogen/flow/_table-deployments-v1.0.mdx"; +import DeploymentNote from "../../../../src/snippets/_deployment-note.mdx"; # Flow v1.0 -This section contains the deployment addresses for the v1.0 release of -[@sablier/flow@1.0.0](https://npmjs.com/package/@sablier/flow/v/1.0.0). +[v1.0.0]: https://npmjs.com/package/@sablier/flow/v/1.0.0 -A few noteworthy details about the deployments: +This section contains the deployment addresses for the v1.0 release of [@sablier/flow@1.0.0][v1.0.0]. -- The addresses are final -- All contracts are non-upgradeable -- The source code is verified on Etherscan across all chains + :::info diff --git a/docs/guides/flow/previous-deployments/v1.1.mdx b/docs/guides/flow/previous-deployments/v1.1.mdx index de944ecd..c802d143 100644 --- a/docs/guides/flow/previous-deployments/v1.1.mdx +++ b/docs/guides/flow/previous-deployments/v1.1.mdx @@ -5,17 +5,15 @@ title: "v1.1" --- import DeploymentsV1_1 from "../../../../src/autogen/flow/_table-deployments-v1.1.mdx"; +import DeploymentNote from "../../../../src/snippets/_deployment-note.mdx"; # Flow v1.1 -This section contains the deployment addresses for the v1.1 release of -[@sablier/flow](https://npmjs.com/package/@sablier/flow). +[v1.1.1]: https://npmjs.com/package/@sablier/flow/v/1.1.1 -A few noteworthy details about the deployments: +This section contains the deployment addresses for the v1.1 release of [@sablier/flow@1.1.1][v1.1.1]. -- The addresses are final -- All contracts are non-upgradeable -- The source code is verified on Etherscan across all chains + :::info diff --git a/docs/guides/lockup/02-deployments.mdx b/docs/guides/lockup/02-deployments.mdx index a79b2e73..16f8698c 100644 --- a/docs/guides/lockup/02-deployments.mdx +++ b/docs/guides/lockup/02-deployments.mdx @@ -6,17 +6,15 @@ title: "Deployment Addresses" import DeploymentsV3_0 from "../../../src/autogen/lockup/_table-deployments-v3.0.mdx"; import ReleaseHistoryLockup from "../../../src/snippets/_release-history-lockup.mdx"; +import DeploymentNote from "../../../src/snippets/_deployment-note.mdx"; # Lockup Deployments -This section contains the deployment addresses for the v3.0 release of -[@sablier/lockup](https://npmjs.com/package/@sablier/lockup). +[latest]: https://npmjs.com/package/@sablier/lockup -A few noteworthy details about the deployments: +This section contains the deployment addresses for the v3.0 release of [@sablier/lockup][latest]. -- The addresses are final -- All contracts are non-upgradeable -- The source code is verified on Etherscan across all chains + :::info[important] diff --git a/docs/guides/lockup/previous-deployments/v1.0.mdx b/docs/guides/lockup/previous-deployments/v1.0.mdx index 573b871c..b931855d 100644 --- a/docs/guides/lockup/previous-deployments/v1.0.mdx +++ b/docs/guides/lockup/previous-deployments/v1.0.mdx @@ -5,20 +5,17 @@ title: "v1.0" --- import DeploymentsV1_0 from "../../../../src/autogen/lockup/_table-deployments-v1.0.mdx"; +import DeploymentNote from "../../../../src/snippets/_deployment-note.mdx"; # Lockup v1.0 -This section contains the deployment addresses for the v1.0 release of [@sablier/v2-core@1.0.2][v2-core] and -[@sablier/v2-periphery@1.0.3][v2-periphery]. - [v2-core]: https://npmjs.com/package/@sablier/v2-core/v/1.0.2 [v2-periphery]: https://npmjs.com/package/@sablier/v2-periphery/v/1.0.3 -A few noteworthy details about the deployments: +This section contains the deployment addresses for the v1.0 release of [@sablier/v2-core@1.0.2][v2-core] and +[@sablier/v2-periphery@1.0.3][v2-periphery]. -- The addresses are final -- All contracts are non-upgradeable -- The source code is verified on Etherscan across all chains + :::info diff --git a/docs/guides/lockup/previous-deployments/v1.1.mdx b/docs/guides/lockup/previous-deployments/v1.1.mdx index f08a956a..379d1664 100644 --- a/docs/guides/lockup/previous-deployments/v1.1.mdx +++ b/docs/guides/lockup/previous-deployments/v1.1.mdx @@ -5,20 +5,17 @@ title: "v1.1" --- import DeploymentsV1_1 from "../../../../src/autogen/lockup/_table-deployments-v1.1.mdx"; +import DeploymentNote from "../../../../src/snippets/_deployment-note.mdx"; # Lockup v1.1 -This section contains the deployment addresses for the v1.1 release of [@sablier/v2-core@1.1.2][v2-core] and -[@sablier/v2-periphery@1.1.1][v2-periphery]. - [v2-core]: https://npmjs.com/package/@sablier/v2-core/v/1.1.2 [v2-periphery]: https://npmjs.com/package/@sablier/v2-periphery/v/1.1.1 -A few noteworthy details about the deployments: +This section contains the deployment addresses for the v1.1 release of [@sablier/v2-core@1.1.2][v2-core] and +[@sablier/v2-periphery@1.1.1][v2-periphery]. -- The addresses are final -- All contracts are non-upgradeable -- The source code is verified on Etherscan across all chains + :::info diff --git a/docs/guides/lockup/previous-deployments/v1.2.mdx b/docs/guides/lockup/previous-deployments/v1.2.mdx index 4ea06146..abc5d26c 100644 --- a/docs/guides/lockup/previous-deployments/v1.2.mdx +++ b/docs/guides/lockup/previous-deployments/v1.2.mdx @@ -5,20 +5,17 @@ title: "v1.2" --- import DeploymentsV1_2 from "../../../../src/autogen/lockup/_table-deployments-v1.2.mdx"; +import DeploymentNote from "../../../../src/snippets/_deployment-note.mdx"; # Lockup v1.2 -This section contains the deployment addresses for the v1.2 release of [@sablier/v2-core@1.2.0][v2-core] and -[@sablier/v2-periphery@1.2.0][v2-periphery]. - [v2-core]: https://npmjs.com/package/@sablier/v2-core/v/1.2.0 [v2-periphery]: https://npmjs.com/package/@sablier/v2-periphery/v/1.2.0 -A few noteworthy details about the deployments: +This section contains the deployment addresses for the v1.2 release of [@sablier/v2-core@1.2.0][v2-core] and +[@sablier/v2-periphery@1.2.0][v2-periphery]. -- The addresses are final -- All contracts are non-upgradeable -- The source code is verified on Etherscan across all chains + :::info diff --git a/docs/guides/lockup/previous-deployments/v2.0.mdx b/docs/guides/lockup/previous-deployments/v2.0.mdx index 14f46996..d2758708 100644 --- a/docs/guides/lockup/previous-deployments/v2.0.mdx +++ b/docs/guides/lockup/previous-deployments/v2.0.mdx @@ -5,17 +5,15 @@ title: "v2.0" --- import DeploymentsV2_0 from "../../../../src/autogen/lockup/_table-deployments-v2.0.mdx"; +import DeploymentNote from "../../../../src/snippets/_deployment-note.mdx"; # Lockup v2.0 -This section contains the deployment addresses for the v2.0 release of -[@sablier/lockup](https://npmjs.com/package/@sablier/lockup). +[v2.0.1]: https://npmjs.com/package/@sablier/lockup/v/2.0.1 -A few noteworthy details about the deployments: +This section contains the deployment addresses for the v2.0 release of [@sablier/lockup@2.0.1][v2.0.1]. -- The addresses are final -- All contracts are non-upgradeable -- The source code is verified on Etherscan across all chains + :::info diff --git a/src/components/organisms/Chains.tsx b/src/components/organisms/Chains.tsx index e556e9d1..29d5ba35 100644 --- a/src/components/organisms/Chains.tsx +++ b/src/components/organisms/Chains.tsx @@ -1,47 +1,28 @@ -import _ from "lodash"; import { useMemo } from "react"; import { sablier } from "sablier"; +import { getLatestLockupChainIds } from "../../helpers"; import GFMContent from "../atoms/GFMContent"; export interface ChainProps { kind: "mainnets" | "testnets"; } -// Cache for chain counts -const chainCounts: { mainnets?: number; testnets?: number } = {}; - export function Chains({ kind }: ChainProps) { const content = useMemo(() => { - // Get the v3.0 lockup release - const lockupV3Release = sablier.releases.get({ - protocol: "lockup", - version: "v3.0", - }); - - // Get all chains that have v3.0 lockup contracts - const lockupV3Contracts = sablier.contracts.getAll({ - release: lockupV3Release, - }); - - // Get unique chain IDs that support Lockup v3.0 - const lockupV3ChainIds = new Set(_.uniq(lockupV3Contracts?.map((c) => c.chainId) || [])); + const latestLockupChainIds = new Set(getLatestLockupChainIds()); let content: string = ""; content += `| Name | Chain ID | In UI? | Native Token | Explorer |\n`; content += `| :--- | :------- | :----- | :----------- | :------- |\n`; - let count = 0; const getter = kind === "mainnets" ? sablier.chains.getMainnets : sablier.chains.getTestnets; - // PR NOTE: I believe we should display only the latest chains we deployed on, - // instead of the entire list of chains where we have ever deployed a specific version. for (const chain of getter()) { // Only include chains that have Lockup v3.0 deployed - if (!lockupV3ChainIds.has(chain.id)) { + if (!latestLockupChainIds.has(chain.id)) { continue; } - count++; const supportedCell = chain.isSupportedByUI ? "✅" : "❌"; const symbolCell = chain.nativeCurrency.symbol; const explorerURL = chain.blockExplorers.default.url; @@ -49,18 +30,25 @@ export function Chains({ kind }: ChainProps) { content += `| ${chain.name} | ${chain.id} | ${supportedCell} | ${symbolCell} | ${explorerCell} |\n`; } - // Store the count for use in MDX - chainCounts[kind] = count; - return content; }, [kind]); return ; } -// Helper function to get the count - reads from cache populated by Chains component +// Helper function to get the count export function getChainCount(kind: "mainnets" | "testnets"): number { - return chainCounts[kind] ?? 0; + const latestLockupChainIds = new Set(getLatestLockupChainIds()); + const query = kind === "mainnets" ? sablier.chains.getMainnets : sablier.chains.getTestnets; + + let count = 0; + for (const chain of query()) { + if (latestLockupChainIds.has(chain.id)) { + count++; + } + } + + return count; } export default Chains; diff --git a/src/components/organisms/ComptrollersTable.tsx b/src/components/organisms/ComptrollersTable.tsx index 10adb1bd..d53ee28b 100644 --- a/src/components/organisms/ComptrollersTable.tsx +++ b/src/components/organisms/ComptrollersTable.tsx @@ -1,28 +1,13 @@ import _ from "lodash"; import { useMemo } from "react"; -import { sablier } from "sablier"; +import { comptroller, sablier } from "sablier"; +import { getLatestLockupChainIds } from "../../helpers"; import GFMContent from "../atoms/GFMContent"; -// Hardcoded comptroller addresses -const DEFAULT_COMPTROLLER = "0x0000008ABbFf7a84a2fE09f9A9b74D3BC2072399"; -const LINEA_COMPTROLLER = "0xF21b304A08993f98A79C7Eb841f812CCeab49B8b"; -const LINEA_CHAIN_ID = 59144; - export function ComptrollersTable() { const content = useMemo(() => { - // Get the v3.0 lockup release - const release = sablier.releases.get({ - protocol: "lockup", - version: "v3.0", - }); - - // Get all chains that have v3.0 lockup contracts - const allContracts = sablier.contracts.getAll({ - release: release, - }); - - // Get unique chains from the contracts - const chainIds = _.uniq(allContracts.map((c) => c.chainId)); + // Get chain IDs that have the latest Lockup v3.0 release deployed + const chainIds = getLatestLockupChainIds(); // Get chain details and filter for mainnets supported by UI const chains = chainIds @@ -34,8 +19,8 @@ export function ComptrollersTable() { content += "| :---- | :------ |\n"; for (const chain of chains) { - // Use special address for Linea, default for all others - const comptrollerAddress = chain.id === LINEA_CHAIN_ID ? LINEA_COMPTROLLER : DEFAULT_COMPTROLLER; + // Get comptroller address from sablier package + const comptrollerAddress = comptroller.get(chain.id).address; const explorerBaseUrl = chain.blockExplorers.default.url; const addressLink = `[${comptrollerAddress}](${explorerBaseUrl}/address/${comptrollerAddress})`; diff --git a/src/helpers.ts b/src/helpers.ts index 9d52e7ca..33905abb 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -1,3 +1,5 @@ +import _ from "lodash"; +import { sablier } from "sablier"; import { BENCHMARKS_COMMIT, GITHUB_ORG } from "./constants"; export function getBenchmarkURL(path: string): string { @@ -7,3 +9,12 @@ export function getBenchmarkURL(path: string): string { export function getRawContentURL(repo: string, ref: string, path: string): string { return `https://raw.githubusercontent.com/${GITHUB_ORG}/${repo}/${ref}/${path}`; } + +/** + * Get chain IDs that have the latest lockup release deployed + */ +export function getLatestLockupChainIds(): number[] { + const release = sablier.releases.getLatest({ protocol: "lockup" }); + const contracts = sablier.contracts.getAll({ release }); + return _.uniq(contracts.map((c) => c.chainId)); +} diff --git a/src/snippets/_deployment-note.mdx b/src/snippets/_deployment-note.mdx new file mode 100644 index 00000000..51ef7bbb --- /dev/null +++ b/src/snippets/_deployment-note.mdx @@ -0,0 +1,5 @@ +A few noteworthy details about the deployments: + +- The addresses are final +- All contracts are non-upgradeable +- The source code is verified on Etherscan across all chains diff --git a/src/snippets/_release-history-airdrops.mdx b/src/snippets/_release-history-airdrops.mdx index cd20ce5e..94da5530 100644 --- a/src/snippets/_release-history-airdrops.mdx +++ b/src/snippets/_release-history-airdrops.mdx @@ -1,4 +1,4 @@ -| Version | Release Date | -| -------------------------------------------------- | ------------- | -| [v2.0](/guides/airdrops/overview) | October 2025 | -| [v1.3](/guides/airdrops/previous-deployments/v1.3) | February 2025 | +| Version | Release Date | UI Aliases | +| -------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| [v2.0](/guides/airdrops/deployments) (latest) | October 2025 | `MF_INST` (Merkle Factory Instant), `MF_LL` (Merkle Factory Linear), `MF_LT` (Merkle Factory Tranched), `MF_VCA` (Merkle Factory VCA) | +| [v1.3](/guides/airdrops/previous-deployments/v1.3) | February 2025 | `MSF4` (Merkle Factory): all factories merged into a single contract | diff --git a/src/snippets/_release-history-flow.mdx b/src/snippets/_release-history-flow.mdx index 4df17101..94927f2f 100644 --- a/src/snippets/_release-history-flow.mdx +++ b/src/snippets/_release-history-flow.mdx @@ -1,5 +1,5 @@ | Version | Release Date | UI Aliases | | ---------------------------------------------- | ------------- | ---------- | -| [v2.0](/guides/flow/overview) (latest) | October 2025 | FL3 | +| [v2.0](/guides/flow/deployments) (latest) | October 2025 | FL3 | | [v1.1](/guides/flow/previous-deployments/v1.1) | February 2025 | FL2 | | [v1.0](/guides/flow/previous-deployments/v1.0) | December 2024 | FL | diff --git a/src/snippets/_release-history-lockup.mdx b/src/snippets/_release-history-lockup.mdx index 3681b55f..6c1b83f8 100644 --- a/src/snippets/_release-history-lockup.mdx +++ b/src/snippets/_release-history-lockup.mdx @@ -1,6 +1,6 @@ | Version | Release Date | UI Aliases | | ------------------------------------------------ | ------------- | ---------------------------------------------------------------------- | -| [v3.0](/guides/lockup/deployments) (latest) | October 2025 | `LK` (Lockup): all models have been merged into a single contract | +| [v3.0](/guides/lockup/deployments) (latest) | October 2025 | `LK2` (Lockup): all models have been merged into a single contract | | [v2.0](/guides/lockup/previous-deployments/v2.0) | February 2025 | `LK` (Lockup): all models have been merged into a single contract | | [v1.2](/guides/lockup/previous-deployments/v1.2) | July 2024 | `LD3` (Lockup Dynamic), `LL3` (Lockup Linear), `LT3` (Lockup Tranched) | | [v1.1](/guides/lockup/previous-deployments/v1.1) | December 2023 | `LD2` (Lockup Dynamic), `LL2` (Lockup Linear) |