Skip to content

update foundry verification#481

Open
ivegabr wants to merge 11 commits intomainfrom
chore/update-foundry-verification
Open

update foundry verification#481
ivegabr wants to merge 11 commits intomainfrom
chore/update-foundry-verification

Conversation

@ivegabr
Copy link
Collaborator

@ivegabr ivegabr commented Mar 13, 2026

Title

  • Update Contract verification using standard json input methof

Description

  • Purpose: fix wrong foundry CLI command
  • Context:
  • Changes:

Screenshots/GIFs

Testing

  • Verification: How did you test these changes? (e.g., ran yarn build or yarn check-links:external to check for broken internal / external links).
  • Output: Paste any relevant terminal output or local build logs.
  • Use N/A if not applicable.

Quality Checklist

  • Please confirm the following standards have been met:
  • Guidelines: I have read and followed the Contributing Guidelines.
  • Vale Linter: I have run vale locally and resolved all Rootstock.Robotics and style warnings using .cursorrules or style guide vale automation.
  • Rootstock Engineer Voice: I have removed AI-style "fluff" (e.g., unleash, delve into, testament to, ever-evolving landscape).
  • Structural Clarity: I have replaced em dashes (—) with commas or periods and ensured there are no stacked headings.
  • Code Quality: Technical comments are placed above the code line, not inline at the end.
  • Terminology: I am using rBTC (not Smart Bitcoin) and Rootstock (not RSK).

Refs

  • Related links to issues, tickets, or external discussions.

Copilot AI review requested due to automatic review settings March 13, 2026 13:58
@vercel
Copy link

vercel bot commented Mar 13, 2026

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

Project Deployment Actions Updated (UTC)
devportal-rootstock Ready Ready Preview, Comment Mar 13, 2026 3:29pm

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@github-actions
Copy link
Contributor

🔗 Broken Links/Anchors Found in en

The build found broken internal links or anchors.

🔗 Broken Links
- Broken link on source page path = /dev-tools/:
   -> linking to /resources/guides/superbridge/
⚓ Broken Anchors


How to fix:

  1. Check if the linked page exists
  2. Update the link to the correct URL
  3. If the page was moved, update to the new location
  4. If the page was deleted, remove the link
  5. For anchors, verify the heading ID exists on the target page

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Rootstock Explorer smart contract verification guide, focusing on correcting/modernizing the “Standard JSON input” instructions (especially for Foundry) and cleaning up Markdown formatting so steps and lists render consistently.

Changes:

  • Reformats multiple sections to fix indentation, list nesting, and spacing for better Markdown rendering.
  • Reworks the “Standard JSON input” verification method section and adds a Foundry command example.
  • Updates the Foundry verifier URL used for Rootstock Explorer verification.
Comments suppressed due to low confidence (1)

docs/02-developers/05-smart-contracts/04-verify-smart-contracts/rootstock-explorer.md:146

  • This snippet is JavaScript (Remix/web3) but the fenced code block is labeled as bash. Consider changing the fence to js for correct highlighting.
  ```bash
  web3.eth.abi.encodeParameters(
    ["address", "uint256"],

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 13, 2026 14:04
ivegabr and others added 3 commits March 13, 2026 15:05
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

🔗 Broken Links/Anchors Found in en

The build found broken internal links or anchors.

🔗 Broken Links
- Broken link on source page path = /dev-tools/:
   -> linking to /resources/guides/superbridge/
⚓ Broken Anchors


How to fix:

  1. Check if the linked page exists
  2. Update the link to the correct URL
  3. If the page was moved, update to the new location
  4. If the page was deleted, remove the link
  5. For anchors, verify the heading ID exists on the target page

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

🔗 Broken Links/Anchors Found in en

The build found broken internal links or anchors.

🔗 Broken Links
- Broken link on source page path = /dev-tools/:
   -> linking to /resources/guides/superbridge/
⚓ Broken Anchors


How to fix:

  1. Check if the linked page exists
  2. Update the link to the correct URL
  3. If the page was moved, update to the new location
  4. If the page was deleted, remove the link
  5. For anchors, verify the heading ID exists on the target page

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Rootstock Explorer smart contract verification guide to document Standard JSON Input verification (including a revised Foundry flow) and cleans up Markdown formatting so the steps render more consistently in the docs site.

Changes:

  • Reworks the “Standard JSON Input” section and adds a Foundry command example intended to output Standard JSON input to a file.
  • Fixes/normalizes Markdown spacing and list indentation across verification methods.
  • Updates the Foundry verifier URL example for Rootstock Explorer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 13, 2026 14:08
@github-actions
Copy link
Contributor

🔗 Broken Links/Anchors Found in en

The build found broken internal links or anchors.

🔗 Broken Links
- Broken link on source page path = /dev-tools/:
   -> linking to /resources/guides/superbridge/
⚓ Broken Anchors


How to fix:

  1. Check if the linked page exists
  2. Update the link to the correct URL
  3. If the page was moved, update to the new location
  4. If the page was deleted, remove the link
  5. For anchors, verify the heading ID exists on the target page

@github-actions
Copy link
Contributor

🔗 Broken Links/Anchors Found in en

The build found broken internal links or anchors.

🔗 Broken Links
- Broken link on source page path = /dev-tools/:
   -> linking to /resources/guides/superbridge/
⚓ Broken Anchors


How to fix:

  1. Check if the linked page exists
  2. Update the link to the correct URL
  3. If the page was moved, update to the new location
  4. If the page was deleted, remove the link
  5. For anchors, verify the heading ID exists on the target page

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

🔗 Broken Links/Anchors Found in en

The build found broken internal links or anchors.

🔗 Broken Links
- Broken link on source page path = /dev-tools/:
   -> linking to /resources/guides/superbridge/
⚓ Broken Anchors


How to fix:

  1. Check if the linked page exists
  2. Update the link to the correct URL
  3. If the page was moved, update to the new location
  4. If the page was deleted, remove the link
  5. For anchors, verify the heading ID exists on the target page

1 similar comment
@github-actions
Copy link
Contributor

🔗 Broken Links/Anchors Found in en

The build found broken internal links or anchors.

🔗 Broken Links
- Broken link on source page path = /dev-tools/:
   -> linking to /resources/guides/superbridge/
⚓ Broken Anchors


How to fix:

  1. Check if the linked page exists
  2. Update the link to the correct URL
  3. If the page was moved, update to the new location
  4. If the page was deleted, remove the link
  5. For anchors, verify the heading ID exists on the target page

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Rootstock Explorer smart-contract verification guide to correct the Foundry workflow for verification/Standard JSON input and to clean up formatting in the verification methods section.

Changes:

  • Reworks the “Standard JSON input” method to describe extracting the input object from Hardhat build-info and adds a Foundry command for printing Standard JSON input.
  • Updates the Foundry verification example (compiler version and verifier URL) for Rootstock Explorer.
  • Normalizes markdown spacing/indentation across lists, images, and sections.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@github-actions
Copy link
Contributor

🔗 Broken Links/Anchors Found in en

The build found broken internal links or anchors.

🔗 Broken Links
- Broken link on source page path = /dev-tools/:
   -> linking to /resources/guides/superbridge/
⚓ Broken Anchors


How to fix:

  1. Check if the linked page exists
  2. Update the link to the correct URL
  3. If the page was moved, update to the new location
  4. If the page was deleted, remove the link
  5. For anchors, verify the heading ID exists on the target page

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 13, 2026 14:14
@github-actions
Copy link
Contributor

🔗 Broken Links/Anchors Found in en

The build found broken internal links or anchors.

🔗 Broken Links
- Broken link on source page path = /dev-tools/:
   -> linking to /resources/guides/superbridge/
⚓ Broken Anchors


How to fix:

  1. Check if the linked page exists
  2. Update the link to the correct URL
  3. If the page was moved, update to the new location
  4. If the page was deleted, remove the link
  5. For anchors, verify the heading ID exists on the target page

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Rootstock Explorer smart-contract verification guide to use a more accurate Foundry workflow and improves formatting/readability of the verification steps.

Changes:

  • Refactors the “Standard JSON input” verification section, including updated guidance for generating the standard JSON input from Hardhat/Foundry.
  • Updates the Foundry verification example (compiler version and Rootstock Explorer verifier URL).
  • Normalizes markdown formatting (lists, spacing, image indentation, code block languages in some places).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@github-actions
Copy link
Contributor

🔗 Broken Links/Anchors Found in en

The build found broken internal links or anchors.

🔗 Broken Links
- Broken link on source page path = /dev-tools/:
   -> linking to /resources/guides/superbridge/
⚓ Broken Anchors


How to fix:

  1. Check if the linked page exists
  2. Update the link to the correct URL
  3. If the page was moved, update to the new location
  4. If the page was deleted, remove the link
  5. For anchors, verify the heading ID exists on the target page

@github-actions
Copy link
Contributor

🔗 Broken Links/Anchors Found in en

The build found broken internal links or anchors.

🔗 Broken Links
- Broken link on source page path = /dev-tools/:
   -> linking to /resources/guides/superbridge/
⚓ Broken Anchors


How to fix:

  1. Check if the linked page exists
  2. Update the link to the correct URL
  3. If the page was moved, update to the new location
  4. If the page was deleted, remove the link
  5. For anchors, verify the heading ID exists on the target page

@ivegabr ivegabr requested a review from owans March 16, 2026 13:09
@owans
Copy link
Collaborator

owans commented Mar 17, 2026

This documentation is a guide on verifying smart contracts using the Rootstock Explorer. The content is well-structured, covers various verification methods, and includes helpful screenshots. The tone is appropriate for technical documentation, using an imperative mood and active voice.

However, there are several areas for improvement concerning technical accuracy, clarity, completeness, and best practices for code examples. This review will address these points in detail for each section of the document, treating each listed "file" as a logical section within the single provided Markdown file.

Review: docs/02-developers/05-smart-contracts/04-verify-smart-contracts/rootstock-explorer.md (Overview and key reasons)

This first section introduces why contract verification matters and its benefits.

Clarity and completeness:

  • The introduction clearly explains why contract verification is important.
  • The "Key reasons for verifying a smart contract" list is clear and thorough. Each point explains a benefit well.

Grammar and style:

  • The language is clear, concise, and adheres to the requested imperative mood.
  • No significant grammatical errors were found.
  • The :::tip block is used correctly.

Recommendation:

  • No major changes are needed in this introductory section. It is a strong start.

Review: What does verification do?

This section describes what happens after successful contract verification on the Rootstock Explorer.

Clarity and completeness:

  • The three points are direct and easy to understand, providing a good overview of the practical benefits.
  • All listed points are accurate outcomes of verification.

Recommendation:

  • This section is concise and effective. No changes are suggested.

Review: Prerequisites

This section lists the requirements before a user can start verification.

Clarity and completeness:

  • The prerequisites are generally clear and accurate.

Missing prerequisites/clarity:

  • "Complete source code of the contract" could be more specific. For multi-file contracts, this means all source files, including imported ones. This is covered later but could be mentioned here.
  • Compiler details, such as the Solc (Solidity Compiler) version and the number of optimization runs, are important. It would help to suggest how users can usually find this information (for example, from their artifacts directory or hardhat.config.js/ts).

Recommendation:

  • For "Complete source code", add "(including all imported files for multi-file contracts)".
  • For "Compiler details", add guidance on where to find the Solc version and optimization runs (e.g., hardhat.config.js/ts or build artifacts).

Review: Getting started

This section shows users how to start the verification process on the Rootstock Explorer.

Clarity and completeness:

  • The instructions are straightforward and easy to follow.
  • The inclusion of both Testnet and Mainnet links is helpful.

Accessibility (alt text):

  • Images are used without explicit alt text in the Markdown (![init](/img/...)). While Docusaurus might generate some alt text from the filename, it is best practice to provide explicit, descriptive alt text for accessibility and SEO.

Technical accuracy:

  • The navigation steps and screenshots accurately reflect the Rootstock Explorer interface.

Recommendation:

  • Add descriptive alt text to the images.

Review: Choosing a verification method

This is the most detailed section, describing the five available verification methods.

1. Single file

This sub-section provides detailed instructions for single-file verification.

Code (ABI-ENCODING with Ethers.js):

  • The example is correct and uses modern ethers v6 syntax (AbiCoder.defaultAbiCoder()).
  • Dependency clarity: It would be good to mention the required ethers package version if there is any ambiguity.

Code (ABI-ENCODING from Remix):

  • The provided JavaScript snippet uses web3.eth.abi.encodeParameters.
  • Code execution results: The provided execution result shows ReferenceError: web3 is not defined. This is expected if web3 is not globally available (for example, in a standard Node.js environment without a web3.js instance). However, when running in Remix, web3 is globally available in the console. The execution environment for the web3.eth.abi.encodeParameters(...) review was outside Remix. The documentation implies it is run in Remix.
  • Correction: The Remix example is correct for Remix's console. The Code execution results block is misleading if it was not run in Remix. If it was run in a general JS environment, it confirms web3 is not defined there. The documentation implies it is run in Remix.

Code (ABI-ENCODING with Foundry (cast)):

  • The cast command is correct.

Docs (constructor arguments):

  • The explanation of constructor arguments is clear, distinguishing between comma-separated and ABI-encoded.
  • Clarity: The example constructor(address owner, uint256 maxSupply) shows the types and names. The corresponding input 0xACa52b1Ab7dA04532127d22D47Dc3d34CFe0Cd5e,1000 is correct.
  • The "How to encode arguments" sub-section is very helpful.

Accessibility (alt text):

  • Images are used without explicit alt text.

Recommendation for single file:

  • Accessibility: Add descriptive alt text to all images in this sub-section.
  • Code execution results clarification: For the Remix example, add a note: "Note: This command is intended to be run in the Remix IDE console, where web3 is globally available." This explains why ReferenceError might occur outside of Remix.
  • Dependency clarity: For the Ethers.js example, consider adding npm install ethers or yarn add ethers if it is not universally assumed.

2. Multiple files

This section accurately describes the process for multi-file contracts.

Clarity and completeness:

  • The "Important rules" are very clear and important for successful multi-file verification.
  • The instructions on how to provide source files (drag/drop, upload folder, combine) are helpful.

Accessibility (alt text):

  • The image lacks explicit alt text.

Recommendation for multiple files:

  • Accessibility: Add descriptive alt text to the image.

3. Standard JSON

This method is rightly recommended for complex projects.

Clarity and completeness:

  • The description and recommendations for Standard JSON are good.
  • The JSON structure example is very helpful for understanding the format.

Technical accuracy (Hardhat):

  • The command npx hardhat compile --show-stack-traces generates build-info files. The subsequent explanation on "How to Extract the Standard JSON Input" is important and correct. It correctly identifies the need to copy the input field.

Technical accuracy (Foundry):

  • The forge verify-contract command is correctly provided for generating the Standard JSON input.
  • The explanation of the placeholder variables is clear.

**Accessibility (alt text):

  • The image lacks explicit alt text.

Recommendation for Standard JSON:

  • Accessibility: Add descriptive alt text to the image.
  • Clarity: In the Hardhat section, emphasize that --show-stack-traces is not required for the JSON generation; npx hardhat compile generates the build-info by default (or the input field is within the artifact itself). --show-stack-traces is for debugging. The primary goal is npx hardhat compile. You could simplify to just npx hardhat compile and then elaborate on finding the build-info file.

4. Hardhat verification

This section provides a convenient method for Hardhat users.

Clarity and completeness:

  • The instructions are clear.
  • The snippet and command are well-structured.

Code:

  • The Hardhat configuration snippet correctly includes the etherscan field (used for explorer verification) and network configurations.
  • The verification command is accurate.

Environment assumptions:

  • It correctly points out the need for PRIVATE_KEY in the .env file.

Accessibility (alt text):

  • The image lacks explicit alt text.

Recommendation for Hardhat verification:

  • Accessibility: Add descriptive alt text to the image.
  • Dependency clarity: Mention npm install @nomicfoundation/hardhat-verify as it is a plugin that needs to be installed.

5. Foundry verification

This section details verification using Foundry.

Clarity and completeness:

  • The instructions and command are clear.

Code:

  • The forge verify-contract command is correct and specifically configured for Rootstock Explorer's Etherscan-compatible API.
  • The use of --verifier custom and --verifier-url is correct for targeting Blockscout explorers.

Accessibility (alt text):

  • No image in this section.

Recommendation for Foundry verification:

  • No changes are needed. This section is well-written and technically accurate.

Review: Submit and validate

This section describes the outcome of a successful verification.

Clarity and completeness:

  • The expected statuses and outcomes (Verified badge, source code tabs, ABI download, interaction panels) are clearly described and illustrated.

Accessibility (alt text):

  • Images are used without explicit alt text.

Technical accuracy:

  • All descriptions of the explorer's post-verification UI are accurate.

Recommendation:

  • Accessibility: Add descriptive alt text to all images in this section.

Review: Troubleshooting

This section provides common errors and solutions.

Clarity and completeness:

  • The Accordion component works well for presenting troubleshooting tips.
  • The issues covered are common and relevant.
  • The solutions are concise and actionable.

Technical accuracy:

  • The advice given for each troubleshooting point is technically sound.

Recommendation:

  • No significant changes are needed. This section is effective.

Review: Resources

This section links to related documentation.

Clarity and completeness:

  • The linked resources are relevant and provide further reading for specific verification methods.

Accessibility (descriptive links):

  • The links are descriptive ("Verify smart contracts using Blockscout or Hardhat Plugin") and not just "click here".

Recommendation:

  • No changes needed.

Consolidated summary of review areas:

Code:

  • Lint/style: Generally good. Code blocks are well-formatted.
  • Readability: Code examples are clear.
  • Missing imports or dependencies: Minor suggestions to clarify ethers installation and hardhat-verify plugin.
  • Unsafe patterns: Not applicable for documentation examples.
  • Example realism: Examples are realistic and directly applicable.
  • Dependency clarity: Mostly clear, with some room for improvement on explicit installation instructions.

Docs:

  • Step gaps: Generally few; instructions are comprehensive.
  • Unclear instructions: Mostly clear, with some suggestions for specificity (e.g., how to find compiler versions).
  • Missing prerequisites: Some suggestion to explicitly state how to find compiler details.
  • Inconsistent terminology: Terminology is consistent.
  • Tone/style violations: Adheres to the requested tone and style.
  • Version mismatches: Not identified; current versions seem to be used.

Tutorials:

  • Step ordering: The sequence of steps is logical and correct.
  • Command correctness: All commands are technically correct for their intended environments.
  • Environment assumptions: Assumptions are mostly stated (e.g., .env for private key).
  • Reproducibility risk: High for the web3.eth.abi.encodeParameters if not run in Remix; addressed in recommendations. Others are low risk given correct inputs.

Technical accuracy:

  • The documentation is largely technically accurate. The main point of contention was the execution context for the web3 example, which is technically correct within Remix but causes a ReferenceError outside of it. Other commands and explanations are sound.

Code execution results:

  • The ReferenceError: web3 is not defined is an expected outcome if the web3.eth.abi.encodeParameters snippet is run outside the Remix console (where web3 is globally available). The documentation implies it should be run in Remix, but this is not explicitly stated near the code. This needs clarification in the docs.

Grammar and style:

  • The grammar is consistently good, and the style aligns with technical documentation best practices.

Clarity and completeness:

  • The documentation is very clear and mostly complete. The main areas for improvement are adding alt text to images and clarifying the execution context for the web3 example.

STRUCTURED FINDINGS


💬 Comment posted via Revue - Documentation Review Tool

- `<compiler-version>` → the Solidity compiler version used to compile and deploy the contract (for example, `v0.8.28`).

- **Other Settings**: All other fields (compiler version, optimization, contract name, constructor arguments, libraries.) work exactly the same as described in the **Single File** Verification section.
> The `> <contract-name>.json` at the end of the command redirects the Standard JSON input output into a file in the current directory, which can then be uploaded as-is to the Rootstock Explorer verification tool.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> The `> <contract-name>.json` at the end of the command redirects the Standard JSON input output into a file in the current directory, which can then be uploaded as-is to the Rootstock Explorer verification tool.
> The `<contract-name>.json` at the end of the command redirects the Standard JSON input output into a file in the current directory, which can then be uploaded to the Rootstock Explorer verification tool.

Copy link
Collaborator Author

@ivegabr ivegabr Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the > symbol is intentional here, as its function is to append the result of a command to a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants