-
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
feat: verify with third party framework #1198
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
WalkthroughThis pull request updates the EVM contract verification functionality by adding support for Hardhat and Foundry. It includes modifications to the Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (1)
🔇 Additional comments (4)
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 (
|
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: 1
🧹 Nitpick comments (2)
src/lib/pages/evm-contract-verify/components/solidity/EvmContractVerifySolidityFoundry.tsx (1)
25-32
: Consider improving the command string construction.The command string construction could be improved in the following ways:
- Add validation for empty or undefined values
- Consider escaping special characters in the inputs
- Add a placeholder or helper text for
[contractFile]:[contractName]
const cmd = useMemo(() => { + if (!rpc || !contractAddress) return ""; + const escapedRpc = rpc.replace(/['"]/g, '\\"'); return `forge verify-contract \\ - --rpc-url ${rpc} \\ + --rpc-url "${escapedRpc}" \\ --verifier custom \\ --verifier-url ${verifierUrl} \\ ${contractAddress} \\ - [contractFile]:[contractName]`; + <contractFile>:<contractName> # Replace with your contract file and name`; }, [rpc, contractAddress]);src/lib/pages/evm-contract-verify/helper.ts (1)
39-43
: Consider using a more type-safe approach for verification options.The current implementation could benefit from using a discriminated union type for the verification options to ensure type safety and better maintainability.
+ type VerificationFormOption = { + option: VerificationOptions; + }; + type VerificationForm = + | (VerificationFormOption & { + constructorArgs?: { enabled: boolean; value: string }; + optimizerConfig?: { enabled: boolean; runs: number }; + evmVersion?: string; + }) + | VerificationFormOption; case VerificationOptions.Hardhat: case VerificationOptions.Foundry: return { option: verificationOption, } as VerificationForm;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
CHANGELOG.md
(1 hunks)src/lib/pages/evm-contract-verify/components/solidity/EvmContractVerifySolidity.tsx
(1 hunks)src/lib/pages/evm-contract-verify/components/solidity/EvmContractVerifySolidityFoundry.tsx
(1 hunks)src/lib/pages/evm-contract-verify/helper.ts
(1 hunks)
🔇 Additional comments (2)
src/lib/pages/evm-contract-verify/components/solidity/EvmContractVerifySolidity.tsx (1)
33-33
: LGTM!The control prop is correctly passed to the EvmContractVerifySolidityFoundry component.
CHANGELOG.md (1)
42-42
: LGTM!The changelog entry is well-formatted and clearly describes the new feature.
src/lib/pages/evm-contract-verify/components/solidity/EvmContractVerifySolidityFoundry.tsx
Show resolved
Hide resolved
feat: verify with Hardhat
Fixes: FRO-757, 756
Summary by CodeRabbit
New Features
Improvements
Bug Fixes