Skip to content

Conversation

@kumaryash90
Copy link
Member

@kumaryash90 kumaryash90 commented Nov 9, 2025


PR-Codex overview

This PR focuses on enhancing the thirdweb platform by adding support for Stylus modules, including minting and transfer functionalities for ERC20, ERC721, and ERC1155 tokens. It also improves documentation for Stylus contracts and updates tests for dynamic contracts.

Detailed summary

  • Added new Stylus minting modules for ERC20, ERC721, and ERC1155.
  • Updated sidebar.tsx to include links for Stylus minting options.
  • Enhanced compatibility checks in installPublishedModule.ts.
  • Improved test cases for uninstalling and installing extensions.
  • Updated CLI commands to create Stylus projects and modules.
  • Enhanced documentation for Stylus minting modules and ZK minting contracts.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features
    • Improved installation/deployment flow for Stylus-based modules.
    • Dashboard now recognizes Stylus modules and bypasses incompatible checks.
    • Added "Airdrop - Arbitrum Stylus" category with three Stylus modular contract types in Explore.
    • Six new Stylus project templates in the CLI create flow.
  • Documentation
    • Two new Stylus guides added to the portal (minting modules and ZK mint).
    • Sidebar updated with Stylus docs links.
  • Tests
    • Previously skipped integration tests re-enabled.
  • Chores
    • Patch release recorded.

@kumaryash90 kumaryash90 requested review from a team as code owners November 9, 2025 10:05
@changeset-bot
Copy link

changeset-bot bot commented Nov 9, 2025

🦋 Changeset detected

Latest commit: 16fc56d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
thirdweb Patch
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch
wagmi-inapp Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Nov 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Nov 10, 2025 10:29am
nebula Ready Ready Preview Comment Nov 10, 2025 10:29am
thirdweb_playground Ready Ready Preview Comment Nov 10, 2025 10:29am
thirdweb-www Ready Ready Preview Comment Nov 10, 2025 10:29am
wallet-ui Ready Ready Preview Comment Nov 10, 2025 10:29am

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 9, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Nov 9, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 9, 2025

Walkthrough

Adds Stylus-specific handling across runtime, UI, CLI, explore data, docs, and tests: conditional Stylus deployment path, dashboard compatibility short-circuit for Stylus modules, expanded Stylus CLI templates, new Stylus modular category and docs, an awaited chain check, and previously-skipped tests enabled.

Changes

Cohort / File(s) Summary
Release changeset
.changeset/sharp-files-cry.md
Adds a patch changeset documenting Stylus deployment/installation notes for the "thirdweb" package.
Module deployment logic
packages/thirdweb/src/extensions/modules/common/installPublishedModule.ts
Introduces name-based conditional deployment: if module name includes "stylus" (case-insensitive) call deployPublishedContract(...) and use its returned address; otherwise use getOrDeployInfraForPublishedContract(...) and extract deployedModule.address. Unifies to implementationAddress; retains TODO about deterministic/create2.
Dashboard module form / compatibility
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/ModuleForm.tsx
Adds isStylus flag (derived from module.metadata.compilers length), extends isModuleCompatible signature to accept isStylus, and short-circuits compatibility to true when isStylus is true.
Explore page categories
apps/dashboard/src/app/(app)/(dashboard)/explore/data.ts
Renames STYLUS displayName and adds MODULAR_CONTRACTS_STYLUS category with ERC20/ERC721/ERC1155 modular contract entries; registers the category in CATEGORIES, updating EXPLORE_PAGE_DATA.
Stylus CLI templates
packages/thirdweb/src/cli/commands/stylus/create.ts
Adds six new Stylus project templates (mintable20, transferable20, mintable721, transferable721, mintable1155, transferable1155) with corresponding git clone branches and spinner messages in the Stylus create flow.
Docs: new Stylus pages
apps/portal/src/app/contracts/arbitrum-stylus/minting-modules/page.mdx, apps/portal/src/app/contracts/arbitrum-stylus/zk-mint/page.mdx
Adds two MDX documentation pages with exported metadata and detailed guides for Stylus minting modules and ZK mint flows.
Sidebar navigation
apps/portal/src/app/contracts/sidebar.tsx
Adds two new "Arbitrum Stylus" sidebar entries: "Stylus Zk Mint" and "Stylus Minting Modules".
Tests: enable previously-skipped tests
packages/thirdweb/src/contract/deployment/deploy-dynamic.test.ts, packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts, packages/thirdweb/src/extensions/dynamic-contracts/write/uninstallExtension.test.ts
Changes it.skip.sequential(...) to it.sequential(...) to run previously-skipped tests; test bodies unchanged.
Async chain check in prebuilts
packages/thirdweb/src/extensions/prebuilts/deploy-published.ts
Converts a synchronous guard to an awaited async check by using await isZkSyncChain(chain) in the autoFactory deployment path; logical condition preserved.
Manifest
package.json
Listed in manifest snippet (no content changes described).

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant installPublishedModule
    participant deployPublishedContract
    participant getOrDeployInfra
    participant Result

    Caller->>installPublishedModule: install module(metadata)
    installPublishedModule->>installPublishedModule: inspect module name (case-insensitive)

    alt name contains "stylus"
        installPublishedModule->>deployPublishedContract: deployPublishedContract(...)
        deployPublishedContract-->>installPublishedModule: implementationAddress
        installPublishedModule->>installPublishedModule: set implementationAddress
        Note over installPublishedModule: TODO: switch to deterministic/create2
    else other modules
        installPublishedModule->>getOrDeployInfra: getOrDeployInfraForPublishedContract(...)
        getOrDeployInfra-->>installPublishedModule: deployedModule
        installPublishedModule->>installPublishedModule: implementationAddress = deployedModule.address
    end

    installPublishedModule->>Result: moduleContract = implementationAddress
    Result-->>Caller: return deployed module info
Loading
sequenceDiagram
    participant UserUI
    participant InstallModuleForm
    participant isModuleCompatible
    participant ThirdwebClient

    UserUI->>InstallModuleForm: select module
    InstallModuleForm->>InstallModuleForm: compute isStylus (metadata.compilers length)
    InstallModuleForm->>isModuleCompatible: isModuleCompatible(..., isStylus)
    
    alt isStylus == true
        isModuleCompatible-->>InstallModuleForm: return true (short-circuit)
    else
        isModuleCompatible->>ThirdwebClient: fetch/compare bytecodes
        ThirdwebClient-->>isModuleCompatible: installedModuleBytecodes
        isModuleCompatible-->>InstallModuleForm: compatibility result
    end

    InstallModuleForm-->>UserUI: enable/disable install flow
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Inspect installPublishedModule.ts branching and ensure implementationAddress/address selection is correct for both paths.
  • Verify isModuleCompatible signature updated everywhere and type-checks across the UI.
  • Confirm UI isStylus detection uses metadata.compilers correctly and doesn't affect non-Stylus flows.
  • Run newly enabled tests to check for flakiness or environment assumptions.
  • Review new CLI template repo URLs and clone/spinner error handling.
  • Ensure await isZkSyncChain(chain) introduction doesn't cause unintended async/timing issues.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description lacks required template sections including an issue tag, specific notes for reviewers, and testing instructions. Add the missing Linear issue tag (TEAM-XXXX format), provide specific notes for reviewers about important changes, and document how to test the changes (unit tests, dashboard testing, CLI testing, etc.).
Title check ❓ Inconclusive The title 'Stylus modules' is vague and overly generic, lacking specificity about the nature of changes despite the PR encompassing multiple significant feature additions, infrastructure updates, test fixes, and documentation improvements. Consider using a more specific title like '[SDK/Dashboard/Portal] Feature: Add Stylus modules deployment support with compatibility checks' to better convey the scope and primary objective.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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 yash/stylus-deploy-modules

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

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

@codecov
Copy link

codecov bot commented Nov 9, 2025

Codecov Report

❌ Patch coverage is 8.00000% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.79%. Comparing base (f6f138c) to head (16fc56d).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...xtensions/modules/common/installPublishedModule.ts 4.16% 23 Missing ⚠️

❌ Your patch status has failed because the patch coverage (8.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8383      +/-   ##
==========================================
+ Coverage   54.64%   54.79%   +0.15%     
==========================================
  Files         919      919              
  Lines       60704    60719      +15     
  Branches     4112     4119       +7     
==========================================
+ Hits        33171    33272     +101     
+ Misses      27431    27345      -86     
  Partials      102      102              
Flag Coverage Δ
packages 54.79% <8.00%> (+0.15%) ⬆️
Files with missing lines Coverage Δ
...rdweb/src/extensions/prebuilts/deploy-published.ts 76.23% <100.00%> (+6.48%) ⬆️
...xtensions/modules/common/installPublishedModule.ts 8.33% <4.16%> (-0.76%) ⬇️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2025

size-limit report 📦

Path Size
@thirdweb-dev/nexus (esm) 104.88 KB (0%)
@thirdweb-dev/nexus (cjs) 316.6 KB (0%)

@vercel vercel bot temporarily deployed to Preview – wallet-ui November 9, 2025 14:59 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground November 9, 2025 14:59 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 November 9, 2025 15:00 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula November 9, 2025 15:00 Inactive
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Nov 9, 2025
@vercel vercel bot temporarily deployed to Preview – nebula November 9, 2025 15:39 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 November 9, 2025 15:39 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui November 9, 2025 15:39 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui November 10, 2025 10:12 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www November 10, 2025 10:12 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula November 10, 2025 10:12 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground November 10, 2025 10:12 Inactive
@github-actions github-actions bot added the Portal Involves changes to the Portal (docs) codebase. label Nov 10, 2025
@kumaryash90 kumaryash90 removed the DO NOT MERGE This pull request is still in progress and is not ready to be merged. label Nov 10, 2025
Copy link
Contributor

@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

🧹 Nitpick comments (3)
apps/portal/src/app/contracts/arbitrum-stylus/minting-modules/page.mdx (1)

38-38: Consider hyphenating compound adjective.

Static analysis suggests using "Rust/Stylus-specific" instead of "Rust / Stylus specific" for better readability.

Apply this diff:

-Here's a list of prebuilt Rust / Stylus specific modules provided by thirdweb:
+Here's a list of prebuilt Rust/Stylus-specific modules provided by thirdweb:
apps/portal/src/app/contracts/arbitrum-stylus/zk-mint/page.mdx (1)

142-142: Consider hyphenating compound adjective.

Static analysis suggests using "above-described" instead of "above described" for grammatical correctness.

Apply this diff:

-The above described logic for ZK verification of user balance is provided as a template. You can modify the logic and write your own custom ZK verification code and circuits as described below.
+The above-described logic for ZK verification of user balance is provided as a template. You can modify the logic and write your own custom ZK verification code and circuits as described below.
packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts (1)

52-59: Document the expected extensions for clarity.

The assertion expects exactly 4 extensions but doesn't clarify which ones. Consider adding a comment explaining what these 4 extensions are (e.g., 3 base extensions + 1 newly installed "DirectListingsLogic"), or verify the extension names explicitly to make the test more maintainable and self-documenting.

Example:

 const extensions = await readContract({
   contract,
   method: resolveMethod("getAllExtensions"),
   params: [],
 });

+// Base EvolvingNFT contract comes with 3 extensions,
+// plus the newly installed DirectListingsLogic
 expect(extensions.length).toEqual(4);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6bae339 and 16fc56d.

📒 Files selected for processing (5)
  • apps/portal/src/app/contracts/arbitrum-stylus/minting-modules/page.mdx (1 hunks)
  • apps/portal/src/app/contracts/arbitrum-stylus/zk-mint/page.mdx (1 hunks)
  • apps/portal/src/app/contracts/sidebar.tsx (1 hunks)
  • packages/thirdweb/src/contract/deployment/deploy-dynamic.test.ts (1 hunks)
  • packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/thirdweb/src/contract/deployment/deploy-dynamic.test.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts
  • apps/portal/src/app/contracts/sidebar.tsx
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.test.{ts,tsx}: Place tests alongside code: foo.tsfoo.test.ts
Use real function invocations with stub data in tests; avoid brittle mocks
Use Mock Service Worker (MSW) for fetch/HTTP call interception in tests
Keep tests deterministic and side-effect free
Use FORKED_ETHEREUM_CHAIN for mainnet interactions and ANVIL_CHAIN for isolated tests

**/*.test.{ts,tsx}: Co‑locate tests as foo.test.ts(x) next to the implementation
Use real function invocations with stub data; avoid brittle mocks
Use MSW to intercept HTTP calls for network interactions; mock only hard‑to‑reproduce scenarios
Keep tests deterministic and side‑effect free; use Vitest

Files:

  • packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts
  • apps/portal/src/app/contracts/sidebar.tsx
packages/thirdweb/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/thirdweb/**/*.{ts,tsx}: Every public symbol must have comprehensive TSDoc with at least one compiling @example and a custom tag (@beta, @internal, @experimental, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Lazy‑load heavy dependencies inside async paths (e.g., const { jsPDF } = await import("jspdf"))

Files:

  • packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to apps/{dashboard,playground}/**/*.stories.tsx : Add Storybook stories (`*.stories.tsx`) alongside new UI components
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to apps/{dashboard,playground}/**/*.{ts,tsx} : Use Tailwind CSS for styling; no inline styles
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Tailwind CSS is the styling system – avoid inline styles or CSS modules.
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use Tailwind CSS only – no inline styles or CSS modules
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Keep tests deterministic and side-effect free

Applied to files:

  • packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.test.{ts,tsx} : Keep tests deterministic and side‑effect free; use Vitest

Applied to files:

  • packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts
🧬 Code graph analysis (1)
packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts (2)
packages/thirdweb/src/extensions/prebuilts/deploy-published.ts (1)
  • deployPublishedContract (87-123)
packages/thirdweb/src/exports/thirdweb.ts (1)
  • resolveMethod (188-188)
🪛 LanguageTool
apps/portal/src/app/contracts/arbitrum-stylus/zk-mint/page.mdx

[grammar] ~142-~142: Use a hyphen to join words.
Context: ... ## Customizing the ZK Logic The above described logic for ZK verification of u...

(QB_NEW_EN_HYPHEN)

apps/portal/src/app/contracts/arbitrum-stylus/minting-modules/page.mdx

[grammar] ~38-~38: Use a hyphen to join words.
Context: ... Here's a list of prebuilt Rust / Stylus specific modules provided by thirdweb: -...

(QB_NEW_EN_HYPHEN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Size
  • GitHub Check: Unit Tests
🔇 Additional comments (4)
apps/portal/src/app/contracts/sidebar.tsx (1)

59-66: LGTM! Navigation entries added correctly.

The new Arbitrum Stylus navigation entries follow the existing pattern and properly link to the corresponding MDX documentation pages.

apps/portal/src/app/contracts/arbitrum-stylus/minting-modules/page.mdx (1)

1-11: LGTM! Metadata structure is correct.

The metadata export follows the established pattern using createMetadata with appropriate title, description, and image fields.

apps/portal/src/app/contracts/arbitrum-stylus/zk-mint/page.mdx (1)

1-11: LGTM! Metadata structure is correct.

The metadata export follows the established pattern using createMetadata with appropriate title, description, and image fields, consistent with other documentation pages.

packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts (1)

14-14: Verify the test is stable and passing consistently.

The test was previously skipped and is now enabled as part of the Stylus module support. Ensure that the underlying issue that caused the skip has been resolved and that the test passes reliably in CI/CD.

@joaquim-verges joaquim-verges merged commit 424e6b8 into main Nov 10, 2025
22 of 23 checks passed
@joaquim-verges joaquim-verges deleted the yash/stylus-deploy-modules branch November 10, 2025 18:33
@joaquim-verges joaquim-verges mentioned this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dashboard Involves changes to the Dashboard. packages Portal Involves changes to the Portal (docs) codebase. SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants