Skip to content

Foundry/main - #594

Merged
Dargon789 merged 39 commits into
mainfrom
foundry/main
Jun 18, 2026
Merged

Foundry/main#594
Dargon789 merged 39 commits into
mainfrom
foundry/main

Conversation

@Dargon789

@Dargon789 Dargon789 commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Motivation

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Summary by Sourcery

Introduce new linting infrastructure and example counter project while tightening filesystem handling and adding extensive CI/CD and security scanning workflows.

New Features:

  • Add a generic linting framework with early AST-based lint passes for smart contract languages.
  • Add a sample counter Foundry project with contract, script, tests, and project configuration.
  • Include Remix-compatible Solidity testing helpers and assertion libraries as project dependencies.

Bug Fixes:

  • Harden temporary project cleanup and script file copying against path traversal and symlink-based directory escape issues.
  • Always run the preprocessed contract decode-internal-functions optimizer test by removing its feature gate.

Enhancements:

  • Add the alloy-hardforks workspace dependency to the Forge crate.
  • Provide a reusable lint context helper to emit diagnostics with configurable descriptions from lint passes.

Build:

  • Add multiple GitHub Actions workflows for building, testing, Docker image creation, deployment, CodeQL analysis, API security scans, and Snyk container scanning.
  • Add CircleCI configurations for Rust formatting, testing, and example web3/game-related jobs.

CI:

  • Set up dedicated CI workflows for the example counter project using Foundry tooling and for various Docker build and signing pipelines.

Documentation:

  • Add README and issue templates for bug reports, feature requests, and custom issues describing project usage and contribution expectations.

Tests:

  • Add unit and fuzz tests for the sample counter contract to validate basic behavior and integration with Forge.

dependabot Bot and others added 19 commits October 16, 2025 13:22
Bumps the cargo group with 2 updates in the / directory: [tracing-subscriber](https://github.com/tokio-rs/tracing) and [ammonia](https://github.com/rust-ammonia/ammonia).


Updates `tracing-subscriber` from 0.3.19 to 0.3.20
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](tokio-rs/tracing@tracing-subscriber-0.3.19...tracing-subscriber-0.3.20)

Updates `ammonia` from 4.1.0 to 4.1.2
- [Release notes](https://github.com/rust-ammonia/ammonia/releases)
- [Changelog](https://github.com/rust-ammonia/ammonia/blob/master/CHANGELOG.md)
- [Commits](rust-ammonia/ammonia@v4.1.0...v4.1.2)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  dependency-version: 0.3.20
  dependency-type: direct:production
  dependency-group: cargo
- dependency-name: ammonia
  dependency-version: 4.1.2
  dependency-type: indirect
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Dargon789 <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: Dargon789 <64915515+Dargon789@users.noreply.github.com>
Tidy up formatting in as_doc.rs by removing extraneous blank lines in the Document::as_doc implementation

Enhancements:

Remove unnecessary blank line before initializing bases
Remove unnecessary blank line before writing state variables
Signed-off-by: Dargon789 <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: Dargon789 <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: Dargon789 <64915515+Dargon789@users.noreply.github.com>
… (#500)

* chore(deps): bump softprops/action-gh-release from 2.6.1 to 3.0.0 (foundry-rs#14396)

* chore(deps): bump actions/cache from 5.0.4 to 5.0.5 (foundry-rs#14397)

* chore(deps): bump crate-ci/typos from 1.45.0 to 1.45.1 (foundry-rs#14398)

* fix(cast): add browser wallet support for erc20 commands (foundry-rs#14395)

* fix(cast): add browser wallet support for erc20 commands

Add a browser wallet branch to the erc20_send! macro so that
cast erc20 transfer/approve/mint/burn --browser works the same way
cast send --browser does.

The new path builds the transaction via the sol! IERC20 macro, applies
user-provided tx params, then fills missing nonce, fees, and gas limit
from the provider before handing the request to the browser wallet.

Closes foundry-rs#13103

Co-authored-by: John Chase <68833933+joohhnnn@users.noreply.github.com>

* fix(cast): default Tempo browser erc20 fee token

* fix(cast): scope Tempo erc20 browser auto-detection

* style(cast): format erc20 Tempo network helper

---------

Co-authored-by: John Chase <68833933+joohhnnn@users.noreply.github.com>

* feat(forge): browser wallet support for `create` subcommand (foundry-rs#14394)

* fix(deps): update rustls-webpki to fix RUSTSEC-2026-0104 (foundry-rs#14408)

chore: update rustls-webpki to fix RUSTSEC-2026-0104

Amp-Thread-ID: https://ampcode.com/threads/T-019db45a-2ee1-771d-8127-2052dc6df2a3

Co-authored-by: Amp <amp@ampcode.com>

* fix: accept 0x-prefixed value inputs (foundry-rs#14406)

* fix: accept 0x-prefixed value inputs

* use U256::from_str for 0x-prefixed hex parsing, add 0X support and expand tests

Amp-Thread-ID: https://ampcode.com/threads/T-019db45a-2ee1-771d-8127-2052dc6df2a3
Co-authored-by: Amp <amp@ampcode.com>

---------

Co-authored-by: zerosnacks <zerosnacks@protonmail.com>
Co-authored-by: Amp <amp@ampcode.com>

* ci(npm): use OIDC trusted publishing, remove NPM_TOKEN (foundry-rs#14249)

* chore: harden Makefile & CI (foundry-rs#14386)

chore: harden Makefile, remove unused deps found w/ cargo shear


Amp-Thread-ID: https://ampcode.com/threads/T-019daf55-1b0e-7756-8fff-4506e2e239c8

Co-authored-by: Amp <amp@ampcode.com>

* feat: use ChannelDb for channel persistence (foundry-rs#14355)

* feat: use mpp-rs ChannelDb for channel persistence

* use foundry-core

* rm blank line

* warn when old channels.json is found after SQLite migration

* rename Channel

---------

Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>

* feat: support console.table (foundry-rs#14338)

* feat(abi): add console.table variants to Console ABI

* feat(fmt): implement console_table_format

* feat(macros): extend ConsoleFmt derive for console.table

* feat(inspectors): push msg per line in hardhat_log

* chore: run cargo fmt

* chore: add todo comment

* refactor: use comfy-table for console_table_format

Amp-Thread-ID: https://ampcode.com/threads/T-019db45a-2ee1-771d-8127-2052dc6df2a3
Co-authored-by: Amp <amp@ampcode.com>

* refactor(macros): detect table structs by field types instead of name

Replace fragile name-based detection (`starts_with("table")`) with a
structural check: table call structs have all fields of type `Vec<T>`
(Solidity arrays), while regular `log` calls never use array parameters.

* refactor(macros): gate table detection on both name prefix and Vec fields

Combine the name-based check (`starts_with("table")`) with the
structural Vec<T> field check so both must hold. This prevents
accidental table rendering for unrelated structs that happen to
have all-Vec fields.

---------

Co-authored-by: zerosnacks <zerosnacks@protonmail.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Mablr <59505383+mablr@users.noreply.github.com>

* chore: bump `foundry-wallets` dep (foundry-rs#14409)

* chore: bump `foundry-wallets` dep + set `browser` & `tempo` features

* chore: set features

* fix(npm): add release environment for OIDC trusted publishing (foundry-rs#14411)

Add `environment: release` to both publish-arch and publish-meta jobs
to match the npm trusted publisher configuration on npmjs.com.

Without the environment claim in the OIDC token, the registry rejects
publishes with a misleading E404.

Also refreshes bun.lock to fix frozen-lockfile failures.

Amp-Thread-ID: https://ampcode.com/threads/T-019db4f4-ee94-735b-b75d-4f1bcbbb3041

Co-authored-by: Amp <amp@ampcode.com>

* fix(npm): remove deprecated `baseUrl` compiler option (foundry-rs#14413)

Amp-Thread-ID: https://ampcode.com/threads/T-019db557-8d02-7723-bfd6-68c4107b9433

Co-authored-by: Amp <amp@ampcode.com>

* chore: bump alloy 2.0.1 (foundry-rs#14417)

* fix(wallets): add gas limit margin to handle WebAuthn/P256 signing (foundry-rs#14416)

fix(wallets): add gas limit margin to handle WebAuthn/P256 signing

* fix(evm): sync gas params when updating executor spec (foundry-rs#14420)

* fix(evm): sync gas params when updating executor spec

* fix: make clippy happy

---------

Co-authored-by: Mablr <59505383+mablr@users.noreply.github.com>

* feat(lint): add incorrect ERC721 interface lint (foundry-rs#14412)

* fix(common): enable `foundry-wallets` browser/tempo feats (foundry-rs#14421)

* chore(tests): bump forge-std version (foundry-rs#14422)

chore: bump forge-std version used for tests

Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>

* fix(anvil-server): distinguish empty and notification batches (foundry-rs#14405)

Co-authored-by: Mablr <59505383+mablr@users.noreply.github.com>

* feat(anvil): add debug_traceBlockByHash and debug_traceBlockByNumber (foundry-rs#14391)

* feat(anvil): add `debug_traceBlockByHash` and `debug_traceBlockByNumber` RPC endpoints

Implement the two missing geth debug_ block tracing endpoints that
trace all transactions in a block at once, returning per-tx results.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: fmt

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Mablr <59505383+mablr@users.noreply.github.com>

* chore(foundryup): remove tempo fork support (foundry-rs#14324)

* chore: remove tempo fork support

Tempo is now fully upstream in the main Foundry repo, so the separate
network handling is no longer needed.

* Apply suggestion from @zerosnacks

Update Foundryup version

* warn when foundryup --network is ignored

* Update foundryup/foundryup

Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>

* Update foundryup/foundryup

Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>

---------

Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>

* fix(lint): add missing visit methods to LateLintVisitor (foundry-rs#14276)

* fix(lint): add missing visit methods to LateLintVisitor

* fix(lint): dispatch deprecated nested late lint hooks

* fix(lint): use by-value nested late lint hooks

* test(lint): cover late visitor hooks

---------

Co-authored-by: figtracer <me@figtracer.com>

* fix: remove `network: tempo` from Tempo template (foundry-rs#14424)

remove network: tempo from template

* feat(anvil): RPC methods for tempo's `TipFeeManager` in `anvil_*` namespace (foundry-rs#14414)

* feat(anvil): RPC methods for tempo's `TipFeeManager` in`anvil_*` namespace

* feat(anvil): add tests + mint TIP20 tokens to admin before adding FeeAMM liquidity

---------

Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>

* fix(anvil): separate queued txs in txpool RPC responses (foundry-rs#14425)

* refactor(cli): unify `NetworkVariant` with `NetworkConfigs` (foundry-rs#14426)

* refactor(cli): unify `NetworkVariant` with `NetworkConfigs`

* chore: clean-ups + tests

* fix: after fig's review

* fix: skip serialization if `network` is `None`

* chore: pin to foundry-wallets release (foundry-rs#14429)

pin to foundry-wallets release

* fix(config): respect custom Etherscan URL in cast/forge commands (foundry-rs#14319)

* fix(config): respect custom Etherscan URL in cast/forge commands

Amp-Thread-ID: https://ampcode.com/threads/T-019db9f9-01dd-729a-9f7a-ed150aabf130
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Gustavo Figueiredo <me@figtracer.com>

* fix lint

* fix clippy

* chore: update Cargo.lock

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019db9f9-01dd-729a-9f7a-ed150aabf130

* fix: update Cargo.lock from upstream base

Amp-Thread-ID: https://ampcode.com/threads/T-019db9f9-01dd-729a-9f7a-ed150aabf130
Co-authored-by: Amp <amp@ampcode.com>

---------

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Gustavo Figueiredo <me@figtracer.com>

* feat(common): add MPP WebSocket transport (foundry-rs#14404)

* feat(common): add MPP WebSocket transport

* docs

* use alloy's wsbakcend::from_socket

* use main repo

* remove patches

* bump rustls-webpki

* fix: only use `MppWsConnect` when MPP key is available

* fix: install default rustls crypto provider

* fix: clean imports

* fix: MPP known host check

* fix: MPP only if known endpoint && key available

---------

Co-authored-by: Mablr <59505383+mablr@users.noreply.github.com>

* fix(script): preserve exit reason in failed revert decode (foundry-rs#13985)

* fix(script): preserve exit reason in failed revert decode

* test(script): cover exit reason output in script failures

* fix(script): initialize exit_reason in ScriptResult default

---------

Co-authored-by: Mablr <59505383+mablr@users.noreply.github.com>

* fix(anvil): fix flaky test_increase_time_by_zero test (foundry-rs#14430)

Co-authored-by: Amp <amp@ampcode.com>

* feat(lint): add incorrect ERC20 interface lint (foundry-rs#14428)

* feat(lint): add incorrect ERC20 interface lint

* test(lint): cover direct-name IERC20 case

* fix(lint): revert IncorrectERC20Interface test to use empty IERC20 base

Expanding IERC20 with full function signatures caused solc compilation
failures (Error 4822: Overriding function return types differ) because
IERC20Incorrect inherits from IERC20 and overrides with incompatible
return types. Revert to the empty-base pattern used by IncorrectERC721Interface.

Amp-Thread-ID: https://ampcode.com/threads/T-019dbb72-89c7-740d-b6cf-b87a1509d3e3
Co-authored-by: Amp <amp@ampcode.com>

* test: clarify incorrect ERC20 interface fixtures

* test: align ERC20 fixture with ERC721

---------

Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>
Co-authored-by: Amp <amp@ampcode.com>

* fix(cheatcodes): reject nested debug trace recording (foundry-rs#14423)

* fix(cheatcodes): reject nested debug trace recording

* test(cheatcodes): restore RecordDebugTrace formatting

* chore: bump revm v38 (foundry-rs#14436)

* deps: bump tempo to TIP-1016 (rev 2e6e9d1)

Patches revm to bluealloy/revm@a1a1824 and op-revm to
foundry-rs/op-revm@66388e6 for the InitialAndFloorGas handler change.
Patches reth-core to paradigmxyz/reth-core@6b12498 for the
Bytecode::new_analyzed unsafe change.

Adds gas_limit() and state_gas_used() to AnvilStorageProvider to
satisfy the updated PrecompileStorageProvider trait.

Co-authored-by: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com>
Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d97c8-3033-770a-bd6c-714c2a8393d5

* fix: resolve CI failures from patched revm

- Replace deprecated OpCode::new_unchecked with new_or_unknown
- Add gas_refunded field to PrecompileOutput struct literals
- Allow foundry-rs/op-revm and paradigmxyz/reth-core git sources in deny.toml

Co-Authored-By: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com>
Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d97c8-3033-770a-bd6c-714c2a8393d5

* fix: align revm/op-revm/tempo revs with tip1016 branch

Updates patch revisions to match tempo/tip1016 HEAD:
- revm: a1a1824 → ea8d1f5
- op-revm: 66388e6 → 780b812
- tempo: 2e6e9d1 → 4092dfe

Fixes CreateInputs::new reservoir parameter for the new revm.

Co-Authored-By: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com>
Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d97c8-3033-770a-bd6c-714c2a8393d5

* fix: pin tempo to tip1016 HEAD (807b57c)

Tempo's [patch.crates-io] now includes all revm sub-crates, preventing
the invariant workflow's patch propagation from clobbering foundry's
patches.

Co-Authored-By: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com>
Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d97c8-3033-770a-bd6c-714c2a8393d5

* bump to later commit in https://github.com/tempoxyz/tempo/pull/2684/commits

* chore: bump revm 37→38, tempo crates to tip1016 head

- revm 37.0.0 → 38.0.0 (crates.io release, no more git patches)
- revm-inspectors 0.38.1 → 0.39.0
- alloy-evm 0.32.0 → 0.33.1
- tempo crates rev f873f0e → c095527 (tip1016 head)
- foundry-fork-db, op-revm, foundry-rs/optimism bumped via branches
- fix OpCode::new_or_unknown → new_unchecked (API change in revm 38)
- add missing Evm::cfg_env impl (new trait method in alloy-evm 0.33.1)

Co-Authored-By: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com>

* bump alloy-evm dep to 0.33.2

* chore: bump revm v38 using upstream OP

* fix: deny.toml

* fix(deps): merge conflict rustls

* style: drop cmnt

Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>

* fix: restore cargo-shear

---------

Co-authored-by: Derek Cofausper <256792747+decofe@users.noreply.github.com>
Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Co-authored-by: zerosnacks <zerosnacks@protonmail.com>
Co-authored-by: Federico Gimenez <federico.gimenez@gmail.com>
Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>

* chore: group dependabot updates by ecosystem (foundry-rs#14438)

Group minor and patch version updates per ecosystem into single PRs
to reduce PR noise. Major version bumps still get individual PRs for
careful review.

Before: up to 15 PRs/week (5 per ecosystem)
After: up to 6 PRs/week (1 grouped + 1 major per ecosystem, worst case)

Amp-Thread-ID: https://ampcode.com/threads/T-019dbe78-a376-7248-a549-6ddbe2c960d4

Co-authored-by: George Niculae <george@gxn3ql7y5j.tail388b2e.ts.net>
Co-authored-by: Amp <amp@ampcode.com>

* refactor(evm): remove useless OP EVM wrapper (foundry-rs#14440)

Co-authored-by: Copilot <copilot@github.com>

* chore(deps): bump the actions-weekly group with 4 updates (foundry-rs#14441)

Bumps the actions-weekly group with 4 updates: [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request), [github/codeql-action](https://github.com/github/codeql-action), [taiki-e/install-action](https://github.com/taiki-e/install-action) and [taiki-e/cache-cargo-install-action](https://github.com/taiki-e/cache-cargo-install-action).


Updates `peter-evans/create-pull-request` from 8.1.0 to 8.1.1
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](peter-evans/create-pull-request@c0f553f...5f6978f)

Updates `github/codeql-action` from 4.35.1 to 4.35.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@c10b806...95e58e9)

Updates `taiki-e/install-action` from 2.75.16 to 2.75.17
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](taiki-e/install-action@a2352fc...58e8625)

Updates `taiki-e/cache-cargo-install-action` from 3.0.5 to 3.0.6
- [Release notes](https://github.com/taiki-e/cache-cargo-install-action/releases)
- [Changelog](https://github.com/taiki-e/cache-cargo-install-action/blob/main/CHANGELOG.md)
- [Commits](taiki-e/cache-cargo-install-action@a8b9ecf...f9eed3e)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-version: 8.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-weekly
- dependency-name: github/codeql-action
  dependency-version: 4.35.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-weekly
- dependency-name: taiki-e/install-action
  dependency-version: 2.75.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-weekly
- dependency-name: taiki-e/cache-cargo-install-action
  dependency-version: 3.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-weekly
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(tests): update gas report snapshot after gas params sync fix (foundry-rs#14439)

The deployment cost for CounterWithFallback changed from 132471 to
132459 after foundry-rs#14420 started properly syncing gas parameters when
updating the executor spec via set_spec_id.

Amp-Thread-ID: https://ampcode.com/threads/T-019dbea7-a331-7269-80a8-b935a7bdaa49

Co-authored-by: Amp <amp@ampcode.com>

* feat: log broken invariant as soon as it is found (foundry-rs#14433)

* feat: log broken invariant as soon as it is found

* fix

* nest failure counts inside metrics

* chore: bump foundry-compilers to 0.20.0, foundry-block-explorers to 0.23.0, foundry-fork-db to 0.26.0 (foundry-rs#14443)

* chore: bump foundry-compilers to 0.20.0

Amp-Thread-ID: https://ampcode.com/threads/T-019dbf04-adac-755f-b685-5fa64d792acb
Co-authored-by: Amp <amp@ampcode.com>

* chore: bump foundry-compilers to 0.20.0, foundry-block-explorers to 0.23.0

Amp-Thread-ID: https://ampcode.com/threads/T-019dbf01-f2de-711e-8edf-581a979f9f0d
Co-authored-by: Amp <amp@ampcode.com>

* chore: bump foundry-fork-db to 0.26.0

Amp-Thread-ID: https://ampcode.com/threads/T-019dbf01-f2de-711e-8edf-581a979f9f0d
Co-authored-by: Amp <amp@ampcode.com>

* chore: enable zstd feature for foundry-fork-db

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dbf01-f2de-711e-8edf-581a979f9f0d

---------

Co-authored-by: Amp <amp@ampcode.com>

* chore: remove unmaintained devcontainer (foundry-rs#14449)

deprecate unmaintained devcontainer

* chore: update security contact email (foundry-rs#14450)

update link

* feat(lint): add block-timestamp lint (foundry-rs#14431)

* feat: add ignored_error_codes_from config option (foundry-rs#13841)

* chore(deny): remove deprecated repos from whitelist (foundry-rs#14455)

* chore(deps): bump rui314/setup-mold from 725a8794d15fc7563f59595bd9556495c0564878 to 9c9c13bf4c3f1adef0cc596abc155580bcb04444 (foundry-rs#14442)

chore(deps): bump rui314/setup-mold

Bumps [rui314/setup-mold](https://github.com/rui314/setup-mold) from 725a8794d15fc7563f59595bd9556495c0564878 to 9c9c13bf4c3f1adef0cc596abc155580bcb04444.
- [Commits](rui314/setup-mold@725a879...9c9c13b)

---
updated-dependencies:
- dependency-name: rui314/setup-mold
  dependency-version: 9c9c13bf4c3f1adef0cc596abc155580bcb04444
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update flake.lock (foundry-rs#14458)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(forge): adjust gas assertion `CounterWithFallback` (foundry-rs#14465)

* chore: update latest benchmarks (foundry-rs#14467)

* ci: split MPP e2e into its own workflow (foundry-rs#14468)

* ci: split MPP e2e into its own workflow

Move the MPP e2e step from ci-tempo.yml into a standalone ci-mpp.yml
workflow so transient HTTP 402 failures from the MPP RPC do not block
the Tempo CI workflow.

Amp-Thread-ID: https://ampcode.com/threads/T-019dceb8-61e5-734f-b047-17665b4ea7d3
Co-authored-by: Amp <amp@ampcode.com>

* ci: rename sanity-check job to tempo-check

Amp-Thread-ID: https://ampcode.com/threads/T-019dceb8-61e5-734f-b047-17665b4ea7d3
Co-authored-by: Amp <amp@ampcode.com>

* ci: rename mpp-e2e job to mpp-check

Amp-Thread-ID: https://ampcode.com/threads/T-019dceb8-61e5-734f-b047-17665b4ea7d3
Co-authored-by: Amp <amp@ampcode.com>

---------

Co-authored-by: Amp <amp@ampcode.com>

* Improve GH actions (foundry-rs#14473)

* fix(benches): add repos + extra args support to prevent blocking errors (foundry-rs#14470)

* fix(benches): add repos + extra args support to prevent blocking errors

* fix(ci): set `inputs.repos` default to empty

* fix: remove `--verbose` flags

* fix: exclude `uniswap/v4-core` `TickMathTestTest`

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: figtracer <me@figtracer.com>
Co-authored-by: John Chase <68833933+joohhnnn@users.noreply.github.com>
Co-authored-by: Mablr <59505383+mablr@users.noreply.github.com>
Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: zerosnacks <zerosnacks@protonmail.com>
Co-authored-by: Derek Cofausper <256792747+decofe@users.noreply.github.com>
Co-authored-by: stevencartavia <112043913+stevencartavia@users.noreply.github.com>
Co-authored-by: Nuno David <74260683+ndavd@users.noreply.github.com>
Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Co-authored-by: Louis Peter Sitoe <defiwarlockdefiwolok@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: MD Islam <mdislamwork@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: mk0walsk <mateuszkowalskiiiiiq@gmail.com>
Co-authored-by: Suuuuuuperrrrr fred <FredrikaPhililip@proton.me>
Co-authored-by: Arsh <arshdeep.ssingh777@gmail.com>
Co-authored-by: Perico Perica <pericc.periccca@gmail.com>
Co-authored-by: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com>
Co-authored-by: Federico Gimenez <federico.gimenez@gmail.com>
Co-authored-by: George Niculae <george@gxn3ql7y5j.tail388b2e.ts.net>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@codesandbox

codesandbox Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@sourcery-ai

sourcery-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds security-hardened file handling in benchmarks and test utilities, introduces a generic linting abstraction over the Solar AST, adjusts forge dependencies/tests, and brings in a large set of CI/workflow, issue-template, and example counter project artifacts (including Remix test libs) into the repo.

File-Level Changes

Change Details Files
Harden temporary project and script file handling against path traversal and unsafe deletions.
  • BenchmarkProject cleanup now canonicalizes entries, verifies they remain under the temp root, logs and skips suspicious paths, and deletes via canonical paths.
  • ScriptTester copy logic now rejects filenames with traversal or separator characters and skips files whose canonical paths escape the source directory.
benches/src/lib.rs
crates/test-utils/src/script.rs
Introduce a generic linting framework over Solar AST to support language-agnostic lints.
  • Define a Linter trait parameterized by language and lint type, plus a Lint trait describing id, severity, description, and help.
  • Add LintContext to simplify emitting diagnostics via solar_interface with optional descriptions.
  • Define EarlyLintPass and EarlyLintVisitor that hook into solar_ast::visit::Visit to run lint passes over expressions, structs, functions, and variable definitions.
crates/lint/src/linter.rs
Adjust forge crate dependencies and tests for new functionality.
  • Add alloy-hardforks as a workspace dependency to forge.
  • Enable preprocess_contract_with_decode_internal test unconditionally by removing the isolate-by-default cfg gate.
crates/forge/Cargo.toml
crates/forge/tests/cli/test_optimizer.rs
Vendor Remix testing helpers into a .deps directory for Solidity-based tests.
  • Add Remix-style Assert library for rich assertion events across multiple Solidity types.
  • Add TestsAccounts helper library with a fixed set of test account addresses.
.deps/remix-tests/remix_tests.sol
.deps/remix-tests/remix_accounts.sol
Add a sample Foundry counter project (with config, contracts, script, tests, and README).
  • Introduce a minimal Counter contract with setNumber and increment methods.
  • Add Forge script and tests for deploying and exercising Counter, plus Foundry config, gitignore, and library submodules.
  • Document basic Foundry usage in a dedicated counter/README.md.
counter/src/Counter.sol
counter/script/Counter.s.sol
counter/test/Counter.t.sol
counter/foundry.toml
counter/README.md
counter/.gitignore
counter/lib/forge-std
counter/lib/openzeppelin-contracts
Introduce multiple CI pipelines and security scanning workflows for Docker, GKE deploys, Snyk, CodeQL, APIsec, and CircleCI.
  • Add GitHub Actions workflows for Docker builds, container publishing, GKE deploy, CodeQL analysis, Snyk container scans, APIsec scans, and Foundry counter project CI.
  • Add several CircleCI configs covering generic jobs, Rust build/test flows, and custom web3/gamefi-oriented executors.
  • Add a basic deploy workflow that builds/tests with cargo and then builds a Docker image.
.github/workflows/docker.yml
.github/workflows/docker-image.yml
.github/workflows/google.yml
.github/workflows/codeql.yml
.github/workflows/snyk-container.yml
.github/workflows/apisec-scan.yml
.github/workflows/deploy.yml
counter/.github/workflows/test.yml
.circleci/config.yml
.circleci/ci.yml
.circleci/cargo.yml
.circleci/ci_cargo.yml
.circleci/ci-web3-gamefi.yml
.circleci/web3_defi_gamefi.yml
Add standard GitHub issue templates to streamline bug reports and feature requests.
  • Provide structured bug report template capturing environment and reproduction steps.
  • Provide feature request template and a placeholder custom template.
.github/ISSUE_TEMPLATE/bug_report.md
.github/ISSUE_TEMPLATE/feature_request.md
.github/ISSUE_TEMPLATE/custom.md
Introduce various repo metadata and placeholder files for tooling integration.
  • Add empty or placeholder files for CodeSandbox tasks, git submodules, and other tooling hooks.
.codesandbox/tasks.json
.gitmodules

Possibly linked issues


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 Jun 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
next Canceled Canceled Jun 18, 2026 11:03am
react Canceled Canceled Jun 18, 2026 11:03am

@snyk-io

snyk-io Bot commented Jun 16, 2026

Copy link
Copy Markdown

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

Status Scan Engine 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 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 several new CircleCI workflows, GitHub issue templates, a counter project, and a new linter framework. It also implements path canonicalization and validation in benchmark cleanup and test-utils scripts to prevent directory traversal. Feedback highlights potential issues with path prefix checks on systems with symlinks due to uncanonicalized base paths, redundant duplicate steps in CircleCI configurations, hardcoded user fork URLs in CI files, and an unused import in suggestions.rs that could trigger compiler warnings.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread benches/src/lib.rs Outdated
Comment thread crates/test-utils/src/script.rs
Comment thread .circleci/cargo.yml
Comment thread .circleci/ci.yml
Comment thread .circleci/ci_cargo.yml
Comment thread .circleci/ci-web3-gamefi.yml
Comment thread .circleci/web3_defi_gamefi.yml
Comment thread crates/cli/src/utils/suggestions.rs

@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 - I've found 8 issues, and left some high level feedback:

  • The .github/workflows/docker.yml workflow is syntactically invalid (e.g., runs-on and permissions are outside the build job and there is a stray jobs.build block at the top); please restructure it so each job has the expected runs-on and steps keys in the right place.
  • In .github/workflows/google.yml, the branch filters are written as "main" / "master" (with embedded quotes), which will not match actual branch names; these should be plain main / master strings.
  • There are multiple overlapping CI configs (several CircleCI files plus several Docker-related GitHub Actions workflows) that appear redundant or sample-based; consider consolidating or removing unused ones to avoid confusion and maintenance overhead.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `.github/workflows/docker.yml` workflow is syntactically invalid (e.g., `runs-on` and `permissions` are outside the `build` job and there is a stray `jobs.build` block at the top); please restructure it so each job has the expected `runs-on` and `steps` keys in the right place.
- In `.github/workflows/google.yml`, the branch filters are written as `"main"` / `"master"` (with embedded quotes), which will not match actual branch names; these should be plain `main` / `master` strings.
- There are multiple overlapping CI configs (several CircleCI files plus several Docker-related GitHub Actions workflows) that appear redundant or sample-based; consider consolidating or removing unused ones to avoid confusion and maintenance overhead.

## Individual Comments

### Comment 1
<location path="crates/lint/src/linter.rs" line_range="47-48" />
<code_context>
+        Self { sess, desc: with_description }
+    }
+
+    // Helper method to emit diagnostics easily from passes
+    pub fn emit<L: Lint>(&self, lint: &'static L, span: Span) {
+        let desc = if self.desc { lint.description() } else { "" };
+        let diag: DiagBuilder<'_, ()> = self
</code_context>
<issue_to_address>
**suggestion:** Requiring `&'static L` in `emit` makes it hard to use non-static lint instances.

Taking `lint: &'static L` unnecessarily requires all lints to be `'static`, so you can’t use lints created per run or that hold non-static configuration. Using `&L` instead (with the caller responsible for the lifetime) keeps the same safety for this call while making the API usable with more lint implementations.

```suggestion
    // Helper method to emit diagnostics easily from passes
    pub fn emit<L: Lint>(&self, lint: &L, span: Span) {
```
</issue_to_address>

### Comment 2
<location path="crates/lint/src/linter.rs" line_range="62-63" />
<code_context>
+    }
+}
+
+/// Trait for lints that operate directly on the AST.
+/// Its methods mirror `solar_ast::visit::Visit`, with the addition of `LintCotext`.
+pub trait EarlyLintPass<'ast>: Send + Sync {
+    fn check_expr(&mut self, _ctx: &LintContext<'_>, _expr: &'ast Expr<'ast>) {}
</code_context>
<issue_to_address>
**nitpick (typo):** Typo in `LintCotext` may cause confusion.

This should be `LintContext`. Even minor typos in type names can hinder searching and make the docs harder to scan.

```suggestion
/// Trait for lints that operate directly on the AST.
/// Its methods mirror `solar_ast::visit::Visit`, with the addition of `LintContext`.
```
</issue_to_address>

### Comment 3
<location path=".github/workflows/google.yml" line_range="105-107" />
<code_context>
+          docker push "${DOCKER_TAG}"
+
+      # Set up kustomize
+      - name: 'Set up Kustomize'
+        run: |-
+          curl -sfLo kustomize https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.4.3/kustomize_v5.4.3_linux_amd64.tar.gz
+          chmod u+x ./kustomize
+
</code_context>
<issue_to_address>
**issue (bug_risk):** Kustomize is downloaded as a tar.gz but never extracted, so the binary is not usable.

The `curl -sfLo kustomize …tar.gz` command saves the compressed tarball as `kustomize` and then marks that tarball as executable, so `./kustomize` will fail. Instead, stream and extract the archive, then chmod the resulting binary, for example:

```bash
curl -sL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.4.3/kustomize_v5.4.3_linux_amd64.tar.gz \
  | tar xz
chmod u+x ./kustomize
```
</issue_to_address>

### Comment 4
<location path=".github/workflows/docker.yml" line_range="25-26" />
<code_context>
+version: 2.1
+#
+jobs:
+  build-and-test:
+    docker:
</code_context>
<issue_to_address>
**issue (bug_risk):** Workflow YAML structure is invalid: job `build` is missing `runs-on` and `steps` nesting is broken.

Here, `jobs.build` starts directly with a list item (e.g. `- name: Build the Docker image`) instead of defining `runs-on` and then a `steps:` list, and `runs-on` is indented as a sibling of `build`, making the YAML invalid and preventing the workflow from running. Please restructure to something like:

```yaml
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Build the Docker image
        run: docker build …
      # other steps…
```
</issue_to_address>

### Comment 5
<location path=".github/workflows/deploy.yml" line_range="26-27" />
<code_context>
+      - name: Run tests
+        run: cargo test
+
+      - name: Docker build
+        run: docker build -t foundryg-rs
</code_context>
<issue_to_address>
**issue (bug_risk):** Docker build command is missing a build context (`.`), which will cause it to fail.

The `docker build` command needs a context argument or it will fail (`"docker build" requires exactly 1 argument`). If you’re building from the repo root, update to:

```yaml
run: docker build -t foundryg-rs .
```
</issue_to_address>

### Comment 6
<location path=".circleci/ci_cargo.yml" line_range="13-18" />
<code_context>
+          keys:
+            - v1-cargo-{{ checksum "Cargo.lock" }}
+            - v1-cargo-
+      - run:
+          name: "Check formatting"
+          command: cargo fmt -- --check
+      - run:
+          name: "Run tests"
+          command: cargo test
+      - save_cache:
+          key: v1-cargo-{{ checksum "Cargo.lock" }}
</code_context>
<issue_to_address>
**suggestion (performance):** Formatting and test steps are duplicated, doubling CI time without added benefit.

`cargo fmt -- --check` and `cargo test` are run twice in this job. Unless there’s a specific need for duplication, please remove the extra pair of steps to reduce CI time and resource usage while preserving behavior.
</issue_to_address>

### Comment 7
<location path="crates/test-utils/src/script.rs" line_range="126-132" />
<code_context>
         for entry in fs::read_dir(&from_dir)? {
             let file = &entry?.path();
             let name = file.file_name().unwrap();
+            // Validate file name to avoid path traversal and absolute paths
+            let name_str = name.to_string_lossy();
+            if name_str.contains("..") || name_str.contains("/") || name_str.contains("\\") {
+                // Skip invalid (potentially dangerous) file names
+                continue;
+            }
+            // Optionally verify canonicalized file is in from_dir to avoid symlink traversal
+            if let Ok(canonical_file) = file.canonicalize() {
+                if !canonical_file.starts_with(&from_dir) {
</code_context>
<issue_to_address>
**suggestion (testing):** Add tests for the new filename validation and symlink traversal checks in `ScriptTester`.

The new validation and symlink checks should be covered so changes don’t silently alter `ScriptTester` behavior. Please add tests that:

- Verify normal filenames (no `..`, `/`, `\`) are still copied.
- Verify filenames containing `..`, `/`, or `\` are skipped.
- Verify that when `canonicalize()` succeeds but the path escapes `from_dir` (e.g., via symlink), the file is skipped.
- Optionally, verify that a `canonicalize()` failure skips the entry without panicking.

This will lock in the security guarantees and clarify the intended behavior for consumers of `ScriptTester`.

Suggested implementation:

```rust
            // Verify canonicalized file is in from_dir to avoid symlink traversal.
            // If canonicalization fails (e.g. a broken symlink), skip the entry as well.
            match file.canonicalize() {
                Ok(canonical_file) => {
                    if !canonical_file.starts_with(&from_dir) {
                        // Skip files that resolve outside the source directory (symlink traversal).
                        continue;
                    }
                }
                Err(_) => {
                    // Skip entries we cannot canonicalize; treat them as unsafe.
                    continue;
                }
            }

```

You’ll also need to add tests around the `ScriptTester` code that uses this loop. Since I don’t see the rest of `script.rs`, you’ll need to adapt the examples to the actual API (e.g. the real method name on `ScriptTester` that triggers this copy logic). Below is a concrete outline you can drop into the existing `#[cfg(test)] mod tests` in `crates/test-utils/src/script.rs`:

1. **Helpers and imports**

Inside `mod tests`, make sure you have:

```rust
use super::*;
use std::fs;
use std::io::Write;
use std::path::Path;
use tempfile::tempdir;

// Helper to create a file with given content
fn write_file(dir: &Path, name: &str, contents: &str) {
    let path = dir.join(name);
    let mut f = fs::File::create(&path).unwrap();
    write!(f, "{}", contents).unwrap();
}
```

Adjust imports to match how `tempfile` or any temp-dir helper is already used elsewhere in your tests.

2. **Test: normal filenames are copied**

Assuming the copy logic is in a function like `copy_scripts(from_dir: &Path, to_dir: &Path) -> anyhow::Result<()>`
or a `ScriptTester` method like `tester.copy_scripts(&from_dir, &to_dir)`:

```rust
#[test]
fn copies_normal_filenames() {
    let from = tempdir().unwrap();
    let to = tempdir().unwrap();

    write_file(from.path(), "normal.txt", "ok");

    // Call into the real production function here:
    // copy_scripts(from.path(), to.path()).unwrap();
    // or:
    // let tester = ScriptTester::new(/* ... */);
    // tester.copy_scripts(from.path(), to.path()).unwrap();

    let copied = to.path().join("normal.txt");
    assert!(copied.exists(), "normal filename should be copied");
}
```

Replace the commented call with the actual `ScriptTester` API you have.

3. **Test: filenames containing `..`, `/`, or `\\` are skipped**

On Unix, you can create filenames containing `..` and `\\` directly; `/` is not allowed in a single filename, so for `/` you either:
- assert current behaviour only for `..` and `\\`, or
- create a subdirectory and assert that because only the basename is checked, it behaves as expected (if that’s what you want to lock in).

Example that locks in `..` and `\\` behaviour:

```rust
#[test]
fn skips_filenames_with_disallowed_components() {
    let from = tempdir().unwrap();
    let to = tempdir().unwrap();

    // This file name literally contains ".."
    write_file(from.path(), "..bad", "x");
    // This file name literally contains a backslash; on Unix it's just part of the name.
    write_file(from.path(), "evil\\file", "x");
    // Control file that should be copied
    write_file(from.path(), "good.txt", "ok");

    // Call into production copy logic
    // copy_scripts(from.path(), to.path()).unwrap();

    assert!(to.path().join("good.txt").exists(), "good.txt should be copied");
    assert!(!to.path().join("..bad").exists(), "..bad should be skipped");
    assert!(
        !to.path().join("evil\\file").exists(),
        "filenames containing backslash should be skipped"
    );
}
```

If you do want to test `/` explicitly on Windows, wrap that test in `#[cfg(windows)]` and create a name like `"dir/evil"` as appropriate for how your code is currently constructing `PathBuf`s.

4. **Test: symlink that escapes `from_dir` is skipped**

On Unix, you can use `std::os::unix::fs::symlink`:

```rust
#[cfg(unix)]
#[test]
fn skips_symlink_that_escapes_from_dir() {
    use std::os::unix::fs::symlink;

    let from = tempdir().unwrap();
    let to = tempdir().unwrap();
    let outside = tempdir().unwrap();

    // Real file outside from_dir
    write_file(outside.path(), "outside.txt", "secret");

    // Symlink inside from_dir pointing outside
    let link_path = from.path().join("link_to_outside");
    symlink(outside.path().join("outside.txt"), &link_path).unwrap();

    // Control file that should be copied
    write_file(from.path(), "inside.txt", "ok");

    // Call into production copy logic
    // copy_scripts(from.path(), to.path()).unwrap();

    assert!(to.path().join("inside.txt").exists(), "inside file should be copied");
    assert!(
        !to.path().join("link_to_outside").exists(),
        "symlink escaping from_dir should be skipped"
    );
}
```

On Windows, you can use `std::os::windows::fs::symlink_file` in a similar `#[cfg(windows)]` test.

5. **Test: canonicalize failure skips the entry**

Now that the code treats `canonicalize()` errors as “unsafe” and skips them, you can use a broken symlink to trigger a failure:

```rust
#[cfg(unix)]
#[test]
fn skips_entries_when_canonicalize_fails() {
    use std::os::unix::fs::symlink;

    let from = tempdir().unwrap();
    let to = tempdir().unwrap();

    // Broken symlink – target does not exist, so canonicalize() will fail.
    let broken_link = from.path().join("broken");
    symlink(from.path().join("nonexistent_target"), &broken_link).unwrap();

    // Control file that should be copied
    write_file(from.path(), "inside.txt", "ok");

    // Call into production copy logic
    // copy_scripts(from.path(), to.path()).unwrap();

    assert!(to.path().join("inside.txt").exists(), "inside file should be copied");
    assert!(
        !to.path().join("broken").exists(),
        "broken symlink should be skipped when canonicalize fails"
    );
}
```

If you want Windows coverage, add the analogous `#[cfg(windows)]` version that uses `std::os::windows::fs::symlink_file`.

**Important integration steps:**
- Replace the commented `copy_scripts(...)` / `ScriptTester::...` calls with the real function/method that runs the `for entry in fs::read_dir(&from_dir)?` loop you showed.
- If `ScriptTester` wraps temp directories internally, you may need to expose a helper (e.g., `fn copy_from_to(from: &Path, to: &Path)`) that the tests can call or create a `ScriptTester` instance in each test and drive it in the same way your existing tests do.
- Ensure `tempfile` is available in `[dev-dependencies]` of your crate, or re-use any existing temp-dir utility already used in `script.rs` tests.

These tests will lock in:
- copying of normal filenames,
- skipping of filenames with `..` or `\\`,
- skipping of symlinks that escape `from_dir`, and
- skipping entries where `canonicalize()` fails, without panicking.
</issue_to_address>

### Comment 8
<location path=".github/ISSUE_TEMPLATE/bug_report.md" line_range="27" />
<code_context>
+
+**Desktop (please complete the following information):**
+ - OS: [e.g. iOS]
+ - Browser [e.g. Chrome, safari]
+ - Version [e.g. 22]
+
</code_context>
<issue_to_address>
**suggestion (typo):** Capitalize "Safari" to match the proper noun and keep consistency with other occurrences.

Here, update `safari` to `Safari` as well.

```suggestion
 - OS: [e.g. iOS]
 - Browser [e.g. Chrome, Safari]
```
</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/lint/src/linter.rs Outdated
Comment thread crates/lint/src/linter.rs Outdated
Comment thread .github/workflows/google.yml
Comment thread .github/workflows/docker.yml
Comment thread .github/workflows/deploy.yml
Comment thread .circleci/ci_cargo.yml
Comment thread crates/test-utils/src/script.rs
Comment thread .github/ISSUE_TEMPLATE/bug_report.md
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
@Dargon789 Dargon789 added documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request dependencies Pull requests that update a dependency file rust Pull requests that update rust code github_actions Pull requests that update GitHub Actions code labels Jun 16, 2026
figtracer and others added 15 commits June 16, 2026 09:20
* fix(debugger): identify forked script contracts

* fix(debugger): gate script debug bytecodes
test: clarify expect emit failure assertions
…oundry-rs#13923)

* fix(chisel): remove unused `latest` variable in next_cached_session

* update

---------

Co-authored-by: figtracer <me@figtracer.com>
* feat(fuzz): update invariant pulse metrics

* fix: according fig's review
…ubmission (foundry-rs#15210)

This is for consistency with the Etherscan submission which also shows a URL to a web interface. The Sourcify server provides a redirect URL for this purpose, because the UI lives on a different base URL.

Co-authored-by: Mablr <59505383+mablr@users.noreply.github.com>
* feat(tempo): resolve fee token symbols on-chain

* fix: fmt

* fix: avoid fee token symbol lookup in curl mode

* feat(common): resolve fee token on chain

* fix(tempo): resolve sponsor fee token before signing

* fix(tempo): propagate fee token lookup errors

* fix(tempo): stamp fee token before sponsor hash print

* fix(tempo): finalize fee token consistently

* refactor: simplify `maybe_print_fee_token`

* refactor(tempo): simplify fee token resolution

* fix(tempo): avoid fee token resolution for sponsored txs

* fix(tempo): resolve sponsor fee token before digest

* fix(tempo): leave default fee token unset

* fix(tempo): avoid duplicate fee token resolution

* fix(tempo): preserve resolved fee token display
@vercel
vercel Bot temporarily deployed to Preview – next June 18, 2026 10:53 Inactive
@vercel
vercel Bot temporarily deployed to Preview – react June 18, 2026 10:53 Inactive
@vercel
vercel Bot temporarily deployed to Preview – next June 18, 2026 11:03 Inactive
@vercel
vercel Bot temporarily deployed to Preview – react June 18, 2026 11:03 Inactive
@Dargon789
Dargon789 merged commit c63dfeb into main Jun 18, 2026
14 of 18 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in web3-Defi-Gamefi Jun 18, 2026
@Dargon789
Dargon789 deleted the foundry/main branch June 18, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request github_actions Pull requests that update GitHub Actions code rust Pull requests that update rust code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Sequence diagram for sign_with_access_key Tempo access-key signing flow

8 participants