Skip to content

Conversation

@gavriliumircea
Copy link
Contributor

@gavriliumircea gavriliumircea commented Oct 22, 2025

Summary

This PR extracts all EVM-specific logic into a dedicated directory with a separate export path.

Motivation

This is a preparatory step for adding support for Solana chains in the future. By isolating EVM-related code, we make the codebase more modular and easier to extend for non-EVM environments.

Breaking Changes

This change introduces breaking changes due to the updated import/export paths.

A migration guide has been added to assist with upgrading.

Copy link
Contributor Author

gavriliumircea commented Oct 22, 2025

@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch from 85bddfe to d4fa8b7 Compare October 22, 2025 14:33
@gavriliumircea gavriliumircea marked this pull request as ready for review October 22, 2025 14:37
@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch from d4fa8b7 to b26fe27 Compare October 22, 2025 15:35
Base automatically changed from 10-20-feat_add_package.json_exports to main October 23, 2025 13:37
@sablier-labs sablier-labs deleted a comment from coderabbitai bot Oct 23, 2025
@PaulRBerg
Copy link
Member

there are some git conflicts here @gavriliumircea - perhaps due to the RouteMesh config I've introduced recently

@gavriliumircea
Copy link
Contributor Author

there are some git conflicts here @gavriliumircea - perhaps due to the RouteMesh config I've introduced recently

My bad I didn't get the chance to rebase, will do now.

@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch from b26fe27 to 1bf1818 Compare October 23, 2025 13:47
@coderabbitai
Copy link

coderabbitai bot commented Oct 23, 2025

Walkthrough

This pull request reorganizes the SDK into an EVM-focused namespace structure, bumping the version to 2.0.0. The codebase relocates chains, contracts, deployments, and releases under a centralized evm namespace. Type definitions are consolidated into src/evm/types.ts and restructured using Sablier.EVM.* prefixes. Package exports are remapped to reflect the new structure. All internal references—including CLI commands, tests, and helper functions—are updated to use the new EVM-specific paths and type namespaces. The public API surface shifts from top-level accessors to sablier.evm.* accessors throughout.

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "refactor: extract evm specific data in separate directory" accurately summarizes the primary change in the changeset. The raw summary confirms that the pull request systematically moves EVM-related code (chains, contracts, releases, deployments, types) into a dedicated src/evm/ directory structure and updates all corresponding import paths and public API exports accordingly. The title is specific and clear enough for a developer scanning commit history to understand the main structural change, even though it doesn't capture all implementation details like the version bump to 2.0.0 or the complete API namespace reorganization.
Description Check ✅ Passed The PR description is directly related to the changeset and provides meaningful context about the changes. It accurately describes the extraction of EVM-specific logic into a dedicated directory, explains the motivation for modularity and future Solana support, acknowledges breaking changes to import/export paths, and mentions the inclusion of a migration guide. The description conveys clear, specific information rather than generic or vague terminology, making it suitable as documentation for why this refactoring was undertaken.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/extract-evm-directory

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
tests/contracts/abi-const.test.ts (1)

11-11: Critical: Update the globby pattern to match the new directory structure.

The file discovery pattern still points to src/releases/ but the actual ABI files have been moved to src/evm/releases/ (as evidenced by the updated imports on lines 109-111). This will cause the dynamic validation tests to fail to discover any ABI files, making the test suite ineffective.

Apply this diff to fix the pattern:

-  const files = await globby("src/releases/**/abi/*.ts", {
+  const files = await globby("src/evm/releases/**/abi/*.ts", {
src/evm/chains/data.ts (1)

318-321: Remove unsupported rpc key from viem defineChain configs (compile-time type error risk).

viemDefine expects rpcUrls, not a top-level rpc. Keep rpcUrls only; you already build your own rpc object later in define().

Apply this diff:

@@
     nativeCurrency: {
       decimals: 18,
       name: "Hyperliquid",
       symbol: HYPEREVM_NATIVE_CURRENCY_SYMBOL,
     },
-    rpc: {
-      public: "https://rpc.hyperliquid.xyz/evm",
-    },
     rpcUrls: {
       default: {
         http: ["https://rpc.hyperliquid.xyz/evm"],
       },
     },
@@
     nativeCurrency: {
       decimals: 18,
       name: "Tangle",
       symbol: "TNT",
     },
-    rpc: {
-      public: "https://rpc.tangle.tools",
-    },
     rpcUrls: {
       default: {
         http: ["https://rpc.tangle.tools"],
       },
     },

Also applies to: 374-376

tests/cron/blocks.test.ts (1)

55-71: Fix: async describe is invalid in Vitest; move awaits inside it and avoid shadowing contracts.

describe must be synchronous. Generate tests synchronously and fetch Etherscan data inside each it.

-  for (const release of sablier.evmReleases.getAll()) {
-    describe(`${release.protocol} ${release.version}`, async () => {
-      const contracts = sablier.evmContracts.getAll({ release })!;
+  for (const release of sablier.evmReleases.getAll()) {
+    describe(`${release.protocol} ${release.version}`, () => {
+      const releaseContracts = sablier.evmContracts.getAll({ release }) ?? [];
 
-      for (const contract of contracts) {
+      for (const contract of releaseContracts) {
         if (!ETHERSCAN_CHAINS.has(contract.chainId)) {
           continue;
         }
         if (!INDEXED[release.protocol].has(contract.name)) {
           it.skip(`Skipped ${contract.name} because it's not an indexed contract.`, () => {});
           continue;
         }
-        const chain = sablier.evmChains.getOrThrow(contract.chainId);
-        const actualBlockNumber = await getContractCreationBlock(contract.address, chain.id);
-        if (!actualBlockNumber) {
-          it.skip(`Skipped ${contract.name} because the block number could not be fetched from Etherscan.`, () => {});
-          continue;
-        }
-        it(`Chain ${chain.name} - Contract ${contract.name} should have a correct block number`, () => {
-          expect(contract.block).toEqual(actualBlockNumber);
-        });
+        const chain = sablier.evmChains.getOrThrow(contract.chainId);
+        it(`Chain ${chain.name} - Contract ${contract.name} should have a correct block number`, async () => {
+          const actualBlockNumber = await getContractCreationBlock(contract.address, chain.id);
+          // If Etherscan has no data, mark inconclusive rather than failing.
+          if (!actualBlockNumber) return;
+          expect(contract.block).toEqual(actualBlockNumber);
+        });
       }
     });
   }

If you prefer skipping the test when Etherscan data is missing, we can switch to it.runIf(Boolean(actualBlockNumber)) if your Vitest version supports it. Happy to adjust.

Also applies to: 69-79

src/evm/releases/lockup/v2.0/deployments.ts (1)

21-232: Now I'll run a corrected script to properly extract and analyze the block numbers and addresses:

Based on my verification, I can now identify the confirmed data hygiene issues. Let me generate the rewritten review comment:

Normalize numeric separators and address checksums; verify block number occurrences across chains.

EIP-55 checksum encoding helps prevent costly mistakes by detecting copying errors in Ethereum addresses. Review of the deployments file reveals:

Checksumming issues: Several addresses lack EIP-55 checksums (all lowercase):

  • coreDao: lines 80–82 (HELPERS, LOCKUP_NFT_DESCRIPTOR, SABLIER_BATCH_LOCKUP, SABLIER_LOCKUP)
  • form: line 83
  • unichain: lines 212–216, 219–223 (HELPERS, VESTING_MATH)
  • xdc: line 268

Numeric formatting inconsistency: Block numbers use mixed formatting—some with underscores (131_196_856, 38_256_772) and some without (8594061). Enforce consistent underscore separators for readability.

Duplicate block number: Gnosis (line 49) and Morph (line 61) both reference block number 38_256_772. Verify this is intentional; coincident block heights across independent chains are unusual and warrant confirmation.

Suggested fixes:

  • Apply EIP-55 checksum encoding to all addresses.
  • Standardize block number formatting (e.g., always use _ for thousands).
  • Confirm Gnosis/Morph block number alignment is correct.
🧹 Nitpick comments (11)
src/helpers.ts (1)

13-21: Harden version parsing to tolerate missing minors and bad inputs.

Current split assumes vX.Y. Recommend a small parser; behavior unchanged for valid inputs.

-export function compareVersions(a: Sablier.EVM.Version, b: Sablier.EVM.Version): number {
-  const [aMajor, aMinor] = a.slice(1).split(".").map(Number);
-  const [bMajor, bMinor] = b.slice(1).split(".").map(Number);
-
-  if (aMajor !== bMajor) {
-    return aMajor - bMajor;
-  }
-  return aMinor - bMinor;
-}
+const parseVersion = (v: string): [number, number] => {
+  const m = /^v(\d+)(?:\.(\d+))?$/.exec(v);
+  if (!m) return [0, 0];
+  return [Number(m[1]), Number(m[2] ?? 0)];
+};
+
+export function compareVersions(a: Sablier.EVM.Version, b: Sablier.EVM.Version): number {
+  const [aMajor, aMinor] = parseVersion(a);
+  const [bMajor, bMinor] = parseVersion(b);
+  return aMajor === bMajor ? aMinor - bMinor : aMajor - bMajor;
+}
cli/commands/print/missing-broadcasts.ts (1)

19-29: Guard against duplicate chain entries per version in results.

If a release lists the same chain multiple times, you may print duplicates. Add a simple de-dup on id.

-        _.defaults(missing, { [r.version]: [] });
-        missing[r.version].push(chain);
+        const list = (missing[r.version] ??= []);
+        if (!list.some((c) => c.id === chain.id)) list.push(chain);

EVM type migration and lookups via sablier.evm* are otherwise good.

Also applies to: 116-129

src/evm/releases/airdrops/v2.0/index.ts (2)

10-12: Avoid in-place mutation from sortDeployments.

sortDeployments returns Array.sort(...) which mutates the input arrays. If other modules reuse mainnets/testnets, this can cause order-dependent bugs.

Preferred fix (in helpers.ts):

-export function sortDeployments<T extends { chainId: number }>(deployments: T[]): T[] {
-  return deployments.sort((a, b) => {
+export function sortDeployments<T extends { chainId: number }>(deployments: T[]): T[] {
+  return [...deployments].sort((a, b) => {
     // ...
   });
}

Local workaround (here):

-const sortedMainnets = sortDeployments(mainnets);
-const sortedTestnets = sortDeployments(testnets);
+const sortedMainnets = sortDeployments([...mainnets]);
+const sortedTestnets = sortDeployments([...testnets]);

14-22: Use object property shorthand for consistency.

Matches the style used in other release files and reduces noise.

 export const release = resolvers.release.standard({
   abi,
   aliases,
-  deployments: deployments,
+  deployments,
   isLatest: true,
-  manifest: manifest,
+  manifest,
   protocol: Protocol.Airdrops,
   version: "v2.0",
 });
src/evm/releases/legacy/v1.1/index.ts (1)

9-11: Prevent in-place sorting of mainnets.

To avoid side effects on shared arrays, sort a copy (or update the helper to be non-mutating).

-const sortedMainnets = sortDeployments(mainnets);
+const sortedMainnets = sortDeployments([...mainnets]);

If you adopt the non-mutating helper suggested elsewhere, this local change is not needed.

tests/helpers/missing.ts (1)

57-66: Minor cleanup: prefer Set and native predicates.

Slightly faster lookups and less lodash for trivial cases.

-// Chains for which we completely lack broadcasts.
-export const MISSING_CHAINS: number[] = [chains.iotex.id, chains.ronin.id, chains.tangle.id];
+// Chains for which we completely lack broadcasts.
+export const MISSING_CHAINS = new Set<number>([chains.iotex.id, chains.ronin.id, chains.tangle.id]);

-export function isKnownMissing(release: Sablier.EVM.Release, chain: Sablier.EVM.Chain, contractName: string): boolean {
-  if (MISSING_CHAINS.includes(chain.id)) {
+export function isKnownMissing(release: Sablier.EVM.Release, chain: Sablier.EVM.Chain, contractName: string): boolean {
+  if (MISSING_CHAINS.has(chain.id)) {
     return true;
   }
 
-  const missingContracts = _.get(MISSING_CONTRACTS, [release.protocol, release.version, chain.id]);
-  if (_.some(missingContracts, (contract) => contract === "all" || contract === contractName)) {
+  const missingContracts = _.get(MISSING_CONTRACTS, [release.protocol, release.version, chain.id]) as string[] | undefined;
+  if (missingContracts?.some((c) => c === "all" || c === contractName)) {
     return true;
   }

Optional: narrow contractName to the union from @src/evm/contracts/names to catch typos at compile time.

Would you like me to wire that type in, given the exported name union in src/evm/contracts/names.ts?

tests/contracts/indexed.test.ts (1)

32-37: Avoid shadowing contracts import and drop the non-null assertion.

Rename the local variable to reduce confusion and use a safe fallback to an empty array.

-  for (const release of sablier.evmReleases.getAll()) {
-    describe(`${release.protocol} ${release.version}`, () => {
-      const contracts = sablier.evmContracts.getAll({ release })!;
+  for (const release of sablier.evmReleases.getAll()) {
+    describe(`${release.protocol} ${release.version}`, () => {
+      const releaseContracts = sablier.evmContracts.getAll({ release }) ?? [];
 
-      for (const contract of contracts) {
+      for (const contract of releaseContracts) {
src/evm/contracts/queries.ts (2)

71-76: Future-proof the fallback search across protocols.

Avoid hardcoding protocol list to reduce drift when adding new protocols.

-      return (
-        _.get(catalog, [Protocol.Airdrops, chainId, address]) ||
-        _.get(catalog, [Protocol.Flow, chainId, address]) ||
-        _.get(catalog, [Protocol.Legacy, chainId, address]) ||
-        _.get(catalog, [Protocol.Lockup, chainId, address])
-      );
+      for (const proto of Object.values(Protocol)) {
+        const hit = _.get(catalog, [proto, chainId, address]);
+        if (hit) return hit;
+      }
+      return undefined;

101-111: Normalize empty-result semantics in getAll for consistency.

Currently, { protocol, chainId } and { release, chainId } can return undefined when empty, while { chainId } alone always returns []. Make behavior consistent (either always undefined or always []). Given current signature allows undefined, consider returning undefined for { chainId } when no matches.

-    // by chain id
+    // by chain id
     if (chainId) {
       const deps = _.flatMap(releasesQueries.getAll(), (r) => r.deployments);
       const filtered = _.filter(deps, (d) => d.chainId === chainId);
-      return _.flatMap(filtered, (d) => d.contracts);
+      if (filtered.length === 0) return undefined;
+      return _.flatMap(filtered, (d) => d.contracts);
     }

Please verify call sites (tests/queries and CLI) don’t rely on [] specifically.

Also applies to: 112-121, 122-131

src/evm/releases/queries.ts (2)

16-23: Minor: simplify getAll implementation.

_.flatMap(_.values(...)) is equivalent to Object.values(...) here since values are releases, not arrays. This reduces overhead and clarifies intent.

-  getAll: (opts?: { protocol?: Sablier.EVM.Protocol }): Sablier.EVM.Release[] => {
+  getAll: (opts?: { protocol?: Sablier.EVM.Protocol }): Sablier.EVM.Release[] => {
     const { protocol } = opts || {};
     if (protocol) {
-      return _.flatMap(_.values(releases[protocol]));
+      return Object.values(releases[protocol]);
     }
-    // Recursively get all releases from all protocols in the enum
-    return _.flatMap(Object.values(Protocol), (protocolName) => _.flatMap(_.values(releases[protocolName])));
+    // Gather all releases from all protocols in the enum
+    return Object.values(Protocol).flatMap((p) => Object.values(releases[p]));
   },

29-38: Prefer array ops over object _.find in getFirst.

Converting to Object.values avoids relying on object key iteration semantics and improves readability.

-  getFirst: (opts: { protocol: Sablier.EVM.Protocol; chainId?: number }): Sablier.EVM.Release | undefined => {
-    const { protocol, chainId } = opts;
-    const list = releases[protocol];
-
-    if (chainId) {
-      return _.find(list, (r) => _.some(r.deployments, { chainId }));
-    }
-
-    return _.values(list)[0];
-  },
+  getFirst: (opts: { protocol: Sablier.EVM.Protocol; chainId?: number }): Sablier.EVM.Release | undefined => {
+    const { protocol, chainId } = opts;
+    const list = Object.values(releases[protocol]);
+    if (chainId) {
+      return list.find((r) => r.deployments.some((d) => d.chainId === chainId));
+    }
+    return list[0];
+  },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2215606 and 1bf1818.

📒 Files selected for processing (74)
  • CHANGELOG.md (2 hunks)
  • MIGRATION.md (1 hunks)
  • README.md (3 hunks)
  • cli/commands/print/aliases.ts (1 hunks)
  • cli/commands/print/chains.ts (1 hunks)
  • cli/commands/print/missing-broadcasts.ts (3 hunks)
  • cli/commands/print/versions.ts (1 hunks)
  • package.json (2 hunks)
  • src/evm/chains/data.ts (6 hunks)
  • src/evm/chains/queries.ts (1 hunks)
  • src/evm/comptroller.ts (4 hunks)
  • src/evm/contracts/catalog.ts (1 hunks)
  • src/evm/contracts/names.ts (2 hunks)
  • src/evm/contracts/queries.ts (3 hunks)
  • src/evm/index.ts (1 hunks)
  • src/evm/releases/airdrops/index.ts (1 hunks)
  • src/evm/releases/airdrops/v1.1/deployments.ts (1 hunks)
  • src/evm/releases/airdrops/v1.1/index.ts (1 hunks)
  • src/evm/releases/airdrops/v1.2/deployments.ts (1 hunks)
  • src/evm/releases/airdrops/v1.2/index.ts (1 hunks)
  • src/evm/releases/airdrops/v1.3/deployments.ts (3 hunks)
  • src/evm/releases/airdrops/v1.3/index.ts (2 hunks)
  • src/evm/releases/airdrops/v2.0/deployments.ts (3 hunks)
  • src/evm/releases/airdrops/v2.0/index.ts (2 hunks)
  • src/evm/releases/flow/index.ts (1 hunks)
  • src/evm/releases/flow/v1.0/deployments.ts (3 hunks)
  • src/evm/releases/flow/v1.0/index.ts (2 hunks)
  • src/evm/releases/flow/v1.1/deployments.ts (3 hunks)
  • src/evm/releases/flow/v1.1/index.ts (2 hunks)
  • src/evm/releases/flow/v2.0/deployments.ts (3 hunks)
  • src/evm/releases/flow/v2.0/index.ts (2 hunks)
  • src/evm/releases/helpers.ts (1 hunks)
  • src/evm/releases/legacy/index.ts (1 hunks)
  • src/evm/releases/legacy/v1.0/deployments.ts (1 hunks)
  • src/evm/releases/legacy/v1.0/index.ts (1 hunks)
  • src/evm/releases/legacy/v1.1/deployments.ts (2 hunks)
  • src/evm/releases/legacy/v1.1/index.ts (1 hunks)
  • src/evm/releases/lockup/index.ts (1 hunks)
  • src/evm/releases/lockup/v1.0/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v1.0/index.ts (2 hunks)
  • src/evm/releases/lockup/v1.1/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v1.1/index.ts (2 hunks)
  • src/evm/releases/lockup/v1.2/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v1.2/index.ts (2 hunks)
  • src/evm/releases/lockup/v2.0/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v2.0/index.ts (1 hunks)
  • src/evm/releases/lockup/v3.0/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v3.0/index.ts (1 hunks)
  • src/evm/releases/queries.ts (4 hunks)
  • src/evm/releases/resolvers.ts (7 hunks)
  • src/helpers.ts (4 hunks)
  • src/index.ts (1 hunks)
  • src/internal/helpers.ts (1 hunks)
  • src/internal/logger.ts (2 hunks)
  • src/sablier.ts (1 hunks)
  • src/types.ts (2 hunks)
  • tests/chains.test.ts (1 hunks)
  • tests/comptroller.test.ts (1 hunks)
  • tests/contracts/abi-const.test.ts (1 hunks)
  • tests/contracts/catalog.test.ts (2 hunks)
  • tests/contracts/checksums.test.ts (1 hunks)
  • tests/contracts/indexed.test.ts (3 hunks)
  • tests/contracts/queries.test.ts (6 hunks)
  • tests/cron/blocks.test.ts (4 hunks)
  • tests/cron/chains-rpc.test.ts (1 hunks)
  • tests/deployments/airdrops.test.ts (1 hunks)
  • tests/deployments/flow.test.ts (1 hunks)
  • tests/deployments/lockup.test.ts (1 hunks)
  • tests/deployments/utils/generators.ts (3 hunks)
  • tests/deployments/utils/loaders.ts (3 hunks)
  • tests/helpers.test.ts (1 hunks)
  • tests/helpers/broadcasts.ts (1 hunks)
  • tests/helpers/missing.ts (2 hunks)
  • tests/types.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (59)
cli/commands/print/chains.ts (1)
src/sablier.ts (1)
  • sablier (38-43)
tests/contracts/checksums.test.ts (2)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/contracts/index.ts (1)
  • contracts (4-7)
src/evm/releases/airdrops/v1.2/deployments.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/legacy/index.ts (1)
src/types.ts (2)
  • Legacy (197-197)
  • Release (190-190)
tests/helpers/broadcasts.ts (1)
src/types.ts (1)
  • Release (190-190)
src/internal/logger.ts (1)
src/types.ts (1)
  • Release (190-190)
src/evm/releases/lockup/index.ts (1)
src/types.ts (2)
  • Lockup (199-199)
  • Release (190-190)
src/evm/releases/airdrops/v1.2/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
cli/commands/print/versions.ts (1)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/chains/data.ts (1)
src/types.ts (1)
  • Chain (33-59)
tests/deployments/utils/loaders.ts (1)
src/types.ts (2)
  • Release (190-190)
  • Chain (33-59)
src/evm/releases/airdrops/v1.1/deployments.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/internal/helpers.ts (1)
src/types.ts (2)
  • Release (190-190)
  • Chain (33-59)
src/evm/releases/lockup/v1.0/index.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/helpers.ts (1)
src/types.ts (2)
  • Version (202-202)
  • Address (30-30)
src/evm/releases/lockup/v2.0/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/releases/flow/v1.0/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/releases/lockup/v1.1/index.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/legacy/v1.0/index.ts (3)
src/evm/releases/helpers.ts (1)
  • sortDeployments (13-19)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/releases/airdrops/index.ts (1)
src/types.ts (2)
  • Airdrops (193-193)
  • Release (190-190)
src/evm/releases/flow/v2.0/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
tests/contracts/queries.test.ts (1)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/releases/legacy/v1.1/index.ts (3)
src/evm/releases/helpers.ts (1)
  • sortDeployments (13-19)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/releases/legacy/v1.0/deployments.ts (1)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/releases/queries.ts (1)
src/types.ts (3)
  • Protocol (99-99)
  • Version (202-202)
  • Release (190-190)
src/evm/chains/queries.ts (2)
src/types.ts (1)
  • Chain (33-59)
src/helpers.ts (1)
  • sortChains (59-61)
src/evm/releases/airdrops/v2.0/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/contracts/names.ts (1)
src/types.ts (1)
  • Manifest (149-149)
src/evm/releases/lockup/v1.2/index.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/lockup/v3.0/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/comptroller.ts (1)
src/types.ts (3)
  • Contract (64-81)
  • ContractMap (95-97)
  • Address (30-30)
src/evm/releases/lockup/v1.0/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (1)
  • ContractMap (95-97)
tests/contracts/indexed.test.ts (3)
src/types.ts (1)
  • Protocol (99-99)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/contracts/index.ts (1)
  • contracts (4-7)
src/evm/releases/flow/v1.0/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/releases/lockup/v1.1/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (1)
  • ContractMap (95-97)
tests/contracts/catalog.test.ts (1)
src/sablier.ts (1)
  • sablier (38-43)
cli/commands/print/aliases.ts (1)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/releases/flow/v1.1/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/contracts/catalog.ts (1)
src/types.ts (1)
  • ContractCatalog (86-92)
tests/deployments/utils/generators.ts (5)
src/types.ts (3)
  • Release (190-190)
  • Chain (33-59)
  • Deployment (132-132)
tests/types.ts (3)
  • BasicContract (8-11)
  • StandardBroadcast (18-23)
  • ZKBroadcast (25-31)
tests/deployments/utils/finders.ts (2)
  • findContract (9-18)
  • findZKContract (20-22)
tests/deployments/utils/loaders.ts (1)
  • loadBroadcast (8-18)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/releases/airdrops/v1.3/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
tests/types.ts (1)
src/types.ts (1)
  • Address (30-30)
src/sablier.ts (1)
src/types.ts (2)
  • Release (190-190)
  • Deployment (132-132)
src/evm/releases/airdrops/v2.0/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/releases/legacy/v1.1/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/releases/airdrops/v1.3/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
tests/helpers/missing.ts (1)
src/types.ts (4)
  • Version (202-202)
  • Protocol (99-99)
  • Release (190-190)
  • Chain (33-59)
tests/cron/blocks.test.ts (3)
src/types.ts (1)
  • Protocol (99-99)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/contracts/index.ts (1)
  • contracts (4-7)
src/evm/releases/flow/v1.1/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/releases/flow/index.ts (1)
src/types.ts (2)
  • Flow (195-195)
  • Release (190-190)
src/evm/contracts/queries.ts (1)
src/types.ts (3)
  • Protocol (99-99)
  • Release (190-190)
  • Contract (64-81)
src/evm/releases/airdrops/v1.1/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/releases/lockup/v3.0/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/releases/flow/v2.0/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/releases/lockup/v2.0/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/releases/resolvers.ts (1)
src/types.ts (6)
  • Protocol (99-99)
  • Version (202-202)
  • AliasMap (29-29)
  • ContractMap (95-97)
  • Deployment (132-132)
  • Contract (64-81)
cli/commands/print/missing-broadcasts.ts (2)
src/types.ts (2)
  • Protocol (99-99)
  • Chain (33-59)
src/sablier.ts (1)
  • sablier (38-43)
src/types.ts (1)
src/evm/enums.ts (1)
  • enums (39-42)
src/evm/releases/lockup/v1.2/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (1)
  • ContractMap (95-97)
🔇 Additional comments (95)
tests/contracts/abi-const.test.ts (1)

109-111: LGTM! Import paths correctly updated for new directory structure.

The type-level import paths have been properly updated to reflect the new EVM-specific directory organization under src/evm/releases/. The paths are consistent and will enable compile-time validation to work correctly.

src/evm/releases/legacy/v1.0/index.ts (1)

1-19: LGTM! Clean namespace migration.

The import paths and type annotations have been correctly updated to use the EVM-specific namespace (Sablier.EVM.*). The runtime logic and data remain unchanged, making this a safe refactor that aligns with the PR's objective of isolating EVM-specific code.

src/evm/releases/flow/index.ts (1)

6-10: LGTM! Type signature correctly updated.

The flow mapping type signature has been properly updated to use EVM-namespaced types while preserving the runtime mappings.

src/evm/releases/legacy/index.ts (1)

5-8: LGTM! Type signature correctly updated.

The legacy mapping type signature has been properly updated to use EVM-namespaced types while preserving the runtime mappings.

src/internal/helpers.ts (1)

27-31: LGTM! Function signature correctly updated.

The checkBroadcast function signature has been properly updated to use EVM-namespaced types (Sablier.EVM.Release and Sablier.EVM.Chain). The function body remains unchanged, maintaining the same behavior.

src/evm/releases/legacy/v1.0/deployments.ts (1)

1-24: LGTM! Clean namespace migration.

The import paths and type annotations have been correctly updated to use the EVM-specific namespace. The deployment data and logic remain unchanged.

src/evm/releases/airdrops/v2.0/deployments.ts (3)

1-16: LGTM! Function signature and imports correctly updated.

The import paths and the get function signature have been properly updated to use EVM-namespaced types. The deployment logic remains unchanged.


21-172: LGTM! Deployment arrays correctly typed.

The mainnets array type annotation has been properly updated to Sablier.EVM.Deployment[]. All deployment data remains unchanged.


177-208: LGTM! Testnet deployments correctly typed.

The testnets array type annotation has been properly updated to Sablier.EVM.Deployment[]. All deployment data remains unchanged.

src/internal/logger.ts (1)

72-83: LGTM! Clean namespace migration with improved handling.

The type annotations have been properly updated to use EVM-namespaced types. The addition of the explicit else branch (lines 76-78) improves clarity when logging without a release context.

src/evm/releases/flow/v1.1/deployments.ts (3)

1-16: LGTM! Function signature and imports correctly updated.

The import paths and the get function signature have been properly updated to use EVM-namespaced types. The deployment logic remains unchanged.


21-142: LGTM! Mainnet deployments correctly typed.

The mainnets array type annotation has been properly updated to Sablier.EVM.Deployment[]. All deployment data remains unchanged.


147-192: LGTM! Testnet deployments correctly typed.

The testnets array type annotation has been properly updated to Sablier.EVM.Deployment[]. All deployment data remains unchanged.

src/evm/chains/data.ts (2)

191-230: Type migration to Sablier.EVM.Chain looks correct.

Return type change and adapter logic remain consistent. No issues.


62-87: Provider endpoints verified as correct and currently supported.

Infura supports Avalanche C-Chain at https://avalanche-mainnet.infura.io/v3/YOUR-API-KEY, BNB Smart Chain via https://bsc-mainnet.infura.io/v3/, and Unichain Mainnet HTTPS JSON-RPC API is operational. Infura supports standard Ethereum methods on BNB Smart Chain.

All URL patterns in the code match the documented base patterns:

  • Alchemy: https://<network>-<variant>.g.alchemy.com/v2/${apiKey}
  • Infura: https://<network>-<variant>.infura.io/v3/${apiKey} (or simplified hostname for mainnet)

No mismatches or unsupported networks were found in the configuration.

tests/deployments/utils/loaders.ts (1)

9-11: LGTM on EVM type migration.

Signatures align with the new namespace; behavior unchanged.

Also applies to: 21-23, 38-40

src/evm/chains/queries.ts (1)

7-29: LGTM on EVM-typed queries.

Type updates are consistent and non-breaking at runtime.

src/evm/releases/flow/v2.0/deployments.ts (1)

1-4: LGTM on EVM namespace transition.

Signatures and exports updated correctly; resolver usage unchanged.

Also applies to: 8-16, 21-22, 127-128

tests/deployments/utils/generators.ts (1)

45-46: LGTM on EVM type migration in test generators.

Types line up across loaders/finders and chain resolution; no functional changes.

Also applies to: 52-54, 93-96, 104-104, 112-116, 124-128, 136-140

tests/cron/chains-rpc.test.ts (1)

1-1: LGTM! Import path updated correctly.

The import path has been updated to reflect the new EVM-specific directory structure, aligning with the PR's objective to isolate EVM-related code.

src/evm/releases/airdrops/v1.3/index.ts (2)

1-3: LGTM! Import paths updated correctly.

All import paths have been updated to reference the new EVM-specific directory structure, maintaining consistency with the broader refactoring effort.


12-12: LGTM! Type annotation updated correctly.

The type annotation has been properly updated to use the Sablier.EVM.Deployment[] namespace, aligning with the new EVM-scoped type structure.

cli/commands/print/versions.ts (1)

14-14: LGTM! API call updated correctly.

The method call has been updated from sablier.releases.getAll() to sablier.evmReleases.getAll(), correctly reflecting the new EVM-namespaced public API.

tests/deployments/lockup.test.ts (1)

1-1: LGTM! Import path updated correctly.

The import path has been updated to reference the new EVM-specific releases module, maintaining consistency with the refactoring effort.

src/evm/releases/lockup/v3.0/index.ts (2)

1-2: LGTM! Import paths updated correctly.

The import paths have been properly updated to reference the new EVM-specific directory structure, maintaining consistency across the codebase.


9-9: LGTM! Type annotation updated correctly.

The type annotation has been updated to use the Sablier.EVM.Deployment[] namespace, correctly reflecting the new EVM-scoped type structure.

tests/deployments/flow.test.ts (1)

1-1: LGTM! Import path updated correctly.

The import path has been updated to reference the new EVM-specific releases module, maintaining consistency with the broader refactoring.

tests/helpers.test.ts (1)

1-1: LGTM! Import path updated correctly.

The import path for the Version enum has been updated to reference the new EVM-specific enums module, aligning with the refactoring to isolate EVM-related code.

tests/chains.test.ts (1)

14-14: LGTM! Import path updated correctly.

The import path has been updated to reference the new EVM-specific chains module, maintaining consistency with the refactoring effort to isolate EVM-related code.

src/evm/releases/helpers.ts (1)

1-1: LGTM! Import path correctly updated to EVM namespace.

The import path update from @src/chains/queries to @src/evm/chains/queries correctly aligns with the EVM-specific module restructuring.

tests/comptroller.test.ts (1)

1-2: LGTM! Test imports correctly updated to EVM namespace.

The import path updates correctly reference the EVM-specific modules while preserving all test logic and assertions.

tests/deployments/airdrops.test.ts (1)

1-1: LGTM! Test import correctly updated to EVM namespace.

The import path update from @src/releases to @src/evm/releases correctly aligns with the EVM-specific module restructuring.

src/evm/releases/airdrops/v1.2/deployments.ts (2)

4-4: LGTM! Import path correctly updated to EVM namespace.

The import path update correctly references the EVM-specific lockup deployments module.


9-9: LGTM! Type signatures correctly updated to EVM namespace.

Both the parameter and return types are correctly updated to use Sablier.EVM.Deployment.* types, maintaining consistency with the broader namespace migration.

cli/commands/print/chains.ts (1)

7-7: LGTM! API surface correctly updated to EVM namespace.

The updates from sablier.chains to sablier.evmChains correctly reflect the new public API structure while preserving all functionality.

Also applies to: 15-15

cli/commands/print/aliases.ts (1)

15-15: LGTM! API surface correctly updated to EVM namespace.

The update from sablier.releases to sablier.evmReleases correctly reflects the new public API structure while preserving all alias-building logic.

src/evm/contracts/names.ts (2)

1-14: LGTM! All imports correctly updated to EVM namespace.

All 14 import statements are consistently updated to reference the EVM-specific release manifests under @src/evm/releases/, maintaining the correct structure for the namespace migration.


47-49: LGTM! Type annotations correctly updated to EVM namespace.

Both the function parameter type (Sablier.EVM.Manifest) and the internal type cast (Sablier.EVM.Manifest.LockupV1) are correctly updated to use the EVM namespace while preserving the function logic.

src/evm/releases/flow/v1.1/index.ts (2)

1-3: LGTM! All imports correctly updated to EVM namespace.

The import paths are consistently updated to reference EVM-specific modules (@src/evm/enums, @src/evm/releases/helpers, @src/evm/releases/resolvers), correctly aligning with the namespace migration.


12-12: LGTM! Type annotation correctly updated to EVM namespace.

The deployments type annotation is correctly updated from Sablier.Deployment[] to Sablier.EVM.Deployment[], maintaining consistency with the broader namespace migration.

tests/helpers/missing.ts (1)

1-9: Type migration to Sablier.EVM. looks good.*

Imports and aliases are aligned with the new EVM namespace. No functional changes observed.

src/evm/releases/airdrops/v1.1/index.ts (1)

1-1: Property shorthand suggestion is unsupported—v2.0 doesn't use it.

The enum and sorting suggestions are valid: v2.0 uses Protocol.Airdrops and calls sortDeployments(). However, the claim that v2.0 uses property shorthand is incorrect. The v2.0 release file uses the same verbose form (deployments: deployments, manifest: manifest) as v1.1, so the diff proposing shorthand is not aligned with the stated pattern to follow. Remove the shorthand portion of the suggested diff; keep only the enum import and sorting suggestions.

Likely an incorrect or invalid review comment.

src/evm/releases/flow/v2.0/index.ts (2)

1-3: LGTM! Import paths correctly updated to EVM-specific modules.

The import paths have been properly updated to reference the new EVM-specific directory structure.


12-12: LGTM! Type annotation correctly updated to EVM namespace.

The deployment type has been properly narrowed to Sablier.EVM.Deployment[], improving type safety for the multi-VM architecture.

tests/types.ts (1)

9-9: LGTM! Test types correctly updated to EVM namespace.

The address types have been properly updated to Sablier.EVM.Address, maintaining consistency with the new namespace structure.

Also applies to: 28-28

tests/contracts/queries.test.ts (1)

1-1: LGTM! Tests correctly updated to use EVM-specific API.

The test file has been properly updated to:

  • Import from @src/evm/releases
  • Use sablier.evmContracts.get() instead of sablier.contracts.get()

Test logic and assertions remain unchanged, ensuring the refactoring maintains existing behavior.

Also applies to: 27-27, 44-44, 68-68, 83-83, 100-100

src/evm/releases/airdrops/index.ts (1)

7-7: LGTM! Airdrops export type correctly updated to EVM namespace.

The type signature has been properly updated to use Sablier.EVM.Version.Airdrops and Sablier.EVM.Release, aligning with the new namespace structure.

src/evm/releases/flow/v1.0/index.ts (1)

1-3: LGTM! Flow v1.0 release correctly migrated to EVM namespace.

Import paths and type annotations have been properly updated, following the same pattern as other release versions.

Also applies to: 12-12

src/evm/releases/lockup/v2.0/index.ts (1)

1-2: LGTM! Lockup v2.0 release correctly migrated to EVM namespace.

Import paths and type annotations have been properly updated to the EVM-specific structure.

Also applies to: 9-9

src/evm/releases/lockup/v1.0/index.ts (1)

1-3: LGTM! Lockup v1.0 release correctly migrated to EVM namespace.

Import paths and the LockupV1-specific type annotation (Sablier.EVM.Deployment.LockupV1[]) have been properly updated.

Also applies to: 12-12

src/evm/contracts/catalog.ts (1)

1-2: LGTM! Contract catalog correctly migrated to EVM namespace.

Import paths, return type, and internal type annotations have been properly updated to use Sablier.EVM.ContractCatalog, while preserving the catalog construction logic.

Also applies to: 6-7

tests/helpers/broadcasts.ts (1)

10-10: LGTM! Clean namespace migration.

The function signature correctly updates to use the EVM-specific namespace while preserving all logic.

src/evm/releases/legacy/v1.1/deployments.ts (3)

1-3: LGTM! Import paths correctly updated.

All imports properly migrated to the EVM-specific module paths.


9-17: LGTM! Type annotations correctly updated.

Function signature and return type properly use the Sablier.EVM namespace while preserving logic.


22-44: LGTM! Consistent type annotation.

The mainnets array correctly uses Sablier.EVM.Deployment[] type.

src/evm/releases/lockup/index.ts (1)

8-14: LGTM! Type signature correctly migrated.

Both the key (Sablier.EVM.Version.Lockup) and value (Sablier.EVM.Release) types are properly updated to the EVM namespace while maintaining runtime data.

tests/contracts/checksums.test.ts (1)

9-11: LGTM! Test correctly updated to new API surface.

The test properly uses the renamed evmReleases and evmContracts query methods while preserving test logic.

src/evm/releases/airdrops/v1.2/index.ts (2)

1-2: LGTM! Import paths correctly migrated.

Imports properly updated to use EVM-specific module paths.


9-9: LGTM! Type annotation correctly updated.

The deployments constant properly uses Sablier.EVM.Deployment[] type.

src/evm/index.ts (1)

1-5: LGTM! Clean aggregator pattern.

This new entry point properly consolidates all EVM-related exports into a single module, simplifying import paths for consumers. The mix of named export (chains) and namespace exports (*) provides a good balance.

src/evm/releases/airdrops/v1.1/deployments.ts (2)

4-4: LGTM! Import path correctly updated.

Import properly migrated to the EVM-specific lockup deployments path.


9-14: LGTM! Function signature correctly migrated.

Both parameter and return types properly use the Sablier.EVM namespace while preserving the filter logic.

src/evm/releases/lockup/v1.1/index.ts (2)

1-3: LGTM! Import paths correctly migrated.

All imports properly updated to use EVM-specific module paths.


12-12: LGTM! Type annotation correctly updated.

The deployments constant properly uses the Sablier.EVM.Deployment.LockupV1[] type.

src/index.ts (1)

1-4: LGTM! Clean refactoring to introduce EVM namespace.

The restructured exports appropriately delegate EVM-specific functionality to the new ./evm module while maintaining existing exports for helpers, sablier, and types. This aligns well with the multi-VM architecture goal.

src/evm/releases/lockup/v1.2/index.ts (1)

1-12: LGTM! Consistent namespace migration.

The import paths and type annotations have been correctly updated to the EVM-specific namespace, maintaining type safety while aligning with the new architecture.

src/evm/releases/airdrops/v1.3/deployments.ts (2)

1-16: LGTM! Proper EVM namespace migration.

The import paths and function signature have been correctly updated to use the Sablier.EVM.* namespace, maintaining type safety throughout.


21-114: LGTM! Export types properly updated.

Both mainnets and testnets arrays are correctly typed as Sablier.EVM.Deployment[], consistent with the namespace refactoring.

src/evm/releases/lockup/v1.1/deployments.ts (2)

1-22: LGTM! Consistent refactoring for LockupV1 deployments.

The imports and function signature correctly use the EVM namespace, with proper typing for the nested core and periphery contract maps.


27-210: LGTM! Export types properly namespaced.

Both deployment arrays are correctly typed as Sablier.EVM.Deployment.LockupV1[].

src/evm/releases/lockup/v1.0/deployments.ts (2)

1-22: LGTM! Proper namespace migration.

The imports and function signature are correctly updated to use the EVM namespace with appropriate typing for LockupV1 deployments.


27-159: LGTM! Export types properly updated.

Both deployment arrays correctly use the Sablier.EVM.Deployment.LockupV1[] type.

src/evm/releases/lockup/v3.0/deployments.ts (2)

1-16: LGTM! Clean EVM namespace migration.

Imports and function signature properly use the EVM-specific paths and types.


21-202: LGTM! Export arrays properly typed.

Both mainnets and testnets correctly use Sablier.EVM.Deployment[].

MIGRATION.md (1)

1-273: Excellent migration guide! Comprehensive and user-friendly.

This migration guide is exceptionally well-crafted:

  • Clear documentation of all breaking changes with before/after comparisons
  • Actionable quick-replace patterns for automated migration
  • Helpful checklist to track progress
  • Good explanation of the rationale (multi-VM support)
  • Complete example at the end showing the full migration workflow

The guide will significantly ease the upgrade path for users.

src/evm/releases/flow/v1.0/deployments.ts (2)

1-16: LGTM! Consistent EVM namespace adoption.

Imports and function signature correctly use the EVM-specific module paths and type namespace.


21-115: LGTM! Export types properly namespaced.

Both deployment arrays are correctly typed as Sablier.EVM.Deployment[].

tests/contracts/indexed.test.ts (2)

1-2: EVM-scoped imports look correct.

Import path updates align with the new evm surface.


42-46: LGTM on getOrThrow usage.

Clear failure mode if a chain is missing.

README.md (1)

69-76: Nice updates showcasing the new EVM surface.

Examples for evmChains.get, getBySlug, and evmReleases.getAll match the refactor intent.

Please confirm top-level exports in package.json still expose releases and chains from "sablier" as shown, per MIGRATION.md.

Also applies to: 98-105

src/evm/releases/queries.ts (1)

43-50: LGTM: getLatest guard is solid.

Clear error when isLatest metadata is inconsistent.

tests/cron/blocks.test.ts (1)

1-37: LGTM on EVM-scoped imports and INDEXED typing.

The migration to @src/evm/* and Record<Sablier.EVM.Protocol, Set<string>> is consistent with the refactor.

Also applies to: 19-37

package.json (2)

7-7: LGTM: Appropriate major version bump.

The version bump from 1.4.2 to 2.0.0 correctly signals breaking changes for the namespace and export path restructuring.


49-64: LGTM: Export structure aligns with new EVM-centric architecture.

The new package exports correctly reflect the restructured module layout with dedicated EVM paths. The addition of the top-level ./evm export provides a convenient entry point for consumers.

src/evm/releases/lockup/v1.2/deployments.ts (2)

1-22: LGTM: Consistent migration to EVM namespace.

The import paths and type signatures have been correctly updated to use the new @src/evm/* paths and Sablier.EVM.* types. The function logic remains unchanged.


27-310: LGTM: Type annotations consistently updated.

The exported arrays mainnets and testnets now use the correct Sablier.EVM.Deployment.LockupV1[] type. All deployment data remains intact.

src/evm/comptroller.ts (2)

1-26: LGTM: Public API correctly updated to EVM namespace.

The import path and all return type signatures (Sablier.EVM.Contract) have been consistently updated to reflect the new namespace structure.


140-157: LGTM: Helper function signatures updated.

The internal get helper function correctly uses Sablier.EVM.ContractMap and Sablier.EVM.Address types, maintaining consistency with the namespace migration.

src/evm/releases/resolvers.ts (2)

1-69: LGTM: Resolver functions consistently migrated to EVM types.

All type parameters, return types, and import paths have been systematically updated to use the Sablier.EVM.* namespace. The resolver logic remains functionally unchanged.


103-124: LGTM: Helper function signature updated.

The mapContractsToDeployment function correctly uses Sablier.EVM.ContractMap and returns Sablier.EVM.Contract[], maintaining type consistency.

src/sablier.ts (2)

19-36: LGTM: Internal implementation correctly updated.

The import paths and type signatures have been consistently updated to use the new EVM structure. The evmDeploymentsQueries correctly references Sablier.EVM.* types and uses evmReleasesQueries.


38-43: Breaking change: Public API renamed to EVM-prefixed properties.

The public API surface now exposes evmChains, evmContracts, evmDeployments, and evmReleases instead of the previous unprefixed names. This is well-documented in CHANGELOG.md and appropriate for the v2.0.0 release.

CHANGELOG.md (1)

19-73: LGTM: Comprehensive breaking changes documentation.

The CHANGELOG thoroughly documents the v2.0.0 breaking changes, including:

  • Public API renames (sablier.chainssablier.evmChains, etc.)
  • Type namespace migration (Sablier.*Sablier.EVM.*)
  • Package export path updates
  • Directory structure reorganization

The quick migration guide provides actionable examples for consumers to update their code.

src/types.ts (2)

2-2: LGTM: Import path updated for EVM directory structure.

The enums import path correctly references the new location at ./evm/enums.


27-247: LGTM: All types successfully migrated to Sablier.EVM namespace.

The comprehensive migration moves all previously top-level types into the Sablier.EVM namespace while preserving the nested structure (e.g., EVM.Deployment.LockupV1, EVM.Release.Standard, EVM.Indexer.TheGraph). This creates a clean separation that will enable future multi-VM support.

The type shapes remain unchanged—this is purely a namespace reorganization.

@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch from 1bf1818 to 79d0a5f Compare October 23, 2025 17:35
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
tests/contracts/abi-const.test.ts (1)

11-11: Update glob pattern to match the new directory structure.

The verification confirms that ABI files have been moved to src/evm/releases/. Update line 11 from:

const files = await globby("src/releases/**/abi/*.ts", {

to:

const files = await globby("src/evm/releases/**/abi/*.ts", {

The old pattern matches 0 files, while the new pattern correctly matches all 43 ABI files.

package.json (1)

13-18: Align viem versions and remove dual listing.

Verification confirms viem is imported in src/types.ts and src/evm/chains/data.ts and used at build time. The current dual listing—viem: ^2.33 in dependencies and viem: ^2.32 in peerDependencies—creates a version mismatch and risks duplicate installs. Since this is a library with an export map and peerDependencies, viem should be declared as a peer dependency (for consumers) and dev dependency (for building), not as a regular dependency. Remove it from dependencies, align versions to ^2.33 in both peerDependencies and add to devDependencies.

src/evm/chains/data.ts (1)

62-87: Fix CoinGecko ID for Gnosis and verify Infura coverage.

Line 139: The CoinGecko ID for Gnosis's native currency is "xdai", not "dai" (confirmed Oct 2025). This should be corrected to [_gnosis.nativeCurrency.symbol]: "xdai".

Additionally, infuraRPCs is missing Gnosis and Sei (lines 93–112), which are both supported by Infura. Consider adding:

[_gnosis.id]: (apiKey) => `https://gnosis-mainnet.infura.io/v3/${apiKey}`,
[_sei.id]: (apiKey) => `https://sei-mainnet.infura.io/v3/${apiKey}`,

Note: Berachain, Ronin, and XDC are correctly absent from infuraRPCs; these chains lack clear public Infura support.

src/evm/releases/queries.ts (1)

43-50: Handle empty protocol releases before accessing last element.

Prevents a cryptic runtime error when no releases exist for a protocol.

   getLatest: (opts: { protocol: Sablier.EVM.Protocol }): Sablier.EVM.Release => {
-    const list = _.values(releases[opts.protocol]);
+    const list = _.values(releases[opts.protocol]);
+    if (!list.length) {
+      throw new Error(`Sablier SDK: No releases found for Sablier ${opts.protocol}.`);
+    }
     const latest = list[list.length - 1];
     if (!latest.isLatest) {
       throw new Error(`Sablier SDK: No latest release found for Sablier ${opts.protocol}. Please report on GitHub.`);
     }
     return latest;
   },
🧹 Nitpick comments (14)
src/evm/releases/flow/v1.1/deployments.ts (1)

90-93: Verify morph block number 40_330_21 (possible digit omission).
Underscore grouping looks off compared to others (likely intended 4_033_021 or 40_330_210). Please confirm the exact block height and normalize separators across entries for consistency.

src/evm/chains/queries.ts (1)

7-28: Precompute indexes for O(1) lookups and avoid repeated scans.
Build maps once at module init (by id/slug) and a single sorted array for getAll/getMainnets/getTestnets. Simpler, faster, fewer lodash calls.

 import * as chains from "./data";
 
-export const chainsQueries = {
-  get: (chainId: number): Sablier.EVM.Chain | undefined => {
-    return _.find(chains, (c) => c.id === chainId);
-  },
-  getAll: (): Sablier.EVM.Chain[] => {
-    return sortChains(_.values(chains));
-  },
-  getBySlug: (slug: string): Sablier.EVM.Chain | undefined => {
-    return _.find(chains, (c) => c.slug === slug);
-  },
-  getMainnets: (): Sablier.EVM.Chain[] => {
-    return sortChains(_.filter(_.values(chains), (c) => !c.isTestnet));
-  },
-  getOrThrow: (chainId: number): Sablier.EVM.Chain => {
-    const chain = _.find(chains, (c) => c.id === chainId);
-    if (!chain) {
-      throw new Error(`Sablier SDK: Chain with ID ${chainId} not found`);
-    }
-    return chain;
-  },
-  getTestnets: (): Sablier.EVM.Chain[] => {
-    return sortChains(_.filter(_.values(chains), (c) => c.isTestnet));
-  },
-};
+const all = sortChains(Object.values(chains));
+const byId = new Map(all.map((c) => [c.id, c]));
+const bySlug = new Map(all.map((c) => [c.slug, c]));
+const mainnets = all.filter((c) => !c.isTestnet);
+const testnets = all.filter((c) => c.isTestnet);
+
+export const chainsQueries = {
+  get: (chainId: number): Sablier.EVM.Chain | undefined => byId.get(chainId),
+  getAll: (): Sablier.EVM.Chain[] => all,
+  getBySlug: (slug: string): Sablier.EVM.Chain | undefined => bySlug.get(slug),
+  getMainnets: (): Sablier.EVM.Chain[] => mainnets,
+  getOrThrow: (chainId: number): Sablier.EVM.Chain => {
+    const chain = byId.get(chainId);
+    if (!chain) throw new Error(`Sablier SDK: Chain with ID ${chainId} not found`);
+    return chain;
+  },
+  getTestnets: (): Sablier.EVM.Chain[] => testnets,
+};
package.json (1)

98-101: Prepack requires bun and just. Ensure the publish environment has them.
If missing, npm pack/publish will fail. Either install them in CI or switch to a Node-native build step.

src/evm/chains/data.ts (2)

299-328: Drop rpc from viemDefine config for hyperevm.
defineChain uses rpcUrls; the extra rpc field is unused noise and may confuse readers. Keep rpcUrls.default.http only.

   viemDefine({
@@
-    rpc: {
-      public: "https://rpc.hyperliquid.xyz/evm",
-    },
     rpcUrls: {
       default: {
         http: ["https://rpc.hyperliquid.xyz/evm"],
       },
     },

355-384: Same here: remove rpc from tangle custom definition.
Stick to rpcUrls.default.http.

   viemDefine({
@@
-    rpc: {
-      public: "https://rpc.tangle.tools",
-    },
     rpcUrls: {
       default: {
         http: ["https://rpc.tangle.tools"],
       },
     },
cli/commands/print/missing-broadcasts.ts (1)

41-44: Slightly simplify missing-list initialization; avoid lodash.
Cleaner and faster with nullish coalescing.

-        _.defaults(missing, { [r.version]: [] });
-        missing[r.version].push(chain);
+        (missing[r.version] ??= []).push(chain);
src/evm/comptroller.ts (1)

35-111: Normalize block-number separators for readability.
Some entries use grouped underscores (e.g., 166_583_712) while others don’t. Consider consistent 3‑digit grouping across all entries.

src/sablier.ts (1)

38-43: Optionally harden the public sablier singleton.
Freeze to prevent accidental mutation by consumers.

-export const sablier = {
+export const sablier = Object.freeze({
   evmChains: evmChainsQueries,
   evmContracts: evmContractsQueries,
   evmDeployments: evmDeploymentsQueries,
   evmReleases: evmReleasesQueries,
-};
+} as const);
src/evm/releases/resolvers.ts (1)

103-124: Prefer native Object.entries over lodash for clarity and bundle size.

Only used here; switching removes a lodash touchpoint on a hot path that maps many contracts.

-  return _.entries(contractMap).map(([name, addressOrTuple]) => {
+  return Object.entries(contractMap).map(([name, addressOrTuple]) => {

If lodash is no longer needed in this file after this change, drop the import _ from "lodash";.

src/types.ts (1)

78-80: Make optional fields optional instead of union with undefined.

Improves DX and avoids | undefined noise in consumers.

-      protocol: Sablier.EVM.Protocol | undefined;
+      protocol?: Sablier.EVM.Protocol;
-      version: Sablier.EVM.Version | undefined;
+      version?: Sablier.EVM.Version;
CHANGELOG.md (2)

19-23: Confirm release tag timing.

Linking to [2.0.0] while PR is open can 404 until the GitHub release is published. Consider marking as “Unreleased” until cut, then update the date and link.


65-72: Make quick migration snippet exhaustive.

Add the deployments rename and the Protocol/Version type moves for parity with “Breaking Changes.”

 sablier.releases → sablier.evmReleases
+sablier.deployments → sablier.evmDeployments
 Sablier.Chain → Sablier.EVM.Chain
 Sablier.Contract → Sablier.EVM.Contract
+Sablier.Protocol → Sablier.EVM.Protocol
+Sablier.Version → Sablier.EVM.Version
+Sablier.Address → Sablier.EVM.Address
src/evm/releases/queries.ts (2)

16-23: Avoid coupling to enum; traverse the source map instead.

This is more robust and eliminates reliance on enum value shapes.

-  getAll: (opts?: { protocol?: Sablier.EVM.Protocol }): Sablier.EVM.Release[] => {
+  getAll: (opts?: { protocol?: Sablier.EVM.Protocol }): Sablier.EVM.Release[] => {
     const { protocol } = opts || {};
     if (protocol) {
       return _.flatMap(_.values(releases[protocol]));
     }
-    // Recursively get all releases from all protocols in the enum
-    return _.flatMap(Object.values(Protocol), (protocolName) => _.flatMap(_.values(releases[protocolName])));
+    // Recursively get all releases from the releases source
+    return _.flatMap(_.values(releases), (byVersion) => _.flatMap(_.values(byVersion)));
   },

29-38: Define ordering for “first” explicitly or document it.

Object iteration order may not reflect semantic “first”. If versions are sortable, pick min version; otherwise, document that this relies on construction order of releases[protocol].

Would you like a helper to compare semantic versions and select the earliest? I can wire it to getFirst.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1bf1818 and 79d0a5f.

📒 Files selected for processing (74)
  • CHANGELOG.md (2 hunks)
  • MIGRATION.md (1 hunks)
  • README.md (3 hunks)
  • cli/commands/print/aliases.ts (1 hunks)
  • cli/commands/print/chains.ts (1 hunks)
  • cli/commands/print/missing-broadcasts.ts (3 hunks)
  • cli/commands/print/versions.ts (1 hunks)
  • package.json (2 hunks)
  • src/evm/chains/data.ts (6 hunks)
  • src/evm/chains/queries.ts (1 hunks)
  • src/evm/comptroller.ts (4 hunks)
  • src/evm/contracts/catalog.ts (1 hunks)
  • src/evm/contracts/names.ts (2 hunks)
  • src/evm/contracts/queries.ts (3 hunks)
  • src/evm/index.ts (1 hunks)
  • src/evm/releases/airdrops/index.ts (1 hunks)
  • src/evm/releases/airdrops/v1.1/deployments.ts (1 hunks)
  • src/evm/releases/airdrops/v1.1/index.ts (1 hunks)
  • src/evm/releases/airdrops/v1.2/deployments.ts (1 hunks)
  • src/evm/releases/airdrops/v1.2/index.ts (1 hunks)
  • src/evm/releases/airdrops/v1.3/deployments.ts (3 hunks)
  • src/evm/releases/airdrops/v1.3/index.ts (2 hunks)
  • src/evm/releases/airdrops/v2.0/deployments.ts (3 hunks)
  • src/evm/releases/airdrops/v2.0/index.ts (2 hunks)
  • src/evm/releases/flow/index.ts (1 hunks)
  • src/evm/releases/flow/v1.0/deployments.ts (3 hunks)
  • src/evm/releases/flow/v1.0/index.ts (2 hunks)
  • src/evm/releases/flow/v1.1/deployments.ts (3 hunks)
  • src/evm/releases/flow/v1.1/index.ts (2 hunks)
  • src/evm/releases/flow/v2.0/deployments.ts (3 hunks)
  • src/evm/releases/flow/v2.0/index.ts (2 hunks)
  • src/evm/releases/helpers.ts (1 hunks)
  • src/evm/releases/legacy/index.ts (1 hunks)
  • src/evm/releases/legacy/v1.0/deployments.ts (1 hunks)
  • src/evm/releases/legacy/v1.0/index.ts (1 hunks)
  • src/evm/releases/legacy/v1.1/deployments.ts (2 hunks)
  • src/evm/releases/legacy/v1.1/index.ts (1 hunks)
  • src/evm/releases/lockup/index.ts (1 hunks)
  • src/evm/releases/lockup/v1.0/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v1.0/index.ts (2 hunks)
  • src/evm/releases/lockup/v1.1/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v1.1/index.ts (2 hunks)
  • src/evm/releases/lockup/v1.2/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v1.2/index.ts (2 hunks)
  • src/evm/releases/lockup/v2.0/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v2.0/index.ts (1 hunks)
  • src/evm/releases/lockup/v3.0/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v3.0/index.ts (1 hunks)
  • src/evm/releases/queries.ts (4 hunks)
  • src/evm/releases/resolvers.ts (7 hunks)
  • src/helpers.ts (4 hunks)
  • src/index.ts (1 hunks)
  • src/internal/helpers.ts (1 hunks)
  • src/internal/logger.ts (2 hunks)
  • src/sablier.ts (2 hunks)
  • src/types.ts (2 hunks)
  • tests/chains.test.ts (1 hunks)
  • tests/comptroller.test.ts (1 hunks)
  • tests/contracts/abi-const.test.ts (1 hunks)
  • tests/contracts/catalog.test.ts (2 hunks)
  • tests/contracts/checksums.test.ts (1 hunks)
  • tests/contracts/indexed.test.ts (3 hunks)
  • tests/contracts/queries.test.ts (6 hunks)
  • tests/cron/blocks.test.ts (4 hunks)
  • tests/cron/chains-rpc.test.ts (1 hunks)
  • tests/deployments/airdrops.test.ts (1 hunks)
  • tests/deployments/flow.test.ts (1 hunks)
  • tests/deployments/lockup.test.ts (1 hunks)
  • tests/deployments/utils/generators.ts (3 hunks)
  • tests/deployments/utils/loaders.ts (3 hunks)
  • tests/helpers.test.ts (1 hunks)
  • tests/helpers/broadcasts.ts (1 hunks)
  • tests/helpers/missing.ts (2 hunks)
  • tests/types.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (36)
  • src/evm/releases/lockup/v1.2/index.ts
  • tests/contracts/catalog.test.ts
  • src/evm/releases/flow/index.ts
  • tests/helpers/broadcasts.ts
  • src/evm/releases/airdrops/v1.2/index.ts
  • cli/commands/print/aliases.ts
  • src/evm/releases/airdrops/v1.3/deployments.ts
  • tests/comptroller.test.ts
  • src/evm/releases/legacy/index.ts
  • src/evm/index.ts
  • src/evm/releases/airdrops/v1.1/deployments.ts
  • src/internal/helpers.ts
  • src/evm/releases/lockup/v2.0/index.ts
  • tests/deployments/lockup.test.ts
  • cli/commands/print/versions.ts
  • tests/deployments/utils/loaders.ts
  • src/evm/releases/lockup/v1.0/deployments.ts
  • cli/commands/print/chains.ts
  • src/index.ts
  • tests/contracts/checksums.test.ts
  • src/evm/releases/lockup/v3.0/index.ts
  • tests/cron/blocks.test.ts
  • src/evm/contracts/names.ts
  • src/evm/releases/airdrops/v1.3/index.ts
  • src/evm/releases/airdrops/v2.0/index.ts
  • tests/chains.test.ts
  • src/evm/releases/legacy/v1.0/deployments.ts
  • src/evm/releases/helpers.ts
  • src/evm/releases/lockup/v2.0/deployments.ts
  • tests/helpers.test.ts
  • src/evm/releases/flow/v1.0/index.ts
  • src/evm/contracts/queries.ts
  • src/helpers.ts
  • tests/deployments/flow.test.ts
  • tests/deployments/airdrops.test.ts
  • src/evm/releases/flow/v1.0/deployments.ts
🧰 Additional context used
🧬 Code graph analysis (32)
src/evm/releases/lockup/v1.0/index.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
tests/deployments/utils/generators.ts (5)
src/types.ts (3)
  • Release (190-190)
  • Chain (33-59)
  • Deployment (132-132)
tests/types.ts (3)
  • BasicContract (8-11)
  • StandardBroadcast (18-23)
  • ZKBroadcast (25-31)
tests/deployments/utils/finders.ts (2)
  • findContract (9-18)
  • findZKContract (20-22)
tests/deployments/utils/loaders.ts (1)
  • loadBroadcast (8-18)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/releases/flow/v1.1/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/releases/lockup/v1.1/index.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/airdrops/v2.0/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/releases/legacy/v1.1/index.ts (3)
src/evm/releases/helpers.ts (1)
  • sortDeployments (13-19)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
tests/types.ts (1)
src/types.ts (1)
  • Address (30-30)
src/evm/releases/airdrops/v1.1/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
tests/contracts/indexed.test.ts (3)
src/types.ts (1)
  • Protocol (99-99)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/contracts/index.ts (1)
  • contracts (4-7)
src/evm/releases/lockup/v1.2/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (1)
  • ContractMap (95-97)
tests/contracts/queries.test.ts (1)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/releases/flow/v2.0/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/releases/flow/v1.1/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/releases/lockup/index.ts (1)
src/types.ts (2)
  • Lockup (199-199)
  • Release (190-190)
src/evm/releases/airdrops/v1.2/deployments.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/resolvers.ts (1)
src/types.ts (6)
  • Protocol (99-99)
  • Version (202-202)
  • AliasMap (29-29)
  • ContractMap (95-97)
  • Deployment (132-132)
  • Contract (64-81)
src/evm/releases/flow/v2.0/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/types.ts (1)
src/evm/enums.ts (1)
  • enums (39-42)
src/internal/logger.ts (1)
src/types.ts (1)
  • Release (190-190)
src/evm/releases/airdrops/index.ts (1)
src/types.ts (2)
  • Airdrops (193-193)
  • Release (190-190)
src/evm/releases/lockup/v3.0/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
tests/helpers/missing.ts (1)
src/types.ts (4)
  • Version (202-202)
  • Protocol (99-99)
  • Release (190-190)
  • Chain (33-59)
src/evm/releases/queries.ts (1)
src/types.ts (3)
  • Protocol (99-99)
  • Version (202-202)
  • Release (190-190)
src/evm/chains/queries.ts (2)
src/types.ts (1)
  • Chain (33-59)
src/helpers.ts (1)
  • sortChains (59-61)
src/sablier.ts (1)
src/types.ts (2)
  • Release (190-190)
  • Deployment (132-132)
src/evm/releases/legacy/v1.0/index.ts (2)
src/evm/releases/helpers.ts (1)
  • sortDeployments (13-19)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/chains/data.ts (1)
src/types.ts (1)
  • Chain (33-59)
cli/commands/print/missing-broadcasts.ts (2)
src/types.ts (2)
  • Protocol (99-99)
  • Chain (33-59)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/contracts/catalog.ts (1)
src/types.ts (1)
  • ContractCatalog (86-92)
src/evm/releases/legacy/v1.1/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/comptroller.ts (1)
src/types.ts (3)
  • Contract (64-81)
  • ContractMap (95-97)
  • Address (30-30)
src/evm/releases/lockup/v1.1/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (1)
  • ContractMap (95-97)
🔇 Additional comments (37)
src/internal/logger.ts (1)

72-83: Type migration is complete and compatible—no issues found.

The verification confirms that all callers of the log function are already using the correct Sablier.EVM.Release type. In src/internal/helpers.ts line 28, the release parameter is already typed as Sablier.EVM.Release, and at line 49 it's passed directly to the log function. The type changes in logger.ts are fully compatible with existing callers.

src/evm/releases/airdrops/index.ts (1)

7-12: Type signature correctly updated and verified.

The change properly namespaces the airdrops export under Sablier.EVM, and all imported release objects are type-compatible. The resolvers.release.standard() function returns Sablier.EVM.Release.Standard, which is a member of the Sablier.EVM.Release union type, ensuring type safety for the record declaration.

src/evm/releases/lockup/v1.0/index.ts (1)

1-12: LGTM! Namespace migration is consistent.

The import paths and type annotations have been correctly updated to use the EVM-specific namespace (Sablier.EVM.Deployment.LockupV1[]). The changes align with the PR's objective of isolating EVM-related code.

tests/contracts/abi-const.test.ts (1)

109-111: LGTM! Type import paths correctly updated.

The type-level imports have been correctly updated to reference the EVM-specific ABI paths, ensuring compile-time validation continues to work with the new structure.

src/evm/contracts/catalog.ts (1)

1-7: LGTM! Catalog types and imports correctly migrated.

The imports and type annotations have been properly updated to use the EVM-specific namespace (Sablier.EVM.ContractCatalog), maintaining consistency with the broader namespace migration.

src/evm/releases/lockup/v1.1/index.ts (1)

1-12: LGTM! Consistent with v1.0 namespace migration.

The import paths and type annotations follow the same pattern as v1.0, correctly using the EVM-specific namespace. The migration is consistent across lockup versions.

src/evm/releases/legacy/v1.1/deployments.ts (1)

1-22: LGTM! Function signatures and exports correctly updated.

The function signature and export types have been properly migrated to the EVM namespace (Sablier.EVM.ContractMap, Sablier.EVM.Deployment). The changes maintain type safety while aligning with the new structure.

src/evm/releases/legacy/v1.1/index.ts (1)

1-11: LGTM! Legacy release namespace migration complete.

The imports and type annotations are correctly updated to use the EVM-specific namespace, consistent with the pattern used across other release versions.

src/evm/releases/lockup/v1.1/deployments.ts (1)

1-27: LGTM! Deployment types correctly migrated to EVM namespace.

The function signature and export types have been properly updated to use the EVM-specific namespace (Sablier.EVM.ContractMap, Sablier.EVM.Deployment.LockupV1). The nested structure for core and periphery contract maps is maintained correctly.

tests/contracts/indexed.test.ts (2)

1-11: LGTM! Test imports and types correctly updated.

The import paths have been correctly updated to reference EVM-specific modules, and the type annotation for INDEXED properly uses the Sablier.EVM.Protocol namespace.


32-42: LGTM! Test API calls correctly migrated.

The test correctly uses the new EVM-prefixed API surface (sablier.evmReleases, sablier.evmContracts, sablier.evmChains), aligning with the breaking changes described in the PR objectives.

src/evm/releases/lockup/v1.2/deployments.ts (1)

1-22: LGTM! Clean namespace migration to EVM-specific types.

The import paths and type signatures have been correctly updated to reflect the new EVM namespace structure. The changes are mechanical and consistent:

  • Import paths migrated to @src/evm/*
  • Types migrated from Sablier.ContractMap to Sablier.EVM.ContractMap
  • Return and export types updated to Sablier.EVM.Deployment.LockupV1

Also applies to: 27-27, 315-315

src/evm/releases/airdrops/v1.2/deployments.ts (1)

4-17: LGTM! Namespace migration applied consistently.

The import path and type signatures are correctly updated to the EVM namespace. Both the function parameter type (Sablier.EVM.Deployment.LockupV1[]) and return type (Sablier.EVM.Deployment.Standard[]) align with the refactor objectives.

src/evm/releases/flow/v2.0/deployments.ts (1)

1-16: LGTM! Consistent with EVM namespace migration pattern.

All changes correctly implement the namespace migration:

  • Import paths updated to @src/evm/* structure
  • Function parameter and return types use Sablier.EVM.* namespace
  • Export type annotations aligned with the new structure

Also applies to: 21-21, 127-127

tests/cron/chains-rpc.test.ts (1)

1-1: LGTM! Import path correctly updated.

The import path has been updated to reference the new EVM-specific chains module location. No behavioral changes to the test.

tests/types.ts (1)

8-11: LGTM! Type namespace migration applied correctly.

Both address type annotations have been updated from Sablier.Address to Sablier.EVM.Address, consistent with the EVM namespace refactor.

Also applies to: 25-31

src/evm/releases/legacy/v1.0/index.ts (1)

1-10: LGTM! Import paths and type annotations correctly migrated.

All changes properly implement the EVM namespace migration:

  • Import paths updated to @src/evm/* structure
  • Deployment array type annotation uses Sablier.EVM.Deployment[]
src/evm/releases/flow/v1.1/index.ts (1)

1-12: LGTM! Consistent namespace migration applied.

Import paths and type annotations correctly updated to the EVM namespace structure, following the same pattern as other release modules.

tests/contracts/queries.test.ts (1)

1-1: LGTM! API surface migration applied consistently.

All changes correctly implement the refactor:

  • Import path updated to @src/evm/releases
  • All API calls migrated from sablier.contracts.get to sablier.evmContracts.get

The test logic and assertions remain unchanged, ensuring test coverage is maintained across the namespace migration.

Also applies to: 27-34, 44-50, 68-73, 83-91, 100-107

src/evm/releases/flow/v2.0/index.ts (1)

1-12: LGTM - Consistent namespace refactoring.

The import path updates and type namespace changes are correct and align with the PR's objective to isolate EVM-specific code. The logic remains unchanged.

src/evm/releases/airdrops/v1.1/index.ts (1)

1-8: LGTM - Consistent with refactoring pattern.

Import paths and type annotations correctly updated to use the EVM namespace.

src/evm/releases/lockup/index.ts (1)

8-14: LGTM - Type signature correctly updated.

The exported constant's type signature has been updated to use the Sablier.EVM namespace, consistent with the overall refactoring strategy.

src/evm/releases/airdrops/v2.0/deployments.ts (2)

1-21: LGTM - Imports and function signature correctly updated.

The import paths and type annotations have been correctly updated to use the EVM namespace. The deployment data logic remains unchanged.


177-177: LGTM - Export type correctly updated.

The testnets export type correctly uses Sablier.EVM.Deployment[].

tests/helpers/missing.ts (2)

1-8: LGTM - Test helper imports and types correctly updated.

The import paths and type definitions have been correctly migrated to the EVM namespace.


59-70: LGTM - Function signature correctly updated.

The isKnownMissing function signature now uses EVM-namespaced types while preserving the original logic.

tests/deployments/utils/generators.ts (3)

45-56: LGTM - Test configuration types correctly updated.

The TestConfig interface and createInnerTests function signatures have been correctly updated to use EVM-namespaced types.


92-110: LGTM - Test generator functions correctly updated.

The createContractTests function signature and internal type cast have been properly updated to use the EVM namespace.


136-148: LGTM - Public API usage correctly updated.

The test suite correctly uses the new sablier.evmChains API (line 139), reflecting the documented breaking change.

src/evm/releases/lockup/v3.0/deployments.ts (2)

1-21: LGTM - Deployment file correctly migrated to EVM namespace.

Import paths, function signature, and export types are all correctly updated. The deployment data remains unchanged.


202-202: LGTM - Testnet exports correctly typed.

The testnets export uses the correct EVM namespace type.

MIGRATION.md (2)

144-220: LGTM - Comprehensive migration guide with clear examples.

The migration guide is well-structured with:

  • Clear before/after examples
  • Actionable checklist
  • Automated migration snippets
  • Rationale for the changes
  • Help resources

This will significantly ease the migration burden for users.


1-48: Clarify whether the parameter change represents a documented breaking change or if the before example contains an error.

The migration guide examples show a parameter name change from name to contractName, but the current implementation (src/evm/contracts/queries.ts) definitively uses contractName. The concern is valid: either (1) this breaking change should be explicitly documented as a fourth item in the Breaking Changes section if v1.x truly used name, or (2) the "Before" example should be corrected to use contractName if both versions used the same parameter name.

Without access to v1.x source code, I cannot definitively determine which scenario applies. Verify the actual v1.x API to resolve this inconsistency.

src/evm/releases/flow/v1.1/deployments.ts (1)

8-16: Type migration to EVM namespace looks correct.
Imports and function signature align with the new EVM surface. No functional changes.

README.md (2)

85-90: Docs fix confirmed: contractName key is correct.
Example now matches evmContracts.get options.


63-73: Verification complete: chains is re-exported from the root entry.

The root entry (src/index.ts) includes export * from "./evm", and src/evm/index.ts exports { chains }, making the README import valid as written. Both approaches work—import { chains } from "sablier" (via barrel export) and import { chains } from "sablier/evm/chains" (direct path). The more explicit path improves clarity about the API structure but is optional.

src/evm/comptroller.ts (1)

15-25: EVM type migration for comptroller looks good.
Signatures and return types are consistent with the refactor.

@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch from 79d0a5f to 82c9bb0 Compare October 23, 2025 18:08
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
tests/contracts/abi-const.test.ts (1)

11-11: Critical: Update glob pattern to match the new directory structure.

The glob pattern still searches the old src/releases/**/abi/*.ts path, but the ABI files have been relocated to src/evm/releases/ (as confirmed by the updated type imports on lines 109-111). This inconsistency will cause the dynamic test discovery to find no files, rendering the runtime validation tests ineffective.

Apply this diff to fix the glob pattern:

-  const files = await globby("src/releases/**/abi/*.ts", {
+  const files = await globby("src/evm/releases/**/abi/*.ts", {
src/evm/releases/queries.ts (1)

43-50: Make getLatest deterministic.

Avoid relying on object insertion order. Select by isLatest.

-  getLatest: (opts: { protocol: Sablier.EVM.Protocol }): Sablier.EVM.Release => {
-    const list = _.values(releases[opts.protocol]);
-    const latest = list[list.length - 1];
-    if (!latest.isLatest) {
-      throw new Error(`Sablier SDK: No latest release found for Sablier ${opts.protocol}. Please report on GitHub.`);
-    }
-    return latest;
-  },
+  getLatest: (opts: { protocol: Sablier.EVM.Protocol }): Sablier.EVM.Release => {
+    const latest = _.find(_.values(releases[opts.protocol]), (r) => r.isLatest);
+    if (!latest) {
+      throw new Error(`Sablier SDK: No latest release found for Sablier ${opts.protocol}. Please report on GitHub.`);
+    }
+    return latest;
+  },
src/sablier.ts (1)

9-15: Fix example to use the new EVM surface.

The snippet references releases.lockup[...]. Update to sablier.evmReleases.

- *   release: releases.lockup["v2.0"],
+ *   release: sablier.evmReleases.get({ protocol: "Lockup", version: "v2.0" })!,
🧹 Nitpick comments (15)
src/evm/releases/helpers.ts (1)

13-19: Avoid in‑place mutation in sortDeployments.
Array.prototype.sort mutates the input, which can reorder imported module constants at call sites. Return a sorted copy instead.

-export function sortDeployments<T extends { chainId: number }>(deployments: T[]): T[] {
-  return deployments.sort((a, b) => {
+export function sortDeployments<T extends { chainId: number }>(deployments: readonly T[]): T[] {
+  return [...deployments].sort((a, b) => {
     const aChain = chainsQueries.getOrThrow(a.chainId);
     const bChain = chainsQueries.getOrThrow(b.chainId);
     return aChain.name.localeCompare(bChain.name);
   });
 }
src/evm/releases/lockup/v3.0/index.ts (1)

1-2: Namespace/type migration LGTM; consider deterministic ordering.
To keep output deterministic and consistent with other releases, sort deployments (without mutating inputs).

-import { Protocol } from "@src/evm/enums";
+import { Protocol } from "@src/evm/enums";
+import { sortDeployments } from "@src/evm/releases/helpers";
@@
-const deployments: Sablier.EVM.Deployment[] = [...mainnets, ...testnets];
+const deployments: Sablier.EVM.Deployment[] = sortDeployments([...mainnets, ...testnets]);

Also applies to: 9-9

src/evm/releases/lockup/v2.0/index.ts (1)

1-2: Consistent ordering suggestion.
Mirror v3.0: sort combined deployments for deterministic iteration.

-import { Protocol } from "@src/evm/enums";
+import { Protocol } from "@src/evm/enums";
+import { sortDeployments } from "@src/evm/releases/helpers";
@@
-const deployments: Sablier.EVM.Deployment[] = [...mainnets, ...testnets];
+const deployments: Sablier.EVM.Deployment[] = sortDeployments([...mainnets, ...testnets]);

Also applies to: 9-9

src/evm/releases/legacy/v1.0/index.ts (1)

9-10: Defensive copy before sorting (current helper mutates input).
Given sortDeployments mutates, this call will reorder the imported mainnets array module‑wide. Copy before sorting (or adopt the non‑mutating helper change).

-const sortedMainnets = sortDeployments(mainnets);
+const sortedMainnets = sortDeployments([...mainnets]);
src/evm/releases/airdrops/v2.0/index.ts (2)

10-12: Copy before sorting to avoid reordering shared arrays.
Until sortDeployments is made non‑mutating, pass copies.

-const sortedMainnets = sortDeployments(mainnets);
-const sortedTestnets = sortDeployments(testnets);
+const sortedMainnets = sortDeployments([...mainnets]);
+const sortedTestnets = sortDeployments([...testnets]);

17-20: Use property shorthand for brevity.
No behavior change, just cleaner.

-  deployments: deployments,
+  deployments,
@@
-  manifest: manifest,
+  manifest,
tests/contracts/queries.test.ts (1)

1-1: Test namespace migration LGTM; align the suite title.
The describe still says "contractsQueries.get". Consider renaming to "evmContracts.get" for clarity.

-describe("contractsQueries.get", () => {
+describe("evmContracts.get", () => {

Also applies to: 27-31, 44-48, 68-72, 83-88, 100-104

src/internal/helpers.ts (1)

27-31: Narrowing suggestion is valid and safe; logging adjustment required.

The narrowing is technically sound—checkBroadcast only accesses protocol and version from release, and isZK and slug from chain. TypeScript's structural typing ensures all four call sites (in loaders.ts and missing-broadcasts.ts) remain compatible when passing full objects to narrowed parameter types.

One constraint: line 51 logs the entire release object. If you narrow the signature, update the logging to only include protocol and version as the comment suggests. This prevents inadvertent logging of large or sensitive object properties.

Example adjustment:

  log("info", {
    msg: `No broadcasts for ${chain.slug} at ${relativePath}`,
-   release,
+   release: { protocol: release.protocol, version: release.version },
  });
tests/contracts/indexed.test.ts (2)

34-35: Avoid shadowing and drop the non‑null assertion.

Rename the local contracts to prevent shadowing the imported contracts, and remove ! (getAll returns an array).

-      const contracts = sablier.evmContracts.getAll({ release })!;
-      for (const contract of contracts) {
+      const releaseContracts = sablier.evmContracts.getAll({ release });
+      for (const contract of releaseContracts) {

11-11: Leverage satisfies for exhaustive protocol coverage at compile‑time.

This avoids widening while guaranteeing all Sablier.EVM.Protocol keys are present.

-const INDEXED: Record<Sablier.EVM.Protocol, Set<string>> = {
+const INDEXED = {
   /* ... */
-};
+} satisfies Record<Sablier.EVM.Protocol, Set<string>>;
src/evm/releases/lockup/v2.0/deployments.ts (1)

21-29: Optional: reduce duplication for repeated constants.

If VESTING_MATH (and similar) are intentionally identical across many chains, consider centralizing them (e.g., shared constant or helper) to cut repetition and reduce copy/paste errors. If addresses differ by chain, ignore.

Also applies to: 237-301

src/evm/releases/queries.ts (2)

29-38: Avoid relying on property enumeration order for “first”.

Object key order is brittle. Consider an explicit marker (e.g., isFirst) or a sort key; as an interim, prefer a clear selector.

-  getFirst: (opts: { protocol: Sablier.EVM.Protocol; chainId?: number }): Sablier.EVM.Release | undefined => {
+  getFirst: (opts: { protocol: Sablier.EVM.Protocol; chainId?: number }): Sablier.EVM.Release | undefined => {
     const { protocol, chainId } = opts;
     const list = releases[protocol];

     if (chainId) {
       return _.find(list, (r) => _.some(r.deployments, { chainId }));
     }

-    return _.values(list)[0];
+    // If available, prefer an explicit flag; otherwise fall back.
+    return _.find(_.values(list), (r) => (r as any).isFirst) ?? _.first(_.values(list));
   },

16-23: Simplify getAll implementation.

Unnecessary nested flatMap.

-  getAll: (opts?: { protocol?: Sablier.EVM.Protocol }): Sablier.EVM.Release[] => {
+  getAll: (opts?: { protocol?: Sablier.EVM.Protocol }): Sablier.EVM.Release[] => {
     const { protocol } = opts || {};
     if (protocol) {
-      return _.flatMap(_.values(releases[protocol]));
+      return _.values(releases[protocol]);
     }
-    // Recursively get all releases from all protocols in the enum
-    return _.flatMap(Object.values(Protocol), (protocolName) => _.flatMap(_.values(releases[protocolName])));
+    return _.flatMap(Object.values(Protocol), (p) => _.values(releases[p]));
   },
src/sablier.ts (1)

29-35: Remove defensive opts || {}; param is required.

Tiny cleanup.

-  get: (opts: { chainId: number; release: Sablier.EVM.Release }): Sablier.EVM.Deployment | undefined => {
-    const { release, chainId } = opts || {};
+  get: (opts: { chainId: number; release: Sablier.EVM.Release }): Sablier.EVM.Deployment | undefined => {
+    const { release, chainId } = opts;
     return _.find(release.deployments, { chainId });
   },
src/evm/releases/resolvers.ts (1)

103-124: Normalize addresses when building deployment contracts.

Apply EIP‑55 checksumming at ingestion to enforce consistency and catch typos.

+import { getAddress } from "viem";
@@
   return _.entries(contractMap).map(([name, addressOrTuple]) => {
-    const [address, blockNumber] = Array.isArray(addressOrTuple) ? addressOrTuple : [addressOrTuple];
+    const [rawAddress, blockNumber] = Array.isArray(addressOrTuple) ? addressOrTuple : [addressOrTuple];
+    const address = getAddress(rawAddress as `0x${string}`);
@@
-      address,
+      address,

If viem isn’t a dependency, I can suggest a small checksum helper instead.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 79d0a5f and 82c9bb0.

📒 Files selected for processing (74)
  • CHANGELOG.md (2 hunks)
  • MIGRATION.md (1 hunks)
  • README.md (3 hunks)
  • cli/commands/print/aliases.ts (1 hunks)
  • cli/commands/print/chains.ts (1 hunks)
  • cli/commands/print/missing-broadcasts.ts (3 hunks)
  • cli/commands/print/versions.ts (1 hunks)
  • package.json (2 hunks)
  • src/evm/chains/data.ts (6 hunks)
  • src/evm/chains/queries.ts (1 hunks)
  • src/evm/comptroller.ts (4 hunks)
  • src/evm/contracts/catalog.ts (1 hunks)
  • src/evm/contracts/names.ts (2 hunks)
  • src/evm/contracts/queries.ts (3 hunks)
  • src/evm/index.ts (1 hunks)
  • src/evm/releases/airdrops/index.ts (1 hunks)
  • src/evm/releases/airdrops/v1.1/deployments.ts (1 hunks)
  • src/evm/releases/airdrops/v1.1/index.ts (1 hunks)
  • src/evm/releases/airdrops/v1.2/deployments.ts (1 hunks)
  • src/evm/releases/airdrops/v1.2/index.ts (1 hunks)
  • src/evm/releases/airdrops/v1.3/deployments.ts (3 hunks)
  • src/evm/releases/airdrops/v1.3/index.ts (2 hunks)
  • src/evm/releases/airdrops/v2.0/deployments.ts (3 hunks)
  • src/evm/releases/airdrops/v2.0/index.ts (2 hunks)
  • src/evm/releases/flow/index.ts (1 hunks)
  • src/evm/releases/flow/v1.0/deployments.ts (3 hunks)
  • src/evm/releases/flow/v1.0/index.ts (2 hunks)
  • src/evm/releases/flow/v1.1/deployments.ts (3 hunks)
  • src/evm/releases/flow/v1.1/index.ts (2 hunks)
  • src/evm/releases/flow/v2.0/deployments.ts (3 hunks)
  • src/evm/releases/flow/v2.0/index.ts (2 hunks)
  • src/evm/releases/helpers.ts (1 hunks)
  • src/evm/releases/legacy/index.ts (1 hunks)
  • src/evm/releases/legacy/v1.0/deployments.ts (1 hunks)
  • src/evm/releases/legacy/v1.0/index.ts (1 hunks)
  • src/evm/releases/legacy/v1.1/deployments.ts (2 hunks)
  • src/evm/releases/legacy/v1.1/index.ts (1 hunks)
  • src/evm/releases/lockup/index.ts (1 hunks)
  • src/evm/releases/lockup/v1.0/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v1.0/index.ts (2 hunks)
  • src/evm/releases/lockup/v1.1/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v1.1/index.ts (2 hunks)
  • src/evm/releases/lockup/v1.2/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v1.2/index.ts (2 hunks)
  • src/evm/releases/lockup/v2.0/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v2.0/index.ts (1 hunks)
  • src/evm/releases/lockup/v3.0/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v3.0/index.ts (1 hunks)
  • src/evm/releases/queries.ts (4 hunks)
  • src/evm/releases/resolvers.ts (7 hunks)
  • src/helpers.ts (4 hunks)
  • src/index.ts (1 hunks)
  • src/internal/helpers.ts (1 hunks)
  • src/internal/logger.ts (2 hunks)
  • src/sablier.ts (2 hunks)
  • src/types.ts (2 hunks)
  • tests/chains.test.ts (1 hunks)
  • tests/comptroller.test.ts (1 hunks)
  • tests/contracts/abi-const.test.ts (1 hunks)
  • tests/contracts/catalog.test.ts (2 hunks)
  • tests/contracts/checksums.test.ts (1 hunks)
  • tests/contracts/indexed.test.ts (3 hunks)
  • tests/contracts/queries.test.ts (6 hunks)
  • tests/cron/blocks.test.ts (4 hunks)
  • tests/cron/chains-rpc.test.ts (1 hunks)
  • tests/deployments/airdrops.test.ts (1 hunks)
  • tests/deployments/flow.test.ts (1 hunks)
  • tests/deployments/lockup.test.ts (1 hunks)
  • tests/deployments/utils/generators.ts (3 hunks)
  • tests/deployments/utils/loaders.ts (3 hunks)
  • tests/helpers.test.ts (1 hunks)
  • tests/helpers/broadcasts.ts (1 hunks)
  • tests/helpers/missing.ts (2 hunks)
  • tests/types.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (29)
  • src/evm/releases/flow/v1.0/index.ts
  • cli/commands/print/chains.ts
  • cli/commands/print/versions.ts
  • src/evm/releases/airdrops/v1.1/index.ts
  • src/evm/releases/lockup/v1.1/index.ts
  • src/evm/releases/legacy/v1.1/index.ts
  • tests/deployments/utils/generators.ts
  • src/evm/releases/flow/v2.0/index.ts
  • tests/deployments/utils/loaders.ts
  • src/evm/index.ts
  • tests/helpers/missing.ts
  • tests/deployments/lockup.test.ts
  • tests/contracts/catalog.test.ts
  • src/evm/releases/airdrops/index.ts
  • src/evm/releases/legacy/v1.1/deployments.ts
  • cli/commands/print/aliases.ts
  • tests/cron/chains-rpc.test.ts
  • tests/deployments/airdrops.test.ts
  • tests/helpers/broadcasts.ts
  • src/evm/releases/lockup/v1.0/index.ts
  • src/evm/contracts/queries.ts
  • tests/comptroller.test.ts
  • src/evm/releases/flow/v1.1/index.ts
  • src/evm/releases/lockup/v3.0/deployments.ts
  • src/evm/releases/flow/v2.0/deployments.ts
  • CHANGELOG.md
  • src/evm/contracts/names.ts
  • src/evm/releases/lockup/v1.2/deployments.ts
  • src/evm/releases/lockup/v1.2/index.ts
🧰 Additional context used
🧬 Code graph analysis (35)
src/internal/logger.ts (1)
src/types.ts (1)
  • Release (190-190)
tests/contracts/indexed.test.ts (3)
src/types.ts (1)
  • Protocol (99-99)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/contracts/index.ts (1)
  • contracts (4-7)
cli/commands/print/missing-broadcasts.ts (2)
src/types.ts (2)
  • Protocol (99-99)
  • Chain (33-59)
src/sablier.ts (1)
  • sablier (38-43)
src/helpers.ts (1)
src/types.ts (2)
  • Version (202-202)
  • Address (30-30)
tests/cron/blocks.test.ts (3)
src/types.ts (1)
  • Protocol (99-99)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/contracts/index.ts (1)
  • contracts (4-7)
src/evm/releases/airdrops/v1.1/deployments.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/lockup/index.ts (1)
src/types.ts (2)
  • Lockup (199-199)
  • Release (190-190)
tests/types.ts (1)
src/types.ts (1)
  • Address (30-30)
src/evm/releases/airdrops/v1.2/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/releases/flow/v1.1/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/releases/airdrops/v1.3/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/releases/flow/v1.0/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/releases/lockup/v3.0/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
tests/contracts/queries.test.ts (1)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/releases/flow/index.ts (1)
src/types.ts (2)
  • Flow (195-195)
  • Release (190-190)
src/evm/releases/airdrops/v2.0/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/releases/lockup/v1.0/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (1)
  • ContractMap (95-97)
src/evm/releases/legacy/v1.0/index.ts (3)
src/evm/releases/helpers.ts (1)
  • sortDeployments (13-19)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/releases/lockup/v2.0/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/releases/legacy/v1.0/deployments.ts (1)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/internal/helpers.ts (1)
src/types.ts (2)
  • Release (190-190)
  • Chain (33-59)
src/evm/releases/lockup/v1.1/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (1)
  • ContractMap (95-97)
src/evm/comptroller.ts (1)
src/types.ts (3)
  • Contract (64-81)
  • ContractMap (95-97)
  • Address (30-30)
src/sablier.ts (1)
src/types.ts (2)
  • Release (190-190)
  • Deployment (132-132)
src/evm/releases/airdrops/v2.0/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
src/evm/releases/airdrops/v1.3/index.ts (2)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/types.ts (1)
  • Deployment (132-132)
src/evm/chains/queries.ts (2)
src/types.ts (1)
  • Chain (33-59)
src/helpers.ts (1)
  • sortChains (59-61)
src/evm/releases/airdrops/v1.2/deployments.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/legacy/index.ts (1)
src/types.ts (2)
  • Legacy (197-197)
  • Release (190-190)
src/types.ts (1)
src/evm/enums.ts (1)
  • enums (39-42)
src/evm/contracts/catalog.ts (1)
src/types.ts (1)
  • ContractCatalog (86-92)
tests/contracts/checksums.test.ts (1)
src/sablier.ts (1)
  • sablier (38-43)
src/evm/releases/resolvers.ts (1)
src/types.ts (6)
  • Protocol (99-99)
  • Version (202-202)
  • AliasMap (28-28)
  • ContractMap (95-97)
  • Deployment (132-132)
  • Contract (64-81)
src/evm/chains/data.ts (1)
src/types.ts (1)
  • Chain (33-59)
src/evm/releases/lockup/v2.0/deployments.ts (2)
src/evm/comptroller.ts (1)
  • get (15-18)
src/types.ts (2)
  • ContractMap (95-97)
  • Deployment (132-132)
🔇 Additional comments (55)
tests/contracts/abi-const.test.ts (1)

109-111: LGTM! Type import paths correctly updated.

The type-level import paths have been correctly updated to reflect the new src/evm/releases/ directory structure, maintaining proper compile-time validation for the ABI const assertions.

tests/helpers.test.ts (1)

1-1: LGTM! Clean import path update.

The import path has been correctly updated to reflect the new EVM-specific directory structure.

tests/types.ts (1)

9-9: LGTM! Type namespace updates are correct.

The Address type has been appropriately qualified under the Sablier.EVM namespace for both BasicContract and ZKBroadcast types, aligning with the EVM-specific reorganization.

Also applies to: 28-28

src/evm/releases/airdrops/v1.3/index.ts (1)

1-3: LGTM! Consistent EVM namespace migration.

Import paths and type qualifications have been correctly updated to the EVM-specific structure while preserving the original logic.

Also applies to: 12-12

src/evm/contracts/catalog.ts (1)

1-2: LGTM! Clean refactoring to EVM namespace.

Import paths and type qualifications have been properly updated to the Sablier.EVM namespace while maintaining the original catalog generation logic.

Also applies to: 6-7

src/evm/releases/lockup/v1.1/deployments.ts (1)

1-3: LGTM! Comprehensive EVM namespace migration.

Import paths, function signatures, and export types have been systematically updated to the Sablier.EVM namespace. The deployment data and logic remain unchanged.

Also applies to: 8-14, 27-27, 210-210

src/evm/releases/airdrops/v1.1/deployments.ts (1)

4-4: LGTM! Clean type namespace updates.

Import path and function signature have been correctly updated to the Sablier.EVM namespace while preserving the filtering logic.

Also applies to: 9-9

src/evm/releases/airdrops/v1.3/deployments.ts (1)

1-3: LGTM! Consistent EVM namespace adoption.

Import paths, function signatures, and export types have been properly migrated to the Sablier.EVM namespace. All deployment configurations remain intact.

Also applies to: 8-8, 21-21, 114-114

src/evm/chains/data.ts (1)

191-191: LGTM! Well-structured chain type migration.

The define function's return type has been updated to Sablier.EVM.Chain, and explicit type annotations have been added to custom chain definitions. This ensures all chain exports are properly typed under the EVM namespace while maintaining the existing chain configurations.

Also applies to: 280-293, 299-328, 330-343, 345-353, 355-384

src/evm/chains/queries.ts (1)

7-28: LGTM! Consistent type migration to EVM namespace.

All query method return types have been consistently updated from Sablier.Chain to Sablier.EVM.Chain, aligning with the broader namespace refactoring for multi-VM support.

package.json (2)

7-7: Appropriate major version bump for breaking changes.

The version bump from 1.4.2 to 2.0.0 correctly reflects the breaking changes in import/export paths and type namespace migrations.


49-64: Export paths correctly restructured for EVM namespace.

The new export map properly reflects the architectural shift:

  • New consolidated ./evm entry point
  • Subpath exports updated to ./evm/chains, ./evm/contracts, ./evm/releases
  • All paths correctly point to dist/evm/* locations
src/evm/comptroller.ts (3)

1-1: Import path correctly updated for EVM directory structure.

The import path change from @src/chains to @src/evm/chains aligns with the new directory organization.


15-25: Type signatures consistently migrated to EVM namespace.

Both query methods (get and getAll) now correctly return Sablier.EVM.Contract types, consistent with the broader namespace refactoring.


140-156: Helper function types properly updated.

The helper function signature and internal type casts are correctly updated to use Sablier.EVM.ContractMap, Sablier.EVM.Contract, and Sablier.EVM.Address.

README.md (3)

69-77: API examples correctly updated for EVM namespace.

The chain query examples properly use sablier.evmChains.get() and sablier.evmChains.getBySlug(), consistent with the new namespace structure.


85-91: Contract query example is correct.

The example correctly uses contractName as the option key (not name), which aligns with the API signature for evmContracts.get().


104-104: Releases query example correctly updated.

The example properly uses sablier.evmReleases.getAll(), consistent with the namespace migration.

cli/commands/print/missing-broadcasts.ts (3)

1-1: Import path correctly updated for EVM enums.

The import path change from @src/enums to @src/evm/enums aligns with the new directory structure.


19-27: Type signatures and data access consistently migrated.

The function now properly uses:

  • Sablier.EVM.Protocol for the protocol parameter
  • Sablier.EVM.Chain[] for the missing chains record
  • sablier.evmReleases and sablier.evmChains for data access

116-116: Command action parameter type correctly updated.

The action options type properly uses Sablier.EVM.Protocol, consistent with the namespace migration.

src/types.ts (2)

2-2: Import path correctly updated for EVM enums.

The enums import path change from "./enums" to "./evm/enums" aligns with the new directory structure.


27-247: Comprehensive type migration to EVM namespace.

All public types have been properly reorganized under the Sablier.EVM namespace, including:

  • Base types (Address, AliasMap, AbiMap, Chain, Contract)
  • Domain types (Protocol, Version, Release, Deployment)
  • Nested namespaces (Deployment, Manifest, Release, Version, Indexer)

This restructuring successfully isolates EVM-specific types in preparation for multi-VM support.

tests/chains.test.ts (1)

14-14: Import path correctly updated for test consistency.

The import path change from @src/chains to @src/evm/chains ensures the test suite continues to work with the new directory structure.

tests/deployments/flow.test.ts (1)

1-1: Import path correctly updated for releases module.

The import path change from @src/releases to @src/evm/releases aligns with the new EVM-specific directory structure.

src/evm/releases/helpers.ts (1)

1-1: Import path migration looks good.
Aligned with the new EVM namespace.

tests/contracts/checksums.test.ts (1)

9-11: LGTM! Test updated to use new EVM-namespaced API.

The test correctly uses the new evmReleases and evmContracts query methods, consistent with the broader refactor to isolate EVM-specific logic.

src/evm/releases/airdrops/v1.2/index.ts (2)

1-2: LGTM! Import paths correctly updated to EVM-specific modules.

The import paths now correctly reference the new EVM-specific directory structure.


9-9: LGTM! Type annotation correctly migrated to EVM namespace.

The type annotation has been properly updated to Sablier.EVM.Deployment[], consistent with the namespace refactor.

src/internal/logger.ts (2)

72-79: LGTM! Type signatures updated and logging behavior improved.

The function signatures correctly use the Sablier.EVM.Release type. The addition of the else branch (lines 76-77) ensures that messages are logged even when no release context is provided, which is a useful improvement.


81-83: LGTM! Helper function updated to EVM namespace.

The type signature correctly uses Sablier.EVM.Release.

src/evm/releases/flow/index.ts (1)

6-10: LGTM! Type annotations correctly migrated to EVM namespace.

The type annotation has been properly updated to use Sablier.EVM.Version.Flow for keys and Sablier.EVM.Release for values, while the runtime mapping remains unchanged.

src/evm/releases/legacy/v1.0/deployments.ts (3)

1-3: LGTM! Import paths correctly updated to EVM-specific modules.

All import paths now correctly reference the new EVM-specific directory structure.


8-11: LGTM! Type annotation correctly migrated to EVM namespace.

The contractMap type has been properly updated to Sablier.EVM.ContractMap.


16-24: LGTM! Type annotation correctly migrated to EVM namespace.

The mainnets array type has been properly updated to Sablier.EVM.Deployment[].

src/evm/releases/lockup/index.ts (1)

8-14: LGTM! Type annotations correctly migrated to EVM namespace.

The type annotation has been properly updated to use Sablier.EVM.Version.Lockup for keys and Sablier.EVM.Release for values, while the runtime mapping remains unchanged.

src/evm/releases/airdrops/v1.2/deployments.ts (2)

4-4: LGTM! Import path correctly updated to EVM-specific module.

The import path now correctly references the new EVM-specific directory structure.


9-14: LGTM! Function signature correctly migrated to EVM namespace.

Both the parameter type (Sablier.EVM.Deployment.LockupV1[]) and return type (Sablier.EVM.Deployment.Standard[]) have been properly updated to use the EVM namespace, while the filter logic remains unchanged.

src/evm/releases/legacy/index.ts (1)

5-8: LGTM! Type annotations correctly migrated to EVM namespace.

The type annotation has been properly updated to use Sablier.EVM.Version.Legacy for keys and Sablier.EVM.Release for values, while the runtime mapping remains unchanged.

src/evm/releases/airdrops/v2.0/deployments.ts (2)

1-8: LGTM! Clean namespace migration to EVM.

The import paths and type signatures have been correctly updated to the EVM namespace. The function signature properly uses Sablier.EVM.ContractMap and returns Sablier.EVM.Deployment, aligning with the broader refactor to support multi-VM environments.


21-21: Export types correctly updated.

The export arrays are properly typed as Sablier.EVM.Deployment[], maintaining type safety throughout the EVM namespace migration.

Also applies to: 177-177

src/index.ts (1)

1-4: LGTM! Entry point correctly restructured for EVM namespace.

The main export now properly delegates to the ./evm module while preserving existing exports for helpers, sablier, and types. This provides a clean separation for EVM-specific functionality while maintaining the public API structure.

tests/cron/blocks.test.ts (2)

1-2: LGTM! Test imports and types correctly migrated.

The imports have been properly updated to the EVM-specific modules (@src/evm/contracts, @src/evm/enums), and the INDEXED type correctly uses Sablier.EVM.Protocol.

Also applies to: 19-19


55-69: API calls correctly updated to EVM namespace.

The test properly uses the new EVM-prefixed API methods:

  • sablier.evmReleases.getAll()
  • sablier.evmContracts.getAll()
  • sablier.evmChains.getOrThrow()

This aligns with the public API changes documented in the migration guide.

MIGRATION.md (1)

1-220: Excellent migration guide!

This is a comprehensive and well-structured migration guide that clearly explains:

  • Breaking changes with before/after examples
  • Quick replace patterns for automated migration
  • Type namespace updates
  • Non-breaking changes for clarity
  • Rationale for the refactor (multi-VM support)
  • Links to additional resources

The checklist format and automated migration snippets will be particularly helpful for users upgrading.

src/evm/releases/lockup/v1.0/deployments.ts (3)

1-14: LGTM! Import paths and function signature correctly updated.

The imports are properly scoped to @src/evm/* modules, and the function signature correctly uses the EVM namespace types (Sablier.EVM.ContractMap, Sablier.EVM.Deployment.LockupV1).


25-27: Documentation comment is correct.

The comment correctly states "Mainnet deployments for Lockup v1.0", which matches the file location and version being deployed. The past review comment appears to have been addressed.


159-159: Export type correctly updated.

The testnets export is properly typed as Sablier.EVM.Deployment.LockupV1[], consistent with the specialized LockupV1 deployment type.

src/evm/releases/flow/v1.0/deployments.ts (2)

1-8: LGTM! Consistent EVM namespace migration.

The import paths and function signature are correctly updated to use the EVM namespace, matching the pattern established across other deployment files.


21-21: Export types properly updated.

Both mainnets and testnets exports are correctly typed as Sablier.EVM.Deployment[].

Also applies to: 115-115

src/helpers.ts (2)

13-13: LGTM! Helper function signatures correctly updated.

All version-related helper functions now properly use Sablier.EVM.Version type parameters, maintaining consistency with the EVM namespace migration.

Also applies to: 42-42, 55-55


29-29: Address type correctly updated.

The getContractExplorerURL function now accepts Sablier.EVM.Address, aligning with the EVM-specific type namespace.

src/evm/releases/flow/v1.1/deployments.ts (2)

1-8: LGTM! EVM namespace migration complete.

The import paths and function signature correctly use the EVM-scoped modules and types, consistent with the broader refactor.


21-21: Export types correctly updated.

Both export arrays are properly typed as Sablier.EVM.Deployment[], maintaining type safety in the EVM namespace.

Also applies to: 147-147

src/evm/releases/lockup/v2.0/deployments.ts (1)

212-217: Normalize addresses to EIP‑55 checksum casing.

Lowercased addresses found (e.g., Lines 212, 216, 219, 223). Prefer checksummed form for consistency and to catch typos early.

Run this script to flag non‑checksummed addresses in this file and ensure all SABLIER_LOCKUP entries are [address, block] tuples:

Also applies to: 219-224

@PaulRBerg
Copy link
Member

PaulRBerg commented Oct 27, 2025

Note: I've accidentally closed this PR by pressing a keyboard shortcut on Graphite UI. I have re-opened it now.

Copy link
Member

@PaulRBerg PaulRBerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested

  1. It is possible to avoid a full API breaking change by re-exporting sablier.FOO as sablier.evm.FOO, e.g. sablier.chains would point to sablier.evm.chains.
  • Ditto for the Sablier.FOO type namespace
  • Why do this? (i) Backward-compatibility and smoother migration and (ii) continuing to provide a good UX for EVM-only users who don't care about Solana.
  1. All those evmChains, evmContracts should be grouped under an evm module. More generally in TypeScript → if a prefix repeats 3+ times, that is a sign of a module grouping.

Code Snippets

Both of the following code snippets should work

Existing API

const mainnet = sablier.chains.get({ chainId: 1 });

New API

const mainnet = sablier.evm.chains.get({ chainId: 1 });

@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch from 82c9bb0 to 100e2a5 Compare October 28, 2025 12:30
@gavriliumircea
Copy link
Contributor Author

gavriliumircea commented Oct 28, 2025

Changes requested

...

I do agree with everything , I just made the changes needed. Can you take a look @PaulRBerg to see if that is what you had in mind?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
README.md (1)

85-91: Documentation correctly updated per past review.

The contract example now properly uses contractName instead of name, and the API call correctly references sablier.evm.contracts.get. This addresses the issue flagged in the previous review.

🧹 Nitpick comments (9)
README.md (1)

69-77: Optional chaining inconsistency in example.

Line 69 assigns the result of sablier.evm.chains.get(42161) to arbitrum, which can return undefined. However, line 75 uses optional chaining arbitrum?.isSupportedByUI defensively. This is correct, but the example would be clearer if it either:

  1. Used a guaranteed-to-exist chain like chains.arbitrum (similar to line 66's chains.mainnet)
  2. Added a nullish check before line 75

Consider this more consistent example:

 // Get chain by ID
-const arbitrum = sablier.evm.chains.get(42161);
+const arbitrum = chains.arbitrum;

 // Get chain by slug
 const polygon = sablier.evm.chains.getBySlug("polygon");

 // Check if chain supports Sablier UI
-if (arbitrum?.isSupportedByUI) {
+if (arbitrum.isSupportedByUI) {
   console.log("Arbitrum available on app.sablier.com");
 }

Or keep the .get() call but add explicit handling:

 // Get chain by ID
 const arbitrum = sablier.evm.chains.get(42161);

 // Get chain by slug
 const polygon = sablier.evm.chains.getBySlug("polygon");

 // Check if chain supports Sablier UI
-if (arbitrum?.isSupportedByUI) {
+if (arbitrum && arbitrum.isSupportedByUI) {
   console.log("Arbitrum available on app.sablier.com");
 }
src/evm/releases/queries.ts (3)

43-50: Make getLatest deterministic (search by isLatest).

Avoid relying on object insertion order. Find the flagged latest instead.

-  getLatest: (opts: { protocol: Sablier.EVM.Protocol }): Sablier.EVM.Release => {
-    const list = _.values(releases[opts.protocol]);
-    const latest = list[list.length - 1];
-    if (!latest.isLatest) {
-      throw new Error(`Sablier SDK: No latest release found for Sablier ${opts.protocol}. Please report on GitHub.`);
-    }
-    return latest;
-  },
+  getLatest: (opts: { protocol: Sablier.EVM.Protocol }): Sablier.EVM.Release => {
+    const list = Object.values(releases[opts.protocol] ?? {}) as Sablier.EVM.Release[];
+    const latest = _.find(list, (r) => r.isLatest);
+    if (!latest) {
+      throw new Error(`Sablier SDK: No latest release found for Sablier ${opts.protocol}. Please report on GitHub.`);
+    }
+    return latest;
+  },

16-23: Simplify getAll; avoid unnecessary flatMap and guard for missing keys.

Cleaner, typed, and null‑safe.

-  getAll: (opts?: { protocol?: Sablier.EVM.Protocol }): Sablier.EVM.Release[] => {
-    const { protocol } = opts || {};
-    if (protocol) {
-      return _.flatMap(_.values(releases[protocol]));
-    }
-    // Recursively get all releases from all protocols in the enum
-    return _.flatMap(Object.values(Protocol), (protocolName) => _.flatMap(_.values(releases[protocolName])));
-  },
+  getAll: (opts?: { protocol?: Sablier.EVM.Protocol }): Sablier.EVM.Release[] => {
+    const { protocol } = opts ?? {};
+    if (protocol) {
+      return Object.values(releases[protocol] ?? {}) as Sablier.EVM.Release[];
+    }
+    return _.flatMap(Object.values(Protocol) as Sablier.EVM.Protocol[], (p) =>
+      Object.values(releases[p] ?? {}),
+    ) as Sablier.EVM.Release[];
+  },

29-38: getFirst relies on object order; consider explicit version ordering.

If insertion order isn’t guaranteed in ./data, compute “first” by an explicit comparator (e.g., semantic version). Otherwise, document the reliance on data order.

src/sablier.ts (1)

37-43: Drop redundant opts || {}; param isn’t optional.

Tiny cleanup.

-  get: (opts: { chainId: number; release: Sablier.EVM.Release }): Sablier.EVM.Deployment | undefined => {
-    const { release, chainId } = opts || {};
+  get: (opts: { chainId: number; release: Sablier.EVM.Release }): Sablier.EVM.Deployment | undefined => {
+    const { release, chainId } = opts;
     return _.find(release.deployments, { chainId });
   },
src/evm/releases/resolvers.ts (1)

103-124: Optionally omit alias when undefined.

Keeps serialized shape minimal.

-  return _.entries(contractMap).map(([name, addressOrTuple]) => {
+  return _.entries(contractMap).map(([name, addressOrTuple]) => {
     const [address, blockNumber] = Array.isArray(addressOrTuple) ? addressOrTuple : [addressOrTuple];
-    return {
-      address,
-      alias: aliasMap[name],
+    const alias = aliasMap[name];
+    const base: Sablier.EVM.Contract = {
+      address,
       block: blockNumber,
       chainId,
       explorerURL: getContractExplorerURL(chain.blockExplorers.default.url, address),
       name,
       protocol,
       version,
-    };
+    };
+    return alias ? { ...base, alias } : base;
   });
tests/deployments/utils/generators.ts (1)

76-87: Normalize address keys to lowercase in validation cache.

Prevents false negatives when the same address appears with different casing.

-          const previouslyValidated = _.get(validatedContracts, [chain.id, contract.name, contract.address]);
+          const addrKey = contract.address.toLowerCase();
+          const previouslyValidated = _.get(validatedContracts, [chain.id, contract.name, addrKey]);
           const message = `Contract ${contract.name} on ${chain.name} has not been found nor validated`;
           expect(previouslyValidated, message).toBeTruthy();
           return;
-        _.set(validatedContracts, [chain.id, contract.name, contract.address], true);
+        _.set(validatedContracts, [chain.id, contract.name, contract.address.toLowerCase()], true);
src/types.ts (2)

61-81: Make protocol/version optional properties instead of T | undefined.

Improves ergonomics and JSON shape.

-      /** The protocol the contract is part of (optional). */
-      protocol: Sablier.EVM.Protocol | undefined;
-      /** The release version the contract is part of (optional). */
-      version: Sablier.EVM.Version | undefined;
+      /** The protocol the contract is part of (optional). */
+      protocol?: Sablier.EVM.Protocol;
+      /** The release version the contract is part of (optional). */
+      version?: Sablier.EVM.Version;

249-265: Mark backward-compatible re‑exports as deprecated in JSDoc.

Helps consumers migrate to Sablier.EVM.*.

-  export type Address = EVM.Address;
+  /** @deprecated Use Sablier.EVM.Address */
+  export type Address = EVM.Address;
-  export type AbiMap = EVM.AbiMap;
+  /** @deprecated Use Sablier.EVM.AbiMap */
+  export type AbiMap = EVM.AbiMap;
-  export type Chain = EVM.Chain;
+  /** @deprecated Use Sablier.EVM.Chain */
+  export type Chain = EVM.Chain;
-  export type CompilerSettings = EVM.CompilerSettings;
+  /** @deprecated Use Sablier.EVM.CompilerSettings */
+  export type CompilerSettings = EVM.CompilerSettings;
-  export type Contract = EVM.Contract;
+  /** @deprecated Use Sablier.EVM.Contract */
+  export type Contract = EVM.Contract;
-  export type ContractCatalog = EVM.ContractCatalog;
+  /** @deprecated Use Sablier.EVM.ContractCatalog */
+  export type ContractCatalog = EVM.ContractCatalog;
-  export type ContractMap = EVM.ContractMap;
+  /** @deprecated Use Sablier.EVM.ContractMap */
+  export type ContractMap = EVM.ContractMap;
-  export type Protocol = EVM.Protocol;
+  /** @deprecated Use Sablier.EVM.Protocol */
+  export type Protocol = EVM.Protocol;
-  export type Deployment = EVM.Deployment;
+  /** @deprecated Use Sablier.EVM.Deployment */
+  export type Deployment = EVM.Deployment;
-  export type Manifest = EVM.Manifest;
+  /** @deprecated Use Sablier.EVM.Manifest */
+  export type Manifest = EVM.Manifest;
-  export type Release = EVM.Release;
+  /** @deprecated Use Sablier.EVM.Release */
+  export type Release = EVM.Release;
-  export type Version = EVM.Version;
+  /** @deprecated Use Sablier.EVM.Version */
+  export type Version = EVM.Version;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 82c9bb0 and 100e2a5.

📒 Files selected for processing (74)
  • CHANGELOG.md (2 hunks)
  • MIGRATION.md (1 hunks)
  • README.md (3 hunks)
  • cli/commands/print/aliases.ts (1 hunks)
  • cli/commands/print/chains.ts (1 hunks)
  • cli/commands/print/missing-broadcasts.ts (3 hunks)
  • cli/commands/print/versions.ts (1 hunks)
  • package.json (2 hunks)
  • src/evm/chains/data.ts (7 hunks)
  • src/evm/chains/queries.ts (1 hunks)
  • src/evm/comptroller.ts (4 hunks)
  • src/evm/contracts/catalog.ts (1 hunks)
  • src/evm/contracts/names.ts (2 hunks)
  • src/evm/contracts/queries.ts (3 hunks)
  • src/evm/index.ts (1 hunks)
  • src/evm/releases/airdrops/index.ts (1 hunks)
  • src/evm/releases/airdrops/v1.1/deployments.ts (1 hunks)
  • src/evm/releases/airdrops/v1.1/index.ts (1 hunks)
  • src/evm/releases/airdrops/v1.2/deployments.ts (1 hunks)
  • src/evm/releases/airdrops/v1.2/index.ts (1 hunks)
  • src/evm/releases/airdrops/v1.3/deployments.ts (3 hunks)
  • src/evm/releases/airdrops/v1.3/index.ts (2 hunks)
  • src/evm/releases/airdrops/v2.0/deployments.ts (3 hunks)
  • src/evm/releases/airdrops/v2.0/index.ts (2 hunks)
  • src/evm/releases/flow/index.ts (1 hunks)
  • src/evm/releases/flow/v1.0/deployments.ts (3 hunks)
  • src/evm/releases/flow/v1.0/index.ts (2 hunks)
  • src/evm/releases/flow/v1.1/deployments.ts (3 hunks)
  • src/evm/releases/flow/v1.1/index.ts (2 hunks)
  • src/evm/releases/flow/v2.0/deployments.ts (3 hunks)
  • src/evm/releases/flow/v2.0/index.ts (2 hunks)
  • src/evm/releases/helpers.ts (1 hunks)
  • src/evm/releases/legacy/index.ts (1 hunks)
  • src/evm/releases/legacy/v1.0/deployments.ts (1 hunks)
  • src/evm/releases/legacy/v1.0/index.ts (1 hunks)
  • src/evm/releases/legacy/v1.1/deployments.ts (2 hunks)
  • src/evm/releases/legacy/v1.1/index.ts (1 hunks)
  • src/evm/releases/lockup/index.ts (1 hunks)
  • src/evm/releases/lockup/v1.0/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v1.0/index.ts (2 hunks)
  • src/evm/releases/lockup/v1.1/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v1.1/index.ts (2 hunks)
  • src/evm/releases/lockup/v1.2/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v1.2/index.ts (2 hunks)
  • src/evm/releases/lockup/v2.0/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v2.0/index.ts (1 hunks)
  • src/evm/releases/lockup/v3.0/deployments.ts (3 hunks)
  • src/evm/releases/lockup/v3.0/index.ts (1 hunks)
  • src/evm/releases/queries.ts (4 hunks)
  • src/evm/releases/resolvers.ts (7 hunks)
  • src/helpers.ts (4 hunks)
  • src/index.ts (1 hunks)
  • src/internal/helpers.ts (1 hunks)
  • src/internal/logger.ts (2 hunks)
  • src/sablier.ts (2 hunks)
  • src/types.ts (2 hunks)
  • tests/chains.test.ts (1 hunks)
  • tests/comptroller.test.ts (1 hunks)
  • tests/contracts/abi-const.test.ts (1 hunks)
  • tests/contracts/catalog.test.ts (2 hunks)
  • tests/contracts/checksums.test.ts (1 hunks)
  • tests/contracts/indexed.test.ts (3 hunks)
  • tests/contracts/queries.test.ts (6 hunks)
  • tests/cron/blocks.test.ts (4 hunks)
  • tests/cron/chains-rpc.test.ts (1 hunks)
  • tests/deployments/airdrops.test.ts (1 hunks)
  • tests/deployments/flow.test.ts (1 hunks)
  • tests/deployments/lockup.test.ts (1 hunks)
  • tests/deployments/utils/generators.ts (3 hunks)
  • tests/deployments/utils/loaders.ts (3 hunks)
  • tests/helpers.test.ts (1 hunks)
  • tests/helpers/broadcasts.ts (1 hunks)
  • tests/helpers/missing.ts (2 hunks)
  • tests/types.ts (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/evm/releases/helpers.ts
🚧 Files skipped from review as they are similar to previous changes (28)
  • src/evm/releases/flow/v1.1/index.ts
  • tests/comptroller.test.ts
  • tests/contracts/catalog.test.ts
  • src/evm/releases/lockup/v3.0/index.ts
  • tests/helpers.test.ts
  • src/evm/releases/legacy/index.ts
  • src/evm/contracts/catalog.ts
  • src/evm/releases/airdrops/v2.0/index.ts
  • src/evm/releases/lockup/v1.1/deployments.ts
  • cli/commands/print/aliases.ts
  • tests/cron/chains-rpc.test.ts
  • cli/commands/print/chains.ts
  • src/evm/releases/flow/v1.1/deployments.ts
  • src/helpers.ts
  • src/evm/releases/airdrops/v1.1/deployments.ts
  • src/evm/releases/airdrops/v1.2/index.ts
  • src/evm/releases/airdrops/v1.3/index.ts
  • package.json
  • src/evm/releases/lockup/v1.0/deployments.ts
  • src/index.ts
  • tests/deployments/utils/loaders.ts
  • src/evm/releases/flow/v2.0/index.ts
  • tests/contracts/indexed.test.ts
  • tests/deployments/lockup.test.ts
  • tests/chains.test.ts
  • tests/contracts/abi-const.test.ts
  • src/evm/releases/legacy/v1.0/index.ts
  • tests/helpers/missing.ts
🧰 Additional context used
🧬 Code graph analysis (28)
src/evm/releases/airdrops/index.ts (1)
src/types.ts (1)
  • Airdrops (193-193)
src/evm/releases/flow/v1.0/index.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/lockup/v1.2/index.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/lockup/v2.0/index.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/legacy/v1.1/index.ts (2)
src/evm/releases/helpers.ts (1)
  • sortDeployments (13-19)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/lockup/v1.1/index.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/flow/index.ts (1)
src/types.ts (1)
  • Flow (195-195)
src/evm/releases/lockup/v2.0/deployments.ts (1)
src/evm/comptroller.ts (1)
  • get (15-18)
src/evm/releases/airdrops/v1.3/deployments.ts (1)
src/evm/comptroller.ts (1)
  • get (15-18)
cli/commands/print/missing-broadcasts.ts (3)
src/types.ts (4)
  • Protocol (99-99)
  • Protocol (259-259)
  • Chain (33-59)
  • Chain (254-254)
src/evm/releases/data.ts (1)
  • releases (6-11)
src/sablier.ts (1)
  • sablier (53-60)
src/evm/chains/queries.ts (1)
src/helpers.ts (1)
  • sortChains (59-61)
src/evm/releases/legacy/v1.1/deployments.ts (1)
src/evm/comptroller.ts (1)
  • get (15-18)
cli/commands/print/versions.ts (1)
src/sablier.ts (1)
  • sablier (53-60)
src/evm/releases/lockup/v1.2/deployments.ts (1)
src/evm/comptroller.ts (1)
  • get (15-18)
src/evm/releases/airdrops/v2.0/deployments.ts (1)
src/evm/comptroller.ts (1)
  • get (15-18)
src/evm/releases/flow/v2.0/deployments.ts (1)
src/evm/comptroller.ts (1)
  • get (15-18)
src/evm/releases/flow/v1.0/deployments.ts (1)
src/evm/comptroller.ts (1)
  • get (15-18)
tests/deployments/utils/generators.ts (4)
tests/types.ts (3)
  • BasicContract (8-11)
  • StandardBroadcast (18-23)
  • ZKBroadcast (25-31)
tests/deployments/utils/finders.ts (2)
  • findContract (9-18)
  • findZKContract (20-22)
tests/deployments/utils/loaders.ts (1)
  • loadBroadcast (8-18)
src/sablier.ts (1)
  • sablier (53-60)
tests/cron/blocks.test.ts (3)
src/types.ts (2)
  • Protocol (99-99)
  • Protocol (259-259)
src/sablier.ts (1)
  • sablier (53-60)
src/evm/contracts/index.ts (1)
  • contracts (4-7)
src/evm/releases/lockup/index.ts (1)
src/types.ts (1)
  • Lockup (199-199)
src/evm/releases/airdrops/v1.1/index.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/lockup/v1.0/index.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/airdrops/v1.2/deployments.ts (1)
src/evm/comptroller.ts (1)
  • deployments (134-134)
src/evm/releases/lockup/v3.0/deployments.ts (1)
src/evm/comptroller.ts (1)
  • get (15-18)
tests/contracts/queries.test.ts (1)
src/sablier.ts (1)
  • sablier (53-60)
src/evm/releases/resolvers.ts (1)
src/types.ts (1)
  • AliasMap (28-28)
tests/contracts/checksums.test.ts (2)
src/sablier.ts (1)
  • sablier (53-60)
src/evm/contracts/index.ts (1)
  • contracts (4-7)
src/types.ts (1)
src/evm/enums.ts (1)
  • enums (39-42)
🔇 Additional comments (57)
src/evm/contracts/queries.ts (3)

1-2: LGTM! Import paths correctly updated to EVM-specific modules.

The import paths have been properly updated to reference the new EVM-specific module structure, aligning with the multi-VM refactoring objectives.


18-24: LGTM! Function signature consistently updated to EVM namespace.

The get function signature correctly uses Sablier.EVM.Protocol, Sablier.EVM.Release, and Sablier.EVM.Contract types, maintaining consistency with the namespace refactoring while preserving all existing logic.


90-94: LGTM! The getAll function signature properly migrated to EVM types.

The function parameters and return type have been consistently updated to use the new Sablier.EVM.* namespace, completing the migration for this query interface.

src/evm/releases/flow/index.ts (1)

6-10: LGTM! Type annotation correctly migrated to EVM namespace.

The flow record type has been properly updated to use Sablier.EVM.Version.Flow and Sablier.EVM.Release, maintaining the existing version mappings while aligning with the multi-VM namespace structure.

src/evm/releases/airdrops/v2.0/deployments.ts (3)

1-3: LGTM! Import paths correctly updated for EVM namespace.

The imports have been properly migrated to reference EVM-specific modules (@src/evm/chains, @src/evm/enums, @src/evm/releases/resolvers), consistent with the broader refactoring.


8-16: LGTM! Helper function signature properly updated.

The get function now correctly accepts Sablier.EVM.ContractMap and returns Sablier.EVM.Deployment, maintaining consistency with the EVM namespace migration.


21-21: LGTM! Export types consistently migrated to EVM namespace.

Both mainnets and testnets arrays are now correctly typed as Sablier.EVM.Deployment[], completing the namespace migration for this deployments file.

Also applies to: 177-177

src/evm/releases/airdrops/v1.3/deployments.ts (2)

1-3: LGTM! Consistent namespace migration for v1.3 airdrops.

Import paths and function signatures have been properly updated to use EVM-specific modules and types, following the same pattern as other deployment files in the refactoring.

Also applies to: 8-16


21-21: LGTM! Export types correctly updated to EVM namespace.

Both mainnet and testnet deployments are now properly typed as Sablier.EVM.Deployment[], maintaining consistency across all airdrops releases.

Also applies to: 114-114

src/evm/chains/queries.ts (1)

7-28: LGTM! Complete migration of chains query interface to EVM namespace.

All query methods (get, getAll, getBySlug, getMainnets, getOrThrow, getTestnets) have been consistently updated to return Sablier.EVM.Chain or Sablier.EVM.Chain[] types, properly completing the namespace migration for the chains module.

cli/commands/print/versions.ts (1)

14-22: LGTM! CLI correctly updated to use new EVM namespace.

The iteration source has been properly changed from sablier.releases.getAll() to sablier.evm.releases.getAll(), aligning with the new public API structure while maintaining all existing functionality.

tests/deployments/airdrops.test.ts (1)

1-6: LGTM! Test import path correctly updated to EVM module.

The import has been properly updated to reference the new EVM-specific releases module (@src/evm/releases), maintaining test functionality while aligning with the namespace refactoring.

src/evm/releases/legacy/v1.1/index.ts (2)

1-3: LGTM! Import paths properly migrated to EVM modules.

The imports have been correctly updated to reference EVM-specific modules for enums, helpers, and resolvers, maintaining consistency with the broader refactoring effort.


11-11: LGTM! Deployments type correctly updated to EVM namespace.

The deployments array is now properly typed as Sablier.EVM.Deployment[], completing the namespace migration for the legacy v1.1 release.

tests/helpers/broadcasts.ts (1)

10-10: LGTM! Namespace update aligns with the EVM extraction.

The parameter type update from Sablier.Release to Sablier.EVM.Release is consistent with the PR's objective to isolate EVM-specific types.

tests/contracts/queries.test.ts (2)

1-1: LGTM! Import path correctly updated for EVM namespace.

The import path change from @src/releases to @src/evm/releases aligns with the reorganization of EVM-specific code.


27-27: LGTM! All contract query calls correctly updated to EVM namespace.

All sablier.contracts.get() calls have been consistently updated to sablier.evm.contracts.get(), maintaining identical arguments and test logic.

Also applies to: 44-44, 68-68, 83-83, 100-100

tests/deployments/flow.test.ts (1)

1-6: LGTM! Import path updated and test coverage expanded.

The import path correctly references the new EVM-specific location, and the addition of test suites for flow v1.1 and v2.0 improves coverage.

src/evm/releases/lockup/v1.0/index.ts (2)

1-3: LGTM! Import paths correctly updated for EVM namespace.

All import paths have been updated to reference the new EVM-specific module locations.


12-12: LGTM! Type annotation improved with more specific type.

The type changed from generic Sablier.Deployment[] to the more specific Sablier.EVM.Deployment.LockupV1[], which provides better type safety for this v1.0 lockup release.

src/evm/releases/lockup/v2.0/index.ts (2)

1-2: LGTM! Import paths correctly updated for EVM namespace.

All import paths have been updated to reference the new EVM-specific module locations.


9-9: LGTM! Type annotation updated to EVM namespace.

The type changed from Sablier.Deployment[] to Sablier.EVM.Deployment[]. Note that v1.0 uses the more specific Sablier.EVM.Deployment.LockupV1[] type, but this generic type is likely appropriate for v2.0's structure.

CHANGELOG.md (1)

19-73: LGTM! Comprehensive and well-structured changelog entry.

The 2.0.0 changelog entry thoroughly documents:

  • All breaking changes with clear before/after examples
  • New exports and additions
  • File reorganization details
  • Migration guidance with reference to MIGRATION.md
  • Quick migration commands

This provides excellent clarity for users upgrading to this version.

tests/types.ts (1)

9-9: LGTM! Type annotations correctly updated to EVM namespace.

Both address types have been consistently updated from Sablier.Address to Sablier.EVM.Address, aligning with the namespace migration for EVM-specific types.

Also applies to: 28-28

src/internal/helpers.ts (1)

27-31: LGTM! Function signature correctly updated to EVM namespace.

The parameter types for release and chain have been updated to use the EVM-specific namespace (Sablier.EVM.Release and Sablier.EVM.Chain), consistent with the broader namespace migration while preserving all function logic.

src/evm/releases/flow/v1.0/index.ts (2)

1-3: LGTM! Import paths correctly updated to EVM namespace.

The import paths have been consistently updated to reference the new @src/evm/ directory structure, aligning with the PR's objective to isolate EVM-specific code.


12-12: LGTM! Type annotation updated to EVM namespace.

The type annotation correctly migrates from Sablier.Deployment[] to Sablier.EVM.Deployment[], consistent with the broader namespace refactoring.

src/evm/releases/airdrops/v1.1/index.ts (2)

1-1: LGTM! Import path correctly updated.

The resolver import path has been updated to reference the new EVM-specific directory structure.


8-8: LGTM! Type annotation migrated to EVM namespace.

The deployments array type annotation correctly reflects the new Sablier.EVM.Deployment[] type.

tests/contracts/checksums.test.ts (1)

9-11: LGTM! Test updated to use EVM-namespaced API.

The test correctly references the new sablier.evm.releases.getAll() and sablier.evm.contracts.getAll() API surfaces while maintaining the same test logic and expectations.

src/internal/logger.ts (2)

72-79: LGTM! Type updated and logging improved.

The function signature correctly migrates to Sablier.EVM.Release, and the addition of the else branch (lines 76-78) is a good improvement. It ensures messages are logged even when no release is provided, handling the optional parameter case properly.


81-83: LGTM! Helper function type updated.

The formatRelease helper correctly uses the new Sablier.EVM.Release type while maintaining the same formatting logic.

src/evm/releases/lockup/index.ts (1)

8-14: LGTM! Export type migrated to EVM namespace.

The lockup record export correctly uses the new Record<Sablier.EVM.Version.Lockup, Sablier.EVM.Release> type annotation while maintaining the same runtime structure and values.

src/evm/contracts/names.ts (2)

1-14: LGTM! All import paths updated to EVM directory structure.

All manifest imports have been systematically updated to reference the new @src/evm/releases/ directory structure, covering airdrops, flow, legacy, and lockup releases.


47-53: LGTM! Type annotations migrated to EVM namespace.

The flatten function correctly uses Sablier.EVM.Manifest and Sablier.EVM.Manifest.LockupV1 types while maintaining the same logic for flattening manifest structures.

src/evm/releases/airdrops/index.ts (1)

7-12: LGTM! Export type migrated to EVM namespace.

The airdrops record export correctly uses the new Record<Sablier.EVM.Version.Airdrops, Sablier.EVM.Release> type annotation while maintaining the same runtime structure and values.

src/evm/releases/airdrops/v1.2/deployments.ts (2)

4-4: LGTM! Import path updated to EVM directory structure.

The lockup deployments import path correctly references the new @src/evm/releases/lockup/v1.2/deployments location.


9-14: LGTM! Function signature migrated to EVM namespace.

The filter function correctly uses Sablier.EVM.Deployment.LockupV1[] for the parameter and Sablier.EVM.Deployment.Standard[] for the return type, while maintaining the same filtering logic.

src/evm/releases/lockup/v1.1/index.ts (1)

1-12: LGTM! Clean namespace migration.

The import paths and type annotations have been correctly updated to the EVM-specific namespace. The changes are mechanical and align with the PR's objective of isolating EVM-related code.

src/evm/releases/legacy/v1.0/deployments.ts (1)

1-16: LGTM! Namespace migration applied correctly.

Import paths and type annotations have been consistently updated to the EVM-specific namespace.

src/evm/releases/lockup/v1.2/index.ts (1)

1-12: LGTM! Consistent refactoring.

The import paths and type annotations have been correctly migrated to the EVM namespace, following the same pattern as the v1.1 release.

src/evm/releases/legacy/v1.1/deployments.ts (1)

1-22: LGTM! Function signature and exports properly updated.

The import paths, function signature, and export types have been correctly migrated to the EVM-specific namespace.

cli/commands/print/missing-broadcasts.ts (1)

1-27: LGTM! CLI command properly migrated to EVM namespace.

The import paths, type annotations, and API calls have been correctly updated to use the EVM-specific namespace (sablier.evm.releases, sablier.evm.chains, Sablier.EVM.Protocol).

src/evm/releases/flow/v1.0/deployments.ts (1)

1-21: LGTM! Deployment types properly migrated.

The import paths, function signature, and export types have been consistently updated to the EVM-specific namespace.

src/evm/releases/flow/v2.0/deployments.ts (1)

1-21: LGTM! Consistent namespace migration.

The import paths and type annotations have been correctly updated to the EVM-specific namespace, following the same pattern as v1.0.

src/evm/releases/lockup/v2.0/deployments.ts (1)

1-21: LGTM! Namespace migration applied correctly.

The import paths, function signature, and export types have been consistently updated to the EVM-specific namespace.

src/evm/releases/lockup/v3.0/deployments.ts (1)

1-3: LGTM! Namespace migration is consistent.

The import paths and type signatures have been correctly updated to the EVM namespace (@src/evm/* and Sablier.EVM.*). The logic remains unchanged.

Also applies to: 8-8, 21-21, 202-202

src/evm/releases/lockup/v1.2/deployments.ts (1)

1-3: LGTM! Consistent EVM namespace migration.

All import paths and type signatures correctly updated to the EVM namespace. The specialized Sablier.EVM.Deployment.LockupV1 type is appropriately used for this release version.

Also applies to: 8-14, 27-27, 315-315

tests/cron/blocks.test.ts (1)

1-2: LGTM! Test properly updated for EVM namespace.

All imports, type references, and API calls correctly migrated to use sablier.evm.* and Sablier.EVM.*. The test logic remains intact.

Also applies to: 19-19, 55-69

src/evm/index.ts (1)

1-5: LGTM! Clean barrel export pattern.

This central entry point appropriately consolidates all EVM-related modules, enabling clean imports via sablier/evm or internal access.

src/evm/comptroller.ts (1)

1-1: LGTM! Comprehensive type migration to EVM namespace.

All public API methods, internal helpers, and type casts correctly updated to use Sablier.EVM.* types. The import path correctly points to the EVM chains module.

Also applies to: 15-15, 23-23, 134-134, 140-140, 150-150

src/evm/chains/data.ts (1)

192-192: LGTM! Chain definitions properly typed with EVM namespace.

The define() helper return type and all explicit chain type annotations correctly use Sablier.EVM.Chain. This ensures type safety throughout the chain definitions.

Also applies to: 280-280, 299-299, 327-327, 342-342, 352-352, 364-364

README.md (1)

104-104: LGTM! Releases API correctly updated.

The releases example properly uses sablier.evm.releases.getAll with the new namespace.

src/evm/releases/resolvers.ts (2)

60-68: LGTM: standard deployment builder is clear and typed.

Good use of EVM types and separation of concerns.


40-49: LGTM: lockupV1 composes from standard and augments core/periphery.

The merge and subsequent mapping read well.

tests/deployments/utils/generators.ts (1)

136-141: LGTM: migration to sablier.evm.chains.getOrThrow is consistent.

EVM surface used correctly.

src/types.ts (1)

29-31: JSDoc alignment for Address looks good.

Address comment is now correctly placed.

Copy link
Member

@PaulRBerg PaulRBerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @gavriliumircea, it's looking better now. more feedback shared above in the comments.

Also:

  1. I know I've said on Slack to keep a single types.ts, but after I've looked at the code, I think the files would be more cleanly organized by having a bespoke types.ts file under src/evm and src/solana. I've refactored the code myself.
  2. We need to group the tests under an evm directory.

@gavriliumircea
Copy link
Contributor Author

thanks @gavriliumircea, it's looking better now. more feedback shared above in the comments.

Also:

  1. I know I've said on Slack to keep a single types.ts, but after I've looked at the code, I think the files would be more cleanly organized by having a bespoke types.ts file under src/evm and src/solana. I've refactored the code myself.
  2. We need to group the tests under an evm directory.

Regarding the tests I reoganised them in this pr: #67

@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch 2 times, most recently from 08f5a00 to 72e5beb Compare October 29, 2025 17:48
PaulRBerg
PaulRBerg previously approved these changes Oct 31, 2025
Copy link
Member

@PaulRBerg PaulRBerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now except for those changes I requested in CHANGELOG.md and README.md

Move EVM-specific type definitions from src/types.ts to src/evm/types.ts for better code organization. Update imports across affected files while maintaining backward compatibility through re-exports.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
src/sablier.ts (1)

56-59: LGTM: Effective backward compatibility strategy.

The spread operator combined with an explicit evm property provides dual API access:

  • Legacy: sablier.contracts, sablier.chains, etc. (via spread)
  • New: sablier.evm.contracts, sablier.evm.chains, etc. (via explicit property)

This approach eases migration for consumers while establishing the new namespace structure.

Note: The past review comment about a missing contracts plural alias is now resolved—the spread operator preserves the plural form from the evm object, so both sablier.contracts and sablier.evm.contracts work correctly.

🧹 Nitpick comments (3)
src/evm/types.ts (2)

10-10: Remove redundant | undefined from optional property.

The ? modifier already makes apiUrl optional (assignable to string | undefined), so explicitly adding | undefined is redundant.

Apply this diff:

-  apiUrl?: string | undefined;
+  apiUrl?: string;

19-19: Consider using Record<> utility type for clearer map types.

For improved readability, consider using TypeScript's Record<K, V> utility type instead of index signatures for map types.

-  export type AliasMap = { [contractName: string]: string };
+  export type AliasMap = Record<string, string>;
-  export type AbiMap = { [contractName: string]: readonly object[] };
+  export type AbiMap = Record<string, readonly object[]>;

Also applies to: 23-23

src/sablier.ts (1)

31-47: Pragmatic workaround for circular dependencies, but consider future refactor.

The local definition of evmDeploymentsQueries breaks the import pattern used for chains, contracts, and releases. While the comment explains this is to avoid circular dependencies, consider extracting this to a dedicated src/evm/deployments/queries.ts module when the dependency graph allows. This would improve consistency and modularity.

The implementation itself is correct—get and getAll properly use lodash utilities and return the appropriate types.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72e5beb and 24c6085.

📒 Files selected for processing (4)
  • README.md (4 hunks)
  • src/evm/types.ts (1 hunks)
  • src/sablier.ts (2 hunks)
  • src/types.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
src/types.ts (1)
src/evm/types.ts (12)
  • Address (21-21)
  • AbiMap (23-23)
  • Chain (24-50)
  • CompilerSettings (92-107)
  • Contract (55-72)
  • ContractCatalog (77-83)
  • ContractMap (86-88)
  • Deployment (127-127)
  • Manifest (148-148)
  • Protocol (90-90)
  • Release (193-193)
  • Version (208-208)
src/evm/types.ts (1)
src/evm/enums.ts (1)
  • enums (39-42)
src/sablier.ts (1)
src/evm/types.ts (2)
  • Release (193-193)
  • Deployment (127-127)
🔇 Additional comments (10)
README.md (3)

85-90: ✅ Previous critical issue resolved: contractName parameter now correct.

The earlier flagged issue where name should be contractName has been properly fixed. The example now correctly uses contractName: "SablierLockup" which matches the API signature.


56-56: ✅ API Reference structure properly organized with EVM and Solana subsections.

The README now clearly separates EVM examples under "## API Reference - EVM 📖" and adds a forward-looking Solana placeholder as requested. This aligns with the PR's goal of preparing for multi-chain support and improves documentation clarity.

Also applies to: 107-109


115-115: No update needed for the types reference.

The ./src/types.ts file still exists and serves as a re-export barrel that imports from ./src/evm/types.ts. The README reference remains correct—users can still access types via ./src/types.ts even though the actual types have been relocated internally to ./src/evm/types.ts. This is a standard refactoring pattern that maintains API stability while reorganizing code.

Likely an incorrect or invalid review comment.

src/evm/types.ts (2)

24-88: Well-structured core EVM types.

The Chain augmentation properly extends Viem's Chain type with Sablier-specific properties, and the Contract types are comprehensive and well-documented. The nested ContractCatalog structure provides efficient lookups by protocol, chain, and address.


92-209: Excellent namespace organization and discriminated unions.

The nested namespace pattern (Deployment, Manifest, Release, Version) provides clear organization, and the discriminated union pattern using the kind field in Release types enables proper type narrowing. Template literal types for versions provide good compile-time safety.

src/types.ts (2)

1-4: Clean namespace organization for EVM types.

The import and re-export of the EVM namespace under Sablier.EVM provides a clear, organized API surface while maintaining the ability to provide backward-compatible aliases.


9-20: Effective backward compatibility layer.

The export import aliases provide a smooth migration path for existing consumers while the new Sablier.EVM.* namespace enables future extensibility (e.g., for Solana support). This balances breaking changes with migration ease.

src/sablier.ts (3)

9-21: LGTM: Clear documentation of both API surfaces.

The JSDoc examples effectively demonstrate both the new sablier.evm.contracts API and the backward-compatible sablier.contracts alias, making the migration path clear for consumers.


27-29: LGTM: Clean EVM namespace isolation.

The imports consistently use the evm* prefix and reference the new ./evm/* directory structure, aligning with the PR's goal of isolating EVM-specific logic.


49-54: LGTM: Clean EVM namespace grouping.

The evm namespace object provides a logical grouping for all EVM-specific queries, supporting the PR's goal of preparing for multi-chain support (EVM, Solana, etc.).

@PaulRBerg PaulRBerg merged commit 6cc31e7 into main Nov 3, 2025
3 checks passed
@PaulRBerg PaulRBerg deleted the refactor/extract-evm-directory branch November 3, 2025 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants