Skip to content

Conversation

@gregfromstl
Copy link
Contributor

@gregfromstl gregfromstl commented Aug 20, 2025


PR-Codex overview

This PR focuses on enhancing the token creation functionality by introducing support for a paired token address in the token creation process, allowing for future customization of currency pairing.

Detailed summary

  • Added a pairedTokenAddress property in the create-token-page-impl.tsx file with a TODO comment for future updates.
  • Updated the createTokenOnUniversalBridge function in create-token-on-bridge.ts to include an optional pairedTokenAddress parameter in its parameters and the request body.

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

Summary by CodeRabbit

  • New Features
    • Token creation via the bridge now supports an optional paired token address.
  • Improvements
    • New tokens are automatically paired with the chain’s native token during creation.
    • Streamlined token launch flow to include paired token details in bridge requests.

@gregfromstl gregfromstl requested review from a team as code owners August 20, 2025 22:46
@changeset-bot
Copy link

changeset-bot bot commented Aug 20, 2025

⚠️ No Changeset found

Latest commit: 291dccb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link

vercel bot commented Aug 20, 2025

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

Project Deployment Preview Comments Updated (UTC)
thirdweb-www Ready Ready Preview Comment Aug 20, 2025 10:54pm
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
docs-v2 Skipped Skipped Aug 20, 2025 10:54pm
nebula Skipped Skipped Aug 20, 2025 10:54pm
thirdweb_playground Skipped Skipped Aug 20, 2025 10:54pm
wallet-ui Skipped Skipped Aug 20, 2025 10:54pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 20, 2025

Walkthrough

Adds an optional pairedTokenAddress to the createTokenOnUniversalBridge API and updates its caller to pass NATIVE_TOKEN_ADDRESS on successful token launch. The POST body now forwards pairedTokenAddress when provided. No other logic, control flow, or error handling changes.

Changes

Cohort / File(s) Summary
Bridge API wrapper
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/_apis/create-token-on-bridge.ts
Extends function signature to include optional pairedTokenAddress; includes it in the request payload to the bridge service.
Create token page
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsx
Updates call to createTokenOnUniversalBridge to pass pairedTokenAddress: NATIVE_TOKEN_ADDRESS; adds TODO for future custom pairing.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as CreateTokenAssetPage
  participant API as createTokenOnUniversalBridge
  participant Bridge as Universal Bridge API

  User->>UI: Launch token (success path)
  UI->>API: createTokenOnUniversalBridge({ chainId, tokenAddress, client, pairedTokenAddress: NATIVE_TOKEN_ADDRESS })
  API->>Bridge: POST /tokens { chainId, tokenAddress, pairedTokenAddress? }
  Bridge-->>API: Response
  API-->>UI: Response
  UI-->>User: Continue workflow
  note over API,Bridge: pairedTokenAddress is forwarded when provided
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

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.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch greg/token-creation-paired-address

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Aug 20, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 20, 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.

@codecov
Copy link

codecov bot commented Aug 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.54%. Comparing base (6d635dc) to head (291dccb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7892   +/-   ##
=======================================
  Coverage   56.54%   56.54%           
=======================================
  Files         904      904           
  Lines       58592    58592           
  Branches     4140     4140           
=======================================
  Hits        33131    33131           
  Misses      25355    25355           
  Partials      106      106           
Flag Coverage Δ
packages 56.54% <ø> (ø)
🚀 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

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.06 KB (0%) 1.3 s (0%) 214 ms (+185.13% 🔺) 1.5 s
thirdweb (cjs) 357.05 KB (0%) 7.2 s (0%) 686 ms (+17.47% 🔺) 7.9 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 77 ms (+1787.65% 🔺) 191 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 56 ms (+1968.49% 🔺) 66 ms
thirdweb/react (minimal + tree-shaking) 19.15 KB (0%) 383 ms (0%) 80 ms (+598.71% 🔺) 463 ms

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/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/_apis/create-token-on-bridge.ts (2)

4-9: Add explicit return type and tighten address typing.

The function lacks an explicit return type, and addresses are plain strings. Add a Promise return type and use a template-literal address type to prevent accidental non-hex values.

-export async function createTokenOnUniversalBridge(params: {
-  chainId: number;
-  tokenAddress: string;
-  pairedTokenAddress?: string;
-  client: ThirdwebClient;
-}) {
+export async function createTokenOnUniversalBridge(params: {
+  chainId: number;
+  tokenAddress: `0x${string}`;
+  pairedTokenAddress?: `0x${string}`;
+  client: ThirdwebClient;
+}): Promise<Response> {

12-16: Send pairedTokenAddress only when defined (readability/clarity).

JSON.stringify drops undefined, but making the intent explicit improves readability and avoids accidental falsey values sneaking in.

-    body: JSON.stringify({
-      chainId: params.chainId.toString(),
-      tokenAddress: params.tokenAddress,
-      pairedTokenAddress: params.pairedTokenAddress,
-    }),
+    body: JSON.stringify({
+      chainId: params.chainId.toString(),
+      tokenAddress: params.tokenAddress,
+      ...(params.pairedTokenAddress && {
+        pairedTokenAddress: params.pairedTokenAddress,
+      }),
+    }),
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsx (1)

444-451: Avoid unhandled promise from createTokenOnUniversalBridge.

This call is not awaited; a network failure will surface as an unhandled rejection in the client. Fire-and-forget is fine here—just make it explicit and catch errors.

-        createTokenOnUniversalBridge({
+        void createTokenOnUniversalBridge({
           chainId: params.chainId,
           client: props.client,
           tokenAddress: params.contractAddress,
           // TODO: UPDATE THIS WHEN WE ALLOW CUSTOM CURRENCY PAIRING
           pairedTokenAddress: NATIVE_TOKEN_ADDRESS,
-        });
+        }).catch((err) => {
+          console.error("Failed to register token on Universal Bridge", err);
+        });
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • 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 6d635dc and 291dccb.

📒 Files selected for processing (2)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/_apis/create-token-on-bridge.ts (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{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

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/_apis/create-token-on-bridge.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

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

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/_apis/create-token-on-bridge.ts
apps/{dashboard,playground-web}/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

apps/{dashboard,playground-web}/**/*.{ts,tsx}: Import UI primitives from @/components/ui/* (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Use NavLink for internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Use cn() from @/lib/utils for conditional class logic
Use design system tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components (Node edge): Start files with import "server-only";
Client Components (browser): Begin files with 'use client';
Always call getAuthToken() to retrieve JWT from cookies on server side
Use Authorization: Bearer header – never embed tokens in URLs
Return typed results (e.g., Project[], User[]) – avoid any
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stable queryKeys for React Query cache hits
Configure staleTime/cacheTime in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never import posthog-js in server components

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/_apis/create-token-on-bridge.ts
⏰ 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). (8)
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Size
  • GitHub Check: Lint Packages
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsx (1)

448-450: Action Required: Confirm bridge API accepts NATIVE_TOKEN_ADDRESS (0xeeee…ee) as the native‐asset sentinel

I attempted the placeholder curl test but received a 401 Unauthorized (authentication required), so I couldn’t validate whether the bridge truly treats 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee as its native‐asset sentinel. Please:

  • Rerun the POST to https://bridge.thirdweb-dev.com/v1/tokens with valid values for:
    • chainId
    • tokenAddress
    • x-client-id
  • Verify that the response succeeds when pairedTokenAddress is set to NATIVE_TOKEN_ADDRESS (0xeeee…ee).
  • If the bridge instead expects a different sentinel (e.g. null, "", or another keyword), update this code block accordingly:
- // TODO: UPDATE THIS WHEN WE ALLOW CUSTOM CURRENCY PAIRING
- pairedTokenAddress: NATIVE_TOKEN_ADDRESS,
+ pairedTokenAddress: /* confirmed sentinel or replacement */,

Once confirmed, we can ensure the implementation aligns with the bridge contract’s requirements.

@gregfromstl gregfromstl merged commit 8b6dead into main Aug 20, 2025
25 checks passed
@gregfromstl gregfromstl deleted the greg/token-creation-paired-address branch August 20, 2025 22:56
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants