Main config forge#85
Conversation
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)
* 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>
Reviewer's GuideThis PR extends the main configuration by adding variant table support to the documentation writer, refactors the verification provider selection logic, standardizes comparison routines across modules, updates CI/workflow configurations and dependency versions, refines error messages, and scaffolds a new Counter example project with tests and scripts. Class diagram for BufWriter and new variant table supportclassDiagram
class BufWriter {
+try_write_variant_table(params: EnumDefinition, comments: Comments): fmt::Result
+try_write_properties_table(params, comments, heading)
+try_write_events_table(params, comments)
+write_bold(text)
+writeln()
+write_piped(text)
}
class EnumDefinition {
+values: Vec<EnumValue>
}
class Comments {
+include_tags(tags)
}
BufWriter --> EnumDefinition
BufWriter --> Comments
Class diagram for VerificationProviderType refactorclassDiagram
class VerificationProviderType {
+client(key: Option<&str>): Result<Box<dyn VerificationProvider>>
}
class VerificationProvider {
}
class EtherscanVerificationProvider {
}
VerificationProviderType --> VerificationProvider
VerificationProviderType --> EtherscanVerificationProvider
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Summary of ChangesHello @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 foundational structure for a new Foundry project, encompassing essential configuration files, CI/CD pipelines, and development environment settings. It also includes minor but important adjustments to the Rust codebase, focusing on numerical comparison safety, improved error reporting, and streamlined external service integration for contract verification and script simulation outputs. Highlights
Ignored Files
Using Gemini Code AssistThe 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
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 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
|
…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>
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
Blocking issues:
- An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. (link)
General comments:
- The new try_write_variant_table duplicates logic from the other table writers—consider extracting a shared helper to avoid code repetition and keep table rendering consistent.
- Hardcoding "ETH" for the estimated amount in simulate assumes Ethereum; you may want to reuse the dynamic chain symbol lookup or make the token symbol configurable for other chains.
- Several comparisons use partial_cmp().unwrap() (and unwrap_or for missing names) which can panic on None; prefer total_cmp for floats or explicitly handle the None case to ensure stable ordering and avoid runtime panics.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new try_write_variant_table duplicates logic from the other table writers—consider extracting a shared helper to avoid code repetition and keep table rendering consistent.
- Hardcoding "ETH" for the estimated amount in simulate assumes Ethereum; you may want to reuse the dynamic chain symbol lookup or make the token symbol configurable for other chains.
- Several comparisons use partial_cmp().unwrap() (and unwrap_or for missing names) which can panic on None; prefer total_cmp for floats or explicitly handle the None case to ensure stable ordering and avoid runtime panics.
## Individual Comments
### Comment 1
<location> `crates/doc/src/writer/buf_writer.rs:189-198` </location>
<code_context>
+ pub fn try_write_variant_table(
</code_context>
<issue_to_address>
**suggestion:** Consider handling cases where param_name is None more robustly.
If '<none>' is used as a placeholder, confirm that downstream code can process it correctly, or consider skipping these rows or adding more context.
Suggested implementation:
```rust
// There is nothing to write.
if comments.is_empty() {
return Ok(());
}
// Prepare rows for the variant table, handling None param_name robustly.
let mut rows = Vec::new();
for (param_name, comment) in comments.iter() {
match param_name {
Some(name) => {
rows.push((name.clone(), comment.clone()));
}
None => {
// Use "<none>" as a placeholder, or skip, or add more context.
// Here, we use "<none>" and add a note to the comment.
rows.push((
"<none>".to_string(),
format!("(No parameter name) {}", comment),
));
}
}
}
// If no rows, nothing to write.
if rows.is_empty() {
return Ok(());
}
// Write the table using the prepared rows.
self.write_variant_table_rows(&rows)
```
You will need to implement or adjust the `write_variant_table_rows` method to accept the new `rows` format (`Vec<(String, String)>`). If you already have a method for writing the table, update it to use the new `rows` variable instead of iterating directly over `comments`.
</issue_to_address>
### Comment 2
<location> `crates/doc/src/writer/buf_writer.rs:187` </location>
<code_context>
self.try_write_table(CommentTag::Param, params, comments, "Properties")
}
+ /// 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(
</code_context>
<issue_to_address>
**issue (complexity):** Consider refactoring both table-writing methods into a single, configurable renderer to avoid duplicated code and logic.
You can collapse both tables into one renderer by giving it a title, a list of headers, and a list of tags to include rather than duplicating the loop/boilerplate. e.g.:
```rust
// 1) Change `try_write_table` to accept `tags` and `headers`:
pub fn try_write_table(
&mut self,
tags: &[CommentTag],
params: &EnumDefinition,
comments: &Comments,
title: &str,
headers: &[&str],
) -> fmt::Result {
let comments = comments.include_tags(tags);
if comments.is_empty() {
return Ok(());
}
self.write_bold(title)?;
self.writeln()?;
// Header row
self.write_piped(&headers.join("|"))?;
// Separator row (same count as headers)
let sep = std::iter::repeat("---").take(headers.len()).join("|");
self.write_piped(&sep)?;
for value in ¶ms.values {
let name = value.as_ref().map(|v| v.name.clone());
let comment = name.as_ref().and_then(|n| {
comments.iter().find_map(|c| c.match_first_word(n))
});
let row = [
Markdown::Code(&name.unwrap_or_default()).as_doc()?,
comment.unwrap_or_default().replace('\n', " "),
];
self.write_piped(&row.join("|"))?;
}
self.writeln()
}
```
```rust
// 2) Now both callers become one-liners:
// Properties table (existing)
self.try_write_table(
&[CommentTag::Param],
params,
comments,
"Properties",
&["Name", "Type", "Description"],
)?;
// Variants table (new)
self.try_write_table(
&[CommentTag::Param, CommentTag::Custom("variant".into())],
params,
comments,
"Variants",
&["Variant", "Description"],
)?;
```
This removes the bespoke `try_write_variant_table`, keeps all functionality, and shares the same simple renderer.
</issue_to_address>
### Comment 3
<location> `counter/.github/workflows/test.yml:24` </location>
<code_context>
uses: foundry-rs/foundry-toolchain@v1
</code_context>
<issue_to_address>
**security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha):** An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
*Source: opengrep*
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request introduces a significant amount of configuration and template files, likely for a new forge project setup. It also includes several refactorings in the Rust codebase, such as improving error messages and changing float comparison logic. My review focuses on a critical issue in the float comparison change that could lead to a panic, and some improvements for the new Solidity test utility files to enhance readability and adhere to best practices.
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>
Pull request was closed
|
Deployment failed with the following error: |
Motivation
Solution
PR Checklist
Summary by Sourcery
Add documentation enhancements, refine provider and gas estimation logic, unify comparison methods, update dependencies and CI workflows, and scaffold a new counter example project with tests and issue templates
New Features:
Enhancements:
CI:
Documentation:
Tests: