-
Notifications
You must be signed in to change notification settings - Fork 559
[TOOL-4897] Dashboard: Add Contract creator badge in Coin and NFT asset page #7458
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
[TOOL-4897] Dashboard: Add Contract creator badge in Coin and NFT asset page #7458
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
""" WalkthroughA new utility to determine and display the contract creator address has been introduced and integrated into both ERC20 and NFT public asset pages. The contract creator is determined via ownership or admin role checks and is now passed and rendered through the relevant UI components, including a new badge component and updated Storybook stories. Changes
Sequence Diagram(s)sequenceDiagram
participant Page as ERC20/NFT Public Page
participant Contract as ThirdwebContract
participant CreatorUtil as getContractCreator
participant HeaderUI as ContractHeaderUI
participant Badge as ContractCreatorBadge
Page->>Contract: Fetch function selectors
Page->>CreatorUtil: getContractCreator(Contract, selectors)
CreatorUtil->>Contract: isOwnerSupported()
alt Owner supported
CreatorUtil->>Contract: owner()
CreatorUtil-->>Page: Return owner address
else Not owner, check admin
CreatorUtil->>Contract: isGetRoleAdminSupported()
alt Admin supported
CreatorUtil->>Contract: getRoleMember("admin", 0)
CreatorUtil-->>Page: Return admin address
else Neither supported
CreatorUtil-->>Page: Return null
end
end
Page->>HeaderUI: Render with contractCreator
HeaderUI->>Badge: Render if contractCreator exists
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Suggested reviewers
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (7)
⏰ Context from checks skipped due to timeout of 90000ms (7)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
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. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7458 +/- ##
=======================================
Coverage 51.92% 51.92%
=======================================
Files 947 947
Lines 63932 63932
Branches 4216 4216
=======================================
Hits 33194 33194
Misses 30632 30632
Partials 106 106
🚀 New features to boost your workflow:
|
size-limit report 📦
|
Merge activity
|
…et page (#7458) <!-- ## 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 introduces the `contractCreator` property to multiple components, allowing the display of the contract creator's address in the UI. It also adds a new function, `getContractCreator`, to retrieve the contract creator's information based on the contract's role. ### Detailed summary - Added `contractCreator` prop to `NFTPublicPageLayout`, `ContractHeaderUI`, and `ContractCreatorBadge`. - Implemented `getContractCreator` function to fetch the contract creator using `ThirdwebContract`. - Updated `NFTPublicPage` and `ERC20PublicPage` to call `getContractCreator` and pass the result to the UI. - Enhanced storybook stories to include `contractCreator` in various scenarios. > ✨ 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 * **New Features** * Added display of contract creator information on ERC20 and NFT public pages. * Introduced a badge showing the contract creator's address in the contract header section. * **Enhancements** * Contract headers now conditionally show the creator badge if creator data is available. * Storybook stories for contract headers updated to include contract creator scenarios for improved UI previews. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
f9d37df
to
d7a0613
Compare
PR-Codex overview
This PR focuses on enhancing the
NFT
andERC20
public page layouts by integrating the contract creator's information and displaying it in the UI components.Detailed summary
contractCreator
prop toNFTPublicPageLayout
andContractHeaderUI
.getContractCreator
function to retrieve contract creator details.ContractCreatorBadge
component to display the creator's wallet address.NFTPublicPage
andERC20PublicPage
to fetch and passcontractCreator
.contractCreator
in various scenarios.Summary by CodeRabbit
New Features
Enhancements