-
Notifications
You must be signed in to change notification settings - Fork 569
Update default config #7859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update default config #7859
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughhasInbuiltDefaultFeeConfig in CustomContractForm now depends only on the existence of DEFAULT_FEE_RECIPIENT. platformFeeBps on non-zero-fee chains uses DEFAULT_FEE_BPS_NEW when DEFAULT_FEE_RECIPIENT exists; otherwise it uses DEFAULT_FEE_BPS. THIRDWEB_PUBLISHER_ADDRESS was removed and two DEFAULT_FEE_BPS constants were added. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant F as CustomContractForm
participant D as Deployment Logic
participant C as Chain
U->>F: Initiate deployment
F->>D: Build deployment params
D->>D: Check DEFAULT_FEE_RECIPIENT existence
alt Non-zero-fee chain
alt DEFAULT_FEE_RECIPIENT exists
D->>D: platformFeeBps = DEFAULT_FEE_BPS_NEW
else
D->>D: platformFeeBps = DEFAULT_FEE_BPS
end
else
D->>D: platformFeeBps per zero-fee rules
end
D->>C: Deploy contract with params
C-->>U: Deployment result
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7859 +/- ##
=======================================
Coverage 56.34% 56.34%
=======================================
Files 905 905
Lines 58834 58834
Branches 4150 4150
=======================================
Hits 33151 33151
Misses 25577 25577
Partials 106 106
🚀 New features to boost your workflow:
|
There was a problem hiding this 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 (1)
apps/dashboard/src/app/(app)/(dashboard)/published-contract/components/custom-contract.tsx (1)
221-221
: Coerce to boolean for clarity and type-safety
hasInbuiltDefaultFeeConfig
should be a boolean, not the ABI entry object. Coercing makes intent explicit and prevents accidental misuse.Apply this diff:
- const hasInbuiltDefaultFeeConfig = defaultFeeRecipientFunction; + const hasInbuiltDefaultFeeConfig = Boolean(defaultFeeRecipientFunction);
📜 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.
📒 Files selected for processing (1)
apps/dashboard/src/app/(app)/(dashboard)/published-contract/components/custom-contract.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 localtypes.ts
barrels
Prefer type aliases over interface except for nominal shapes
Avoidany
andunknown
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)/(dashboard)/published-contract/components/custom-contract.tsx
**/*.{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)/(dashboard)/published-contract/components/custom-contract.tsx
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
UseNavLink
for internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Usecn()
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 withimport "server-only";
Client Components (browser): Begin files with'use client';
Always callgetAuthToken()
to retrieve JWT from cookies on server side
UseAuthorization: Bearer
header – never embed tokens in URLs
Return typed results (e.g.,Project[]
,User[]
) – avoidany
Wrap client-side data fetching calls in React Query (@tanstack/react-query
)
Use descriptive, stablequeryKeys
for React Query cache hits
ConfigurestaleTime
/cacheTime
in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never importposthog-js
in server components
Files:
apps/dashboard/src/app/(app)/(dashboard)/published-contract/components/custom-contract.tsx
⏰ 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: E2E Tests (pnpm, vite)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Size
- GitHub Check: Unit Tests
- GitHub Check: Lint Packages
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/dashboard/src/app/(app)/(dashboard)/published-contract/components/custom-contract.tsx (1)
552-559
: Confirm broader default fee logic for ABI-based configsDuring review we verified that in
apps/dashboard/src/app/(app)/(dashboard)/published-contract/components/custom-contract.tsx
:
- The flag
hasInbuiltDefaultFeeConfig
(line 217) is now set solely by detecting aDEFAULT_FEE_RECIPIENT
function in the contract’s ABI—no longer gated by the thirdweb publisher address.- Consequently, in the deploy params (lines 557–559),
platformFeeBps
falls back toDEFAULT_FEE_BPS_NEW
for any contract exposingDEFAULT_FEE_RECIPIENT
, not just thirdweb-published ones.This change broadens the scope of the new default fee BPS. Please confirm whether this wider application is intentional.
size-limit report 📦
|
Merge activity
|
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on the removal of the `THIRDWEB_PUBLISHER_ADDRESS` constant from the `addresses.ts` file and its associated usage in the `custom-contract.tsx` file, simplifying the logic related to default fee configuration. ### Detailed summary - Removed the `THIRDWEB_PUBLISHER_ADDRESS` constant from `addresses.ts`. - Updated `custom-contract.tsx` to eliminate the use of `THIRDWEB_PUBLISHER_ADDRESS`. - Simplified the `hasInbuiltDefaultFeeConfig` logic by only checking `defaultFeeRecipientFunction`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Corrected default platform-fee selection during contract deployment: when a default fee recipient is configured, the updated default fee rate is applied regardless of publisher identity, ensuring consistent platform fees on non–zero-fee chains. * **Chores** * Removed an unused publisher address constant from configuration. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
930fe44
to
6f581c8
Compare
PR-Codex overview
This PR removes the
THIRDWEB_PUBLISHER_ADDRESS
constant from theaddresses.ts
file and updates theCustomContractForm
component incustom-contract.tsx
to remove its dependency on this constant, simplifying the fee configuration logic.Detailed summary
THIRDWEB_PUBLISHER_ADDRESS
fromaddresses.ts
.custom-contract.tsx
to eliminate references toTHIRDWEB_PUBLISHER_ADDRESS
.hasInbuiltDefaultFeeConfig
logic by only checkingdefaultFeeRecipientFunction
.Summary by CodeRabbit