Skip to content

Forge/remix master - #124

Closed
Dargon789 wants to merge 72 commits into
Dargon789-patch-1from
forge/remix-master
Closed

Dargon789 wants to merge 72 commits into
Dargon789-patch-1from
forge/remix-master

Conversation

@Dargon789

@Dargon789 Dargon789 commented Oct 14, 2025 •

Copy link
Copy Markdown
Owner

Motivation

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Summary by Sourcery

Add variant table support in documentation, refine verification provider logic, unify comparison routines, standardize gas estimation output, expose new conversions, adjust dependencies, and introduce a new counter example project with tests and CI workflows.

New Features:

  • Render enum variant tables in generated documentation using try_write_variant_table

Enhancements:

  • Refactor VerificationProviderType selection to match on enum variants and enforce API key requirements
  • Replace total_cmp with partial_cmp in various sorting and comparison functions to avoid panics
  • Standardize estimated gas amount output to always use ETH and update redaction patterns accordingly
  • Implement From<Vec> for Comments and improve error message for conflicting restriction settings
  • Downgrade derive_more dependency from version 2.0 to 1.0 for compatibility

Build:

  • Downgrade actions/setup-python to v4 in GitHub CI workflow
  • Update derive_more version in Cargo.toml

CI:

  • Revise nextest workflow and add new GitHub Actions for CodeQL, Jekyll deployment, Docker image CI, APIsec scanning, and Forge-based CI for the counter example
  • Add CircleCI configuration and multiple issue templates for bug reports, feature requests, and custom issues

Documentation:

  • Add counter project README with Foundry overview and usage instructions

Tests:

  • Include remix test contracts and Forge tests for the new counter example project
  • Adjust test-utils redaction regex to match ETH output

Dargon789 and others added 30 commits October 12, 2024 01:59
     Locking 35 packages to latest compatible versions
    Updating alloy-dyn-abi v0.8.6 -> v0.8.7
    Updating alloy-json-abi v0.8.6 -> v0.8.7
    Updating alloy-primitives v0.8.6 -> v0.8.7
    Updating alloy-sol-macro v0.8.6 -> v0.8.7
    Updating alloy-sol-macro-expander v0.8.6 -> v0.8.7
    Updating alloy-sol-macro-input v0.8.6 -> v0.8.7
    Updating alloy-sol-type-parser v0.8.6 -> v0.8.7
    Updating alloy-sol-types v0.8.6 -> v0.8.7
    Updating async-compression v0.4.13 -> v0.4.14
    Updating aws-sdk-kms v1.46.0 -> v1.47.0
    Updating aws-sdk-sso v1.45.0 -> v1.46.0
    Updating aws-sdk-ssooidc v1.46.0 -> v1.47.0
    Updating aws-sdk-sts v1.45.0 -> v1.46.0
    Updating aws-smithy-runtime v1.7.1 -> v1.7.2
    Updating cc v1.1.28 -> v1.1.30
    Updating clap v4.5.19 -> v4.5.20
    Updating clap_builder v4.5.19 -> v4.5.20
    Updating clap_complete v4.5.32 -> v4.5.33
    Updating derive_builder v0.20.1 -> v0.20.2
    Updating derive_builder_core v0.20.1 -> v0.20.2
    Updating derive_builder_macro v0.20.1 -> v0.20.2
    Updating js-sys v0.3.70 -> v0.3.72
    Updating lru v0.12.4 -> v0.12.5
    Updating newtype-uuid v1.1.0 -> v1.1.2
    Updating proc-macro2 v1.0.86 -> v1.0.87
    Updating scc v2.2.0 -> v2.2.1
    Updating sdd v3.0.3 -> v3.0.4
    Updating syn-solidity v0.8.6 -> v0.8.7
    Updating wasm-bindgen v0.2.93 -> v0.2.95
    Updating wasm-bindgen-backend v0.2.93 -> v0.2.95
    Updating wasm-bindgen-futures v0.4.43 -> v0.4.45
    Updating wasm-bindgen-macro v0.2.93 -> v0.2.95
    Updating wasm-bindgen-macro-support v0.2.93 -> v0.2.95
    Updating wasm-bindgen-shared v0.2.93 -> v0.2.95
    Updating web-sys v0.3.70 -> v0.3.72
note: pass `--verbose` to see 10 unchanged dependencies behind latest
chore(deps): weekly `cargo update`
Signed-off-by: Legion's  <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: Legion's  <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Signed-off-by: Legion's  <64915515+Dargon789@users.noreply.github.com>
feat(forge): allow `--verifier custom` option (foundry-rs#9311)
Dargon789 and others added 18 commits March 9, 2025 18:58
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix deny.toml, ignore RUSTSEC-2025-0014 (foundry-rs#10052)

* fix deny.toml, ignore RUSTSEC-2025-0014

* roll back allow-git

* update derive_more to 2.0 (foundry-rs#9987)

* chore: fix ci, bump python setup version (foundry-rs#10054)

Bump gh python setup version

* feat(forge): match chain id with token symbol (foundry-rs#10043)

* feat: match chain id with token symbol

* fix: change symbol from matic to pol

* fix: use NameChain instead of manual mapping

* Fix tests, fmt and clippy

---------

Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Co-authored-by: grandizzy <grandizzy.the.egg@gmail.com>

* feat(cast): storage add --proxy to manually specify a proxy contract when Etherscan fails to find it (foundry-rs#10033)

* Adding a proxy parameter to the cast storage command, allowing manual selection of a proxy address to retrieve the full storage layout.

* Adding tests for the cast storage proxy optional argument.

* Using if let some else pattern.

* Improved documentation.

---------

Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>

* fix(forge): use etherscan verifier if key provided (foundry-rs#10058)

* fix(forge): use etherscan if key provided

* Changes after review: expose is_sourcify and is_etherscan fns

---------

Co-authored-by: gerald <3949379+getong@users.noreply.github.com>
Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Co-authored-by: supamongkonR <73258014+supamongkonR@users.noreply.github.com>
Co-authored-by: grandizzy <grandizzy.the.egg@gmail.com>
Co-authored-by: Cizeon <110527347+Cizeon@users.noreply.github.com>
* feat(forge): allow path in forge selectors upload (foundry-rs#10073)

* feat(forge): allow path in forge selectors upload

* Changes after review: reuse PathOrContractInfo

* feat: add `x86_64-musl` and `aarch64-musl` release targets (foundry-rs#9984)

* feat: add `x86_64` and `aarch64` musl targets

* feat: update nextest matrices

* try with aarch64 targets

* feat: define granular linux targets and restore `aarch64` one

* revert `matrices.py` file

* chore: reenable impersonate test (foundry-rs#10076)

* feat: solc 0.8.29 (foundry-rs#10078)

* feat: solc 0.8.29

* update match

---------

Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Co-authored-by: Giovanni Napoli <giovanni.napoli@aminagroup.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Bumps the cargo group with 1 update in the / directory: [zip](https://github.com/zip-rs/zip2).


Updates `zip` from 2.2.3 to 2.4.1
- [Release notes](https://github.com/zip-rs/zip2/releases)
- [Changelog](https://github.com/zip-rs/zip2/blob/master/CHANGELOG.md)
- [Commits](zip-rs/zip2@v2.2.3...v2.4.1)

---
updated-dependencies:
- dependency-name: zip
  dependency-type: indirect
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
@sourcery-ai

sourcery-ai Bot commented Oct 14, 2025 •

Copy link
Copy Markdown

Reviewer's Guide

This PR merges Forge/remix master by extending the documentation generator with variant tables, refactoring verification provider logic, standardizing comparisons via partial_cmp, and bundling a new Remix test suite along with multiple CI/workflow and sample project files.

Entity relationship diagram for Counter contract storage

erDiagram
    COUNTER {
      uint256 number
    }
Loading

Class diagram for new and updated Counter contract

classDiagram
    class Counter {
        +uint256 number
        +setNumber(newNumber uint256)
        +increment()
    }
Loading

Class diagram for BufWriter with new variant table method

classDiagram
    class BufWriter {
        +try_write_variant_table(params: EnumDefinition, comments: Comments)
        +try_write_table(...)
        +try_write_events_table(...)
        +write_bold(...)
        +writeln(...)
        +write_piped(...)
    }
Loading

Class diagram for VerificationProviderType logic refactor

classDiagram
    class VerificationProviderType {
        +client(key: Option<&str>) Result<Box<dyn VerificationProvider>>
    }
    VerificationProviderType <|-- EtherscanVerificationProvider
    VerificationProviderType <|-- SourcifyVerificationProvider
Loading

File-Level Changes

Change Details Files
Support rendering enum variant tables in docs
  • Declare variant table headers and separators
  • Implement try_write_variant_table in BufWriter
  • Filter and integrate custom variant comments in AsDoc
  • Add Comments conversion from Vec
crates/doc/src/writer/buf_writer.rs
crates/doc/src/writer/as_doc.rs
crates/doc/src/parser/comment.rs
Refactor verification provider selection
  • Use matches! to select Sourcify/Etherscan branches
  • Enforce API key presence for Etherscan
  • Remove legacy helper methods and streamline key checks
crates/verify/src/provider.rs
Standardize numeric comparisons and formatting
  • Replace total_cmp with partial_cmp and unwrap_or for sorts and comparisons
  • Update percentage comparison to use partial_cmp
  • Unify gas estimation output using a fixed token
  • Adjust regex redaction for ETH symbol
  • Bump derive_more version
crates/forge/src/cmd/snapshot.rs
crates/test-utils/src/util.rs
crates/cli/src/utils/suggestions.rs
crates/common/src/contracts.rs
crates/config/src/compilation.rs
crates/script/src/simulate.rs
Cargo.toml
Add Remix test suite, sample project, and CI/workflows
  • Include .deps/remix-tests solidity libraries with tests and accounts
  • Add CodeQL, Jekyll, Docker and CI pipeline workflows
  • Add counter sample project with Forge scripts, tests, and config
  • Introduce GitHub issue templates and CircleCI config
.deps/remix-tests/remix_tests.sol
.deps/remix-tests/remix_accounts.sol
.github/workflows/nextest.yml
.github/workflows/codeql.yml
.github/workflows/jekyll.yml
.github/workflows/docker-image.yml
.github/workflows/apisec-scan.yml
crates/forge/src/cmd/snapshot.rs
counter/**/*
.github/ISSUE_TEMPLATE/*
.circleci/config.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@vercel

vercel Bot commented Oct 14, 2025 •

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
next Ready Ready Preview Comment Oct 14, 2025 9:42pm
react Ready Ready Preview Comment Oct 14, 2025 9:42pm

@snyk-io

snyk-io Bot commented Oct 14, 2025

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @Dargon789, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes a new Foundry project structure within the repository, complete with essential development environment configurations and CI/CD pipelines. Concurrently, it refines existing Rust codebase components by addressing floating-point comparison safety, improving error reporting, and enhancing documentation generation capabilities. The changes also streamline script simulation outputs and clarify the process for selecting external verification providers.

Highlights

  • New Project Structure & Tooling Integration: This PR introduces a foundational setup for a Foundry-based project, including a complete counter/ directory with a sample Solidity contract, deployment script, and tests. It also integrates forge-std and openzeppelin-contracts as Git submodules, and adds remix-tests Solidity libraries for accounts and assertions.
  • CI/CD and Development Environment Setup: New configuration files for CircleCI (.circleci/config.yml), CodeSandbox (.codesandbox/tasks.json), and GitHub Actions (counter/.github/workflows/test.yml) have been added. The GitHub Actions workflow specifically sets up Foundry for building, formatting, and testing the new counter project.
  • Rust Codebase Refinements and Bug Fixes: Several Rust files across different crates have been updated. Key changes include enhancing floating-point comparisons for robustness, improving error messages, and refining documentation generation for enums to include dedicated variant tables. The derive_more dependency was also downgraded in Cargo.toml.
  • Streamlined Script Simulation and Verification Logic: The script simulation output now consistently displays 'ETH' for estimated amounts, removing dynamic token symbols. Additionally, the logic for selecting verification providers (Etherscan/Sourcify) has been refactored for clearer and more explicit handling of API key requirements.
Ignored Files
  • Ignored by pattern: .github/workflows/** (5)
    • .github/workflows/apisec-scan.yml
    • .github/workflows/codeql.yml
    • .github/workflows/docker-image.yml
    • .github/workflows/jekyll.yml
    • .github/workflows/nextest.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `crates/doc/src/writer/buf_writer.rs:189` </location>
<code_context>

+    /// Tries to write the variant table to the buffer.
+    /// Doesn't write anything if either params or comments are empty.
+    pub fn try_write_variant_table(
+        &mut self,
+        params: &EnumDefinition,
</code_context>

<issue_to_address>
**issue (complexity):** Consider extracting the repeated table-writing logic into a reusable helper to simplify and unify table rendering methods.

You’re introducing a lot of the same “write headers / write separator / join rows” logic that already lives in `try_write_table`. You can pull that out into a small helper and then your variant method becomes just “filter → map rows → call helper.” For example:

```rust
impl<'a> YourWriter<'a> {
    /// Writes any piped-table given a title, headers, and an iterator of row cells.
    fn write_piped_table<I>(
        &mut self,
        title: &str,
        headers: &[&str],
        rows: I,
    ) -> fmt::Result
    where
        I: IntoIterator<Item = Vec<String>>,
    {
        self.write_bold(title)?;
        self.writeln()?;
        // header row
        self.write_piped(&headers.join("|"))?;
        // separator row
        self.write_piped(&headers.iter().map(|_| "---").join("|"))?;
        // data rows
        for row in rows {
            self.write_piped(&row.join("|"))?;
        }
        self.writeln()
    }
}
```

Then collapse your `try_write_variant_table` to:

```rust
pub fn try_write_variant_table(
    &mut self,
    params: &EnumDefinition,
    comments: &Comments
) -> fmt::Result {
    let comments = comments.include_tags(&[CommentTag::Param, CommentTag::Custom("variant".into())]);
    if comments.is_empty() {
        return Ok(());
    }

    let rows = params.values.iter().map(|value| {
        let name = value.as_ref().map(|v| v.name.as_str()).unwrap_or("<none>");
        let comment = comments
            .iter()
            .find_map(|c| c.match_first_word(name))
            .unwrap_or_default()
            .replace('\n', " ");

        vec![
            Markdown::Code(name).as_doc().unwrap(),
            comment,
        ]
    });

    self.write_piped_table("Variants", &VARIANTS_TABLE_HEADERS, rows)
}
```

This preserves all behavior but removes ad-hoc joins, separators, and nesting—reusing one concise helper for every piped table.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread crates/doc/src/writer/buf_writer.rs

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a wide range of changes, including adding support for enum variant tables in documentation, refining verification provider logic, and adding a new counter example project. The changes are generally positive, improving functionality and code structure. However, I've identified a regression in how script execution costs are displayed, which now incorrectly hardcodes "ETH" as the currency for all chains, potentially misleading users. I've also suggested a refactoring for a new Solidity test utility to improve its clarity and style.

Comment thread crates/script/src/simulate.rs
Comment thread .deps/remix-tests/remix_accounts.sol
@Dargon789
Dargon789 enabled auto-merge (squash) October 14, 2025 22:39
@Dargon789 Dargon789 self-assigned this Oct 14, 2025

@Dargon789 Dargon789 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Forge/remix master#124

@Dargon789 Dargon789 closed this Oct 14, 2025
auto-merge was automatically disabled October 14, 2025 23:59

Pull request was closed

@Dargon789
Dargon789 deleted the forge/remix-master branch October 16, 2025 16:01

This branch was previously deployed

2 inactive deployments
Preview – react — 9c9343ad Deployed Oct 14, 2025 by vercel[bot]
Preview – next — 9c9343ad Deployed Oct 14, 2025 by vercel[bot]
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