-
Notifications
You must be signed in to change notification settings - Fork 20
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
FRO-753: Feat: Verify Contract Solidity Upload Files #1201
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
WalkthroughThis pull request introduces EVM contract verification functionality with file upload support. The changes span multiple files across the project, adding new components, updating configuration, and enhancing the verification process for Solidity contracts. The implementation includes support for file uploads, contract libraries, and additional information accordions for Hardhat and Foundry, providing users with a more comprehensive contract verification experience. Changes
Sequence DiagramsequenceDiagram
participant User
participant EvmContractVerify
participant DropZone
participant EvmContractVerifySolidityUploadFiles
User->>EvmContractVerify: Select Solidity Upload Files
EvmContractVerify->>EvmContractVerifySolidityUploadFiles: Render Upload Component
User->>DropZone: Upload .sol files
DropZone->>EvmContractVerifySolidityUploadFiles: Pass uploaded files
EvmContractVerifySolidityUploadFiles->>User: Display uploaded files
User->>EvmContractVerifySolidityUploadFiles: Configure contract details
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
update changelog
src/lib/pages/evm-contract-verify/components/solidity/EvmContractVerifySolidityUploadFiles.tsx
Outdated
Show resolved
Hide resolved
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: 2
🧹 Nitpick comments (3)
src/lib/pages/evm-contract-verify/components/FoundryInfoAccordion.tsx (1)
38-41
: Consider enhancing the Foundry description.The current description is quite brief. Consider adding more details about:
- How Foundry generates metadata
- The verification process
- Key benefits of using Foundry
src/lib/pages/evm-contract-verify/helper.ts (1)
39-43
: LGTM! Consider initializing files with undefined.The implementation looks good. However, for the
files
array, consider initializing it asundefined
instead of an empty array to better represent the initial state before user interaction.src/lib/pages/evm-contract-verify/index.tsx (1)
245-264
: Consider improving the Grid layout implementation.While the layout works, there are a few suggestions for improvement:
- Consider using CSS Grid named areas instead of magic numbers for column spans
- The
maxHeight={0}
on GridItem might cause layout issues - consider using a different approach for hiding content-<GridItem colSpan={2} colStart={1}> - <Grid - templateColumns="6fr 4fr" - columnGap="32px" - rowGap="24px" - > +<GridItem + colSpan={2} + colStart={1} + css={{ + display: 'grid', + gridTemplateAreas: ` + "main sidebar" + `, + gridTemplateColumns: '6fr 4fr', + gap: '32px 24px' + }} +> <Stack gap={12}> <EvmContractVerifyOptions control={control} /> <Divider /> <EvmContractVerifyForms control={control} /> </Stack> - <GridItem maxHeight={0}> + <GridItem + style={{ + visibility: shouldShowAccordion ? 'visible' : 'hidden', + height: shouldShowAccordion ? 'auto' : 0 + }} + >
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
CHANGELOG.md
(1 hunks)src/lib/components/dropzone/config.ts
(2 hunks)src/lib/components/dropzone/index.tsx
(1 hunks)src/lib/pages/evm-contract-verify/components/EvmContractVerifyForms.tsx
(1 hunks)src/lib/pages/evm-contract-verify/components/FoundryInfoAccordion.tsx
(1 hunks)src/lib/pages/evm-contract-verify/components/HardhatInfoAccordion.tsx
(1 hunks)src/lib/pages/evm-contract-verify/components/solidity/EvmContractVerifySolidityUploadFiles.tsx
(1 hunks)src/lib/pages/evm-contract-verify/helper.ts
(1 hunks)src/lib/pages/evm-contract-verify/index.tsx
(3 hunks)src/lib/pages/evm-contract-verify/types.ts
(1 hunks)
🔇 Additional comments (11)
src/lib/pages/evm-contract-verify/components/solidity/EvmContractVerifySolidityUploadFiles.tsx (1)
31-33
: Simplify the component structure by removing unnecessaryFragment
Since the
<Fragment>
only wraps a single<UploadCard>
component, you can remove the<Fragment>
and apply thekey
prop directly to<UploadCard>
.Apply this diff to simplify the code:
- <Fragment key={field.id}> - <UploadCard file={field.file} deleteFile={() => remove(index)} /> - </Fragment> + <UploadCard key={field.id} file={field.file} deleteFile={() => remove(index)} />src/lib/components/dropzone/config.ts (1)
56-61
: LGTM!The addition of the "sol" file type and its configuration aligns well with the existing structure.
src/lib/pages/evm-contract-verify/components/HardhatInfoAccordion.tsx (1)
46-47
: Update the placeholder link inUserDocsLink
There's a TODO comment indicating the need to update the link in the
UserDocsLink
component. Please replace the placeholderhref="#"
with the appropriate URL to ensure users can access the relevant documentation.Do you want me to help find the correct link or open a new issue to track this task?
src/lib/pages/evm-contract-verify/components/FoundryInfoAccordion.tsx (2)
46-47
: Update documentation link before merging.The TODO comment indicates a missing documentation link. Please update the
href
with the correct documentation URL.
15-17
: Verify sticky positioning behavior.The sticky positioning might affect the user experience when multiple accordions are present. Please verify:
- Behavior with multiple accordions
- Interaction with other sticky elements
- Scrolling behavior on different screen sizes
src/lib/pages/evm-contract-verify/components/EvmContractVerifyForms.tsx (1)
38-38
: LGTM!The addition of the
control
prop maintains consistency with other form components and ensures proper form state management.src/lib/pages/evm-contract-verify/types.ts (1)
59-59
: LGTM!The contract libraries schema implementation looks good and provides proper type safety.
src/lib/components/dropzone/index.tsx (1)
53-53
: LGTM! The size limit for Solidity files is appropriate.The addition of a 10MB size limit for
.sol
files is consistent with other file types and provides a reasonable constraint for Solidity contract files.src/lib/pages/evm-contract-verify/index.tsx (2)
34-35
: LGTM! New accordion components imported correctly.The imports for Hardhat and Foundry info accordions are properly structured.
62-63
: LGTM! Watch function properly includes the option field.The addition of 'option' to the watch destructuring is correct and follows React Hook Form patterns.
CHANGELOG.md (1)
42-42
: LGTM! Changelog entry is properly formatted.The changelog entry follows the established format and clearly describes the new feature.
Summary by CodeRabbit
New Features
Improvements