Copy disabled (too large)
Download .txt
Showing preview only (13,677K chars total). Download the full file to get everything.
Repository: foundry-rs/foundry
Branch: master
Commit: fc2c1473e143
Files: 1285
Total size: 12.8 MB
Directory structure:
gitextract_5h1i4s30/
├── .cargo/
│ └── config.toml
├── .config/
│ └── nextest.toml
├── .devcontainer/
│ ├── Dockerfile.dev
│ └── devcontainer.json
├── .dockerignore
├── .git-blame-ignore-revs
├── .gitattributes
├── .github/
│ ├── CODEOWNERS
│ ├── FLAKY_TEST_FAILURE_TEMPLATE.md
│ ├── FLAKY_TEST_ISOLATE_FAILURE_TEMPLATE.md
│ ├── INTEGRATION_FAILURE.md
│ ├── ISSUE_TEMPLATE/
│ │ ├── BUG-FORM.yml
│ │ ├── FEATURE-FORM.yml
│ │ └── config.yml
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── RELEASE_FAILURE_ISSUE_TEMPLATE.md
│ ├── TEST_ISOLATE_FAILURE_TEMPLATE.md
│ ├── changelog.json
│ ├── dependabot.yml
│ ├── scripts/
│ │ ├── combine-benchmarks.sh
│ │ ├── commit-and-read-benchmarks.sh
│ │ ├── create-tag.js
│ │ ├── format-pr-comment.sh
│ │ ├── format.sh
│ │ ├── matrices.py
│ │ ├── move-tag.js
│ │ ├── prune-prereleases.js
│ │ ├── setup-foundryup.sh
│ │ └── shellcheck.sh
│ └── workflows/
│ ├── benchmarks.yml
│ ├── bump-forge-std.yml
│ ├── ci.yml
│ ├── dependencies.yml
│ ├── docker-publish.yml
│ ├── docs.yml
│ ├── nix.yml
│ ├── npm.yml
│ ├── release.yml
│ ├── test-flaky.yml
│ ├── test-isolate.yml
│ └── test.yml
├── .gitignore
├── CONTRIBUTING.md
├── Cargo.toml
├── Dockerfile
├── FUNDING.json
├── LICENSE-APACHE
├── LICENSE-MIT
├── Makefile
├── README.md
├── SECURITY.md
├── benches/
│ ├── Cargo.toml
│ ├── LATEST.md
│ ├── README.md
│ └── src/
│ ├── lib.rs
│ ├── main.rs
│ └── results.rs
├── benchmark.sh
├── clippy.toml
├── crates/
│ ├── anvil/
│ │ ├── Cargo.toml
│ │ ├── bin/
│ │ │ └── main.rs
│ │ ├── core/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ ├── eth/
│ │ │ │ ├── block.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── serde_helpers.rs
│ │ │ │ ├── subscription.rs
│ │ │ │ ├── transaction/
│ │ │ │ │ └── mod.rs
│ │ │ │ └── wallet.rs
│ │ │ ├── lib.rs
│ │ │ └── types.rs
│ │ ├── rpc/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ ├── error.rs
│ │ │ ├── lib.rs
│ │ │ ├── request.rs
│ │ │ └── response.rs
│ │ ├── server/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ ├── config.rs
│ │ │ ├── error.rs
│ │ │ ├── handler.rs
│ │ │ ├── ipc.rs
│ │ │ ├── lib.rs
│ │ │ ├── pubsub.rs
│ │ │ └── ws.rs
│ │ ├── src/
│ │ │ ├── args.rs
│ │ │ ├── cmd.rs
│ │ │ ├── config.rs
│ │ │ ├── error.rs
│ │ │ ├── eth/
│ │ │ │ ├── api.rs
│ │ │ │ ├── backend/
│ │ │ │ │ ├── cheats.rs
│ │ │ │ │ ├── db.rs
│ │ │ │ │ ├── env.rs
│ │ │ │ │ ├── executor.rs
│ │ │ │ │ ├── fork.rs
│ │ │ │ │ ├── genesis.rs
│ │ │ │ │ ├── info.rs
│ │ │ │ │ ├── mem/
│ │ │ │ │ │ ├── cache.rs
│ │ │ │ │ │ ├── fork_db.rs
│ │ │ │ │ │ ├── in_memory_db.rs
│ │ │ │ │ │ ├── inspector.rs
│ │ │ │ │ │ ├── mod.rs
│ │ │ │ │ │ ├── state.rs
│ │ │ │ │ │ └── storage.rs
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ ├── notifications.rs
│ │ │ │ │ ├── time.rs
│ │ │ │ │ └── validate.rs
│ │ │ │ ├── error.rs
│ │ │ │ ├── fees.rs
│ │ │ │ ├── macros.rs
│ │ │ │ ├── miner.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── otterscan/
│ │ │ │ │ ├── api.rs
│ │ │ │ │ └── mod.rs
│ │ │ │ ├── pool/
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── transactions.rs
│ │ │ │ ├── sign.rs
│ │ │ │ └── util.rs
│ │ │ ├── evm.rs
│ │ │ ├── filter.rs
│ │ │ ├── lib.rs
│ │ │ ├── logging.rs
│ │ │ ├── opts.rs
│ │ │ ├── pubsub.rs
│ │ │ ├── server/
│ │ │ │ ├── beacon/
│ │ │ │ │ ├── error.rs
│ │ │ │ │ ├── handlers.rs
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── utils.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── rpc_handlers.rs
│ │ │ ├── service.rs
│ │ │ ├── shutdown.rs
│ │ │ └── tasks/
│ │ │ ├── block_listener.rs
│ │ │ └── mod.rs
│ │ ├── test-data/
│ │ │ ├── SimpleStorage.json
│ │ │ ├── SimpleStorage.sol
│ │ │ ├── emit_logs.json
│ │ │ ├── emit_logs.sol
│ │ │ ├── greeter.json
│ │ │ ├── multicall.json
│ │ │ ├── multicall.sol
│ │ │ ├── state-dump-legacy-stress.json
│ │ │ ├── state-dump-legacy.json
│ │ │ ├── state-dump.json
│ │ │ └── storage_sample.json
│ │ └── tests/
│ │ └── it/
│ │ ├── abi.rs
│ │ ├── anvil.rs
│ │ ├── anvil_api.rs
│ │ ├── api.rs
│ │ ├── beacon_api.rs
│ │ ├── eip2935.rs
│ │ ├── eip4844.rs
│ │ ├── eip7702.rs
│ │ ├── fork.rs
│ │ ├── gas.rs
│ │ ├── genesis.rs
│ │ ├── ipc.rs
│ │ ├── logs.rs
│ │ ├── main.rs
│ │ ├── optimism.rs
│ │ ├── otterscan.rs
│ │ ├── proof.rs
│ │ ├── pubsub.rs
│ │ ├── revert.rs
│ │ ├── sign.rs
│ │ ├── simulate.rs
│ │ ├── state.rs
│ │ ├── traces.rs
│ │ ├── transaction.rs
│ │ ├── txpool.rs
│ │ ├── utils.rs
│ │ └── wsapi.rs
│ ├── cast/
│ │ ├── Cargo.toml
│ │ ├── bin/
│ │ │ └── main.rs
│ │ ├── src/
│ │ │ ├── args.rs
│ │ │ ├── base.rs
│ │ │ ├── cmd/
│ │ │ │ ├── access_list.rs
│ │ │ │ ├── artifact.rs
│ │ │ │ ├── b2e_payload.rs
│ │ │ │ ├── bind.rs
│ │ │ │ ├── call.rs
│ │ │ │ ├── constructor_args.rs
│ │ │ │ ├── create2.rs
│ │ │ │ ├── creation_code.rs
│ │ │ │ ├── da_estimate.rs
│ │ │ │ ├── erc20.rs
│ │ │ │ ├── estimate.rs
│ │ │ │ ├── find_block.rs
│ │ │ │ ├── interface.rs
│ │ │ │ ├── logs.rs
│ │ │ │ ├── mktx.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── rpc.rs
│ │ │ │ ├── run.rs
│ │ │ │ ├── send.rs
│ │ │ │ ├── storage.rs
│ │ │ │ ├── trace.rs
│ │ │ │ ├── txpool.rs
│ │ │ │ └── wallet/
│ │ │ │ ├── list.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── vanity.rs
│ │ │ ├── debug.rs
│ │ │ ├── errors.rs
│ │ │ ├── lib.rs
│ │ │ ├── opts.rs
│ │ │ ├── rlp_converter.rs
│ │ │ └── tx.rs
│ │ └── tests/
│ │ ├── cli/
│ │ │ ├── erc20.rs
│ │ │ ├── main.rs
│ │ │ └── selectors.rs
│ │ └── fixtures/
│ │ ├── ERC20Artifact.json
│ │ ├── TestToken.sol
│ │ ├── cast_logs.stdout
│ │ ├── interface.json
│ │ ├── interface_inherited_struct.json
│ │ ├── keystore/
│ │ │ ├── UTC--2022-10-30T06-51-20.130356000Z--560d246fcddc9ea98a8b032c9a2f474efb493c28
│ │ │ ├── UTC--2022-12-20T10-30-43.591916000Z--ec554aeafe75601aaab43bd4621a22284db566c2
│ │ │ ├── password
│ │ │ └── password-ec554
│ │ ├── sign_typed_data.json
│ │ ├── storage_layout_complex.json
│ │ └── storage_layout_simple.json
│ ├── cheatcodes/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── assets/
│ │ │ ├── cheatcodes.json
│ │ │ └── cheatcodes.schema.json
│ │ ├── spec/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ ├── cheatcode.rs
│ │ │ ├── function.rs
│ │ │ ├── items.rs
│ │ │ ├── lib.rs
│ │ │ └── vm.rs
│ │ └── src/
│ │ ├── base64.rs
│ │ ├── config.rs
│ │ ├── crypto.rs
│ │ ├── env.rs
│ │ ├── error.rs
│ │ ├── evm/
│ │ │ ├── fork.rs
│ │ │ ├── mapping.rs
│ │ │ ├── mock.rs
│ │ │ ├── prank.rs
│ │ │ └── record_debug_step.rs
│ │ ├── evm.rs
│ │ ├── fs.rs
│ │ ├── inspector/
│ │ │ ├── analysis.rs
│ │ │ └── utils.rs
│ │ ├── inspector.rs
│ │ ├── json.rs
│ │ ├── lib.rs
│ │ ├── script.rs
│ │ ├── string.rs
│ │ ├── test/
│ │ │ ├── assert.rs
│ │ │ ├── assume.rs
│ │ │ ├── expect.rs
│ │ │ └── revert_handlers.rs
│ │ ├── test.rs
│ │ ├── toml.rs
│ │ ├── utils.rs
│ │ └── version.rs
│ ├── chisel/
│ │ ├── Cargo.toml
│ │ ├── assets/
│ │ │ └── preview.tape
│ │ ├── bin/
│ │ │ └── main.rs
│ │ ├── src/
│ │ │ ├── args.rs
│ │ │ ├── cmd.rs
│ │ │ ├── dispatcher.rs
│ │ │ ├── executor.rs
│ │ │ ├── lib.rs
│ │ │ ├── opts.rs
│ │ │ ├── runner.rs
│ │ │ ├── session.rs
│ │ │ ├── solidity_helper.rs
│ │ │ └── source.rs
│ │ └── tests/
│ │ └── it/
│ │ ├── main.rs
│ │ └── repl/
│ │ ├── mod.rs
│ │ └── session.rs
│ ├── cli/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── clap.rs
│ │ ├── handler.rs
│ │ ├── lib.rs
│ │ ├── opts/
│ │ │ ├── build/
│ │ │ │ ├── core.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── paths.rs
│ │ │ │ └── utils.rs
│ │ │ ├── chain.rs
│ │ │ ├── dependency.rs
│ │ │ ├── evm.rs
│ │ │ ├── global.rs
│ │ │ ├── mod.rs
│ │ │ ├── network.rs
│ │ │ ├── rpc.rs
│ │ │ ├── tempo.rs
│ │ │ └── transaction.rs
│ │ └── utils/
│ │ ├── abi.rs
│ │ ├── allocator.rs
│ │ ├── cmd.rs
│ │ ├── default_directives.txt
│ │ ├── mod.rs
│ │ └── suggestions.rs
│ ├── cli-markdown/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── common/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── build.rs
│ │ ├── fmt/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ ├── console.rs
│ │ │ ├── dynamic.rs
│ │ │ ├── exp.rs
│ │ │ ├── lib.rs
│ │ │ └── ui.rs
│ │ └── src/
│ │ ├── abi.rs
│ │ ├── calc.rs
│ │ ├── comments/
│ │ │ ├── comment.rs
│ │ │ ├── inline_config.rs
│ │ │ └── mod.rs
│ │ ├── compile.rs
│ │ ├── constants.rs
│ │ ├── contracts.rs
│ │ ├── errors/
│ │ │ ├── fs.rs
│ │ │ └── mod.rs
│ │ ├── fs.rs
│ │ ├── io/
│ │ │ ├── macros.rs
│ │ │ ├── mod.rs
│ │ │ ├── shell.rs
│ │ │ ├── stdin.rs
│ │ │ └── style.rs
│ │ ├── iter.rs
│ │ ├── lib.rs
│ │ ├── mapping_slots.rs
│ │ ├── preprocessor/
│ │ │ ├── data.rs
│ │ │ ├── deps.rs
│ │ │ └── mod.rs
│ │ ├── provider/
│ │ │ ├── curl_transport.rs
│ │ │ ├── mod.rs
│ │ │ └── runtime_transport.rs
│ │ ├── retry.rs
│ │ ├── selectors.rs
│ │ ├── serde_helpers.rs
│ │ ├── slot_identifier.rs
│ │ ├── term.rs
│ │ ├── traits.rs
│ │ ├── transactions.rs
│ │ ├── utils.rs
│ │ └── version.rs
│ ├── config/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── bind_json.rs
│ │ ├── cache.rs
│ │ ├── compilation.rs
│ │ ├── doc.rs
│ │ ├── endpoints.rs
│ │ ├── error.rs
│ │ ├── etherscan.rs
│ │ ├── extend.rs
│ │ ├── filter.rs
│ │ ├── fix.rs
│ │ ├── fmt.rs
│ │ ├── fs_permissions.rs
│ │ ├── fuzz.rs
│ │ ├── inline/
│ │ │ ├── mod.rs
│ │ │ └── natspec.rs
│ │ ├── invariant.rs
│ │ ├── lib.rs
│ │ ├── lint.rs
│ │ ├── macros.rs
│ │ ├── providers/
│ │ │ ├── ext.rs
│ │ │ ├── mod.rs
│ │ │ ├── remappings.rs
│ │ │ └── warnings.rs
│ │ ├── resolve.rs
│ │ ├── soldeer.rs
│ │ ├── utils.rs
│ │ ├── vyper.rs
│ │ └── warning.rs
│ ├── debugger/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── builder.rs
│ │ ├── debugger.rs
│ │ ├── dump.rs
│ │ ├── lib.rs
│ │ ├── node.rs
│ │ ├── op.rs
│ │ └── tui/
│ │ ├── context.rs
│ │ ├── draw.rs
│ │ └── mod.rs
│ ├── doc/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── src/
│ │ │ ├── builder.rs
│ │ │ ├── document.rs
│ │ │ ├── helpers.rs
│ │ │ ├── lib.rs
│ │ │ ├── parser/
│ │ │ │ ├── comment.rs
│ │ │ │ ├── error.rs
│ │ │ │ ├── item.rs
│ │ │ │ └── mod.rs
│ │ │ ├── preprocessor/
│ │ │ │ ├── contract_inheritance.rs
│ │ │ │ ├── deployments.rs
│ │ │ │ ├── git_source.rs
│ │ │ │ ├── infer_hyperlinks.rs
│ │ │ │ ├── inheritdoc.rs
│ │ │ │ └── mod.rs
│ │ │ ├── solang_ext/
│ │ │ │ ├── ast_eq.rs
│ │ │ │ ├── loc.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── safe_unwrap.rs
│ │ │ │ └── visit.rs
│ │ │ └── writer/
│ │ │ ├── as_doc.rs
│ │ │ ├── buf_writer.rs
│ │ │ ├── markdown.rs
│ │ │ ├── mod.rs
│ │ │ └── traits.rs
│ │ └── static/
│ │ ├── book.css
│ │ └── book.toml
│ ├── evm/
│ │ ├── abi/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ ├── Console.json
│ │ │ ├── console/
│ │ │ │ ├── ds.rs
│ │ │ │ ├── hh.rs
│ │ │ │ └── mod.rs
│ │ │ ├── console.py
│ │ │ └── lib.rs
│ │ ├── core/
│ │ │ ├── Cargo.toml
│ │ │ ├── src/
│ │ │ │ ├── backend/
│ │ │ │ │ ├── cow.rs
│ │ │ │ │ ├── diagnostic.rs
│ │ │ │ │ ├── error.rs
│ │ │ │ │ ├── in_memory_db.rs
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── snapshot.rs
│ │ │ │ ├── buffer.rs
│ │ │ │ ├── bytecode.rs
│ │ │ │ ├── constants.rs
│ │ │ │ ├── decode.rs
│ │ │ │ ├── either_evm.rs
│ │ │ │ ├── env.rs
│ │ │ │ ├── evm.rs
│ │ │ │ ├── fork/
│ │ │ │ │ ├── database.rs
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── multi.rs
│ │ │ │ ├── hardfork.rs
│ │ │ │ ├── ic.rs
│ │ │ │ ├── lib.rs
│ │ │ │ ├── opts.rs
│ │ │ │ ├── precompiles.rs
│ │ │ │ ├── state_snapshot.rs
│ │ │ │ └── utils.rs
│ │ │ └── test-data/
│ │ │ └── storage.json
│ │ ├── coverage/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ ├── analysis.rs
│ │ │ ├── anchors.rs
│ │ │ ├── inspector.rs
│ │ │ └── lib.rs
│ │ ├── evm/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ ├── executors/
│ │ │ │ ├── builder.rs
│ │ │ │ ├── corpus.rs
│ │ │ │ ├── fuzz/
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── types.rs
│ │ │ │ ├── invariant/
│ │ │ │ │ ├── error.rs
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ ├── replay.rs
│ │ │ │ │ ├── result.rs
│ │ │ │ │ └── shrink.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── trace.rs
│ │ │ ├── inspectors/
│ │ │ │ ├── chisel_state.rs
│ │ │ │ ├── custom_printer.rs
│ │ │ │ ├── logs.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── revert_diagnostic.rs
│ │ │ │ ├── script.rs
│ │ │ │ └── stack.rs
│ │ │ └── lib.rs
│ │ ├── fuzz/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ ├── error.rs
│ │ │ ├── inspector.rs
│ │ │ ├── invariant/
│ │ │ │ ├── call_override.rs
│ │ │ │ ├── filters.rs
│ │ │ │ └── mod.rs
│ │ │ ├── lib.rs
│ │ │ └── strategies/
│ │ │ ├── calldata.rs
│ │ │ ├── int.rs
│ │ │ ├── invariants.rs
│ │ │ ├── literals.rs
│ │ │ ├── mod.rs
│ │ │ ├── mutators.rs
│ │ │ ├── param.rs
│ │ │ ├── state.rs
│ │ │ └── uint.rs
│ │ ├── networks/
│ │ │ ├── Cargo.toml
│ │ │ ├── README.md
│ │ │ └── src/
│ │ │ ├── celo/
│ │ │ │ ├── mod.rs
│ │ │ │ └── transfer.rs
│ │ │ └── lib.rs
│ │ ├── test-data/
│ │ │ └── solc-obj.json
│ │ └── traces/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── backtrace/
│ │ │ ├── mod.rs
│ │ │ └── source_map.rs
│ │ ├── debug/
│ │ │ ├── mod.rs
│ │ │ └── sources.rs
│ │ ├── decoder/
│ │ │ ├── mod.rs
│ │ │ └── precompiles.rs
│ │ ├── folded_stack_trace.rs
│ │ ├── identifier/
│ │ │ ├── external.rs
│ │ │ ├── local.rs
│ │ │ ├── mod.rs
│ │ │ └── signatures.rs
│ │ └── lib.rs
│ ├── fmt/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── src/
│ │ │ ├── lib.rs
│ │ │ ├── pp/
│ │ │ │ ├── convenience.rs
│ │ │ │ ├── helpers.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── ring.rs
│ │ │ └── state/
│ │ │ ├── common.rs
│ │ │ ├── mod.rs
│ │ │ ├── sol.rs
│ │ │ └── yul.rs
│ │ ├── testdata/
│ │ │ ├── Annotation/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── ArrayExpressions/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── BlockComments/
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ └── tab.fmt.sol
│ │ │ ├── BlockCommentsFunction/
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ └── tab.fmt.sol
│ │ │ ├── CommentEmptyLine/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── ConditionalOperatorExpression/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── ConstructorDefinition/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── ConstructorModifierStyle/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── ContractDefinition/
│ │ │ │ ├── bracket-spacing.fmt.sol
│ │ │ │ ├── contract-new-lines.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── DoWhileStatement/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── DocComments/
│ │ │ │ ├── block.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── line.fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ ├── tab.fmt.sol
│ │ │ │ └── wrap-comments.fmt.sol
│ │ │ ├── EmitStatement/
│ │ │ │ ├── 120.compact.fmt.sol
│ │ │ │ ├── 120.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── EnumDefinition/
│ │ │ │ ├── bracket-spacing.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── EnumVariants/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── ErrorDefinition/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── EventDefinition/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── ForStatement/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── FunctionCall/
│ │ │ │ ├── bracket-spacing.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── FunctionCallArgsStatement/
│ │ │ │ ├── bracket-spacing.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── FunctionDefinition/
│ │ │ │ ├── all-params.fmt.sol
│ │ │ │ ├── all.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ ├── override-spacing.fmt.sol
│ │ │ │ ├── params-always.fmt.sol
│ │ │ │ └── params-multi.fmt.sol
│ │ │ ├── FunctionDefinitionWithFunctionReturns/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── FunctionType/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── HexUnderscore/
│ │ │ │ ├── bytes.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ ├── preserve.fmt.sol
│ │ │ │ └── remove.fmt.sol
│ │ │ ├── IfStatement/
│ │ │ │ ├── block-multi.fmt.sol
│ │ │ │ ├── block-single.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── IfStatement2/
│ │ │ │ ├── 120.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── ImportDirective/
│ │ │ │ ├── bracket-spacing.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── namespace-import-prefer-glob.fmt.sol
│ │ │ │ ├── namespace-import-prefer-plain.fmt.sol
│ │ │ │ ├── namespace-import-preserve.fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ ├── preserve-quote.fmt.sol
│ │ │ │ ├── single-quote.fmt.sol
│ │ │ │ └── single_line_import.fmt.sol
│ │ │ ├── InlineDisable/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── IntTypes/
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ ├── preserve.fmt.sol
│ │ │ │ └── short.fmt.sol
│ │ │ ├── LiteralExpression/
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ ├── preserve-quote.fmt.sol
│ │ │ │ └── single-quote.fmt.sol
│ │ │ ├── MappingType/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── ModifierDefinition/
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ └── override-spacing.fmt.sol
│ │ │ ├── NamedFunctionCallExpression/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── NonKeywords/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── NumberLiteralUnderscore/
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ ├── preserve.fmt.sol
│ │ │ │ ├── remove.fmt.sol
│ │ │ │ └── thousands.fmt.sol
│ │ │ ├── OperatorExpressions/
│ │ │ │ ├── 120.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ └── pow-no-space.fmt.sol
│ │ │ ├── PragmaDirective/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── Repros/
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ ├── sorted.fmt.sol
│ │ │ │ └── tab.fmt.sol
│ │ │ ├── ReprosCalls/
│ │ │ │ ├── 110.fmt.sol
│ │ │ │ ├── 120.fmt.sol
│ │ │ │ ├── 80.fmt.sol
│ │ │ │ ├── consistent.120.fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── ReprosFunctionDefs/
│ │ │ │ ├── all.120.fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── ReturnStatement/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── RevertNamedArgsStatement/
│ │ │ │ ├── bracket-spacing.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── RevertStatement/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── SimpleComments/
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ └── wrap-comments.fmt.sol
│ │ │ ├── SortedImports/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── StatementBlock/
│ │ │ │ ├── bracket-spacing.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── StructDefinition/
│ │ │ │ ├── bracket-spacing.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── StructFieldAccess/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── ThisExpression/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── TrailingComma/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── TryStatement/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── TypeDefinition/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── UnitExpression/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── UsingDirective/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── VariableAssignment/
│ │ │ │ ├── bracket-spacing.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── VariableDefinition/
│ │ │ │ ├── fmt.sol
│ │ │ │ ├── original.sol
│ │ │ │ └── override-spacing.fmt.sol
│ │ │ ├── WhileStatement/
│ │ │ │ ├── block-multi.fmt.sol
│ │ │ │ ├── block-single.fmt.sol
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ ├── Yul/
│ │ │ │ ├── fmt.sol
│ │ │ │ └── original.sol
│ │ │ └── YulStrings/
│ │ │ ├── fmt.sol
│ │ │ ├── original.sol
│ │ │ ├── preserve-quote.fmt.sol
│ │ │ └── single-quote.fmt.sol
│ │ └── tests/
│ │ └── formatter.rs
│ ├── forge/
│ │ ├── Cargo.toml
│ │ ├── assets/
│ │ │ ├── .gitignoreTemplate
│ │ │ ├── README.md
│ │ │ ├── generated/
│ │ │ │ └── TestTemplate.t.sol
│ │ │ ├── solidity/
│ │ │ │ ├── CounterTemplate.s.sol
│ │ │ │ ├── CounterTemplate.sol
│ │ │ │ ├── CounterTemplate.t.sol
│ │ │ │ └── workflowTemplate.yml
│ │ │ ├── tempo/
│ │ │ │ ├── MailTemplate.s.sol
│ │ │ │ ├── MailTemplate.sol
│ │ │ │ ├── MailTemplate.t.sol
│ │ │ │ ├── README.md
│ │ │ │ └── workflowTemplate.yml
│ │ │ └── vyper/
│ │ │ ├── CounterTemplate.s.sol
│ │ │ ├── CounterTemplate.t.sol
│ │ │ ├── CounterTemplate.vy
│ │ │ ├── ICounterTemplate.sol
│ │ │ └── workflowTemplate.yml
│ │ ├── bin/
│ │ │ └── main.rs
│ │ ├── src/
│ │ │ ├── args.rs
│ │ │ ├── cmd/
│ │ │ │ ├── bind.rs
│ │ │ │ ├── bind_json.rs
│ │ │ │ ├── build.rs
│ │ │ │ ├── cache.rs
│ │ │ │ ├── clone.rs
│ │ │ │ ├── compiler.rs
│ │ │ │ ├── config.rs
│ │ │ │ ├── coverage.rs
│ │ │ │ ├── create.rs
│ │ │ │ ├── doc/
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── server.rs
│ │ │ │ ├── eip712.rs
│ │ │ │ ├── flatten.rs
│ │ │ │ ├── fmt.rs
│ │ │ │ ├── geiger.rs
│ │ │ │ ├── generate/
│ │ │ │ │ └── mod.rs
│ │ │ │ ├── init.rs
│ │ │ │ ├── inspect.rs
│ │ │ │ ├── install.rs
│ │ │ │ ├── lint.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── remappings.rs
│ │ │ │ ├── remove.rs
│ │ │ │ ├── selectors.rs
│ │ │ │ ├── snapshot.rs
│ │ │ │ ├── soldeer.rs
│ │ │ │ ├── test/
│ │ │ │ │ ├── filter.rs
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── summary.rs
│ │ │ │ ├── tree.rs
│ │ │ │ ├── update.rs
│ │ │ │ └── watch.rs
│ │ │ ├── coverage.rs
│ │ │ ├── gas_report.rs
│ │ │ ├── lib.rs
│ │ │ ├── lockfile.rs
│ │ │ ├── multi_runner.rs
│ │ │ ├── opts.rs
│ │ │ ├── progress.rs
│ │ │ ├── result.rs
│ │ │ └── runner.rs
│ │ └── tests/
│ │ ├── cli/
│ │ │ ├── backtrace.rs
│ │ │ ├── bind.rs
│ │ │ ├── bind_json.rs
│ │ │ ├── build.rs
│ │ │ ├── cache.rs
│ │ │ ├── cmd.rs
│ │ │ ├── compiler.rs
│ │ │ ├── config.rs
│ │ │ ├── constants.rs
│ │ │ ├── context.rs
│ │ │ ├── coverage.rs
│ │ │ ├── create.rs
│ │ │ ├── debug.rs
│ │ │ ├── doc.rs
│ │ │ ├── eip712.rs
│ │ │ ├── ext_integration.rs
│ │ │ ├── failure_assertions.rs
│ │ │ ├── fmt.rs
│ │ │ ├── fmt_integration.rs
│ │ │ ├── inline_config.rs
│ │ │ ├── install.rs
│ │ │ ├── json.rs
│ │ │ ├── lint/
│ │ │ │ └── geiger.rs
│ │ │ ├── lint.rs
│ │ │ ├── main.rs
│ │ │ ├── multi_script.rs
│ │ │ ├── precompiles.rs
│ │ │ ├── script.rs
│ │ │ ├── soldeer.rs
│ │ │ ├── svm.rs
│ │ │ ├── test_cmd/
│ │ │ │ ├── core.rs
│ │ │ │ ├── fuzz.rs
│ │ │ │ ├── invariant/
│ │ │ │ │ ├── common.rs
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ ├── storage.rs
│ │ │ │ │ └── target.rs
│ │ │ │ ├── logs.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── repros.rs
│ │ │ │ ├── spec.rs
│ │ │ │ ├── table.rs
│ │ │ │ └── trace.rs
│ │ │ ├── test_optimizer.rs
│ │ │ ├── utils.rs
│ │ │ ├── verify.rs
│ │ │ ├── verify_bytecode.rs
│ │ │ └── version.rs
│ │ ├── fixtures/
│ │ │ ├── CreateXScript.sol
│ │ │ ├── ExpectCallFailures.t.sol
│ │ │ ├── ExpectCreateFailures.t.sol
│ │ │ ├── ExpectEmitFailures.t.sol
│ │ │ ├── ExpectEmitParamFailures.t.sol
│ │ │ ├── ExpectEmitParamHarness.sol
│ │ │ ├── ExpectRevertFailures.t.sol
│ │ │ ├── MemSafetyFailures.t.sol
│ │ │ ├── ScriptVerify.sol
│ │ │ ├── SimpleContractTestNonVerbose.json
│ │ │ ├── SimpleContractTestVerbose.json
│ │ │ └── backtraces/
│ │ │ ├── Backtrace.t.sol
│ │ │ ├── DelegateCall.sol
│ │ │ ├── ForkBacktrace.t.sol
│ │ │ ├── ForkedERC20Wrapper.sol
│ │ │ ├── LibraryBacktrace.t.sol
│ │ │ ├── LibraryConsumer.sol
│ │ │ ├── MultipleLibraryBacktrace.t.sol
│ │ │ ├── MultipleLibraryConsumer.sol
│ │ │ ├── NestedCalls.sol
│ │ │ ├── SimpleRevert.sol
│ │ │ ├── StaticCall.sol
│ │ │ └── libraries/
│ │ │ ├── ExternalMathLib.sol
│ │ │ ├── InternalMathLib.sol
│ │ │ └── MultipleLibraries.sol
│ │ └── ui.rs
│ ├── linking/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── lint/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── src/
│ │ │ ├── lib.rs
│ │ │ ├── linter/
│ │ │ │ ├── early.rs
│ │ │ │ ├── late.rs
│ │ │ │ └── mod.rs
│ │ │ └── sol/
│ │ │ ├── codesize/
│ │ │ │ ├── mod.rs
│ │ │ │ └── unwrapped_modifier_logic.rs
│ │ │ ├── gas/
│ │ │ │ ├── custom_errors.rs
│ │ │ │ ├── keccak.rs
│ │ │ │ └── mod.rs
│ │ │ ├── high/
│ │ │ │ ├── incorrect_shift.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── unchecked_calls.rs
│ │ │ ├── info/
│ │ │ │ ├── imports.rs
│ │ │ │ ├── interface_naming.rs
│ │ │ │ ├── mixed_case.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── multi_contract_file.rs
│ │ │ │ ├── named_struct_fields.rs
│ │ │ │ ├── pascal_case.rs
│ │ │ │ ├── screaming_snake_case.rs
│ │ │ │ └── unsafe_cheatcodes.rs
│ │ │ ├── macros.rs
│ │ │ ├── med/
│ │ │ │ ├── div_mul.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── unsafe_typecast.rs
│ │ │ └── mod.rs
│ │ └── testdata/
│ │ ├── .gitignore
│ │ ├── CustomErrors.sol
│ │ ├── CustomErrors.stderr
│ │ ├── DivideBeforeMultiply.sol
│ │ ├── DivideBeforeMultiply.stderr
│ │ ├── Imports.sol
│ │ ├── Imports.stderr
│ │ ├── IncorrectShift.sol
│ │ ├── IncorrectShift.stderr
│ │ ├── Keccak256.sol
│ │ ├── Keccak256.stderr
│ │ ├── MixedCase.sol
│ │ ├── MixedCase.stderr
│ │ ├── MultiContractFile.sol
│ │ ├── MultiContractFile.stderr
│ │ ├── MultiContractFile_InterfaceLibrary.sol
│ │ ├── MultiContractFile_InterfaceLibrary.stderr
│ │ ├── NamedStructFields.sol
│ │ ├── NamedStructFields.stderr
│ │ ├── ScreamingSnakeCase.sol
│ │ ├── ScreamingSnakeCase.stderr
│ │ ├── SoloInterfaces.sol
│ │ ├── StructPascalCase.sol
│ │ ├── StructPascalCase.stderr
│ │ ├── UncheckedCall.sol
│ │ ├── UncheckedCall.stderr
│ │ ├── UncheckedTransferERC20.sol
│ │ ├── UncheckedTransferERC20.stderr
│ │ ├── UnsafeCheatcodes.sol
│ │ ├── UnsafeCheatcodes.stderr
│ │ ├── UnsafeTypecast.sol
│ │ ├── UnsafeTypecast.stderr
│ │ ├── UnwrappedModifierLogic.sol
│ │ ├── UnwrappedModifierLogic.stderr
│ │ └── auxiliary/
│ │ ├── ImportsAnotherFile.sol
│ │ ├── ImportsAnotherFile2.sol
│ │ ├── ImportsConstants.sol
│ │ ├── ImportsFile.sol
│ │ ├── ImportsSomeFile.sol
│ │ ├── ImportsSomeFile2.sol
│ │ ├── ImportsTypes.sol
│ │ ├── ImportsUtils.sol
│ │ ├── ImportsUtils2.sol
│ │ └── Test.sol
│ ├── macros/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── cheatcodes.rs
│ │ ├── console_fmt.rs
│ │ └── lib.rs
│ ├── primitives/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── network/
│ │ │ ├── mod.rs
│ │ │ ├── receipt.rs
│ │ │ └── transaction.rs
│ │ └── transaction/
│ │ ├── envelope.rs
│ │ ├── mod.rs
│ │ ├── receipt.rs
│ │ └── request.rs
│ ├── script/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── broadcast.rs
│ │ ├── build.rs
│ │ ├── execute.rs
│ │ ├── lib.rs
│ │ ├── multi_sequence.rs
│ │ ├── progress.rs
│ │ ├── providers.rs
│ │ ├── receipts.rs
│ │ ├── runner.rs
│ │ ├── sequence.rs
│ │ ├── simulate.rs
│ │ ├── transaction.rs
│ │ └── verify.rs
│ ├── script-sequence/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── reader.rs
│ │ ├── sequence.rs
│ │ └── transaction.rs
│ ├── sol-macro-gen/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ └── sol_macro_gen.rs
│ ├── test-utils/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── etherscan.rs
│ │ ├── ext.rs
│ │ ├── fd_lock.rs
│ │ ├── filter.rs
│ │ ├── lib.rs
│ │ ├── macros.rs
│ │ ├── prj.rs
│ │ ├── rpc.rs
│ │ ├── script.rs
│ │ ├── ui_runner.rs
│ │ └── util.rs
│ ├── verify/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── bytecode.rs
│ │ ├── etherscan/
│ │ │ ├── flatten.rs
│ │ │ ├── mod.rs
│ │ │ └── standard_json.rs
│ │ ├── lib.rs
│ │ ├── provider.rs
│ │ ├── retry.rs
│ │ ├── sourcify.rs
│ │ ├── types.rs
│ │ ├── utils.rs
│ │ └── verify.rs
│ └── wallets/
│ ├── Cargo.toml
│ └── src/
│ ├── error.rs
│ ├── lib.rs
│ ├── opts.rs
│ ├── signer.rs
│ ├── utils.rs
│ ├── wallet_browser/
│ │ ├── app/
│ │ │ ├── assets/
│ │ │ │ ├── index.html
│ │ │ │ ├── main.js
│ │ │ │ └── styles.css
│ │ │ └── mod.rs
│ │ ├── error.rs
│ │ ├── handlers.rs
│ │ ├── mod.rs
│ │ ├── opts.rs
│ │ ├── queue.rs
│ │ ├── router.rs
│ │ ├── server.rs
│ │ ├── signer.rs
│ │ ├── state.rs
│ │ └── types.rs
│ ├── wallet_multi/
│ │ └── mod.rs
│ └── wallet_raw/
│ └── mod.rs
├── deny.toml
├── docs/
│ └── dev/
│ ├── README.md
│ ├── architecture.md
│ ├── cheatcodes.md
│ ├── debugging.md
│ ├── lintrules.md
│ ├── networks.md
│ └── scripting.md
├── dprint.json
├── flake.nix
├── foundryup/
│ ├── README.md
│ ├── foundryup
│ └── install
├── npm/
│ ├── .gitignore
│ ├── @foundry-rs/
│ │ ├── anvil/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── cast/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── chisel/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ └── forge/
│ │ ├── README.md
│ │ └── package.json
│ ├── README.md
│ ├── bunfig.toml
│ ├── env.d.ts
│ ├── package.json
│ ├── scripts/
│ │ ├── check.sh
│ │ ├── prepublish.mjs
│ │ ├── publish-meta.mjs
│ │ ├── publish.mjs
│ │ └── stage-from-artifact.mjs
│ ├── src/
│ │ ├── bin.mjs
│ │ ├── const.mjs
│ │ ├── generate-package-json.mjs
│ │ └── install.mjs
│ └── tsconfig.json
├── rustfmt.toml
├── testdata/
│ ├── .gitignore
│ ├── README.md
│ ├── default/
│ │ ├── cheats/
│ │ │ ├── AccessList.t.sol
│ │ │ ├── Addr.t.sol
│ │ │ ├── ArbitraryStorage.t.sol
│ │ │ ├── Assert.t.sol
│ │ │ ├── Assume.t.sol
│ │ │ ├── AssumeNoRevert.t.sol
│ │ │ ├── AttachBlob.t.sol
│ │ │ ├── AttachDelegation.t.sol
│ │ │ ├── Bank.t.sol
│ │ │ ├── Base64.t.sol
│ │ │ ├── BlobBaseFee.t.sol
│ │ │ ├── Blobhashes.t.sol
│ │ │ ├── Broadcast.t.sol
│ │ │ ├── BroadcastRawTransaction.t.sol
│ │ │ ├── ChainId.t.sol
│ │ │ ├── CloneAccount.t.sol
│ │ │ ├── Cool.t.sol
│ │ │ ├── CopyStorage.t.sol
│ │ │ ├── CurrentFilePath.t.sol
│ │ │ ├── Deal.t.sol
│ │ │ ├── DeployCode.t.sol
│ │ │ ├── Derive.t.sol
│ │ │ ├── Ed25519.t.sol
│ │ │ ├── EnsNamehash.t.sol
│ │ │ ├── Env.t.sol
│ │ │ ├── Etch.t.sol
│ │ │ ├── ExecuteTransaction.t.sol
│ │ │ ├── ExpectCall.t.sol
│ │ │ ├── ExpectCreate.t.sol
│ │ │ ├── ExpectEmit.t.sol
│ │ │ ├── ExpectRevert.t.sol
│ │ │ ├── Fee.t.sol
│ │ │ ├── Ffi.t.sol
│ │ │ ├── Fork.t.sol
│ │ │ ├── Fork2.t.sol
│ │ │ ├── Fs.t.sol
│ │ │ ├── GasMetering.t.sol
│ │ │ ├── GetArtifactPath.t.sol
│ │ │ ├── GetBlockTimestamp.t.sol
│ │ │ ├── GetChain.t.sol
│ │ │ ├── GetCode.t.sol
│ │ │ ├── GetDeployedCode.t.sol
│ │ │ ├── GetFoundryVersion.t.sol
│ │ │ ├── GetLabel.t.sol
│ │ │ ├── GetNonce.t.sol
│ │ │ ├── GetRawBlockHeader.t.sol
│ │ │ ├── GetStorageSlots.t.sol
│ │ │ ├── Json.t.sol
│ │ │ ├── Label.t.sol
│ │ │ ├── Load.t.sol
│ │ │ ├── Mapping.t.sol
│ │ │ ├── MemSafety.t.sol
│ │ │ ├── MockCall.t.sol
│ │ │ ├── MockCalls.t.sol
│ │ │ ├── MockFunction.t.sol
│ │ │ ├── Nonce.t.sol
│ │ │ ├── Parse.t.sol
│ │ │ ├── Prank.t.sol
│ │ │ ├── Prevrandao.t.sol
│ │ │ ├── ProjectRoot.t.sol
│ │ │ ├── Prompt.t.sol
│ │ │ ├── RandomAddress.t.sol
│ │ │ ├── RandomBytes.t.sol
│ │ │ ├── RandomCheatcodes.t.sol
│ │ │ ├── RandomUint.t.sol
│ │ │ ├── ReadCallers.t.sol
│ │ │ ├── Record.t.sol
│ │ │ ├── RecordAccountAccesses.t.sol
│ │ │ ├── RecordDebugTrace.t.sol
│ │ │ ├── RecordLogs.t.sol
│ │ │ ├── Remember.t.sol
│ │ │ ├── ResetNonce.t.sol
│ │ │ ├── Rlp.t.sol
│ │ │ ├── Roll.t.sol
│ │ │ ├── RpcUrls.t.sol
│ │ │ ├── Seed.t.sol
│ │ │ ├── SetBlockhash.t.sol
│ │ │ ├── SetNonce.t.sol
│ │ │ ├── SetNonceUnsafe.t.sol
│ │ │ ├── Setup.t.sol
│ │ │ ├── Shuffle.t.sol
│ │ │ ├── Sign.t.sol
│ │ │ ├── SignP256.t.sol
│ │ │ ├── Skip.t.sol
│ │ │ ├── Sleep.t.sol
│ │ │ ├── Sort.t.sol
│ │ │ ├── StateDiffBytesString.t.sol
│ │ │ ├── StateDiffMappings.t.sol
│ │ │ ├── StateDiffStorageLayout.t.sol
│ │ │ ├── StateDiffStructTest.t.sol
│ │ │ ├── StateSnapshots.t.sol
│ │ │ ├── StorageSlotState.t.sol
│ │ │ ├── Store.t.sol
│ │ │ ├── StringUtils.t.sol
│ │ │ ├── ToString.t.sol
│ │ │ ├── Toml.t.sol
│ │ │ ├── Travel.t.sol
│ │ │ ├── TryFfi.sol
│ │ │ ├── UnixTime.t.sol
│ │ │ ├── Wallet.t.sol
│ │ │ ├── Warp.t.sol
│ │ │ ├── dumpState.t.sol
│ │ │ ├── getBlockNumber.t.sol
│ │ │ └── loadAllocs.t.sol
│ │ ├── core/
│ │ │ ├── Abstract.t.sol
│ │ │ ├── BadSigAfterInvariant.t.sol
│ │ │ ├── ContractEnvironment.t.sol
│ │ │ ├── Reverting.t.sol
│ │ │ └── SetupConsistency.t.sol
│ │ ├── fork/
│ │ │ ├── DssExecLib.sol
│ │ │ ├── ForkSame_1.t.sol
│ │ │ ├── ForkSame_2.t.sol
│ │ │ └── LaunchFork.t.sol
│ │ ├── fs/
│ │ │ ├── Disabled.t.sol
│ │ │ └── ReadOnly.sol
│ │ ├── inline/
│ │ │ ├── FuzzInlineConf.t.sol
│ │ │ └── InvariantInlineConf.t.sol
│ │ ├── linking/
│ │ │ ├── cycle/
│ │ │ │ └── Cycle.t.sol
│ │ │ ├── duplicate/
│ │ │ │ └── Duplicate.t.sol
│ │ │ ├── nested/
│ │ │ │ └── Nested.t.sol
│ │ │ ├── samefile_union/
│ │ │ │ ├── Libs.sol
│ │ │ │ └── SameFileUnion.t.sol
│ │ │ └── simple/
│ │ │ └── Simple.t.sol
│ │ ├── repros/
│ │ │ ├── Issue10302.t.sol
│ │ │ ├── Issue10477.t.sol
│ │ │ ├── Issue10527.t.sol
│ │ │ ├── Issue10552.t.sol
│ │ │ ├── Issue10586.t.sol
│ │ │ ├── Issue10957.t.sol
│ │ │ ├── Issue11353.t.sol
│ │ │ ├── Issue11616.t.sol
│ │ │ ├── Issue12075.t.sol
│ │ │ ├── Issue2623.t.sol
│ │ │ ├── Issue2629.t.sol
│ │ │ ├── Issue2723.t.sol
│ │ │ ├── Issue2898.t.sol
│ │ │ ├── Issue2956.t.sol
│ │ │ ├── Issue2984.t.sol
│ │ │ ├── Issue3077.t.sol
│ │ │ ├── Issue3110.t.sol
│ │ │ ├── Issue3119.t.sol
│ │ │ ├── Issue3190.t.sol
│ │ │ ├── Issue3192.t.sol
│ │ │ ├── Issue3220.t.sol
│ │ │ ├── Issue3221.t.sol
│ │ │ ├── Issue3223.t.sol
│ │ │ ├── Issue3653.t.sol
│ │ │ ├── Issue3661.t.sol
│ │ │ ├── Issue3674.t.sol
│ │ │ ├── Issue3685.t.sol
│ │ │ ├── Issue3703.t.sol
│ │ │ ├── Issue3708.t.sol
│ │ │ ├── Issue3753.t.sol
│ │ │ ├── Issue3792.t.sol
│ │ │ ├── Issue4232.t.sol
│ │ │ ├── Issue4402.t.sol
│ │ │ ├── Issue4586.t.sol
│ │ │ ├── Issue4630.t.sol
│ │ │ ├── Issue4640.t.sol
│ │ │ ├── Issue5038.t.sol
│ │ │ ├── Issue5529.t.sol
│ │ │ ├── Issue5739.t.sol
│ │ │ ├── Issue5808.t.sol
│ │ │ ├── Issue5929.t.sol
│ │ │ ├── Issue5935.t.sol
│ │ │ ├── Issue5948.t.sol
│ │ │ ├── Issue6006.t.sol
│ │ │ ├── Issue6032.t.sol
│ │ │ ├── Issue6070.t.sol
│ │ │ ├── Issue6115.t.sol
│ │ │ ├── Issue6180.t.sol
│ │ │ ├── Issue6293.t.sol
│ │ │ ├── Issue6437.t.sol
│ │ │ ├── Issue6538.t.sol
│ │ │ ├── Issue6554.t.sol
│ │ │ ├── Issue6616.t.sol
│ │ │ ├── Issue6634.t.sol
│ │ │ ├── Issue6643.t.sol
│ │ │ ├── Issue6759.t.sol
│ │ │ ├── Issue6966.t.sol
│ │ │ ├── Issue7238.t.sol
│ │ │ ├── Issue7457.t.sol
│ │ │ ├── Issue7481.t.sol
│ │ │ ├── Issue8004.t.sol
│ │ │ ├── Issue8006.t.sol
│ │ │ ├── Issue8168.t.sol
│ │ │ ├── Issue8277.t.sol
│ │ │ ├── Issue8287.t.sol
│ │ │ ├── Issue8566.t.sol
│ │ │ ├── Issue8639.t.sol
│ │ │ ├── Issue8971.t.sol
│ │ │ └── Issue9643.t.sol
│ │ ├── spec/
│ │ │ └── ShanghaiCompat.t.sol
│ │ └── vyper/
│ │ └── CounterTest.vy
│ ├── etherscan/
│ │ ├── 0x044b75f554b886A065b9567891e45c79542d7357/
│ │ │ ├── creation_data.json
│ │ │ └── metadata.json
│ │ ├── 0x35Fb958109b70799a8f9Bc2a8b1Ee4cC62034193/
│ │ │ ├── creation_data.json
│ │ │ └── metadata.json
│ │ ├── 0x3a23F943181408EAC424116Af7b7790c94Cb97a5/
│ │ │ ├── creation_data.json
│ │ │ └── metadata.json
│ │ ├── 0x71356E37e0368Bd10bFDbF41dC052fE5FA24cD05/
│ │ │ ├── creation_data.json
│ │ │ └── metadata.json
│ │ ├── 0x8B3D32cf2bb4d0D16656f4c0b04Fa546274f1545/
│ │ │ ├── creation_data.json
│ │ │ └── metadata.json
│ │ ├── 0x9AB6b21cDF116f611110b048987E58894786C244/
│ │ │ ├── creation_data.json
│ │ │ └── metadata.json
│ │ ├── 0x9d27527Ada2CF29fBDAB2973cfa243845a08Bd3F/
│ │ │ ├── creation_data.json
│ │ │ └── metadata.json
│ │ └── 0xDb53f47aC61FE54F456A4eb3E09832D08Dd7BEec/
│ │ ├── creation_data.json
│ │ └── metadata.json
│ ├── fixtures/
│ │ ├── Derive/
│ │ │ ├── mnemonic_chinese_simplified.txt
│ │ │ ├── mnemonic_chinese_traditional.txt
│ │ │ ├── mnemonic_czech.txt
│ │ │ ├── mnemonic_english.txt
│ │ │ ├── mnemonic_french.txt
│ │ │ ├── mnemonic_italian.txt
│ │ │ ├── mnemonic_japanese.txt
│ │ │ ├── mnemonic_korean.txt
│ │ │ ├── mnemonic_portuguese.txt
│ │ │ └── mnemonic_spanish.txt
│ │ ├── Dir/
│ │ │ ├── depth1
│ │ │ └── nested/
│ │ │ ├── depth2
│ │ │ └── nested2/
│ │ │ └── depth3
│ │ ├── File/
│ │ │ ├── ignored/
│ │ │ │ └── .gitignore
│ │ │ └── read.txt
│ │ ├── GetCode/
│ │ │ ├── HardhatWorkingContract.json
│ │ │ ├── HuffWorkingContract.json
│ │ │ ├── Override.json
│ │ │ ├── Override.sol
│ │ │ ├── UnlinkedContract.sol
│ │ │ ├── WorkingContract.json
│ │ │ └── WorkingContract.sol
│ │ ├── Json/
│ │ │ ├── Issue4402.json
│ │ │ ├── Issue4630.json
│ │ │ ├── nested_json_struct.json
│ │ │ ├── test.json
│ │ │ ├── test_allocs.json
│ │ │ ├── whole_json.json
│ │ │ ├── write_complex_test.json
│ │ │ └── write_test.json
│ │ ├── Rpc/
│ │ │ ├── README.md
│ │ │ ├── balance_params.json
│ │ │ └── eth_getLogs.json
│ │ ├── Toml/
│ │ │ ├── Issue4402.toml
│ │ │ ├── nested_toml_struct.toml
│ │ │ ├── test.toml
│ │ │ ├── whole_toml.toml
│ │ │ ├── write_complex_test.toml
│ │ │ └── write_test.toml
│ │ ├── broadcast.log.json
│ │ └── broadcast.sensitive.log.json
│ ├── forge-std-rev
│ ├── foundry.toml
│ ├── multi-version/
│ │ ├── Counter.sol
│ │ ├── Importer.sol
│ │ └── cheats/
│ │ ├── GetCode.t.sol
│ │ └── GetCode17.t.sol
│ ├── paris/
│ │ ├── cheats/
│ │ │ ├── Fork.t.sol
│ │ │ ├── GasSnapshots.t.sol
│ │ │ └── LastCallGas.t.sol
│ │ ├── core/
│ │ │ └── BeforeTest.t.sol
│ │ ├── fork/
│ │ │ └── Transact.t.sol
│ │ └── spec/
│ │ └── ShanghaiCompat.t.sol
│ ├── src/
│ │ ├── Counter.vy
│ │ └── ICounter.vyi
│ └── utils/
│ ├── DSTest.sol
│ ├── Test.sol
│ ├── Vm.sol
│ └── console.sol
└── typos.toml
================================================
FILE CONTENTS
================================================
================================================
FILE: .cargo/config.toml
================================================
[alias]
cheats = "test -p foundry-cheatcodes-spec --features schema tests::"
test-debugger = "test -p forge --test cli manual_debug_setup -- --include-ignored --nocapture"
bless-lints = "test -p forge --test ui -- --bless"
# Increase the stack size to 10MB for Windows targets, which is in line with Linux
# (whereas default for Windows is 1MB).
[target.x86_64-pc-windows-msvc]
rustflags = ["-Clink-arg=/STACK:10000000"]
[target.i686-pc-windows-msvc]
rustflags = ["-Clink-arg=/STACK:10000000"]
================================================
FILE: .config/nextest.toml
================================================
[test-groups]
[profile.default]
retries = { backoff = "exponential", count = 2, delay = "5s", jitter = true }
slow-timeout = { period = "30s", terminate-after = 3 }
# Exclude flaky tests from regular CI runs - they run in nightly test-flaky workflow
default-filter = "not test(/flaky_/)"
[[profile.default.overrides]]
filter = "test(/ext_integration/)"
slow-timeout = { period = "5m", terminate-after = 4 }
# Do not re-run so that `cargo cheats` is ran locally.
[[profile.default.overrides]]
filter = "package(foundry-cheatcodes-spec)"
retries = 0
# Profile for running flaky tests (used by nightly CI and for local debugging)
# Run with: cargo nextest run --profile flaky
[profile.flaky]
default-filter = "test(/flaky_/)"
retries = { backoff = "exponential", count = 5, delay = "10s", jitter = true }
slow-timeout = { period = "60s", terminate-after = 3 }
================================================
FILE: .devcontainer/Dockerfile.dev
================================================
FROM ubuntu:22.04
ARG USERNAME=foundry
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG PYTHON_VERSION=3.14
ARG NODE_MAJOR=20
ARG VYPER_VERSION=0.4.3
ENV DEBIAN_FRONTEND=noninteractive
ENV CARGO_TERM_COLOR=always \
RUST_BACKTRACE=full
WORKDIR /workspace
RUN apt-get update && apt-get install -y --no-install-recommends \
# Build tools
build-essential \
clang \
lld \
pkg-config \
# Network/SSL
curl \
ca-certificates \
gnupg \
libssl-dev \
# Version control & utils
git \
sudo \
unzip \
# Python
python${PYTHON_VERSION} \
python3-pip \
python${PYTHON_VERSION}-venv \
# Add Node.js repo
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
# Update again after adding repo and install Node.js
&& apt-get update && apt-get install -y --no-install-recommends \
nodejs \
# Clean up apt cache
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Ensure python points to the installed python version
RUN ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python && \
ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python3
# Create non-root user with sudo privileges
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \
# Setup sudo without password prompt
&& echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
# Add user to the sudo group (standard practice)
&& usermod -aG sudo $USERNAME
# Switch to the non-root user
USER $USERNAME
WORKDIR /home/$USERNAME
# --- User-specific installations ---
# Install Bun
ENV BUN_INSTALL="/home/$USERNAME/.bun"
ENV PATH="$BUN_INSTALL/bin:$PATH"
RUN curl -fsSL https://bun.sh/install | bash
# Install Rust & cargo-nextest
ENV CARGO_HOME="/home/$USERNAME/.cargo"
ENV RUSTUP_HOME="/home/$USERNAME/.rustup"
ENV PATH="$CARGO_HOME/bin:$PATH"
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& cargo install cargo-nextest --locked
# Install Vyper using pip
# Ensure pip user install directory is in PATH
ENV PYTHONUSERBASE="/home/$USERNAME/.local"
ENV PATH="$PYTHONUSERBASE/bin:$PATH"
RUN pip3 install --user vyper==${VYPER_VERSION}
# Switch back to the main workspace directory
WORKDIR /workspace
================================================
FILE: .devcontainer/devcontainer.json
================================================
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "Foundry Development",
"build": {
"context": "..",
"dockerfile": "Dockerfile.dev"
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"upgradePackages": true
}
},
"forwardPorts": [],
"postCreateCommand": "rustup default stable && rustup update",
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"serayuzgur.crates",
"tamasfe.even-better-toml",
"ms-python.python",
"dbaeumer.vscode-eslint",
"oven.bun-vscode"
],
"settings": {
"rust-analyzer.checkOnSave": true,
"rust-analyzer.cargo.features": "all"
}
}
},
"remoteUser": "foundry",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"workspaceFolder": "/workspace",
"mounts": [
"source=${localEnv:HOME}/.cargo/registry,target=/home/foundry/.cargo/registry,type=bind,consistency=cached",
"source=${localEnv:HOME}/.cargo/git,target=/home/foundry/.cargo/git,type=bind,consistency=cached"
]
}
================================================
FILE: .dockerignore
================================================
target
.github
================================================
FILE: .git-blame-ignore-revs
================================================
# Since version 2.23 (released in August 2019), git-blame has a feature
# to ignore or bypass certain commits.
#
# This file contains a list of commits that are not likely what you
# are looking for in a blame, such as mass reformatting or renaming.
# You can set this file as a default ignore file for blame by running
# the following command.
#
# $ git config blame.ignoreRevsFile .git-blame-ignore-revs
# fmt: all (#3398)
860d083183b51a6f8d865408ef1a44aa694d6862
# chore: bump to rust edition 2024 (#10802)
710a1584aae8e0f8ca8d5ba552632dc72381091e
================================================
FILE: .gitattributes
================================================
crates/cheatcodes/assets/*.json linguist-generated
testdata/cheats/Vm.sol linguist-generated
bun.lock linguist-generated
# See <https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header>
*.rs diff=rust
crates/lint/testdata/* text eol=lf
testdata/fixtures/**/* eol=lf
dprint.json linguist-language=JSON-with-Comments
.devcontainer/devcontainer.json linguist-language=JSON-with-Comments
.env.example linguist-language=Dotenv
================================================
FILE: .github/CODEOWNERS
================================================
* @danipopes @mattsse @grandizzy @yash-atreya @zerosnacks @onbjerg @0xrusowsky
================================================
FILE: .github/FLAKY_TEST_FAILURE_TEMPLATE.md
================================================
---
title: "bug: flaky tests workflow failed"
labels: P-normal, T-bug
---
The nightly flaky tests workflow has failed. This indicates external API rate limiting, RPC reliability issues, or other intermittent failures that may affect users.
Check the [flaky tests workflow page]({{ env.WORKFLOW_URL }}) for details.
This issue was raised by the workflow at `.github/workflows/test-flaky.yml`.
================================================
FILE: .github/FLAKY_TEST_ISOLATE_FAILURE_TEMPLATE.md
================================================
---
title: "bug: flaky tests workflow failed (isolate)"
labels: P-normal, T-bug
---
The nightly flaky tests workflow (with isolation mode enabled) has failed. This indicates external API rate limiting, RPC reliability issues, or other intermittent failures that may affect users.
Check the [flaky tests workflow page]({{ env.WORKFLOW_URL }}) for details.
This issue was raised by the workflow at `.github/workflows/test-isolate.yml`.
================================================
FILE: .github/INTEGRATION_FAILURE.md
================================================
---
title: "bug: long-running integration tests failed"
labels: P-high, T-bug
---
The heavy (long-running) integration tests have failed. This indicates a regression in Foundry.
Check the [heavy integration tests workflow page]({{ env.WORKFLOW_URL }}) for details.
This issue was raised by the workflow at `.github/workflows/heavy-integration.yml`.
================================================
FILE: .github/ISSUE_TEMPLATE/BUG-FORM.yml
================================================
name: Bug report
description: File a bug report
type: Bug
labels: ["T-bug", "T-needs-triage"]
body:
- type: markdown
attributes:
value: |
Please ensure that the bug has not already been filed in the issue tracker.
Thanks for taking the time to report this bug!
- type: dropdown
id: component
attributes:
label: Component
description: What component is the bug in?
multiple: true
options:
- Forge
- Cast
- Anvil
- Foundryup
- Chisel
- Other (please describe)
validations:
required: true
- type: checkboxes
attributes:
label: Have you ensured that all of these are up to date?
options:
- label: Foundry
- label: Foundryup
- type: input
attributes:
label: What version of Foundry are you on?
placeholder: "Run forge --version and paste the output here"
- type: input
attributes:
label: What version of Foundryup are you on?
placeholder: "Run foundryup --version and paste the output here"
- type: input
attributes:
label: What command(s) is the bug in?
description: Leave empty if not relevant
placeholder: "For example: forge test"
- type: dropdown
attributes:
label: Operating System
description: What operating system are you on?
options:
- Windows
- macOS (Intel)
- macOS (Apple Silicon)
- Linux
- type: textarea
id: description
attributes:
label: Describe the bug
description: Please include relevant Solidity snippets as well if relevant.
validations:
required: true
================================================
FILE: .github/ISSUE_TEMPLATE/FEATURE-FORM.yml
================================================
name: Feature request
description: Suggest a feature
type: Feature
labels: ["T-feature", "T-needs-triage"]
body:
- type: markdown
attributes:
value: |
Please ensure that the feature has not already been requested in the issue tracker.
Thanks for helping us improve Foundry!
- type: dropdown
id: component
attributes:
label: Component
description: What component is the feature for?
multiple: true
options:
- Forge
- Cast
- Anvil
- Foundryup
- Chisel
- Other (please describe)
validations:
required: true
- type: textarea
id: description
attributes:
label: Describe the feature you would like
description: Please also describe what the feature is aiming to solve, if relevant.
validations:
required: true
- type: textarea
attributes:
label: Additional context
description: Add any other context to the feature (like screenshots, resources)
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: true
contact_links:
- name: Support
url: https://t.me/foundry_support
about: This issue tracker is only for bugs and feature requests. Support is available on Telegram!
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide: https://github.com/foundry-rs/foundry/blob/HEAD/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options ** -->
## Motivation
<!--
Explain the context and why you're making that change. What is the problem
you're trying to solve? In some cases there is not a problem and this can be
thought of as being the motivation for your change.
-->
## Solution
<!--
Summarize the solution and provide any necessary context needed to understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
================================================
FILE: .github/RELEASE_FAILURE_ISSUE_TEMPLATE.md
================================================
---
title: "bug: release workflow failed"
labels: P-high, T-bug
---
The release workflow has failed. Some or all binaries might have not been published correctly.
Check the [release workflow page]({{ env.WORKFLOW_URL }}) for details.
This issue was raised by the workflow at `.github/workflows/release.yml`.
================================================
FILE: .github/TEST_ISOLATE_FAILURE_TEMPLATE.md
================================================
---
title: "bug: test-isolate workflow failed"
labels: P-high, T-bug
---
The daily test-isolate workflow (tests with isolation mode enabled) has failed. This indicates a regression in Foundry's test isolation behavior.
Check the [test-isolate workflow page]({{ env.WORKFLOW_URL }}) for details.
This issue was raised by the workflow at `.github/workflows/test-isolate.yml`.
================================================
FILE: .github/changelog.json
================================================
{
"categories": [
{
"title": "## Breaking changes",
"labels": ["T-likely-breaking "]
},
{
"title": "## Anvil Features",
"labels": ["C-anvil", "T-feature"],
"exhaustive": true,
"exhaustive_rules": false
},
{
"title": "## Anvil Fixes",
"labels": ["C-anvil", "T-bug"],
"exhaustive": true,
"exhaustive_rules": false
},
{
"title": "## Cast Features",
"labels": ["C-cast", "T-feature"],
"exhaustive": true,
"exhaustive_rules": false
},
{
"title": "## Cast Fixes",
"labels": ["C-cast", "T-bug"],
"exhaustive": true,
"exhaustive_rules": false
},
{
"title": "## Chisel Features",
"labels": ["C-chisel", "T-feature"],
"exhaustive": true,
"exhaustive_rules": false
},
{
"title": "## Chisel Fixes",
"labels": ["C-chisel", "T-bug"],
"exhaustive": true,
"exhaustive_rules": false
},
{
"title": "## Forge Features",
"labels": ["C-forge", "T-feature"],
"exhaustive": true,
"exhaustive_rules": false
},
{
"title": "## Forge Fixes",
"labels": ["C-forge", "T-bug"],
"exhaustive": true,
"exhaustive_rules": false
},
{
"title": "## Performance improvements",
"labels": ["T-perf"]
}
],
"ignore_labels": ["L-ignore"],
"template": "${{CHANGELOG}}\n## Other\n\n${{UNCATEGORIZED}}\n## Full Changelog:\n ${{RELEASE_DIFF}}",
"pr_template": "- ${{TITLE}} (#${{NUMBER}}) by @${{AUTHOR}}",
"empty_template": "- No changes",
"max_pull_requests": 500,
"max_back_track_time_days": 120
}
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "softprops/action-gh-release"
================================================
FILE: .github/scripts/combine-benchmarks.sh
================================================
#!/bin/bash
set -euo pipefail
# Script to combine individual benchmark results into LATEST.md
# Usage: ./combine-benchmarks.sh <output_dir>
OUTPUT_DIR="${1:-benches}"
# Create output directory if it doesn't exist
mkdir -p "$OUTPUT_DIR"
# Define the benchmark files and their section names
declare -A BENCHMARK_FILES=(
["forge_test_bench.md"]="Forge Test"
["forge_isolate_test_bench.md"]="Forge Test (Isolated)"
["forge_build_bench.md"]="Forge Build"
["forge_coverage_bench.md"]="Forge Coverage"
)
# Function to extract a specific section from a benchmark file
extract_section() {
local file=$1
local section=$2
local in_section=0
while IFS= read -r line; do
if [[ "$line" =~ ^##[[:space:]]+"$section" ]]; then
in_section=1
echo "$line"
elif [[ $in_section -eq 1 && "$line" =~ ^##[[:space:]] && ! "$line" =~ ^##[[:space:]]+"$section" ]]; then
break
elif [[ $in_section -eq 1 ]]; then
echo "$line"
fi
done < "$file"
}
# Function to extract summary info (repos and versions) from a file
extract_summary_info() {
local file=$1
local in_summary=0
local in_repos=0
local in_versions=0
while IFS= read -r line; do
# Check for Summary section
if [[ "$line" =~ ^##[[:space:]]+Summary ]]; then
in_summary=1
continue
fi
# Check for Repositories Tested subsection
if [[ $in_summary -eq 1 && "$line" =~ ^###[[:space:]]+Repositories[[:space:]]+Tested ]]; then
in_repos=1
echo "### Repositories Tested"
echo
continue
fi
# Check for Foundry Versions subsection
if [[ $in_summary -eq 1 && "$line" =~ ^###[[:space:]]+Foundry[[:space:]]+Versions ]]; then
in_repos=0
in_versions=1
echo "### Foundry Versions"
echo
continue
fi
# End of summary section
if [[ $in_summary -eq 1 && "$line" =~ ^##[[:space:]] && ! "$line" =~ ^##[[:space:]]+Summary ]]; then
break
fi
# Output repo or version lines
if [[ ($in_repos -eq 1 || $in_versions -eq 1) && -n "$line" ]]; then
echo "$line"
fi
done < "$file"
}
# Function to extract benchmark table from a section
extract_benchmark_table() {
local file=$1
local section=$2
local in_section=0
local found_table=0
while IFS= read -r line; do
if [[ "$line" =~ ^##[[:space:]]+"$section" ]]; then
in_section=1
continue
elif [[ $in_section -eq 1 && "$line" =~ ^##[[:space:]] && ! "$line" =~ ^##[[:space:]]+"$section" ]]; then
break
elif [[ $in_section -eq 1 ]]; then
# Skip empty lines before table
if [[ -z "$line" && $found_table -eq 0 ]]; then
continue
fi
# Detect table start
if [[ "$line" =~ ^\|[[:space:]]*Repository ]]; then
found_table=1
fi
# Output table lines
if [[ $found_table -eq 1 && -n "$line" ]]; then
echo "$line"
fi
fi
done < "$file"
}
# Function to extract system information
extract_system_info() {
local file=$1
awk '/^## System Information/ { found=1; next } found { print }' "$file"
}
# Start building LATEST.md
cat > "$OUTPUT_DIR/LATEST.md" << EOF
# 📊 Foundry Benchmark Results
**Generated at**: $(date -u '+%Y-%m-%d %H:%M:%S UTC')
EOF
# Process each benchmark file
FIRST_FILE=1
SYSTEM_INFO=""
for bench_file in "forge_test_bench.md" "forge_isolate_test_bench.md" "forge_build_bench.md" "forge_coverage_bench.md"; do
if [ -f "$OUTPUT_DIR/$bench_file" ]; then
echo "Processing $bench_file..."
SECTION_NAME="${BENCHMARK_FILES[$bench_file]:-$bench_file}"
# Grouped output for ShellCheck SC2129
{
# Add section header
echo "## $SECTION_NAME"
echo
# Add summary info
extract_summary_info "$OUTPUT_DIR/$bench_file"
echo
# Handle benchmark tables
if [[ "$bench_file" == "forge_test_bench.md" ]]; then
extract_benchmark_table "$OUTPUT_DIR/$bench_file" "Forge Test"
echo
if grep -q "^## Forge Fuzz Test" "$OUTPUT_DIR/$bench_file"; then
echo "## Forge Fuzz Test"
echo
extract_benchmark_table "$OUTPUT_DIR/$bench_file" "Forge Fuzz Test"
fi
elif [[ "$bench_file" == "forge_build_bench.md" ]]; then
echo "### No Cache"
echo
extract_benchmark_table "$OUTPUT_DIR/$bench_file" "Forge Build (No Cache)"
echo
echo "### With Cache"
echo
extract_benchmark_table "$OUTPUT_DIR/$bench_file" "Forge Build (With Cache)"
else
extract_benchmark_table "$OUTPUT_DIR/$bench_file" "$SECTION_NAME"
fi
echo
} >> "$OUTPUT_DIR/LATEST.md"
# Extract system info from first file only
if [[ $FIRST_FILE -eq 1 ]]; then
SYSTEM_INFO=$(extract_system_info "$OUTPUT_DIR/$bench_file")
FIRST_FILE=0
fi
else
echo "Warning: $bench_file not found, skipping..."
fi
done
# Add system information at the end
if [[ -n "$SYSTEM_INFO" ]]; then
{
echo "## System Information"
echo
echo "$SYSTEM_INFO"
} >> "$OUTPUT_DIR/LATEST.md"
fi
echo "Successfully combined benchmark results into $OUTPUT_DIR/LATEST.md"
================================================
FILE: .github/scripts/commit-and-read-benchmarks.sh
================================================
#!/bin/bash
set -euo pipefail
# Script to commit benchmark results and read them for GitHub Actions output
# Usage: ./commit-and-read-benchmarks.sh <output_dir> <github_event_name> <github_repository>
OUTPUT_DIR="${1:-benches}"
GITHUB_EVENT_NAME="${2:-pull_request}"
GITHUB_REPOSITORY="${3:-}"
# Global variable for branch name
BRANCH_NAME=""
# Function to commit benchmark results
commit_results() {
echo "Configuring git..."
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
# For PR runs, fetch and checkout the PR branch to ensure we're up to date
if [ "$GITHUB_EVENT_NAME" = "pull_request" ] && [ -n "${GITHUB_HEAD_REF:-}" ]; then
echo "Fetching latest changes for PR branch: $GITHUB_HEAD_REF"
git fetch origin "$GITHUB_HEAD_REF"
git checkout -B "$GITHUB_HEAD_REF" "origin/$GITHUB_HEAD_REF"
fi
echo "Adding benchmark file..."
git add "$OUTPUT_DIR/LATEST.md"
if git diff --staged --quiet; then
echo "No changes to commit"
else
echo "Committing benchmark results..."
git commit -m "chore(\`benches\`): update benchmark results
🤖 Generated with [Foundry Benchmarks](https://github.com/${GITHUB_REPOSITORY}/actions)
Co-Authored-By: github-actions <github-actions@github.com>"
echo "Pushing to repository..."
if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
# For manual runs, we're on a new branch
git push origin "$BRANCH_NAME"
elif [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
# For PR runs, push to the PR branch
if [ -n "${GITHUB_HEAD_REF:-}" ]; then
echo "Pushing to PR branch: $GITHUB_HEAD_REF"
git push origin "$GITHUB_HEAD_REF"
else
echo "Error: GITHUB_HEAD_REF not set for pull_request event"
exit 1
fi
else
# This workflow should only run on workflow_dispatch or pull_request
echo "Error: Unexpected event type: $GITHUB_EVENT_NAME"
echo "This workflow only supports 'workflow_dispatch' and 'pull_request' events"
exit 1
fi
echo "Successfully pushed benchmark results"
fi
}
# Function to read benchmark results and output for GitHub Actions
read_results() {
if [ -f "$OUTPUT_DIR/LATEST.md" ]; then
echo "Reading benchmark results..."
# Output full results
{
echo 'results<<EOF'
cat "$OUTPUT_DIR/LATEST.md"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
# Format results for PR comment
echo "Formatting results for PR comment..."
FORMATTED_COMMENT=$("$(dirname "$0")/format-pr-comment.sh" "$OUTPUT_DIR/LATEST.md")
{
echo 'pr_comment<<EOF'
echo "$FORMATTED_COMMENT"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
echo "Successfully read and formatted benchmark results"
else
echo 'results=No benchmark results found.' >> "$GITHUB_OUTPUT"
echo 'pr_comment=No benchmark results found.' >> "$GITHUB_OUTPUT"
echo "Warning: No benchmark results found at $OUTPUT_DIR/LATEST.md"
fi
}
# Main execution
echo "Starting benchmark results processing..."
# Create new branch for manual runs
if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
echo "Manual workflow run detected, creating new branch..."
BRANCH_NAME="benchmarks/results-$(date +%Y%m%d-%H%M%S)"
git checkout -b "$BRANCH_NAME"
echo "Created branch: $BRANCH_NAME"
# Output branch name for later use
echo "branch_name=$BRANCH_NAME" >> "$GITHUB_OUTPUT"
fi
# Always commit benchmark results
echo "Committing benchmark results..."
commit_results
# Always read results for output
read_results
echo "Benchmark results processing complete"
================================================
FILE: .github/scripts/create-tag.js
================================================
module.exports = async ({ github, context }, tagName) => {
try {
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${tagName}`,
sha: context.sha,
force: true,
});
} catch (err) {
console.error(`Failed to create tag: ${tagName}`);
console.error(err);
}
};
================================================
FILE: .github/scripts/format-pr-comment.sh
================================================
#!/bin/bash
set -euo pipefail
# Script to format benchmark results for PR comment
# Usage: ./format-pr-comment.sh <benchmark_results_file>
RESULTS_FILE="${1:-}"
if [ -z "$RESULTS_FILE" ] || [ ! -f "$RESULTS_FILE" ]; then
echo "Error: Benchmark results file not provided or does not exist"
exit 1
fi
# Read the file content
CONTENT=$(cat "$RESULTS_FILE")
# Find where "## Forge Build" starts and split the content
# Extract everything before "## Forge Build"
BEFORE_FORGE_BUILD=$(echo "$CONTENT" | awk '/^## Forge Build$/ {exit} {print}')
# Extract everything from "## Forge Build" onwards
FROM_FORGE_BUILD=$(echo "$CONTENT" | awk '/^## Forge Build$/ {found=1} found {print}')
# Output the formatted comment with dropdown
cat << EOF
${BEFORE_FORGE_BUILD}
<details>
<summary>📈 View all benchmark results</summary>
${FROM_FORGE_BUILD}
</details>
EOF
================================================
FILE: .github/scripts/format.sh
================================================
#!/usr/bin/env bash
set -eo pipefail
# We have to ignore at shell level because testdata/ is not a valid Foundry project,
# so running `forge fmt` with `--root testdata` won't actually check anything
sol_files=()
while IFS= read -r -d '' file; do
sol_files+=("$file")
done < <(find testdata -name '*.sol' ! -name Vm.sol ! -name console.sol -print0)
# Run forge fmt on all found files
cargo run --bin forge -- fmt "$@" "${sol_files[@]}"
================================================
FILE: .github/scripts/matrices.py
================================================
#!/usr/bin/env python3
import json
import os
# A runner target
class Target:
# GHA runner
runner_label: str
# Rust target triple
target: str
# SVM Solc target
svm_target_platform: str
def __init__(self, runner_label: str, target: str, svm_target_platform: str):
self.runner_label = runner_label
self.target = target
self.svm_target_platform = svm_target_platform
# A single test suite to run.
class Case:
# Name of the test suite.
name: str
# Nextest filter expression.
filter: str
# Number of partitions to split the test suite into.
n_partitions: int
# Whether to run on non-Linux platforms for PRs. All platforms and tests are run on pushes.
pr_cross_platform: bool
def __init__(
self, name: str, filter: str, n_partitions: int, pr_cross_platform: bool
):
self.name = name
self.filter = filter
self.n_partitions = n_partitions
self.pr_cross_platform = pr_cross_platform
# GHA matrix entry
class Expanded:
name: str
runner_label: str
target: str
svm_target_platform: str
flags: str
partition: int
def __init__(
self,
name: str,
runner_label: str,
target: str,
svm_target_platform: str,
flags: str,
partition: int,
):
self.name = name
self.runner_label = runner_label
self.target = target
self.svm_target_platform = svm_target_platform
self.flags = flags
self.partition = partition
profile = os.environ.get("PROFILE")
is_pr = os.environ.get("EVENT_NAME") == "pull_request"
t_linux_x86 = Target(
"depot-ubuntu-latest-16", "x86_64-unknown-linux-gnu", "linux-amd64"
)
t_linux_arm = Target(
"depot-ubuntu-latest-arm-16", "aarch64-unknown-linux-gnu", "linux-aarch64"
)
t_macos = Target("depot-macos-latest", "aarch64-apple-darwin", "macosx-aarch64")
t_windows = Target("depot-windows-latest-16", "x86_64-pc-windows-msvc", "windows-amd64")
targets = [t_linux_x86] if is_pr else [t_linux_x86, t_linux_arm, t_macos, t_windows]
config = [
Case(
name="all",
filter="!test(/\\bext_integration/)",
n_partitions=1,
pr_cross_platform=True,
),
Case(
name="external",
filter="package(=forge) & test(/\\bext_integration/)",
n_partitions=1,
pr_cross_platform=False,
),
]
def main():
expanded = []
for target in targets:
for case in config:
if is_pr and (not case.pr_cross_platform and target != t_linux_x86):
continue
for partition in range(1, case.n_partitions + 1):
os_str = ""
if len(targets) > 1:
os_str = f" ({target.target})"
name = case.name
flags = f"-E '{case.filter}'"
if case.n_partitions > 1:
s = f"{partition}/{case.n_partitions}"
name += f" ({s})"
flags += f" --partition count:{s}"
if profile == "isolate":
flags += " --features=isolate-by-default"
name += os_str
flags += " --no-fail-fast"
obj = Expanded(
name=name,
runner_label=target.runner_label,
target=target.target,
svm_target_platform=target.svm_target_platform,
flags=flags,
partition=partition,
)
expanded.append(vars(obj))
print_json({"include": expanded})
def print_json(obj):
print(json.dumps(obj), end="", flush=True)
if __name__ == "__main__":
main()
================================================
FILE: .github/scripts/move-tag.js
================================================
module.exports = async ({ github, context }, tagName) => {
try {
await github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `tags/${tagName}`,
sha: context.sha,
force: true,
});
} catch (err) {
console.error(`Failed to move nightly tag.`);
console.error(`This should only happen the first time.`);
console.error(err);
}
};
================================================
FILE: .github/scripts/prune-prereleases.js
================================================
// In case node 21 is not used.
function groupBy(array, keyOrIterator) {
var iterator;
// use the function passed in, or create one
if(typeof keyOrIterator !== 'function') {
const key = String(keyOrIterator);
iterator = function (item) { return item[key]; };
} else {
iterator = keyOrIterator;
}
return array.reduce(function (memo, item) {
const key = iterator(item);
memo[key] = memo[key] || [];
memo[key].push(item);
return memo;
}, {});
}
module.exports = async ({ github, context }) => {
console.log("Pruning old prereleases");
// doc: https://docs.github.com/en/rest/releases/releases
const { data: releases } = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo,
});
let nightlies = releases.filter(
release =>
// Only consider releases tagged `nightly-${SHA}` for deletion
release.tag_name.includes("nightly") &&
release.tag_name !== "nightly"
);
// Pruning rules:
// 1. only keep the earliest (by created_at) release of the month
// 2. to keep the newest 30 nightlies (to make sure nightlies are kept until the next monthly release)
// Notes:
// - This addresses https://github.com/foundry-rs/foundry/issues/6732
// - Name of the release may deviate from created_at due to the usage of different timezones.
// Group releases by months.
// Per doc:
// > The latest release is the most recent non-prerelease, non-draft release, sorted by the created_at attribute.
const groups = groupBy(nightlies, i => i.created_at.slice(0, 7));
const nightliesToPrune = Object.values(groups)
.reduce((acc, cur) => acc.concat(cur.slice(0, -1)), []) // rule 1
.slice(30); // rule 2
for (const nightly of nightliesToPrune) {
console.log(`Deleting nightly: ${nightly.tag_name}`);
await github.rest.repos.deleteRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: nightly.id,
});
console.log(`Deleting nightly tag: ${nightly.tag_name}`);
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `tags/${nightly.tag_name}`,
});
}
console.log("Done.");
};
================================================
FILE: .github/scripts/setup-foundryup.sh
================================================
#!/bin/bash
set -euo pipefail
# Script to setup foundryup in CI environment
# This ensures foundryup is available in PATH for the benchmark binary
echo "Setting up foundryup..."
# Check if foundryup script exists in the repo
if [ ! -f "foundryup/foundryup" ]; then
echo "Error: foundryup/foundryup script not found in repository"
exit 1
fi
# Copy foundryup to a location in PATH
echo "Copying foundryup to /usr/local/bin..."
sudo cp foundryup/foundryup /usr/local/bin/foundryup
sudo chmod +x /usr/local/bin/foundryup
# Verify foundryup is accessible
if ! command -v foundryup &> /dev/null; then
echo "Error: foundryup not found in PATH after installation"
exit 1
fi
echo "foundryup is now available at: $(which foundryup)"
# Create foundry directories
echo "Creating foundry directories..."
# Use FOUNDRY_DIR if set, otherwise default to $HOME/.foundry
FOUNDRY_DIR="${FOUNDRY_DIR:-$HOME/.foundry}"
echo "Using FOUNDRY_DIR: $FOUNDRY_DIR"
# Create all necessary directories
mkdir -p "$FOUNDRY_DIR/bin"
mkdir -p "$FOUNDRY_DIR/versions"
mkdir -p "$FOUNDRY_DIR/share/man/man1"
# Export PATH for current session
export PATH="$FOUNDRY_DIR/bin:$PATH"
# Run foundryup to install default version
echo "Installing default foundry version..."
foundryup
# Verify installation
if command -v forge &> /dev/null; then
echo "Forge installed successfully: $(forge --version)"
else
echo "Warning: forge not found in PATH after installation"
fi
echo "Foundry setup complete!"
================================================
FILE: .github/scripts/shellcheck.sh
================================================
#!/usr/bin/env bash
# runs shellcheck and prints GitHub Actions annotations for each warning and error
# https://github.com/koalaman/shellcheck
IGNORE_DIRS=(
"./.git/*"
"./target/*"
)
ignore_args=()
for dir in "${IGNORE_DIRS[@]}"; do
ignore_args+=(-not -path "$dir")
done
find . -name "*.sh" "${ignore_args[@]}" -exec shellcheck -f gcc {} + | \
while IFS=: read -r file line col severity msg; do
level="warning"
[[ "$severity" == *error* ]] && level="error"
file="${file#./}"
echo "::${level} file=${file},line=${line},col=${col}::${file}:${line}:${col}:${msg}"
done
exit "${PIPESTATUS[0]}"
================================================
FILE: .github/workflows/benchmarks.yml
================================================
name: Foundry Benchmarks
permissions: {}
on:
workflow_dispatch:
inputs:
pr_number:
description: "PR number to comment on (optional)"
required: false
type: string
versions:
description: "Comma-separated list of Foundry versions to benchmark (e.g., stable,nightly,v1.0.0)"
required: false
type: string
default: "stable,nightly"
repos:
description: "Comma-separated list of repos to benchmark (e.g., ithacaxyz/account:main,Vectorized/solady)"
required: false
type: string
default: "ithacaxyz/account:v0.3.2,Vectorized/solady:v0.1.22"
env:
ITHACAXYZ_ACCOUNT: "ithacaxyz/account:v0.3.2"
VECTORIZED_SOLADY: "Vectorized/solady:v0.1.22"
DEFAULT_REPOS: "ithacaxyz/account:v0.3.2,Vectorized/solady:v0.1.22"
RUSTC_WRAPPER: "sccache"
jobs:
run-benchmarks:
name: Run All Benchmarks
runs-on: depot-ubuntu-24.04-32
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential pkg-config
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: stable
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- name: Setup Foundry
env:
FOUNDRY_DIR: ${{ github.workspace }}/.foundry
GITHUB_WORKSPACE: ${{ github.workspace }}
run: |
./.github/scripts/setup-foundryup.sh
printf '%s\n' "$GITHUB_WORKSPACE/.foundry/bin" >> "$GITHUB_PATH"
- name: Build benchmark binary
run: cargo build --release --bin foundry-bench
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
- name: Install hyperfine
run: |
curl -L https://github.com/sharkdp/hyperfine/releases/download/v1.19.0/hyperfine-v1.19.0-x86_64-unknown-linux-gnu.tar.gz | tar xz
sudo mv hyperfine-v1.19.0-x86_64-unknown-linux-gnu/hyperfine /usr/local/bin/
rm -rf hyperfine-v1.19.0-x86_64-unknown-linux-gnu
- name: Run forge test benchmarks
env:
FOUNDRY_DIR: ${{ github.workspace }}/.foundry
run: |
VERSIONS="${{ github.event.inputs.versions || 'stable,nightly' }}"
REPOS="${{ github.event.inputs.repos || env.DEFAULT_REPOS }}"
./target/release/foundry-bench --output-dir ./benches --force-install \
--versions $VERSIONS \
--repos $REPOS \
--benchmarks forge_test,forge_fuzz_test \
--output-file forge_test_bench.md
- name: Run forge isolate test benchmarks
env:
FOUNDRY_DIR: ${{ github.workspace }}/.foundry
run: |
VERSIONS="${{ github.event.inputs.versions || 'stable,nightly' }}"
# Isolate tests default to Vectorized/solady but can be overridden
REPOS="${{ github.event.inputs.repos || env.VECTORIZED_SOLADY }}"
./target/release/foundry-bench --output-dir ./benches --force-install \
--versions $VERSIONS \
--repos $REPOS \
--benchmarks forge_isolate_test \
--output-file forge_isolate_test_bench.md
- name: Run forge build benchmarks
env:
FOUNDRY_DIR: ${{ github.workspace }}/.foundry
run: |
VERSIONS="${{ github.event.inputs.versions || 'stable,nightly' }}"
REPOS="${{ github.event.inputs.repos || env.DEFAULT_REPOS }}"
./target/release/foundry-bench --output-dir ./benches --force-install \
--versions $VERSIONS \
--repos $REPOS \
--benchmarks forge_build_no_cache,forge_build_with_cache \
--output-file forge_build_bench.md
- name: Run forge coverage benchmarks
env:
FOUNDRY_DIR: ${{ github.workspace }}/.foundry
run: |
VERSIONS="${{ github.event.inputs.versions || 'stable,nightly' }}"
# Coverage only runs on ithacaxyz/account:v0.3.2
./target/release/foundry-bench --output-dir ./benches --force-install \
--versions $VERSIONS \
--repos ${{ env.ITHACAXYZ_ACCOUNT }} \
--benchmarks forge_coverage \
--output-file forge_coverage_bench.md
- name: Combine benchmark results
run: ./.github/scripts/combine-benchmarks.sh benches
- name: Commit and read benchmark results
id: benchmark_results
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}
run: ./.github/scripts/commit-and-read-benchmarks.sh benches "${{ github.event_name }}" "${{ github.repository }}"
- name: Upload benchmark results as artifacts
uses: actions/upload-artifact@v7
with:
name: benchmark-results
path: |
benches/forge_test_bench.md
benches/forge_isolate_test_bench.md
benches/forge_build_bench.md
benches/forge_coverage_bench.md
benches/LATEST.md
outputs:
branch_name: ${{ steps.benchmark_results.outputs.branch_name }}
pr_comment: ${{ steps.benchmark_results.outputs.pr_comment }}
publish-results:
name: Publish Results
needs: run-benchmarks
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Download benchmark results
uses: actions/download-artifact@v8
with:
name: benchmark-results
path: benches/
- name: Push branch for manual runs
if: github.event_name == 'workflow_dispatch'
run: |
git push origin "${{ needs.run-benchmarks.outputs.branch_name }}"
echo "Pushed branch: ${{ needs.run-benchmarks.outputs.branch_name }}"
- name: Create PR for manual runs
if: github.event_name == 'workflow_dispatch'
uses: actions/github-script@v8
with:
script: |
const branchName = '${{ needs.run-benchmarks.outputs.branch_name }}';
const prComment = `${{ needs.run-benchmarks.outputs.pr_comment }}`;
// Create the pull request
const { data: pr } = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'chore(bench): update benchmark results',
head: branchName,
base: 'master',
body: `## Benchmark Results Update
This PR contains the latest benchmark results from a manual workflow run.
${prComment}
---
🤖 This PR was automatically generated by the [Foundry Benchmarks workflow](https://github.com/${{ github.repository }}/actions).`
});
console.log(`Created PR #${pr.number}: ${pr.html_url}`);
- name: Comment on PR
if: github.event.inputs.pr_number != '' || github.event_name == 'pull_request'
uses: actions/github-script@v8
with:
script: |
const prNumber = ${{ github.event.inputs.pr_number || github.event.pull_request.number }};
const prComment = `${{ needs.run-benchmarks.outputs.pr_comment }}`;
const comment = `${prComment}
---
🤖 This comment was automatically generated by the [Foundry Benchmarks workflow](https://github.com/${{ github.repository }}/actions).
To run benchmarks manually: Go to [Actions](https://github.com/${{ github.repository }}/actions/workflows/benchmarks.yml) → "Run workflow"`;
github.rest.issues.createComment({
issue_number: prNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
================================================
FILE: .github/workflows/bump-forge-std.yml
================================================
# Daily CI job to update forge-std version used for tests if new release has been published
name: bump-forge-std
permissions: {}
on:
schedule:
- cron: "0 0 * * *" # Run daily at midnight UTC
workflow_dispatch: # Needed so we can run it manually
jobs:
update-tag:
name: update forge-std tag
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Fetch and update forge-std tag
run: curl 'https://api.github.com/repos/foundry-rs/forge-std/tags' | jq '.[0].commit.sha' -jr > testdata/forge-std-rev
- name: Create pull request
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7
with:
commit-message: "chore: bump forge-std version used for tests"
title: "chore(tests): bump forge-std version"
body: |
New release of forge-std has been published, bump forge-std version used in tests. Likely some fixtures need to be updated.
branch: chore/bump-forge-std
================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
permissions: {}
on:
push:
branches: [master]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTC_WRAPPER: "sccache"
jobs:
test:
uses: ./.github/workflows/test.yml
permissions:
contents: read
with:
profile: default
secrets: inherit
docs:
uses: ./.github/workflows/docs.yml
permissions:
contents: read
pages: write
id-token: write
secrets: inherit
doctest:
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: stable
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- run: cargo test --workspace --doc
typos:
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: crate-ci/typos@631208b7aac2daa8b707f55e7331f9112b0e062d # v1
shellcheck:
runs-on: depot-ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Shellcheck
shell: bash
run: ./.github/scripts/shellcheck.sh
clippy:
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: nightly
components: clippy
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- run: cargo clippy --workspace --all-targets --all-features
env:
RUSTFLAGS: -Dwarnings
rustfmt:
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: nightly
components: rustfmt
- run: cargo fmt --all --check
forge-fmt:
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: stable
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- name: forge fmt
shell: bash
run: ./.github/scripts/format.sh --check
crate-checks:
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: stable
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: taiki-e/install-action@94a7388bec5d4c8dd93e3ebf09e0ff448f3f6f4d # v2
with:
tool: cargo-hack
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- run: cargo hack check
deny:
uses: tempoxyz/ci/.github/workflows/deny.yml@268b3ce142717ff86c58fbbcc3abc3f109f0fb8d # main
permissions:
contents: read
codeql:
name: analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
ci-success:
runs-on: ubuntu-latest
if: always()
permissions: {}
needs:
- test
- docs
- doctest
- typos
- clippy
- rustfmt
- forge-fmt
- crate-checks
- deny
- codeql
timeout-minutes: 30
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
with:
jobs: ${{ toJSON(needs) }}
================================================
FILE: .github/workflows/dependencies.yml
================================================
# Runs `cargo update` periodically.
name: dependencies
permissions: {}
on:
schedule:
- cron: "0 0 * * SUN" # Run weekly on Sundays at midnight UTC
workflow_dispatch: # Needed so we can run it manually
jobs:
update:
uses: tempoxyz/ci/.github/workflows/cargo-update-pr.yml@268b3ce142717ff86c58fbbcc3abc3f109f0fb8d # main
permissions:
contents: write
pull-requests: write
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
================================================
FILE: .github/workflows/docker-publish.yml
================================================
name: docker
permissions: {}
on:
workflow_dispatch:
inputs:
tag_name:
default: nightly
description: The tag we're building for
type: string
workflow_call:
inputs:
tag_name:
required: true
type: string
concurrency:
group: docker-${{ github.head_ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
# Keep in sync with `release.yml`.
RUST_PROFILE: dist
RUST_FEATURES: aws-kms,gcp-kms,turnkey,cli,asm-keccak,js-tracer
jobs:
build:
name: build and push
runs-on: depot-ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Login into registry ${{ env.REGISTRY }}
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Creates an additional 'latest' or 'nightly' tag
# If the job is triggered via cron schedule, tag nightly and nightly-{SHA}
# If the job is triggered via workflow dispatch and on a master branch, tag branch and latest
# Otherwise, just tag as the branch name
- name: Finalize Docker Metadata
id: docker_tagging
run: |
TAG="${{ inputs.tag_name }}"
REGISTRY="${{ env.REGISTRY }}"
IMAGE="${{ env.IMAGE_NAME }}"
if [[ "${{ github.event_name }}" == "schedule" ]]; then
printf "cron trigger, assigning nightly tag\n"
printf "docker_tags=%s/%s:nightly,%s/%s:nightly-%s\n" "$REGISTRY" "$IMAGE" "$REGISTRY" "$IMAGE" "$GITHUB_SHA" >> "$GITHUB_OUTPUT"
elif [[ "${GITHUB_REF##*/}" == "main" ]] || [[ "${GITHUB_REF##*/}" == "master" ]]; then
printf "manual trigger from master/main branch, assigning latest tag\n"
printf "docker_tags=%s/%s:%s,%s/%s:latest\n" "$REGISTRY" "$IMAGE" "${GITHUB_REF##*/}" "$REGISTRY" "$IMAGE" >> "$GITHUB_OUTPUT"
elif [[ "$TAG" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
MAJOR="v${BASH_REMATCH[1]}"
MINOR="v${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
printf "version tag release, assigning %s, %s, and %s tags\n" "$TAG" "$MINOR" "$MAJOR"
printf "docker_tags=%s/%s:%s,%s/%s:%s,%s/%s:%s\n" "$REGISTRY" "$IMAGE" "$TAG" "$REGISTRY" "$IMAGE" "$MINOR" "$REGISTRY" "$IMAGE" "$MAJOR" >> "$GITHUB_OUTPUT"
else
printf "Neither scheduled nor manual release from main branch. Just tagging as branch name\n"
printf "docker_tags=%s/%s:%s\n" "$REGISTRY" "$IMAGE" "${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT"
fi
# Log docker metadata to explicitly know what is being pushed
- name: Inspect Docker Metadata
run: |
printf "TAGS -> %s\n" "${{ steps.docker_tagging.outputs.docker_tags }}"
printf "LABELS -> %s\n" "${{ steps.meta.outputs.labels }}"
- name: Set up Depot CLI
uses: depot/setup-action@15c09a5f77a0840ad4bce955686522a257853461 # v1
- name: Build and push Foundry image
uses: depot/build-push-action@5f3b3c2e5a00f0093de47f657aeaefcedff27d18 # v1
with:
build-args: |
RUST_PROFILE=${{ env.RUST_PROFILE }}
RUST_FEATURES=${{ env.RUST_FEATURES }}
TAG_NAME=${{ inputs.tag_name }}
VERGEN_GIT_SHA=${{ github.sha }}
project: 8gkbxxjrpw
context: .
tags: ${{ steps.docker_tagging.outputs.docker_tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true
================================================
FILE: .github/workflows/docs.yml
================================================
name: docs
permissions: {}
on:
push:
branches:
- master
workflow_call:
concurrency:
group: docs-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTC_WRAPPER: "sccache"
jobs:
docs:
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: nightly
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- name: Build documentation
run: cargo doc --workspace --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: --cfg docsrs -D warnings --show-type-layout --generate-link-to-definition --enable-index-page -Zunstable-options
- name: Setup Pages
if: github.ref_name == 'master' && github.event_name == 'push'
uses: actions/configure-pages@v5
- name: Upload artifact
if: github.ref_name == 'master' && github.event_name == 'push'
uses: actions/upload-pages-artifact@v4
with:
path: ./target/doc
deploy-docs:
if: github.ref_name == 'master' && github.event_name == 'push'
needs: [docs]
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
================================================
FILE: .github/workflows/nix.yml
================================================
name: nix
permissions: {}
on:
schedule:
- cron: "0 0 * * SUN" # Run weekly on Sundays at midnight UTC
workflow_dispatch: # Needed so we can run it manually
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Opens a PR with an updated flake.lock file
update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: DeterminateSystems/determinate-nix-action@131015bad844610e5e6300f8a143bf625d3e74f4 # v3
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: DeterminateSystems/update-flake-lock@e80a657d7603606be0c69b117cfdc240f1e6af88 # main
with:
pr-title: "Update flake.lock"
pr-labels: |
L-ignore
A-dependencies
build:
strategy:
matrix:
runs-on: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.runs-on }}
permissions:
contents: read
steps:
- uses: DeterminateSystems/determinate-nix-action@131015bad844610e5e6300f8a143bf625d3e74f4 # v3
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Update flake.lock
run: nix flake update
- name: Activate nix env
run: nix develop -c echo Ok
- name: Check that we can compile all crates
run: nix develop -c cargo check --all-targets
================================================
FILE: .github/workflows/npm.yml
================================================
name: npm
permissions: {}
on:
workflow_dispatch:
inputs:
run_id:
type: string
required: false
description: The run id of the release to publish
workflow_run:
types: [completed]
workflows: [release]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
NPM_CONFIG_PROVENANCE: true
NPM_REGISTRY_URL: "https://registry.npmjs.org"
jobs:
publish-arch:
permissions:
contents: read
actions: read
id-token: write
name: ${{ matrix.tool }}-${{ matrix.os }}-${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
max-parallel: 3
fail-fast: false
matrix:
include:
- tool: forge
os: linux
arch: amd64
- tool: forge
os: linux
arch: arm64
- tool: forge
os: darwin
arch: amd64
- tool: forge
os: darwin
arch: arm64
- tool: forge
os: win32
arch: amd64
- tool: cast
os: linux
arch: amd64
- tool: cast
os: linux
arch: arm64
- tool: cast
os: darwin
arch: amd64
- tool: cast
os: darwin
arch: arm64
- tool: cast
os: win32
arch: amd64
- tool: anvil
os: linux
arch: amd64
- tool: anvil
os: linux
arch: arm64
- tool: anvil
os: darwin
arch: amd64
- tool: anvil
os: darwin
arch: arm64
- tool: anvil
os: win32
arch: amd64
- tool: chisel
os: linux
arch: amd64
- tool: chisel
os: linux
arch: arm64
- tool: chisel
os: darwin
arch: amd64
- tool: chisel
os: darwin
arch: arm64
- tool: chisel
os: win32
arch: amd64
# Run automatically after a successful 'release' workflow, or manually if a run_id is provided
if: >-
${{
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') ||
(github.event_name == 'workflow_dispatch' && inputs.run_id != '')
}}
outputs:
RELEASE_VERSION: ${{ steps.release-version.outputs.RELEASE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set Isolated Artifact Directory
id: paths
run: |
set -euo pipefail
printf 'artifact_dir=%s\n' "$RUNNER_TEMP/foundry_artifacts" >> "$GITHUB_OUTPUT"
- name: Prepare Isolated Artifact Directory
env:
ARTIFACT_DIR: ${{ steps.paths.outputs.artifact_dir }}
run: |
mkdir -p "$ARTIFACT_DIR"
ls -la "$ARTIFACT_DIR" || true
- name: Download Release Assets
uses: actions/download-artifact@v8
with:
merge-multiple: true
# Download all foundry artifacts from the triggering release run
pattern: "foundry_*"
# Extract artifacts into an isolated temp directory, not the workspace
path: ${{ steps.paths.outputs.artifact_dir }}
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id || inputs.run_id }}
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: latest
- name: Setup Node (for npm publish auth)
uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- name: Derive RELEASE_VERSION
id: release-version
working-directory: ./npm
env:
PROVENANCE: true
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_REGISTRY_URL: ${{ env.NPM_REGISTRY_URL }}
ARTIFACT_DIR: ${{ steps.paths.outputs.artifact_dir }}
run: |
set -euo pipefail
echo "Artifacts in $ARTIFACT_DIR:"
ls -la "$ARTIFACT_DIR" || true
# Derive RELEASE_VERSION from any foundry artifact we downloaded
# Expected names: foundry_<VERSION>_<platform>_<arch>.{tar.gz,zip}
first_file=$(ls "$ARTIFACT_DIR"/foundry_* 2>/dev/null | head -n1 || true)
if [[ -z "${first_file}" ]]; then
echo "No foundry artifacts found to publish" >&2
exit 1
fi
version_part=$(basename "$first_file")
version_part=${version_part#foundry_}
export RELEASE_VERSION=${version_part%%_*}
echo "Detected RELEASE_VERSION=$RELEASE_VERSION"
printf 'RELEASE_VERSION=%s\n' "$RELEASE_VERSION" >>"$GITHUB_OUTPUT"
- name: Stage Binary Into Package
working-directory: ./npm
env:
RELEASE_VERSION: ${{ steps.release-version.outputs.RELEASE_VERSION }}
ARTIFACT_DIR: ${{ steps.paths.outputs.artifact_dir }}
run: |
set -euo pipefail
bun ./scripts/stage-from-artifact.mjs \
--tool '${{ matrix.tool }}' \
--platform '${{ matrix.os }}' \
--arch '${{ matrix.arch }}' \
--release-version "$RELEASE_VERSION" \
--artifact-dir "$ARTIFACT_DIR"
- name: Sanity Check Binary
working-directory: ./npm
run: |
set -euo pipefail
TOOL='${{ matrix.tool }}'
PLATFORM='${{ matrix.os }}'
ARCH='${{ matrix.arch }}'
PKG_DIR="./@foundry-rs/${TOOL}-${PLATFORM}-${ARCH}"
BIN="$PKG_DIR/bin/${TOOL}"
if [[ "$PLATFORM" == "win32" ]]; then
BIN="$PKG_DIR/bin/${TOOL}.exe"
fi
echo "Verifying binary at: $BIN"
ls -la "$BIN"
if [[ ! -f "$BIN" ]]; then
echo "ERROR: Binary not found at $BIN" >&2
exit 1
fi
if [[ "${{ matrix.os }}" != "win32" ]]; then
if [[ ! -x "$BIN" ]]; then
echo "ERROR: Binary not marked executable" >&2
exit 1
fi
fi
- name: Publish ${{ matrix.os }}-${{ matrix.arch }} Binary
working-directory: ./npm
env:
PROVENANCE: true
VERSION_NAME: ${{ steps.release-version.outputs.RELEASE_VERSION }}
RELEASE_VERSION: ${{ steps.release-version.outputs.RELEASE_VERSION }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
set -euo pipefail
TOOL='${{ matrix.tool }}'
PLATFORM='${{ matrix.os }}'
ARCH='${{ matrix.arch }}'
PACKAGE_DIR="./@foundry-rs/${TOOL}-${PLATFORM}-${ARCH}"
ls -la "$PACKAGE_DIR"
bun ./scripts/publish.mjs "$PACKAGE_DIR"
echo "Published @foundry-rs/${TOOL}-${PLATFORM}-${ARCH}"
publish-meta:
permissions:
contents: read
actions: read
id-token: write
needs: publish-arch
name: Publish Meta Package
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
RELEASE_VERSION: ${{ needs.publish-arch.outputs.RELEASE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: latest
- name: Setup Node (for npm publish auth)
uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- name: Install Dependencies
working-directory: ./npm
run: bun install --frozen-lockfile
- name: Typecheck
working-directory: ./npm
run: bun tsc --project tsconfig.json --noEmit
- name: Publish Meta Packages
working-directory: ./npm
run: |
set -euo pipefail
bun ./scripts/publish-meta.mjs --release-version "$RELEASE_VERSION"
env:
PROVENANCE: true
VERSION_NAME: ${{ env.RELEASE_VERSION }}
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
NPM_TOKEN: ${{ env.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ env.NODE_AUTH_TOKEN }}
NPM_REGISTRY_URL: ${{ env.NPM_REGISTRY_URL }}
================================================
FILE: .github/workflows/release.yml
================================================
name: release
permissions: {}
on:
push:
tags:
- "stable"
- "rc"
- "rc-*"
- "v*.*.*"
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
IS_NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
# Keep in sync with `docker-publish.yml`.
RUST_PROFILE: dist
RUST_FEATURES: aws-kms,gcp-kms,turnkey,cli,asm-keccak,js-tracer
LAST_STABLE_VERSION: "v1.5.1"
jobs:
prepare:
name: Prepare release
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
pull-requests: read
outputs:
tag_name: ${{ steps.release_info.outputs.tag_name }}
release_name: ${{ steps.release_info.outputs.release_name }}
changelog: ${{ steps.build_changelog.outputs.changelog }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
- name: Compute release name and tag
id: release_info
run: |
if [[ ${IS_NIGHTLY} == 'true' ]]; then
printf 'tag_name=%s\n' "nightly-${GITHUB_SHA}" >> "$GITHUB_OUTPUT"
printf 'release_name=%s\n' "Nightly ($(date '+%Y-%m-%d'))" >> "$GITHUB_OUTPUT"
else
printf 'tag_name=%s\n' "$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT"
printf 'release_name=%s\n' "$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT"
fi
# Creates a `nightly-SHA` tag for this specific nightly
# This tag is used for this specific nightly version's release
# which allows users to roll back. It is also used to build
# the changelog.
- name: Create build-specific nightly tag
if: ${{ env.IS_NIGHTLY == 'true' }}
uses: actions/github-script@v8
env:
TAG_NAME: ${{ steps.release_info.outputs.tag_name }}
with:
script: |
const createTag = require('./.github/scripts/create-tag.js')
await createTag({ github, context }, process.env.TAG_NAME)
- name: Build changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@a34a8009a9588bb86b02a873cf592440e96a5da8 # v6
with:
configuration: "./.github/changelog.json"
fromTag: ${{ env.IS_NIGHTLY == 'true' && 'nightly' || env.STABLE_VERSION }}
toTag: ${{ steps.release_info.outputs.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-docker:
name: Release Docker
needs: prepare
uses: ./.github/workflows/docker-publish.yml
permissions:
contents: read
id-token: write
packages: write
with:
tag_name: ${{ needs.prepare.outputs.tag_name }}
release:
permissions:
id-token: write
contents: write
attestations: write
name: release ${{ matrix.target }} (${{ matrix.runner }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 240
needs: prepare
strategy:
fail-fast: false
matrix:
include:
# `runner`: GHA runner label
# `target`: Rust build target triple
# `platform` and `arch`: Used in tarball names
# `svm`: target platform to use for the Solc binary: https://github.com/roynalnaruto/svm-rs/blob/84cbe0ac705becabdc13168bae28a45ad2299749/svm-builds/build.rs#L4-L24
# These are pinned to the oldest runner versions to support old libc/SDK versions.
- runner: depot-ubuntu-22.04-16
target: x86_64-unknown-linux-gnu
svm_target_platform: linux-amd64
platform: linux
arch: amd64
- runner: depot-ubuntu-22.04-16
target: x86_64-unknown-linux-musl
svm_target_platform: linux-amd64
platform: alpine
arch: amd64
- runner: depot-ubuntu-22.04-arm-16
target: aarch64-unknown-linux-gnu
svm_target_platform: linux-aarch64
platform: linux
arch: arm64
- runner: depot-ubuntu-22.04-16
target: aarch64-unknown-linux-musl
svm_target_platform: linux-aarch64
platform: alpine
arch: arm64
- runner: macos-14-large
target: x86_64-apple-darwin
svm_target_platform: macosx-amd64
platform: darwin
arch: amd64
- runner: macos-latest-large
target: aarch64-apple-darwin
svm_target_platform: macosx-aarch64
platform: darwin
arch: arm64
- runner: depot-windows-latest-16
target: x86_64-pc-windows-msvc
svm_target_platform: windows-amd64
platform: win32
arch: amd64
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: stable
targets: ${{ matrix.target }}
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
if: ${{ contains(matrix.runner, 'depot') }}
- run: printf 'RUSTC_WRAPPER=sccache\n' >> "$GITHUB_ENV"
if: ${{ contains(matrix.runner, 'depot') }}
- name: Apple M1 setup
if: matrix.target == 'aarch64-apple-darwin'
run: |
printf 'SDKROOT=%s\n' "$(xcrun -sdk macosx --show-sdk-path)" >> "$GITHUB_ENV"
printf 'MACOSX_DEPLOYMENT_TARGET=%s\n' "$(xcrun -sdk macosx --show-sdk-platform-version)" >> "$GITHUB_ENV"
- name: cross setup
if: contains(matrix.target, 'musl')
uses: taiki-e/cache-cargo-install-action@59027ebf20a9617c4e819eb53ccd2673cb162b89 # v2
with:
git: https://github.com/cross-rs/cross
rev: baf457efc2555225af47963475bd70e8d2f5993f
tool: cross
- name: Build binaries
env:
TAG_NAME: ${{ (env.IS_NIGHTLY == 'true' && 'nightly') || needs.prepare.outputs.tag_name }}
SVM_TARGET_PLATFORM: ${{ matrix.svm_target_platform }}
PLATFORM_NAME: ${{ matrix.platform }}
TARGET: ${{ matrix.target }}
OUT_DIR: target/${{ matrix.target }}/${{ env.RUST_PROFILE }}
shell: bash
run: |
set -eo pipefail
flags=(--target $TARGET --profile $RUST_PROFILE --bins
--no-default-features --features "$RUST_FEATURES")
# `jemalloc` is not fully supported on MSVC or aarch64 Linux.
if [[ "$TARGET" != *msvc* && "$TARGET" != "aarch64-unknown-linux-gnu" ]]; then
flags+=(--features jemalloc)
fi
[[ "$TARGET" == *windows* ]] && ext=".exe"
if [[ "$TARGET" == *-musl ]]; then
cross build "${flags[@]}"
else
cargo build "${flags[@]}"
fi
bins=(anvil cast chisel forge)
for name in "${bins[@]}"; do
bin="$OUT_DIR/$name$ext"
printf '\n'
file "$bin" || true
du -h "$bin" || true
ldd "$bin" || true
$bin --version || true
printf '%s_bin_path=%s\n' "$name" "$bin" >> "$GITHUB_ENV"
done
- name: Archive binaries
id: artifacts
env:
PLATFORM_NAME: ${{ matrix.platform }}
OUT_DIR: target/${{ matrix.target }}/${{ env.RUST_PROFILE }}
VERSION_NAME: ${{ (env.IS_NIGHTLY == 'true' && 'nightly') || needs.prepare.outputs.tag_name }}
ARCH: ${{ matrix.arch }}
shell: bash
run: |
if [[ "$PLATFORM_NAME" == "linux" || "$PLATFORM_NAME" == "alpine" ]]; then
tar -czvf "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C "$OUT_DIR" forge cast anvil chisel
printf "file_name=%s\n" "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> "$GITHUB_OUTPUT"
elif [ "$PLATFORM_NAME" == "darwin" ]; then
# We need to use gtar here otherwise the archive is corrupt.
# See: https://github.com/actions/virtual-environments/issues/2619
gtar -czvf "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C "$OUT_DIR" forge cast anvil chisel
printf "file_name=%s\n" "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> "$GITHUB_OUTPUT"
else
cd "$OUT_DIR"
7z a -tzip "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" forge.exe cast.exe anvil.exe chisel.exe
mv "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" ../../../
printf "file_name=%s\n" "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" >> "$GITHUB_OUTPUT"
fi
printf "foundry_attestation=%s\n" "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.attestation.txt" >> "$GITHUB_OUTPUT"
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
retention-days: 1
name: ${{ steps.artifacts.outputs.file_name }}
path: ${{ steps.artifacts.outputs.file_name }}
- name: Build man page
id: man
if: matrix.target == 'x86_64-unknown-linux-gnu'
env:
OUT_DIR: target/${{ matrix.target }}/${{ env.RUST_PROFILE }}
VERSION_NAME: ${{ (env.IS_NIGHTLY == 'true' && 'nightly') || needs.prepare.outputs.tag_name }}
shell: bash
run: |
sudo apt-get -y install help2man
help2man -N $OUT_DIR/forge > forge.1
help2man -N $OUT_DIR/cast > cast.1
help2man -N $OUT_DIR/anvil > anvil.1
help2man -N $OUT_DIR/chisel > chisel.1
gzip forge.1
gzip cast.1
gzip anvil.1
gzip chisel.1
tar -czvf "foundry_man_${VERSION_NAME}.tar.gz" forge.1.gz cast.1.gz anvil.1.gz chisel.1.gz
printf 'foundry_man=%s\n' "foundry_man_${VERSION_NAME}.tar.gz" >> "$GITHUB_OUTPUT"
- name: Binaries attestation
id: attestation
uses: actions/attest-build-provenance@v4
with:
subject-path: |
${{ env.anvil_bin_path }}
${{ env.cast_bin_path }}
${{ env.chisel_bin_path }}
${{ env.forge_bin_path }}
- name: Record attestation URL
env:
ATTESTATION_URL: ${{ steps.attestation.outputs.attestation-url }}
FOUNDRY_ATTESTATION: ${{ steps.artifacts.outputs.foundry_attestation }}
shell: bash
run: |
set -euo pipefail
printf '%s\n' "$ATTESTATION_URL" > "$FOUNDRY_ATTESTATION"
# Creates the release for this specific version
- name: Create release
uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2.4.2
with:
name: ${{ needs.prepare.outputs.release_name }}
tag_name: ${{ needs.prepare.outputs.tag_name }}
prerelease: ${{ env.IS_NIGHTLY == 'true' }}
body: ${{ needs.prepare.outputs.changelog }}
files: |
${{ steps.artifacts.outputs.file_name }}
${{ steps.artifacts.outputs.foundry_attestation }}
${{ steps.man.outputs.foundry_man }}
# If this is a nightly release, it also updates the release
# tagged `nightly` for compatibility with `foundryup`
- name: Update nightly release
if: ${{ env.IS_NIGHTLY == 'true' }}
uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2.4.2
with:
name: "Nightly"
tag_name: "nightly"
prerelease: true
body: ${{ needs.prepare.outputs.changelog }}
files: |
${{ steps.artifacts.outputs.file_name }}
${{ steps.artifacts.outputs.foundry_attestation }}
${{ steps.man.outputs.foundry_man }}
cleanup:
name: Release cleanup
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
needs: release
if: always()
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
# Moves the `nightly` tag to `HEAD`
- name: Move nightly tag
if: ${{ env.IS_NIGHTLY == 'true' }}
uses: actions/github-script@v8
with:
script: |
const moveTag = require('./.github/scripts/move-tag.js')
await moveTag({ github, context }, 'nightly')
- name: Delete old nightlies
uses: actions/github-script@v8
with:
script: |
const prunePrereleases = require('./.github/scripts/prune-prereleases.js')
await prunePrereleases({github, context})
# If any of the jobs fail, this will create a high-priority issue to signal so.
issue:
name: Open an issue
runs-on: ubuntu-latest
needs: [prepare, release-docker, release, cleanup]
if: failure()
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_URL: |
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/RELEASE_FAILURE_ISSUE_TEMPLATE.md
================================================
FILE: .github/workflows/test-flaky.yml
================================================
# Daily CI job to run flaky tests that are excluded from regular CI via nextest default-filter
name: test-flaky
permissions: {}
on:
schedule:
- cron: "0 1 * * *" # Run daily at 1 AM UTC (offset from test-isolate)
workflow_dispatch: # Needed so we can run it manually
concurrency:
group: tests-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTC_WRAPPER: "sccache"
jobs:
test:
name: flaky tests
runs-on: depot-ubuntu-latest-16
timeout-minutes: 60
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: stable
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: taiki-e/install-action@94a7388bec5d4c8dd93e3ebf09e0ff448f3f6f4d # v2
with:
tool: nextest
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- name: Test flaky tests
env:
SVM_TARGET_PLATFORM: linux-amd64
HTTP_ARCHIVE_URLS: ${{ secrets.HTTP_ARCHIVE_URLS }}
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
run: cargo nextest run --profile flaky --no-fail-fast
# If any of the jobs fail, this will create a normal-priority issue to signal so.
issue:
name: Open an issue
runs-on: ubuntu-latest
needs: [test]
if: failure()
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_URL: |
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/FLAKY_TEST_FAILURE_TEMPLATE.md
================================================
FILE: .github/workflows/test-isolate.yml
================================================
# Daily CI job to run tests with isolation mode enabled by default
name: test-isolate
permissions: {}
on:
schedule:
- cron: "0 0 * * *" # Run daily at midnight UTC
workflow_dispatch: # Needed so we can run it manually
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTC_WRAPPER: "sccache"
jobs:
nextest:
uses: ./.github/workflows/test.yml
permissions:
contents: read
with:
profile: isolate
# Run flaky tests with isolation enabled
flaky:
name: flaky tests (isolate)
runs-on: depot-ubuntu-latest-16
timeout-minutes: 60
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: stable
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: taiki-e/install-action@94a7388bec5d4c8dd93e3ebf09e0ff448f3f6f4d # v2
with:
tool: nextest
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- name: Test flaky tests with isolation
env:
SVM_TARGET_PLATFORM: linux-amd64
HTTP_ARCHIVE_URLS: ${{ secrets.HTTP_ARCHIVE_URLS }}
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
run: cargo nextest run --profile flaky --features=isolate-by-default --no-fail-fast
# If nextest fails, create a high-priority issue for isolation failures.
issue-isolate:
name: Open isolation issue
runs-on: ubuntu-latest
needs: [nextest]
if: failure()
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_URL: |
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/TEST_ISOLATE_FAILURE_TEMPLATE.md
# If flaky tests fail, create a normal-priority issue for flaky failures.
issue-flaky:
name: Open flaky issue
runs-on: ubuntu-latest
needs: [flaky]
if: failure()
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_URL: |
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/FLAKY_TEST_ISOLATE_FAILURE_TEMPLATE.md
================================================
FILE: .github/workflows/test.yml
================================================
# Reusable workflow for running tests via `cargo nextest`
name: test
permissions: {}
on:
workflow_call:
inputs:
profile:
required: true
type: string
concurrency:
group: tests-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTC_WRAPPER: "sccache"
RUST_MIN_STACK: 4194304 # 2 * the default (2 * 1024 * 1024)
jobs:
matrices:
name: build matrices
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
test-matrix: ${{ steps.gen.outputs.test-matrix }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Generate matrices
id: gen
env:
EVENT_NAME: ${{ github.event_name }}
PROFILE: ${{ inputs.profile }}
shell: bash
run: |
output=$(python3 .github/scripts/matrices.py)
printf '::debug::test-matrix=%s\n' "$output"
printf 'test-matrix=%s\n' "$output" >> "$GITHUB_OUTPUT"
test:
name: test ${{ matrix.name }}
runs-on: ${{ matrix.runner_label }}
timeout-minutes: 60
permissions:
contents: read
needs: matrices
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrices.outputs.test-matrix) }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: stable
target: ${{ matrix.target }}
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: taiki-e/install-action@94a7388bec5d4c8dd93e3ebf09e0ff448f3f6f4d # v2
with:
tool: nextest
# External tests dependencies
- name: Setup Node.js
if: contains(matrix.name, 'external')
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install Bun
if: contains(matrix.name, 'external')
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: latest
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install Vyper
# Also update vyper version in .devcontainer/Dockerfile.dev
run: pip --version && pip install vyper==0.4.3
- name: Foundry test cache
uses: actions/cache@v5
with:
path: |
~/.foundry/cache
~/.config/.foundry/cache
testdata/cache
testdata/out
# Use a unique key for each run to always update the cache.
key: ${{ runner.os }}-foundry-${{ matrix.name }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-foundry-${{ matrix.name }}-
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- name: Setup Git config
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
git config --global url."https://github.com/".insteadOf "git@github.com:"
- name: Test
env:
SVM_TARGET_PLATFORM: ${{ matrix.svm_target_platform }}
HTTP_ARCHIVE_URLS: ${{ secrets.HTTP_ARCHIVE_URLS }}
WS_ARCHIVE_URLS: ${{ secrets.WS_ARCHIVE_URLS }}
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
ARBITRUM_RPC: ${{ secrets.ARBITRUM_RPC }}
ETH_SEPOLIA_RPC: ${{ secrets.ETH_SEPOLIA_RPC }}
run: cargo nextest run ${{ matrix.flags }}
================================================
FILE: .gitignore
================================================
.DS_STORE
/target*
/*.sol
CLAUDE.md
# Foundry artifacts
out/
snapshots/
# IDEs and extensions
.idea
.vscode
.claude
.zed
# NPM
.env
node_modules
npm/dist
npm/bin
_
*.tgz
.vercel
.vite
.wrangler
*.zip
================================================
FILE: CONTRIBUTING.md
================================================
## Contributing to Foundry
Thanks for your interest in improving Foundry!
There are multiple opportunities to contribute at any level. It doesn't matter if you are just getting started with Rust or are the most weathered expert, we can use your help.
This document will help you get started. **Do not let the document intimidate you**.
It should be considered as a guide to help you navigate the process.
The [dev Telegram][dev-tg] is available for any concerns you may have that are not covered in this guide.
### Code of Conduct
The Foundry project adheres to the [Rust Code of Conduct][rust-coc]. This code of conduct describes the _minimum_ behavior expected from all contributors.
Instances of violations of the Code of Conduct can be reported by contacting the team at [me@gakonst.com](mailto:me@gakonst.com).
### Ways to contribute
There are fundamentally four ways an individual can contribute:
1. **By opening an issue:** For example, if you believe that you have uncovered a bug
in Foundry, creating a new issue in the issue tracker is the way to report it.
2. **By adding context:** Providing additional context to existing issues,
such as screenshots and code snippets, which help resolve issues.
3. **By resolving issues:** Typically this is done in the form of either
demonstrating that the issue reported is not a problem after all, or more often,
by opening a pull request that fixes the underlying problem, in a concrete and
reviewable manner.
**Anybody can participate in any stage of contribution**. We urge you to participate in the discussion
around bugs and participate in reviewing PRs.
### Contributions Related to Spelling and Grammar
At this time, we will not be accepting contributions that only fix spelling or grammatical errors in documentation, code or elsewhere.
### Contributions Assisted by AI
If you are using any kind of AI assistance while contributing to Foundry,
**this must be disclosed in the pull request**, along with the extent to
which AI assistance was used (e.g. docs only vs. code generation).
If PR responses are being generated by an AI, disclose that as well.
As a small exception, trivial tab-completion doesn't need to be disclosed,
so long as it is limited to single keywords or short phrases.
An example disclosure:
> This PR was written primarily by Claude Code.
Or a more detailed disclosure:
> I consulted ChatGPT to understand the codebase but the solution
> was fully authored manually by myself.
Failure to disclose this makes it difficult to determine how much scrutiny to apply to the contribution as it is unclear how much the contributor themselves understands the code they propose to merge.
If you do not disclose your use of AI assistance and reviewers suspect your contribution to be AI generated, it will likely be refused on those grounds.
### Asking for help
If you have reviewed existing documentation and still have questions, or you are having problems, you can get help in the following ways:
- **Asking in the support Telegram:** The [Foundry Support Telegram][support-tg] is a fast and easy way to ask questions.
- **Opening a discussion:** This repository comes with a discussions board where you can also ask for help. Click the "Discussions" tab at the top.
As Foundry is still in heavy development, the documentation can be a bit scattered.
The [Foundry Book][foundry-book] is our current best-effort attempt at keeping up-to-date information.
### Submitting a bug report
When filing a new bug report in the issue tracker, you will be presented with a basic form to fill out.
If you believe that you have uncovered a bug, please fill out the form to the best of your ability. Do not worry if you cannot answer every detail; just fill in what you can. Contributors will ask follow-up questions if something is unclear.
The most important pieces of information we need in a bug report are:
- The Foundry version you are on (and that it is up to date)
- The platform you are on (Windows, macOS or Linux)
- Code snippets if this is happening in relation to testing or building code
- Concrete steps to reproduce the bug
In order to rule out the possibility of the bug being in your project, the code snippets should be as minimal
as possible. It is better if you can reproduce the bug with a small snippet as opposed to an entire project!
See [this guide][mcve] on how to create a minimal, complete, and verifiable example.
### Submitting a feature request
When adding a feature request in the issue tracker, you will be presented with a basic form to fill out.
Please include as detailed of an explanation as possible of the feature you would like, adding additional context if necessary.
If you have examples of other tools that have the feature you are requesting, please include them as well.
### Resolving an issue
Pull requests are the way concrete changes are made to the code, documentation, and dependencies of Foundry.
Even minor pull requests, such as those fixing wording, are greatly appreciated. Before making a large change, it is usually
a good idea to first open an issue describing the change to solicit feedback and guidance. This will increase
the likelihood of the PR getting merged.
Please also make sure that the following commands pass if you have changed the code:
```sh
cargo check --all
cargo test --all --all-features
cargo +nightly fmt -- --check
cargo +nightly clippy --workspace --all-targets --all-features -- -D warnings
```
or alternatively:
```sh
make build
make pr
```
If you are working in VSCode, we recommend you install the [rust-analyzer](https://rust-analyzer.github.io/) extension, and use the following VSCode user settings:
```json
"editor.formatOnSave": true,
"rust-analyzer.rustfmt.extraArgs": ["+nightly"],
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
}
```
If you are working on a larger feature, we encourage you to open up a draft pull request, to make sure that other contributors are not duplicating work.
If you would like to test the binaries built from your change, see [foundryup](https://github.com/foundry-rs/foundry/tree/HEAD/foundryup).
If you would like to use a debugger with breakpoints to debug a patch you might be working on, keep in mind we currently strip debug info for faster builds, which is _not_ the default. Therefore, to use a debugger, you need to enable it on the workspace [`Cargo.toml`'s `dev` profile](https://github.com/foundry-rs/foundry/tree/HEAD/Cargo.toml#L15-L18).
#### Adding tests
If the change being proposed alters code, it is either adding new functionality to Foundry, or fixing existing, broken functionality.
In both of these cases, the pull request should include one or more tests to ensure that Foundry does not regress
in the future.
Types of tests include:
- **Unit tests**: Functions which have very specific tasks should be unit tested.
- **Integration tests**: For general purpose, far reaching functionality, integration tests should be added.
The best way to add a new integration test is to look at existing ones and follow the style.
Tests that use forking must contain "fork" in their name.
#### Commits
It is a recommended best practice to keep your changes as logically grouped as possible within individual commits. There is no limit to the number of commits any single pull request may have, and many contributors find it easier to review changes that are split across multiple commits.
That said, if you have a number of commits that are "checkpoints" and don't represent a single logical change, please squash those together.
#### Opening the pull request
From within GitHub, opening a new pull request will present you with a template that should be filled out. Please try your best at filling out the details, but feel free to skip parts if you're not sure what to put.
#### Discuss and update
You will probably get feedback or requests for changes to your pull request.
This is a big part of the submission process, so don't be discouraged! Some contributors may sign off on the pull request right away, others may have more detailed comments or feedback.
This is a necessary part of the process in order to evaluate whether the changes are correct and necessary.
**Any community member can review a PR, so you might get conflicting feedback**.
Keep an eye out for comments from code owners to provide guidance on conflicting feedback.
#### Reviewing pull requests
**Any Foundry community member is welcome to review any pull request**.
All contributors who choose to review and provide feedback on pull requests have a responsibility to both the project and individual making the contribution. Reviews and feedback must be helpful, insightful, and geared towards improving the contribution as opposed to simply blocking it. If there are reasons why you feel the PR should not be merged, explain what those are. Do not expect to be able to block a PR from advancing simply because you say "no" without giving an explanation. Be open to having your mind changed. Be open to working _with_ the contributor to make the pull request better.
Reviews that are dismissive or disrespectful of the contributor or any other reviewers are strictly counter to the Code of Conduct.
When reviewing a pull request, the primary goals are for the codebase to improve and for the person submitting the request to succeed. **Even if a pull request is not merged, the submitter should come away from the experience feeling like their effort was not unappreciated**. Every PR from a new contributor is an opportunity to grow the community.
##### Review a bit at a time
Do not overwhelm new contributors.
It is tempting to micro-optimize and make everything about relative performance, perfect grammar, or exact style matches. Do not succumb to that temptation..
Focus first on the most significant aspects of the change:
1. Does this change make sense for Foundry?
2. Does this change make Foundry better, even if only incrementally?
3. Are there clear bugs or larger scale issues that need attending?
4. Are the commit messages readable and correct? If it contains a breaking change, is it clear enough?
Note that only **incremental** improvement is needed to land a PR. This means that the PR does not need to be perfect, only better than the status quo. Follow-up PRs may be opened to continue iterating.
When changes are necessary, _request_ them, do not _demand_ them, and **do not assume that the submitter already knows how to add a test or run a benchmark**.
Specific performance optimization techniques, coding styles and conventions change over time. The first impression you give to a new contributor never does.
Nits (requests for small changes that are not essential) are fine, but try to avoid stalling the pull request. Most nits can typically be fixed by the Foundry maintainers merging the pull request, but they can also be an opportunity for the contributor to learn a bit more about the project.
It is always good to clearly indicate nits when you comment, e.g.: `Nit: change foo() to bar(). But this is not blocking`.
If your comments were addressed but were not folded after new commits, or if they proved to be mistaken, please, [hide them][hiding-a-comment] with the appropriate reason to keep the conversation flow concise and relevant.
##### Be aware of the person behind the code
Be aware that _how_ you communicate requests and reviews in your feedback can have a significant impact on the success of the pull request. Yes, we may merge a particular change that makes Foundry better, but the individual might just not want to have anything to do with Foundry ever again. The goal is not just having good code.
##### Abandoned or stale pull requests
If a pull request appears to be abandoned or stalled, it is polite to first check with the contributor to see if they intend to continue the work before checking if they would mind if you took it over (especially if it just has nits left). When doing so, it is courteous to give the original contributor credit for the work they started, either by preserving their name and e-mail address in the commit log, or by using the `Author:` or `Co-authored-by:` metadata tag in the commits.
_Adapted from the [ethers-rs contributing guide](https://github.com/gakonst/ethers-rs/blob/master/CONTRIBUTING.md)_.
### Releasing
Releases are automatically done by the release workflow when a tag is pushed, however, these steps still need to be taken:
1. Ensure that the versions in the relevant `Cargo.toml` files are up-to-date.
2. Update documentation links
3. Perform a final audit for breaking changes.
[rust-coc]: https://www.rust-lang.org/policies/code-of-conduct
[dev-tg]: https://t.me/foundry_rs
[foundry-book]: https://github.com/foundry-rs/foundry-book
[support-tg]: https://t.me/foundry_support
[mcve]: https://stackoverflow.com/help/mcve
[hiding-a-comment]: https://docs.github.com/en/communities/moderating-comments-and-conversations/managing-disruptive-comments
================================================
FILE: Cargo.toml
================================================
[workspace]
members = [
"benches/",
"crates/anvil/",
"crates/anvil/core/",
"crates/anvil/rpc/",
"crates/anvil/server/",
"crates/cast/",
"crates/cheatcodes/",
"crates/cheatcodes/spec/",
"crates/chisel/",
"crates/cli/",
"crates/common/",
"crates/config/",
"crates/debugger/",
"crates/doc/",
"crates/evm/core/",
"crates/evm/coverage/",
"crates/evm/evm/",
"crates/evm/fuzz/",
"crates/evm/traces/",
"crates/fmt/",
"crates/forge/",
"crates/lint/",
"crates/macros/",
"crates/primitives/",
"crates/script-sequence/",
"crates/test-utils/",
"crates/cli-markdown/",
]
resolver = "2"
[workspace.package]
version = "1.6.0"
edition = "2024"
rust-version = "1.89"
authors = ["Foundry Contributors"]
license = "MIT OR Apache-2.0"
homepage = "https://getfoundry.sh"
repository = "https://github.com/foundry-rs/foundry"
exclude = ["benches/", "tests/", "test-data/", "testdata/"]
[workspace.lints.clippy]
borrow_as_ptr = "warn"
branches_sharing_code = "warn"
clear_with_drain = "warn"
cloned_instead_of_copied = "warn"
collection_is_never_read = "warn"
dbg-macro = "warn"
explicit_iter_loop = "warn"
manual-string-new = "warn"
uninlined-format-args = "warn"
use-self = "warn"
redundant-clone = "warn"
octal-escapes = "allow"
# until <https://github.com/rust-lang/rust-clippy/issues/13885> is fixed
literal-string-with-formatting-args = "allow"
result_large_err = "allow"
[workspace.lints.rust]
redundant_imports = "warn"
redundant-lifetimes = "warn"
rust-2018-idioms = "warn"
unused-must-use = "warn"
# unreachable-pub = "warn"
[workspace.lints.rustdoc]
all = "warn"
# Speed up compilation time for dev builds by reducing emitted debug info.
# NOTE: Debuggers may provide less useful information with this setting.
# Uncomment this section if you're using a debugger.
[profile.dev]
# https://davidlattimore.github.io/posts/2024/02/04/speeding-up-the-rust-edit-build-run-cycle.html
debug = "line-tables-only"
split-debuginfo = "unpacked"
[profile.release]
opt-level = 3
lto = "thin"
debug = "none"
strip = "debuginfo"
panic = "abort"
codegen-units = 16
# Use the `--profile profiling` flag to show symbols in release mode.
# e.g. `cargo build --profile profiling`
[profile.profiling]
inherits = "release"
debug = "full"
strip = "none"
[profile.bench]
inherits = "profiling"
[profile.dist]
inherits = "release"
lto = "fat"
codegen-units = 1
# Speed up tests and dev build.
[profile.dev.package]
# Solc and artifacts.
foundry-compilers-artifacts-solc.opt-level = 3
foundry-compilers-core.opt-level = 3
foundry-compilers.opt-level = 3
serde_json.opt-level = 3
serde.opt-level = 3
foundry-solang-parser.opt-level = 3
lalrpop-util.opt-level = 3
solar-compiler.opt-level = 3
solar-ast.opt-level = 3
solar-data-structures.opt-level = 3
solar-interface.opt-level = 3
solar-parse.opt-level = 3
solar-sema.opt-level = 3
# CLI.
clap.opt-level = 3
clap_builder.opt-level = 3
clap_lex.opt-level = 3
# EVM.
alloy-dyn-abi.opt-level = 3
alloy-json-abi.opt-level = 3
alloy-primitives.opt-level = 3
alloy-sol-type-parser.opt-level = 3
alloy-sol-types.opt-level = 3
alloy-evm.opt-level = 3
bitvec.opt-level = 3
revm.opt-level = 3
revm-bytecode.opt-level = 3
revm-context.opt-level = 3
revm-context-interface.opt-level = 3
revm-database.opt-level = 3
revm-database-interface.opt-level = 3
revm-handler.opt-level = 3
revm-inspector.opt-level = 3
revm-interpreter.opt-level = 3
revm-precompile.opt-level = 3
revm-primitives.opt-level = 3
revm-state.opt-level = 3
revm-inspectors.opt-level = 3
ruint.opt-level = 3
sha2.opt-level = 3
sha3.opt-level = 3
keccak.opt-level = 3
# Fuzzing.
proptest.opt-level = 3
foundry-evm-fuzz.opt-level = 3
rand.opt-level = 3
rand_chacha.opt-level = 3
ppv-lite86.opt-level = 3
# Backtraces.
addr2line.opt-level = 3
backtrace.opt-level = 3
gimli.opt-level = 3
# Forking.
axum.opt-level = 3
# Keystores.
scrypt.opt-level = 3
# Misc.
hashbrown.opt-level = 3
foldhash.opt-level = 3
rayon.opt-level = 3
rayon-core.opt-level = 3
regex.opt-level = 3
regex-syntax.opt-level = 3
regex-automata.opt-level = 3
walkdir.opt-level = 3
# Override packages which aren't perf-sensitive for faster compilation speed and smaller binary size.
[profile.release.package]
alloy-sol-macro-expander.opt-level = "s"
figment2.opt-level = "s"
foundry-compilers-artifacts-solc.opt-level = "s"
foundry-config.opt-level = "s"
html5ever.opt-level = "s"
mdbook-driver.opt-level = "s"
prettyplease.opt-level = "s"
protobuf.opt-level = "s"
pulldown-cmark.opt-level = "s"
syn-solidity.opt-level = "s"
syn.opt-level = "s"
trezor-client.opt-level = "s"
# Networking stack (not perf-critical for CLI tools).
reqwest.opt-level = "s"
hyper.opt-level = "s"
hyper-util.opt-level = "s"
h2.opt-level = "s"
rustls.opt-level = "s"
tower.opt-level = "s"
tower-http.opt-level = "s"
# Doc generation / templating.
mdbook-core.opt-level = "s"
mdbook-html.opt-level = "s"
font-awesome-as-a-crate.opt-level = "s"
handlebars.opt-level = "s"
# Watch mode.
watchexec.opt-level = "s"
watchexec-events.opt-level = "s"
watchexec-signals.opt-level = "s"
watchexec-supervisor.opt-level = "s"
# Soldeer package manager.
soldeer-commands.opt-level = "s"
soldeer-core.opt-level = "s"
# Parsing / editing (not perf-sensitive in CLI).
toml_edit.opt-level = "s"
toml.opt-level = "s"
# Block explorers / verification.
foundry-block-explorers.opt-level = "s"
# Misc CLI dependencies.
clap_builder.opt-level = "s"
clap_complete.opt-level = "s"
comfy-table.opt-level = "s"
indicatif.opt-level = "s"
dialoguer.opt-level = "s"
ratatui.opt-level = "s"
crossterm.opt-level = "s"
# Alloy JSON (parsing, not hot path).
alloy-json-abi.opt-level = "s"
[workspace.dependencies]
anvil = { path = "crates/anvil" }
cast = { path = "crates/cast" }
chisel = { path = "crates/chisel" }
forge = { path = "crates/forge" }
forge-doc = { path = "crates/doc" }
forge-fmt = { path = "crates/fmt" }
forge-lint = { path = "crates/lint" }
forge-verify = { path = "crates/verify" }
forge-script = { path = "crates/script" }
forge-sol-macro-gen = { path = "crates/sol-macro-gen" }
forge-script-sequence = { path = "crates/script-sequence" }
foundry-cheatcodes = { path = "crates/cheatcodes" }
foundry-cheatcodes-spec = { path = "crates/cheatcodes/spec" }
foundry-cli = { path = "crates/cli" }
foundry-cli-markdown = { path = "crates/cli-markdown" }
foundry-common = { path = "crates/common" }
foundry-common-fmt = { path = "crates/common/fmt" }
foundry-config = { path = "crates/config" }
foundry-debugger = { path = "crates/debugger" }
foundry-evm = { path = "crates/evm/evm" }
foundry-evm-abi = { path = "crates/evm/abi" }
foundry-evm-core = { path = "crates/evm/core" }
foundry-evm-coverage = { path = "crates/evm/coverage" }
foundry-evm-networks = { path = "crates/evm/networks" }
foundry-evm-fuzz = { path = "crates/evm/fuzz" }
foundry-evm-traces = { path = "crates/evm/traces" }
foundry-macros = { path = "crates/macros" }
foundry-test-utils = { path = "crates/test-utils" }
foundry-wallets = { path = "crates/wallets" }
foundry-linking = { path = "crates/linking" }
foundry-primitives = { path = "crates/primitives" }
# solc & compilation utilities
foundry-block-explorers = { version = "0.22.0", default-features = false }
foundry-compilers = { version = "0.19.14", default-features = false, features = [
"rustls",
"svm-solc",
] }
foundry-fork-db = "0.23"
solang-parser = { version = "=0.3.9", package = "foundry-solang-parser" }
solar = { package = "solar-compiler", version = "=0.1.8", default-features = false }
svm = { package = "svm-rs", version = "0.5", default-features = false, features = [
"rustls",
] }
## alloy
alloy-consensus = { version = "2.0.0-rc.0", default-features = false }
alloy-contract = { version = "2.0.0-rc.0", default-features = false }
alloy-eips = { version = "2.0.0-rc.0", default-features = false }
alloy-eip5792 = { version = "2.0.0-rc.0", default-features = false }
alloy-ens = { version = "2.0.0-rc.0", default-features = false }
alloy-genesis = { version = "2.0.0-rc.0", default-features = false }
alloy-json-rpc = { version = "2.0.0-rc.0", default-features = false }
alloy-network = { version = "2.0.0-rc.0", default-features = false }
alloy-provider = { version = "2.0.0-rc.0", default-features = false }
alloy-pubsub = { version = "2.0.0-rc.0", default-features = false }
alloy-rpc-client = { version = "2.0.0-rc.0", default-features = false }
alloy-rpc-types = { version = "2.0.0-rc.0", default-features = true }
alloy-rpc-types-beacon = { version = "2.0.0-rc.0", default-features = true }
alloy-rpc-types-eth = { version = "2.0.0-rc.0", default-features = false }
alloy-serde = { version = "2.0.0-rc.0", default-features = false }
alloy-signer = { version = "2.0.0-rc.0", default-features = false }
alloy-signer-aws = { version = "2.0.0-rc.0", default-features = false }
alloy-signer-gcp = { version = "2.0.0-rc.0", default-features = false }
alloy-signer-ledger = { version = "2.0.0-rc.0", default-features = false }
alloy-signer-local = { version = "2.0.0-rc.0", default-features = false }
alloy-signer-trezor = { version = "2.0.0-rc.0", default-features = false }
alloy-signer-turnkey = { version = "2.0.0-rc.0", default-features = false }
alloy-transport = { version = "2.0.0-rc.0", default-features = false }
alloy-transport-http = { version = "2.0.0-rc.0", default-features = false }
alloy-transport-ipc = { version = "2.0.0-rc.0", default-features = false }
alloy-transport-ws = { version = "2.0.0-rc.0", default-features = false }
alloy-hardforks = { version = "0.4.7", default-features = false }
alloy-op-hardforks = { version = "0.4.7", default-features = false }
## alloy-core
alloy-dyn-abi = "1.5.2"
alloy-json-abi = "1.5.2"
alloy-primitives = { version = "1.5.2", features = [
"getrandom",
"rand",
"map-fxhash",
"map-foldhash",
] }
alloy-sol-macro-expander = "1.5.2"
alloy-sol-macro-input = "1.5.2"
alloy-sol-types = "1.5.2"
alloy-chains = "0.2"
alloy-rlp = "0.3"
alloy-trie = "0.9"
## op-alloy
op-alloy-consensus = "0.24.0"
op-alloy-network = "0.24.0"
op-alloy-rpc-types = "0.24.0"
op-alloy-flz = "0.13.1"
## alloy-evm
alloy-evm = "0.28.1"
alloy-op-evm = "0.26.3"
# revm
revm = { version = "34.0.0", default-features = false }
revm-inspectors = { version = "0.36.0", features = ["serde"] }
op-revm = { version = "15.0.0", default-features = false }
## cli
anstream = "0.6"
anstyle = "1.0"
dialoguer = { version = "0.12", default-features = false, features = [
"password",
] }
clap_complete = "4"
clap_complete_nushell = "4"
# macros
proc-macro2 = "1.0"
quote = "1.0"
syn = "2.0"
async-trait = "0.1"
derive_more = { version = "2.1", features = ["full"] }
thiserror = "2"
# allocators
mimalloc = "0.1"
tikv-jemallocator = "0.6"
# misc
auto_impl = "1"
bytes = "1.11"
walkdir = "2"
prettyplease = "0.2"
base64 = "0.22"
chrono = { version = "0.4", default-features = false, features = [
"clock",
"std",
] }
axum = "0.8"
ciborium = "0.2"
color-eyre = "0.6"
comfy-table = "7"
dirs = "6"
dunce = "1"
evm-disassembler = "0.6"
evmole = "0.8"
eyre = "0.6"
figment = { package = "figment2", version = "0.11" }
futures = { version = "0.3", default-features = false }
hyper = "1.8"
indicatif = "0.18"
itertools = "0.14"
jsonpath_lib = "0.3"
k256 = "0.13"
mesc = "0.3"
memchr = "2.7"
num-format = "0.4"
parking_lot = "0.12"
proptest = "1.9.0"
rand = "0.9"
rand_08 = { package = "rand", version = "0.8" }
rayon = "1"
regex = { version = "1", default-features = false }
reqwest = { version = "0.13", default-features = false, features = ["rustls"] }
rustls = "0.23"
semver = "1"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["arbitrary_precision"] }
similar-asserts = "1.7"
soldeer-commands = "=0.10.0"
soldeer-core = { version = "=0.10.0", features = ["serde"] }
strum = "0.27"
tempfile = "3.23"
tokio = "1"
toml = "0.9"
toml_edit = "0.24"
tower = "0.5"
tower-http = "0.6"
tracing = "0.1"
tracing-subscriber = "0.3"
url = "2"
vergen = { package = "vergen-gitcl", version = "10.0.0-beta.5", default-features = false, features = [
"build",
"cargo",
] }
yansi = { version = "1.0", features = ["detect-tty", "detect-env"] }
path-slash = "0.2"
jiff = { version = "0.2", default-features = false, features = [
"std",
"perf-inline",
] }
heck = "0.5"
uuid = "1.19.0"
flate2 = "1.1"
ethereum_ssz = "0.10"
# Tempo
tempo-primitives = { git = "https://github.com/tempoxyz/tempo", branch = "alloy-2.0", default-features = false, features = ["serde"] }
tempo-alloy = { git = "https://github.com/tempoxyz/tempo", branch = "alloy-2.0", default-features = false }
## Pinned dependencies. Enabled for the workspace in crates/test-utils.
# testing
snapbox = { version = "0.6", features = ["json", "regex", "term-svg"] }
# Use unicode-rs which has a smaller binary size than the default ICU4X as the IDNA backend, used
# by the `url` crate.
# See the `idna_adapter` README.md for more details: https://docs.rs/crate/idna_adapter/latest
idna_adapter = "=1.1.0"
[patch.crates-io]
# https://github.com/rust-cli/rexpect/pull/106
rexpect = { git = "https://github.com/rust-cli/rexpect", rev = "2ed0b1898d7edaf6a85bedbae71a01cc578958fc" }
## alloy-core
# alloy-dyn-abi = { path = "../../alloy-rs/core/crates/dyn-abi" }
# alloy-json-abi = { path = "../../alloy-rs/core/crates/json-abi" }
# alloy-primitives = { path = "../../alloy-rs/core/crates/primitives" }
# alloy-sol-macro = { path = "../../alloy-rs/core/crates/sol-macro" }
# alloy-sol-macro-expander = { path = "../../alloy-rs/core/crates/sol-macro-expander" }
# alloy-sol-macro-input = { path = "../../alloy-rs/core/crates/sol-macro-input" }
# alloy-sol-type-parser = { path = "../../alloy-rs/core/crates/sol-type-parser" }
# alloy-sol-types = { path = "../../alloy-rs/core/crates/sol-types" }
# syn-solidity = { path = "../../alloy-rs/core/crates/syn-solidity" }
## alloy
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-contract = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-eip5792 = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-ens = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-network-primitives = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-rpc-types-beacon = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-rpc-types-eth = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-serde = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-signer-aws = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-signer-gcp = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-signer-ledger = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-signer-local = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-signer-trezor = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-signer-turnkey = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "100a3325ac4d624f3eb0bd404125750e76edf8ca" }
## alloy-evm
alloy-evm = { git = "https://github.com/alloy-rs/evm.git", branch = "alloy-2.0" }
## op-alloy / alloy-op-evm
op-alloy-consensus = { git = "https://github.com/foundry-rs/optimism", branch = "alloy-2.0" }
op-alloy-network = { git = "https://github.com/foundry-rs/optimism", branch = "alloy-2.0" }
op-alloy-rpc-types = { git = "https://github.com/foundry-rs/optimism", branch = "alloy-2.0" }
op-alloy = { git = "https://github.com/foundry-rs/optimism", branch = "alloy-2.0" }
alloy-op-evm = { git = "https://github.com/foundry-rs/optimism", branch = "alloy-2.0" }
alloy-op-hardforks = { git = "https://github.com/foundry-rs/optimism", branch = "alloy-2.0" }
## revm
# revm = { git = "https://github.com/bluealloy/revm.git", rev = "7e59936" }
# op-revm = { git = "https://github.com/bluealloy/revm.git", rev = "7e59936" }
revm-inspectors = { git = "https://github.com/paradigmxyz/revm-inspectors.git", branch = "alloy-2.0" }
## foundry
foundry-fork-db = { git = "https://github.com/foundry-rs/foundry-fork-db", branch = "alloy-2.0" }
# solar
solar = { package = "solar-compiler", git = "https://github.com/paradigmxyz/solar", rev = "530f129" }
solar-interface = { package = "solar-interface", git = "https://github.com/paradigmxyz/solar", rev = "530f129" }
solar-ast = { package = "solar-ast", git = "https://github.com/paradigmxyz/solar", rev = "530f129" }
solar-sema = { package = "solar-sema", git = "https://github.com/paradigmxyz/solar", rev = "530f129" }
================================================
FILE: Dockerfile
================================================
# syntax=docker/dockerfile:1
FROM rust:1-bookworm AS chef
WORKDIR /app
RUN apt update && apt install -y build-essential libssl-dev git pkg-config curl perl
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | sh
RUN cargo binstall cargo-chef sccache
# Prepare the cargo-chef recipe.
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
# Build the project.
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
ARG RUST_PROFILE
ARG RUST_FEATURES
ENV CARGO_INCREMENTAL=0 \
RUSTC_WRAPPER=sccache \
SCCACHE_DIR=/sccache
# Build dependencies.
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=shared \
--mount=type=cache,target=/usr/local/cargo/git,sharing=shared \
--mount=type=cache,target=$SCCACHE_DIR,sharing=shared \
cargo chef cook --recipe-path recipe.json --profile ${RUST_PROFILE} --no-default-features --features "${RUST_FEATURES}"
ARG TAG_NAME="dev"
ENV TAG_NAME=$TAG_NAME
ARG VERGEN_GIT_SHA="ffffffffffffffffffffffffffffffffffffffff"
ENV VERGEN_GIT_SHA=$VERGEN_GIT_SHA
# Build the project.
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=shared \
--mount=type=cache,target=/usr/local/cargo/git,sharing=shared \
--mount=type=cache,target=$SCCACHE_DIR,sharing=shared \
cargo build --profile ${RUST_PROFILE} --no-default-features --features "${RUST_FEATURES}" \
&& sccache --show-stats || true
# `dev` profile outputs to the `target/debug` directory.
RUN ln -s /app/target/debug /app/target/dev \
&& mkdir -p /app/output \
&& mv \
/app/target/${RUST_PROFILE}/forge \
/app/target/${RUST_PROFILE}/cast \
/app/target/${RUST_PROFILE}/anvil \
/app/target/${RUST_PROFILE}/chisel \
/app/output/
FROM ubuntu:22.04 AS runtime
# Install runtime dependencies.
RUN apt update && apt install -y git
COPY --from=builder /app/output/* /usr/local/bin/
RUN groupadd -g 1000 foundry && \
useradd -m -u 1000 -g foundry foundry
USER foundry
ENTRYPOINT ["/bin/sh", "-c"]
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="Foundry" \
org.label-schema.description="Foundry" \
org.label-schema.url="https://getfoundry.sh" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/foundry-rs/foundry.git" \
org.label-schema.vendor="Foundry-rs" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0"
================================================
FILE: FUNDING.json
================================================
{
"drips": {
"ethereum": {
"ownedBy": "0x86308c59a6005d012C51Eef104bBc21786aC5D2E"
}
},
"opRetro": {
"projectId": "0x4562c0630907577f433cad78c7e2cc03349d918b6c14ef982f11a2678f5999ad"
}
}
================================================
FILE: LICENSE-APACHE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
================================================
FILE: LICENSE-MIT
================================================
Copyright (c) 2021 Georgios Konstantopoulos
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: Makefile
================================================
# Heavily inspired by:
# - Lighthouse: https://github.com/sigp/lighthouse/blob/693886b94176faa4cb450f024696cb69cda2fe58/Makefile
# - Reth: https://github.com/paradigmxyz/reth/blob/1f642353ca083b374851ab355b5d80207b36445c/Makefile
.DEFAULT_GOAL := help
# Cargo profile for builds.
PROFILE ?= dev
# The docker image name
DOCKER_IMAGE_NAME ?= ghcr.io/foundry-rs/foundry:latest
BIN_DIR = dist/bin
CARGO_TARGET_DIR ?= target
# List of features to use when building. Can be overridden via the environment.
# No jemalloc on Windows
ifeq ($(OS),Windows_NT)
FEATURES ?= aws-kms gcp-kms turnkey cli asm-keccak
else
FEATURES ?= jemalloc aws-kms gcp-kms turnkey cli asm-keccak
endif
##@ Help
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Build
.PHONY: build
build: ## Build the project.
cargo build --features "$(FEATURES)" --profile "$(PROFILE)"
.PHONY: build-docker
build-docker: ## Build the docker image.
docker build . -t "$(DOCKER_IMAGE_NAME)" \
--build-arg "RUST_PROFILE=$(PROFILE)" \
--build-arg "RUST_FEATURES=$(FEATURES)" \
--build-arg "TAG_NAME=dev" \
--build-arg "VERGEN_GIT_SHA=$(shell git rev-parse HEAD)"
##@ Test
## Run unit/doc tests and generate html coverage report in `target/llvm-cov/html` folder.
## Notice that `llvm-cov` supports doc tests only in nightly builds because the `--doc` flag
## is unstable (https://github.com/taiki-e/cargo-llvm-cov/issues/2).
.PHONY: test-coverage
test-coverage:
cargo +nightly llvm-cov --no-report nextest -E 'kind(test) & !test(/\b(issue|ext_integration|flaky_)/)' && \
cargo +nightly llvm-cov --no-report --doc && \
cargo +nightly llvm-cov report --doctests --open
.PHONY: test-unit
test-unit: ## Run unit tests.
cargo nextest run -E 'kind(test) & !test(/\b(issue|ext_integration|flaky_)/)'
.PHONY: test-doc
test-doc: ## Run doc tests.
cargo test --doc --workspace
.PHONY: test
test: ## Run all tests.
$(MAKE) test-unit && \
$(MAKE) test-doc
##@ Linting
.PHONY: fmt
fmt: ## Run all formatters.
cargo +nightly fmt
./.github/scripts/format.sh --check
.PHONY: lint-clippy
lint-clippy: ## Run clippy on the codebase.
cargo +nightly clippy \
--workspace \
--all-targets \
--all-features \
-- -D warnings
.PHONY: lint-clippy-fix
lint-clippy-fix: ## Run clippy on the codebase and fix warnings.
cargo +nightly clippy \
--workspace \
--all-targets \
--all-features \
--fix \
--allow-dirty \
--allow-staged \
-- -D warnings
.PHONY: lint-typos
lint-typos: ## Run typos on the codebase.
@command -v typos >/dev/null || { \
echo "typos not found. Please install it by running the command `cargo install typos-cli` or refer to the following link for more information: https://github.com/crate-ci/typos"; \
exit 1; \
}
typos
.PHONY: lint
lint: ## Run all linters.
$(MAKE) fmt && \
$(MAKE) lint-clippy && \
$(MAKE) lint-typos
##@ Other
.PHONY: clean
clean: ## Clean the project.
cargo clean
.PHONY: deny
deny: ## Perform a `cargo` deny check.
cargo deny --all-features check all
.PHONY: pr
pr: ## Run all checks and tests.
$(MAKE) deny && \
$(MAKE) lint && \
$(MAKE) test
# dprint formatting commands
.PHONY: dprint-fmt
dprint-fmt: ## Format code with dprint
@if ! command -v dprint > /dev/null; then \
echo "Installing dprint..."; \
cargo install dprint; \
fi
dprint fmt
.PHONY: dprint-check
dprint-check: ## Check formatting with dprint
@if ! command -v dprint > /dev/null; then \
echo "Installing dprint..."; \
cargo install dprint; \
fi
dprint check
================================================
FILE: README.md
================================================
<div align="center">
<img src=".github/assets/banner.png" alt="Foundry banner" />
[![Github Actions][gha-badge]][gha-url] [![Telegram Chat][tg-badge]][tg-url] [![Telegram Support][tg-support-badge]][tg-support-url]
[gha-badge]: https://img.shields.io/github/actions/workflow/status/foundry-rs/foundry/test.yml?branch=master&style=flat-square
[gha-url]: https://github.com/foundry-rs/foundry/actions
[tg-badge]: https://img.shields.io/endpoint?color=neon&logo=telegram&label=chat&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Ffoundry_rs
[tg-url]: https://t.me/foundry_rs
[tg-support-badge]: https://img.shields.io/endpoint?color=neon&logo=telegram&label=support&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Ffoundry_support
[tg-support-url]: https://t.me/foundry_support
**[Install](https://getfoundry.sh/getting-started/installation)**
| [Docs][foundry-docs]
| [Benchmarks](https://www.getfoundry.sh/benchmarks)
| [Developer Guidelines](./docs/dev/README.md)
| [Contributing](./CONTRIBUTING.md)
| [Crate Docs](https://foundry-rs.github.io/foundry)
</div>
---
Blazing fast, portable and modular toolkit for Ethereum application development, written in Rust.
- [**Forge**](https://getfoundry.sh/forge) — Build, test, fuzz, debug and deploy Solidity contracts.
- [**Cast**](https://getfoundry.sh/cast) — Swiss Army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- [**Anvil**](https://getfoundry.sh/anvil) — Fast local Ethereum development node.
- [**Chisel**](https://getfoundry.sh/chisel) — Fast, utilitarian and verbose Solidity REPL.

## Installation
```sh
curl -L https://foundry.paradigm.xyz | bash
foundryup
```
See the [installation guide](https://getfoundry.sh/getting-started/installation) for more details.
## Getting Started
Initialize a new project, build and test:
```sh
forge init counter && cd counter
forge build
forge test
```
Interact with a live network:
```sh
cast block-number --rpc-url https://eth.merkle.io
cast balance vitalik.eth --ether --rpc-url https://eth.merkle.io
```
Fork mainnet locally:
```sh
anvil --fork-url https://eth.merkle.io
```
Read the [Foundry Docs][foundry-docs] to learn more.
## Contributing
Contributions are welcome and highly appreciated. To get started, check out the [contributing guidelines](./CONTRIBUTING.md).
Join our [Telegram][tg-url] to chat about the development of Foundry.
## Support
Having trouble? Check the [Foundry Docs][foundry-docs], join the [support Telegram][tg-support-url], or [open an issue](https://github.com/foundry-rs/foundry/issues/new).
#### License
<sup>
Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
</sup>
<br>
<sub>
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in these crates by you, as defined in the Apache-2.0 license,
shall be dual licensed as above, without any additional terms or conditions.
</sub>
[foundry-docs]: https://getfoundry.sh
================================================
FILE: SECURITY.md
================================================
# Security Policy
## Reporting a Vulnerability
Contact [security@ithaca.xyz](mailto:security@ithaca.xyz).
================================================
FILE: benches/Cargo.toml
================================================
[package]
name = "foundry-bench"
description = "Foundry benchmark runner"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
[lints]
workspace = true
[[bin]]
name = "foundry-bench"
path = "src/main.rs"
[dependencies]
foundry-test-utils.workspace = true
foundry-common.workspace = true
foundry-compilers = { workspace = true, features = ["project-util"] }
eyre.workspace = true
color-eyre.workspace = true
serde.workspace = true
serde_json.workspace = true
chrono = { version = "0.4", features = ["serde"] }
rayon.workspace = true
clap = { version = "4", features = ["derive"] }
once_cell = "1.21"
================================================
FILE: benches/LATEST.md
================================================
# Foundry Benchmark Results
**Date**: 2025-10-02 12:14:23
## Repositories Tested
1. [ithacaxyz/account](https://github.com/ithacaxyz/account)
2. [Vectorized/solady](https://github.com/Vectorized/solady)
3. [Uniswap/v4-core](https://github.com/Uniswap/v4-core)
4. [sparkdotfi/spark-psm](https://github.com/sparkdotfi/spark-psm)
## Foundry Versions
- **v1.3.6**: forge Version: 1.3.6-v1.3.6 (d241588 2025-09-16)
- **v1.4.0-rc1**: forge Version: 1.4.0-v1.4.0-rc1 (bd0e4a7 2025-10-01)
## Forge Test
| Repository | v1.3.6 | v1.4.0-rc1 |
| -------------------- | ------- | ---------- |
| ithacaxyz-account | 3.17 s | 2.94 s |
| solady | 2.28 s | 2.10 s |
| Uniswap-v4-core | 7.27 s | 6.13 s |
| sparkdotfi-spark-psm | 43.04 s | 44.08 s |
## Forge Fuzz Test
| Repository | v1.3.6 | v1.4.0-rc1 |
| -------------------- | ------ | ---------- |
| ithacaxyz-account | 3.18 s | 3.02 s |
| solady | 2.39 s | 2.24 s |
| Uniswap-v4-core | 6.84 s | 6.20 s |
| sparkdotfi-spark-psm | 3.07 s | 2.72 s |
## Forge Test (Isolated)
| Repository | v1.3.6 | v1.4.0-rc1 |
| -------------------- | ------- | ---------- |
| solady | 2.26 s | 2.41 s |
| Uniswap-v4-core | 7.22 s | 7.71 s |
| sparkdotfi-spark-psm | 45.53 s | 50.49 s |
## Forge Build (No Cache)
| Repository | v1.3.6 | v1.4.0-rc1 |
| -------------------- | ------- | ---------- |
| ithacaxyz-account | 9.16 s | 9.08 s |
| solady | 14.62 s | 14.69 s |
| Uniswap-v4-core | 2m 3.8s | 2m 5.3s |
| sparkdotfi-spark-psm | 13.17 s | 13.14 s |
## Forge Build (With Cache)
| Repository | v1.3.6 | v1.4.0-rc1 |
| -------------------- | ------- | ---------- |
| ithacaxyz-account | 0.156 s | 0.113 s |
| solady | 0.089 s | 0.094 s |
| Uniswap-v4-core | 0.133 s | 0.127 s |
| sparkdotfi-spark-psm | 0.173 s | 0.131 s |
## Forge Coverage
| Repository | v1.3.6 | v1.4.0-rc1 |
| -------------------- | -------- | ---------- |
| ithacaxyz-account | 14.91 s | 13.34 s |
| Uniswap-v4-core | 1m 34.8s | 1m 30.3s |
| sparkdotfi-spark-psm | 3m 49.3s | 3m 40.2s |
## System Information
- **OS**: macos
- **CPU**: 8
- **Rustc**: rustc 1.90.0-nightly (3014e79f9 2025-07-15)
================================================
FILE: benches/README.md
================================================
# Foundry Benchmarks
This directory contains performance benchmarks for Foundry commands across multiple repositories and Foundry versions.
## Prerequisites
Before running the benchmarks, ensure you have the following installed:
1. **Rust and Cargo** - Required for building the benchmark binary
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
2. **Foundryup** - The Foundry toolchain installer
```bash
curl -L https://foundry.paradigm.xyz | bash
foundryup
```
3. **Git** - For cloning benchmark repositories
4. [**Hyperfine**](https://github.com/sharkdp/hyperfine/blob/master/README.md) - The benchmarking tool used by foundry-bench
5. **Node.js and npm** - Some repositories require npm dependencies
## Running Benchmarks
Build and install the benchmark runner:
```bash
cargo build --release --bin foundry-bench
```
To install `foundry-bench` to your PATH:
```bash
cd benches && cargo install --path . --bin foundry-bench
```
#### Run with default settings
```bash
# Run all benchmarks on default repos with stable and nightly versions
foundry-bench --versions stable,nightly
```
#### Run with custom configurations
```bash
# Bench specific versions
foundry-bench --versions stable,nightly,v1.0.0
# Run on specific repositories. Default rev for the repo is "main"
foundry-bench --repos ithacaxyz/account,Vectorized/solady
# Test specific repository with custom revision
foundry-bench --repos ithacaxyz/account:main,Vectorized/solady:v0.0.123
# Run only specific benchmarks
foundry-bench --benchmarks forge_build_with_cache,forge_test
# Run only fuzz tests
foundry-bench --benchmarks forge_fuzz_test
# Run coverage benchmark
foundry-bench --benchmarks forge_coverage
# Combine options
foundry-bench \
--versions stable,nightly \
--repos ithacaxyz/account \
--benchmarks forge_build_with_cache
# Force install Foundry versions
foundry-bench --force-install
# Verbose output to see hyperfine logs
foundry-bench --verbose
# Output to specific directory
foundry-bench --output-dir ./results --output-file LATEST_RESULTS.md
```
#### Command-line Options
- `--versions <VERSIONS>` - Comma-separated list of Foundry versions (default: stable,nightly)
- `--repos <REPOS>` - Comma-separated list of repos in org/repo[:rev] format (default: ithacaxyz/account:v0.3.2,Vectorized/solady:v0.1.22)
- `--benchmarks <BENCHMARKS>` - Comma-separated list of benchmarks to run
- `--force-install` - Force installation of Foundry versions
- `--verbose` - Show detailed benchmark output
- `--output-dir <DIR>` - Directory for output files (default: benches)
- `--output-file <FILE_NAME.md>` - Name of the output file (default: LATEST.md)
## Benchmark Structure
- `forge_test` - Benchmarks `forge test` command across repos
- `forge_build_no_cache` - Benchmarks `forge build` with clean cache
- `forge_build_with_cache` - Benchmarks `forge build` with existing cache
- `forge_fuzz_test` - Benchmarks `forge test` with only fuzz tests (tests with parameters)
- `forge_coverage` - Benchmarks `forge coverage --ir-minimum` command across repos
## Configuration
The benchmark binary uses command-line arguments to configure which repositories and versions to test. The default repositories are:
- `ithacaxyz/account:v0.3.2`
- `Vectorized/solady:v0.1.22`
You can override these using the `--repos` flag with the format `org/repo[:rev]`.
## Results
Benchmark results are saved to `benches/LATEST.md` (or custom output file specified with `--output-file`). The report includes:
- Summary of versions and repositories tested
- Performance comparison tables for each benchmark type showing:
- Mean execution time
- Min/Max times
- Standard deviation
- Relative performance comparison between versions
- System information (OS, CPU cores)
- Detailed hyperfine benchmark results in JSON format
## Troubleshooting
1. **Foundry version not found**: Use `--force-install` flag or manually install with `foundryup --install <version>`
2. **Repository clone fails**: Check network connectivity and repository access
3. **Build failures**: Some repositories may have specific dependencies - check their README files
4. **Hyperfine not found**: Install hyperfine using the instructions in Prerequisites
5. **npm/Node.js errors**: Ensure Node.js and npm are installed for repositories that require them
================================================
FILE: benches/src/lib.rs
================================================
//! Foundry benchmark runner.
use crate::results::{HyperfineOutput, HyperfineResult};
use eyre::{Result, WrapErr};
use foundry_common::{sh_eprintln, sh_println};
use foundry_compilers::project_util::TempProject;
use foundry_test_utils::util::clone_remote;
use once_cell::sync::Lazy;
use std::{
path::{Path, PathBuf},
process::Command,
str::FromStr,
};
pub mod results;
/// Default number of runs for benchmarks
pub const RUNS: u32 = 5;
/// Configuration for repositories to benchmark
#[derive(Debug, Clone)]
pub struct RepoConfig {
pub name: String,
pub org: String,
pub repo: String,
pub rev: String,
}
impl FromStr for RepoConfig {
type Err = eyre::Error;
fn from_str(spec: &str) -> Result<Self> {
// Split by ':' first to separate repo path from optional rev
let parts: Vec<&str> = spec.splitn(2, ':').collect();
let repo_path = parts[0];
let custom_rev = parts.get(1).copied();
// Now split the repo path by '/'
let path_parts: Vec<&str> = repo_path.split('/').collect();
if path_parts.len() != 2 {
eyre::bail!("Invalid repo format '{}'. Expected 'org/repo' or 'org/repo:rev'", spec);
}
let org = path_parts[0];
let repo = path_parts[1];
// Try to find this repo in BENCHMARK_REPOS to get the full config
let existing_config = BENCHMARK_REPOS.iter().find(|r| r.org == org && r.repo == repo);
let config = if let Some(existing) = existing_config {
// Use existing config but allow custom rev to override
let mut config = existing.clone();
if let Some(rev) = custom_rev {
config.rev = rev.to_string();
}
config
} else {
// Create new config with custom rev or default
// Name should follow the format: org-repo (with hyphen)
Self {
name: format!("{org}-{repo}"),
org: org.to_string(),
repo: repo.to_string(),
rev: custom_rev.unwrap_or("main").to_string(),
}
};
let _ = sh_println!("Parsed repo spec '{spec}' -> {config:?}");
Ok(config)
}
}
/// Available repositories for benchmarking
pub fn default_benchmark_repos() -> Vec<RepoConfig> {
vec![
RepoConfig {
name: "ithacaxyz-account".to_string(),
org: "ithacaxyz".to_string(),
repo: "account".to_string(),
rev: "main".to_string(),
},
RepoConfig {
name: "solady".to_string(),
org: "Vectorized".to_string(),
repo: "solady".to_string(),
rev: "main".to_string(),
},
]
}
// Keep a lazy static for compatibility
pub static BENCHMARK_REPOS: Lazy<Vec<RepoConfig>> = Lazy::new(default_benchmark_repos);
/// Foundry versions to benchmark
///
/// To add more versions for comparison, install them first:
/// ```bash
/// foundryup --install stable
/// foundryup --install nightly
/// foundryup --install v0.2.0 # Example specific version
/// ```
///
/// Then add the version strings to this array. Supported formats:
/// - "stable" - Latest stable release
/// - "nightly" - Latest nightly build
/// - "v0.2.0" - Specific version tag
/// - "commit-hash" - Specific commit hash
/// - "nightly-rev" - Nightly build with specific revision
pub static FOUNDRY_VERSIONS: &[&str] = &["stable", "nightly"];
/// A benchmark project that represents a cloned repository ready for testing
pub struct BenchmarkProject {
pub name: String,
pub temp_project: TempProject,
pub root_path: PathBuf,
}
impl BenchmarkProject {
/// Set up a benchmark project by cloning the repository
#[allow(unused_must_use)]
pub fn setup(config: &RepoConfig) -> Result<Self> {
let temp_project =
TempProject::dapptools().wrap_err("Failed to create temporary project")?;
// Get root path before clearing
let root_path = temp_project.root().to_path_buf();
let root = root_path.to_str().unwrap();
// Remove all files in the directory
for entry in std::fs::read_dir(&root_path)? {
let entry = entry?;
let path = entry.path();
if path.is_dir() {
std::fs::remove_dir_all(&path).ok();
} else {
std::fs::remove_file(&path).ok();
}
}
// Clone the repository
let repo_url = format!("https://github.com/{}/{}.git", config.org, config.repo);
clone_remote(&repo_url, root, true);
// Checkout specific revision if provided
if !config.rev.is_empty() && config.rev != "main" && config.rev != "master" {
let status = Command::new("git")
.current_dir(root)
.args(["checkout", &config.rev])
.status()
.wrap_err("Failed to checkout revision")?;
if !status.success() {
eyre::bail!("Git checkout failed for {}", config.name);
}
}
// Git submodules are already cloned via --recursive flag
// But npm dependencies still need to be installed
Self::install_npm_dependencies(&root_path)?;
sh_println!(" ✅ Project {} setup complete at {}", config.name, root);
Ok(Self { name: config.name.to_string(), root_path, temp_project })
}
/// Install npm dependencies if package.json exists
#[allow(unused_must_use)]
fn install_npm_dependencies(root: &Path) -> Result<()> {
if root.join("package.json").exists() {
sh_println!(" 📦 Running npm install...");
let status = Command::new("npm")
.current_dir(root)
.args(["install"])
.stdout(std::process::Stdio::inherit())
.stderr(std::process::Stdio::inherit())
.status()
.wrap_err("Failed to run npm install")?;
if !status.success() {
sh_println!(
" ⚠️ Warning: npm install failed with exit code: {:?}",
status.code()
);
} else {
sh_println!(" ✅ npm install completed successfully");
}
}
Ok(())
}
/// Run a command with hyperfine and return the results
///
/// # Arguments
/// * `benchmark_name` - Name of the benchmark for organizing output
/// * `version` - Foundry version being benchmarked
/// * `command` - The command to benchmark
/// * `runs` - Number of runs to perform
/// * `setup` - Optional setup command to run before the benchmark series (e.g., "forge build")
/// * `prepare` - Optional prepare command to run before each timing run (e.g., "forge clean")
/// * `conclude` - Optional conclude command to run after each timing run (e.g., cleanup)
/// * `verbose` - Whether to show command output
///
/// # Hyperfine flags used:
/// * `--runs` - Number of timing runs
/// * `--setup` - Execute before the benchmark series (not before each run)
/// * `--prepare` - Execute before each timing run
/// * `--conclude` - Execute after each timing run
/// * `--export-json` - Export results to JSON for parsing
/// * `--shell=bash` - Use bash for shell command execution
/// * `--show-output` - Show command output (when verbose)
#[allow(clippy::too_many_arguments)]
fn hyperfine(
&self,
benchmark_name: &str,
version: &str,
command: &str,
runs: u32,
setup: Option<&str>,
prepare: Option<&str>,
conclude: Option<&str>,
verbose: bool,
) -> Result<HyperfineResult> {
// Create structured temp directory for JSON output
// Format: <temp_dir>/<benchmark_name>/<version>/<repo_name>/<benchmark_name>.json
let temp_dir = std::env::temp_dir();
let json_dir =
temp_dir.join("foundry-bench").join(benchmark_name).join(version).join(&self.name);
std::fs::create_dir_all(&json_dir)?;
let json_path = json_dir.join(format!("{benchmark_name}.json"));
// Build hyperfine command
let mut hyperfine_cmd = Command::new("hyperfine");
hyperfine_cmd
.current_dir(&self.root_path)
.arg("--runs")
.arg(runs.to_string())
.arg("--export-json")
.arg(&json_path)
.arg("--shell=bash");
// Add optional setup command
if let Some(setup_cmd) = setup {
hyperfine_cmd.arg("--setup").arg(setup_cmd);
}
// Add optional prepare command
if let Some(prepare_cmd) = prepare {
hyperfine_cmd.arg("--prepare").arg(prepare_cmd);
}
// Add optional conclude command
if let Some(conclude_cmd) = conclude {
hyperfine_cmd.arg("--conclude").arg(conclude_cmd);
}
if verbose {
hyperfine_cmd.arg("--show-output");
hyperfine_cmd.stderr(std::process::Stdio::inherit());
hyperfine_cmd.stdout(std::process::Stdio::inherit());
}
// Add the benchmark command last
hyperfine_cmd.arg(command);
let status = hyperfine_cmd.status().wrap_err("Failed to run hyperfine")?;
if !status.success() {
eyre::bail!("Hyperfine failed for command: {}", command);
}
// Read and parse the JSON output
let json_content = std::fs::read_to_string(json_path)?;
let output: HyperfineOutput = serde_json::from_str(&json_content)?;
// Extract the first result (we only run one command at a time)
output.results.into_iter().next().ok_or_else(|| eyre::eyre!("No results from hyperfine"))
}
/// Benchmark forge test
pub fn bench_forge_test(
&self,
version: &str,
runs: u32,
verbose: bool,
) -> Result<HyperfineResult> {
// Build before running tests
self.hyperfine(
"forge_test",
version,
"forge test",
runs,
Some("forge build"),
None,
None,
verbose,
)
}
/// Benchmark forge build with cache
pub fn bench_forge_build_with_cache(
&self,
version: &str,
runs: u32,
verbose: bool,
) -> Result<HyperfineResult> {
self.hyperfine(
"forge_build_with_cache",
version,
"FOUNDRY_LINT_LINT_ON_BUILD=false forge build",
runs,
None,
Some("forge build"),
None,
verbose,
)
}
/// Benchmark forge build without cache
pub fn bench_forge_build_no_cache(
&self,
version: &str,
runs: u32,
verbose: bool,
) -> Result<HyperfineResult> {
// Clean before each timing run
self.hyperfine(
"forge_build_no_cache",
version,
"FOUNDRY_LINT_LINT_ON_BUILD=false forge build",
runs,
Some("forge clean"),
None,
Some("forge clean"),
verbose,
)
}
/// Benchmark forge fuzz tests
pub fn bench_forge_fuzz_test(
&self,
version: &str,
runs: u32,
verbose: bool,
) -> Result<HyperfineResult> {
// Build before running fuzz tests
self.hyperfine(
"forge_fuzz_test",
version,
r#"forge test --match-test "test[^(]*\([^)]+\)""#,
runs,
Some("forge build"),
None,
None,
verbose,
)
}
/// Benchmark forge coverage
pub fn bench_forge_coverage(
&self,
version: &str,
runs: u32,
verbose: bool,
) -> Result<HyperfineResult> {
// No setup needed, forge coverage builds internally
// Use --ir-minimum to avoid "Stack too deep" errors
self.hyperfine(
"forge_coverage",
version,
"forge coverage --ir-minimum",
runs,
None,
None,
None,
verbose,
)
}
/// Benchmark forge test with --isolate flag
pub fn bench_forge_isolate_test(
&self,
version: &str,
runs: u32,
verbose: bool,
) -> Result<HyperfineResult> {
// Build before running tests
self.hyperfine(
"forge_isolate_test",
version,
"forge test --isolate",
runs,
Some("forge build"),
None,
None,
verbose,
)
}
/// Get the root path of the project
pub fn root(&self) -> &Path {
&self.root_path
}
/// Run a specific benchmark by name
pub fn run(
&self,
benchmark: &str,
version: &str,
runs: u32,
verbose: bool,
) -> Result<HyperfineResult> {
match benchmark {
"forge_test" => self.bench_forge_test(version, runs, verbose),
"forge_build_no_cache" => self.bench_forge_build_no_cache(version, runs, verbose),
"forge_build_with_cache" => self.bench_forge_build_with_cache(version, runs, verbose),
"forge_fuzz_test" => self.bench_forge_fuzz_test(version, runs, verbose),
"forge_coverage" => self.bench_forge_coverage(version, runs, verbose),
"forge_isolate_test" => self.bench_forge_isolate_test(version, runs, verbose),
_ => eyre::bail!("Unknown benchmark: {}", benchmark),
}
}
}
/// Switch to a specific foundry version
#[allow(unused_must_use)]
pub fn switch_foundry_version(version: &str) -> Result<()> {
let output = Command::new("foundryup")
.args(["--use", version])
.output()
.wrap_err("Failed to run foundryup")?;
// Check if the error is about forge --version failing
let stderr = String::from_utf8_lossy(&output.stderr);
if stderr.contains("command failed") && stderr.contains("forge --version") {
eyre::bail!(
"Foundry binaries maybe corrupted. Please reinstall by running `foundryup --install <version>`"
);
}
if !output.status.success() {
sh_eprintln!("foundryup stderr: {stderr}");
eyre::bail!("Failed to switch to foundry version: {}", version);
}
sh_println!(" Successfully switched to version: {version}");
Ok(())
}
/// Get the current forge version
pub fn get_forge_version() -> Result<String> {
let output = Command::new("forge")
.args(["--version"])
.output()
.wrap_err("Failed to get forge version")?;
if !output.status.success() {
eyre::bail!("forge --version failed");
}
let version =
String::from_utf8(output.stdout).wrap_err("Invalid UTF-8 in forge version output")?;
Ok(version.lines().next().unwrap_or("unknown").to_string())
}
/// Get the full forge version details including commit hash and date
pub fn get_forge_version_details() -> Result<String> {
let output = Command::new("forge")
.args(["--version"])
.output()
.wrap_err("Failed to get forge version")?;
if !output.status.success() {
eyre::bail!("forge --version failed");
}
let full_output =
String::from_utf8(output.stdout).wrap_err("Invalid UTF-8 in forge version output")?;
// Extract relevant lines and format them
let lines: Vec<&str> = full_output.lines().collect();
if lines.len() >= 3 {
// Extract version, commit, and timestamp
let version = lines[0].trim();
let commit = lines[1].trim().replace("Commit SHA: ", "");
let timestamp = lines[2].trim().replace("Build Timestamp: ", "");
// Format as: "forge 1.2.3-nightly (51650ea 2025-06-27)"
let short_commit = &commit[..7]; // First 7 chars of commit hash
let date = timestamp.split('T').next().unwrap_or(×tamp);
Ok(format!("{version} ({short_commit} {date})"))
} else {
// Fallback to just the first line if format is unexpected
Ok(lines.first().unwrap_or(&"unknown").to_string())
}
}
================================================
FILE: benches/src/main.rs
================================================
use clap::Parser;
use eyre::{Result, WrapErr};
use foundry_bench::{
BENCHMARK_REPOS, BenchmarkProject, FOUNDRY_VERSIONS, RUNS, RepoConfig, get_forge_version,
get_forge_version_details,
results::{BenchmarkResults, HyperfineResult},
switch_foundry_version,
};
use foundry_common::sh_println;
use rayon::prelude::*;
use std::{fs, path::PathBuf, process::Command, sync::Mutex};
const ALL_BENCHMARKS: [&str; 6] = [
"forge_test",
"forge_build_no_cache",
"forge_build_with_cache",
"forge_fuzz_test",
"forge_coverage",
"forge_isolate_test",
];
/// Foundry Benchmark Runner
#[derive(Parser, Debug)]
#[clap(name = "foundry-bench", about = "Run Foundry benchmarks across multiple versions")]
struct Cli {
/// Comma-separated list of Foundry versions to test (e.g., stable,nightly,v1.2.0)
#[clap(long, value_delimiter = ',')]
versions: Option<Vec<String>>,
/// Force install Foundry versions
#[clap(long)]
force_install: bool,
/// Show verbose output
#[clap(long)]
verbose: bool,
/// Directory where the aggregated benchmark results will be written.
#[clap(long, default_value = ".")]
output_dir: PathBuf,
/// Name of the output file (default: LATEST.md)
#[clap(long, default_value = "LATEST.md")]
output_file: String,
/// Run only specific benchmarks (comma-separated:
/// forge_test,forge_build_no_cache,forge_build_with_cache,forge_fuzz_test,forge_coverage)
#[clap(long, value_delimiter = ',')]
benchmarks: Option<Vec<String>>,
/// Run only on specific repositories (comma-separated in org/repo[:rev] format:
/// ithacaxyz/account,Vectorized/solady:main,foundry-rs/foundry:v1.0.0)
#[clap(long, value_delimiter = ',')]
repos: Option<Vec<String>>,
}
/// Mutex to prevent concurrent foundryup calls
static FOUNDRY_LOCK: Mutex<()> = Mutex::new(());
fn switch_version_safe(version: &str) -> Result<()> {
let _lock = FOUNDRY_LOCK.lock().unwrap();
switch_foundry_version(version)
}
#[allow(unused_must_use)]
fn main() -> Result<()> {
color_eyre::install()?;
let cli = Cli::parse();
// Check if hyperfine is installed
let hyperfine_check = Command::new("hyperfine").arg("--version").output();
if hyperfine_check.is_err() || !hyperfine_check.unwrap().status.success() {
eyre::bail!(
"hyperfine is not installed. Please install it first: https://github.com/sharkdp/hyperfine"
);
}
// Determine versions to test
let versions = if let Some(v) = cli.versions {
v
} else {
FOUNDRY_VERSIONS.iter().map(|&s| s.to_string()).collect()
};
// Get repo configurations
let repos = if let Some(repo_specs) = cli.repos.clone() {
repo_specs.iter().map(|spec| spec.parse::<RepoConfig>()).collect::<Result<Vec<_>>>()?
} else {
BENCHMARK_REPOS.clone()
};
sh_println!("🚀 Foundry Benchmark Runner");
sh_println!("Running with versions: {}", versions.join(", "));
sh_println!(
"Running on repos: {}",
repos.iter().map(|r| format!("{}/{}", r.org, r.repo)).collect::<Vec<_>>().join(", ")
);
// Install versions if requested
if cli.force_install {
install_foundry_versions(&versions)?;
}
// Determine benchmarks to run
let benchmarks = if let Some(b) = cli.benchmarks {
b.into_iter().filter(|b| ALL_BENCHMARKS.contains(&b.as_str())).collect()
} else {
// Default: run all benchmarks except fuzz tests and coverage (which can be slow)
vec!["forge_test", "forge_build_no_cache", "forge_build_with_cache"]
.into_iter()
.map(String::from)
.collect::<Vec<_>>()
};
sh_println!("Running benchmarks: {}", benchmarks.join(", "));
let mut results = BenchmarkResults::new();
// Set the first version as baseline
if let Some(first_version) = versions.first() {
results.set_baseline_version(first_version.clone());
}
// Setup all projects upfront before version loop
sh_println!("📦 Setting up projects to benchmark");
let projects: Vec<(RepoConfig, BenchmarkProject)> = repos
.par_iter()
.map(|repo_config| -> Result<(RepoConfig, BenchmarkProject)> {
sh_println!("Setting up {}/{}", repo_config.org, repo_config.repo);
let project = BenchmarkProject::setup(repo_config).wrap_err(format!(
"Failed to setup project for {}/{}",
repo_config.org, repo_config.repo
))?;
Ok((repo_config.clone(), project))
})
.collect::<Result<Vec<_>>>()?;
sh_println!("✅ All projects setup complete");
// Create a list of all benchmark tasks (same for all versions)
let benchmark_tasks: Vec<_> = projects
.iter()
.flat_map(|(repo_config, project)| {
benchmarks
.iter()
.map(move |benchmark| (repo_config.clone(), project, benchmark.clone()))
})
.collect();
sh_println!("Will run {} benchmark tasks per version", benchmark_tasks.len());
// Run benchmarks for each version
for version in &versions {
sh_println!("🔧 Switching to Foundry version: {version}");
switch_version_safe(version)?;
// Verify the switch and capture full version details
let current = get_forge_version()?;
sh_println!("Current version: {}", current.trim());
// Get and store the full version details with commit hash and date
let version_details = get_forge_version_details()?;
results.add_version_details(version, version_details);
sh_println!("Running benchmark tasks for version {version}...");
// Run all benchmarks sequentially
let version_results = benchmark_tasks
.iter()
.map(|(repo_config, project, benchmark)| -> Result<(String, String, HyperfineResult)> {
sh_println!("Running {} on {}/{}", benchmark, repo_config.org, repo_config.repo);
// Determine runs based on benchmark type
let runs = match benchmark.as_str() {
"forge_coverage" => 1, // Coverage runs only once as an exception
_ => RUNS, // Use default RUNS constant for all other benchmarks
};
// Run the appropriate benchmark
let result = project.run(benchmark, version, runs, cli.verbose);
match result {
Ok(hyperfine_result) => {
sh_println!(
" {} on {}/{}: {:.3}s ± {:.3}s",
benchmark,
repo_config.org,
repo_config.repo,
hyperfine_result.mean,
hyperfine_result.stddev.unwrap_or(0.0)
);
Ok((repo_config.name.clone(), benchmark.clone(), hyperfine_result))
}
Err(e) => {
eyre::bail!(
"Benchmark {} failed for {}/{}: {}",
benchmark,
repo_config.org,
repo_config.repo,
e
);
}
}
})
.collect::<Result<Vec<_>>>()?;
// Add all collected results to the main results structure
for (repo_name, benchmark, hyperfine_result) in version_results {
results.add_result(&benchmark, version, &repo_name, hyperfine_result);
}
}
// Generate markdown report
sh_println!("📝 Generating report...");
let markdown = results.generate_markdown(&versions, &repos);
let output_path = cli.output_dir.join(cli.output_file);
fs::write(&output_path, markdown).wrap_err("Failed to write output file")?;
sh_println!("✅ Report written to: {}", output_path.display());
Ok(())
}
#[allow(unused_must_use)]
fn install_foundry_versions(versions: &[String]) -> Result<()> {
sh_println!("Installing Foundry versions...");
for version in versions {
sh_println!("Installing {version}...");
let status = Command::new("foundryup")
.args(["--install", version, "--force"])
.status()
.wrap_err("Failed to run foundryup")?;
if !status.success() {
eyre::bail!("Failed to install Foundry version: {}", version);
}
}
sh_println!("✅ All versions installed successfully");
Ok(())
}
================================================
FILE: benches/src/results.rs
================================================
use crate::RepoConfig;
use eyre::Result;
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, process::Command, thread};
/// Hyperfine benchmark result
#[derive(Debug, Deserialize, Serialize)]
pub struct HyperfineResult {
pub command: String,
pub mean: f64,
pub stddev: Option<f64>,
pub median: f64,
pub user: f64,
pub system: f64,
pub min: f64,
pub max: f64,
pub times: Vec<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub exit_codes: Option<Vec<i32>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub parameters: Option<HashMap<String, serde_json::Value>>,
}
/// Hyperfine JSON output format
#[derive(Debug, Deserialize, Serialize)]
pub struct HyperfineOutput {
pub results: Vec<HyperfineResult>,
}
/// Aggregated benchmark results
#[derive(Debug, Default)]
pub struct BenchmarkResults {
/// Map of benchmark_name -> version -> repo -> result
pub data: HashMap<String, HashMap<String, HashMap<String, HyperfineResult>>>,
/// Track the baseline version for comparison
pub baseline_version: Option<String>,
/// Map of version name -> full version details
pub version_details: HashMap<String, String>,
}
impl BenchmarkResults {
pub fn new() -> Self {
Self::default()
}
pub fn set_baseline_version(&mut self, version: String) {
self.baseline_version = Some(version);
}
pub fn add_result(
&mut self,
benchmark: &str,
version: &str,
repo: &str,
result: HyperfineResult,
) {
self.data
.entry(benchmark.to_string())
.or_default()
.entry(version.to_string())
.or_default()
.insert(repo.to_string(), result);
}
pub fn add_version_details(&mut self, version: &str, details: String) {
self.version_details.insert(version.to_string(), details);
}
pub fn generate_markdown(&self, versions: &[String], repos: &[RepoConfig]) -> String {
let mut output = String::new();
// Header
output.push_str("# Foundry Benchmark Results\n\n");
output.push_str(&format!(
"**Date**: {}\n\n",
chrono::Local::now().format("%Y-%m-%d %H:%M:%S")
));
// Summary
output.push_str("## Summary\n\n");
// Count actual repos that have results
let mut repos_with_results = std::collections::HashSet::new();
for version_data in self.data.values() {
for repo_data in version_data.values() {
for repo_name in repo_data.keys() {
repos_with_results.insert(repo_name.clone());
}
}
}
output.push_str(&format!(
"Benchmarked {} Foundry versions across {} repositories.\n\n",
versions.len(),
repos_with_results.len()
));
// Repositories tested
output.push_str("### Repositories Tested\n\n");
for (i, repo) in repos.iter().enumerate() {
output.push_str(&format!(
"{}. [{}/{}](https://github.com/{}/{})\n",
i + 1,
repo.org,
repo.repo,
repo.org,
repo.repo
));
}
output.push('\n');
// Versions tested
output.push_str("### Foundry Versions\n\n");
for version in versions {
if let Some(details) = self.version_details.get(version) {
output.push_str(&format!("- **{version}**: {}\n", details.trim()));
} else {
output.push_str(&format!("- {version}\n"));
}
}
output.push('\n');
// Results for each benchmark type
for (benchmark_name, version_data) in &self.data {
output.push_str(&self.generate_benchmark_table(
benchmark_name,
version_data,
versions,
repos,
));
}
// System info
output.push_str("## System Information\n\n");
output.push_str(&format!("- **OS**: {}\n", std::env::consts::OS));
output.push_str(&format!(
"- **CPU**: {}\n",
thread::available_parallelism().map_or(1, |n| n.get())
));
output.push_str(&format!(
"- **Rustc**: {}\n",
get_rustc_version().unwrap_or_else(|_| "unknown".to_string())
));
output
}
/// Generate a complete markdown table for a single benchmark type
///
/// This includes the section header, table header, separator, and all rows
fn generate_benchmark_table(
&self,
benchmark_name: &str,
version_data: &HashMap<String, HashMap<String, HyperfineResult>>,
versions: &[String],
repos: &[RepoConfig],
) -> String {
let mut output = String::new();
// Section header
output.push_str(&format!("## {}\n\n", format_benchmark_name(benchmark_name)));
// Create table header
output.push_str("| Repository |");
for version in versions {
output.push_str(&format!(" {version} |"));
}
output.push('\n');
// Table separator
output.push_str("|------------|");
for _ in versions {
output.push_str("----------|");
}
output.push('\n');
// Table rows
output.push_str(&generate_table_rows(version_data, versions, repos));
output.push('\n');
output
}
}
/// Generate table rows for benchmark results
///
/// This function creates the markdown table rows for each repository,
/// showing the benchmark results for each version.
fn generate_table_rows(
version_data: &HashMap<String, HashMap<String, HyperfineResult>>,
versions: &[String],
repos: &[RepoConfig],
) -> String {
let mut output = String::new();
for repo in repos {
output.push_str(&format!("| {} |", repo.name));
for version in versions {
let cell_content = get_benchmark_cell_content(version_data, version, &repo.name);
output.push_str(&format!(" {cell_content} |"));
}
output.push('\n');
}
output
}
/// Get the content for a single benchmark table cell
///
/// Returns the formatted duration or "N/A" if no data is available.
/// The nested if-let statements handle the following cases:
/// 1. Check if version data exists
/// 2. Check if repository data exists for this version
fn get_benchmark_cell_content(
version_data: &HashMap<String, HashMap<String, HyperfineResult>>,
version: &str,
repo_name: &str,
) -> String {
// Check if we have data for this version
if let Some(repo_data) = version_data.get(version) &&
// Check if we have data for this repository
let Some(result) = repo_data.get(repo_name)
{
return format_duration_seconds(result.mean);
}
"N/A".to_string()
}
pub fn format_benchmark_name(name: &str) -> String {
match name {
"forge_test" => "Forge Test",
"forge_build_no_cache" => "Forge Build (No Cache)",
"forge_build_with_cache" => "Forge Build (With Cache)",
"forge_fuzz_test" => "Forge Fuzz Test",
"forge_coverage" => "Forge Coverage",
"forge_isolate_test" => "Forge Test (Isolated)",
_ => name,
}
.to_string()
}
pub fn format_duration_seconds(seconds: f64) -> String {
if seconds < 0.001 {
format!("{:.2} ms", seconds * 1000.0)
} else if seconds < 1.0 {
format!("{seconds:.3} s")
} else if seconds < 60.0 {
format!("{seconds:.2} s")
} else {
let minutes = (seconds / 60.0).floor();
let remaining_seconds = seconds % 60.0;
format!("{minutes:.0}m {remaining_seconds:.1}s")
}
}
pub fn get_rustc_version() -> Result<String> {
let output = Command::new("rustc").arg("--version").output()?;
Ok(String::from_utf8_lossy(&output.stdout).trim().to_string())
}
================================================
FILE: benchmark.sh
================================================
#!/bin/bash
versions="v1.3.6,v1.4.0-rc1"
# Repositories
export ITHACA_ACCOUNT="ithacaxyz/account:v0.3.2"
export SOLADY_REPO="Vectorized/solady:v0.1.22"
export UNISWAP_V4_CORE="Uniswap/v4-core:59d3ecf"
export SPARK_PSM="sparkdotfi/spark-psm:v1.0.0"
# Benches
echo "===========FORGE TEST AND BUILD BENCHMARKS==========="
foundry-bench --versions $versions \
--repos $ITHACA_ACCOUNT,$SOLADY_REPO,$UNISWAP_V4_CORE,$SPARK_PSM \
--benchmarks forge_test,forge_fuzz_test,forge_build_no_cache,forge_build_with_cache \
--output-dir ./benches/results \
--output-file TEST_BUILD.md
echo "===========FORGE COVERAGE BENCHMARKS==========="
foundry-bench --versions $versions \
--repos $ITHACA_ACCOUNT,$UNISWAP_V4_CORE,$SPARK_PSM \
--benchmarks forge_coverage \
--output-dir ./benches/results \
--output-file COVERAGE.md
echo "===========FORGE ISOLATE TEST BENCHMARKS==========="
foundry-bench --versions $versions \
--repos $SOLADY_REPO,$UNISWAP_V4_CORE,$SPARK_PSM \
--benchmarks forge_isolate_test \
--output-dir ./benches/results \
--output-file ISOLATE_TEST.md
echo "===========BENCHMARKS COMPLETED==========="
================================================
FILE: clippy.toml
================================================
# `bytes::Bytes` is included by default and `alloy_primitives::Bytes` is a wrapper around it,
# so it is safe to ignore it as well.
ignore-interior-mutability = ["bytes::Bytes", "alloy_primitives::Bytes"]
disallowed-macros = [
# See `foundry_common::shell`.
{ path = "std::print", reason = "use `sh_print` or similar macros instead" },
{ path = "std::eprint", reason = "use `sh_eprint` or similar macros instead" },
{ path = "std::println", reason = "use `sh_println` or similar macros instead" },
{ path = "std::eprintln", reason = "use `sh_eprintln` or similar macros instead" },
]
================================================
FILE: crates/anvil/Cargo.toml
================================================
[package]
name = "anvil"
description = "Local ethereum node"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
[lints]
workspace = true
[[bin]]
name = "anvil"
path = "bin/main.rs"
required-features = ["cli"]
[dependencies]
# foundry internal
anvil-core = { path = "core" }
anvil-rpc = { path = "rpc" }
anvil-server = { path = "server" }
foundry-cli.workspace = true
foundry-common.workspace = true
foundry-config.workspace = true
foundry-evm.workspace = true
foundry-evm-networks.workspace = true
foundry-primitives.workspace = true
tempo-primitives.workspace = true
# alloy
alloy-evm = { workspace = true, features = ["call-util"] }
alloy-op-evm.workspace = true
alloy-primitives = { workspace = true, features = ["serde"] }
alloy-consensus = { workspace = true, features = ["k256", "kzg"] }
alloy-contract = { workspace = true, features = ["pubsub"] }
alloy-network.workspace = true
alloy-eips.workspace = true
alloy-rlp.workspace = true
alloy-signer = { workspace = true, features = ["eip712"] }
alloy-signer-local = { workspace = true, features = ["mnemonic"] }
alloy-sol-types = { workspace = true, features = ["std"] }
alloy-dyn-abi = { workspace = true, features = ["std", "eip712"] }
alloy-rpc-types = { workspace = true, features = ["anvil", "trace", "txpool"] }
alloy-rpc-types-beacon.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-serde.workspace = true
alloy-provider = { workspace = true, features = [
"reqwest",
"ws",
"ipc",
"debug-api",
"trace-api",
] }
alloy-transport.workspace = true
alloy-chains.workspace = true
alloy-genesis.workspace = true
alloy-trie.workspace = true
op-alloy-consensus = { workspace = true, features = ["serde"] }
# revm
revm = { workspace = true, features = [
"std",
"serde",
"memory_limit",
"c-kzg",
] }
revm-inspectors.workspace = true
op-revm.workspace = true
# axum related
axum.workspace = true
hyper.workspace = true
# tracing
tracing.workspace = true
tracing-subscriber = { workspace = true, features = ["env-filter"] }
# async
tokio = { workspace = true, features = ["time"] }
parking_lot.workspace = true
futures.workspace = true
async-trait.workspace = true
# misc
flate2.workspace = true
serde_json.workspace = true
serde.workspace = true
thiserror.workspace = true
yansi.workspace = true
tempfile.workspace = true
itertools.workspace = true
rand_08.workspace = true
eyre.workspace = true
ethereum_ssz.workspace = true
# cli
clap = { version = "4", features = [
"derive",
"env",
"wrap_help",
], optional = true }
clap_complete = { workspace = true, optional = true }
chrono.workspace = true
ctrlc = { version = "3", optional = true }
fdlimit = { version = "0.3", optional = true }
[dev-dependencies]
alloy-provider = { workspace = true, features = ["txpool-api"] }
alloy-pubsub.workspace = true
rand.workspace = true
reqwest.workspace = true
foundry-test-utils.workspace = true
tokio = { workspace = true, features = ["full"] }
op-alloy-rpc-types.workspace = true
[features]
default = ["cli", "jemalloc"]
asm-keccak = ["alloy-primitives/asm-keccak"]
jemalloc = ["foundry-cli/jemalloc"]
mimalloc = ["foundry-cli/mimalloc"]
tracy-allocator = ["foundry-cli/tracy-allocator"]
cli = ["tokio/full", "cmd"]
cmd = [
"clap",
"clap_complete",
"dep:fdlimit",
"dep:ctrlc",
"anvil-server/clap",
"tokio/signal",
]
js-tracer = ["revm-inspectors/js-tracer"]
================================================
FILE: crates/anvil/bin/main.rs
================================================
//! The `anvil` CLI: a fast local Ethereum development node, akin to Hardhat Network, Tenderly.
use anvil::args::run;
#[global_allocator]
static ALLOC: foundry_cli::utils::Allocator = foundry_cli::utils::new_allocator();
fn main() {
if let Err(err) = run() {
let _ = foundry_common::sh_err!("{err:?}");
std::process::exit(1);
}
}
================================================
FILE: crates/anvil/core/Cargo.toml
================================================
[package]
name = "anvil-core"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
[lints]
workspace = true
[dependencies]
foundry-common.workspace = true
foundry-evm.workspace = true
foundry-primitives.workspace = true
revm = { workspace = true, default-features = false, features = [
"std",
"serde",
"memory_limit",
"c-kzg",
] }
alloy-primitives = { workspace = true, features = ["serde", "rlp"] }
alloy-rpc-types = { workspace = true, features = ["anvil", "trace"] }
alloy-serde.workspace = true
alloy-rlp.workspace = true
alloy-eips.workspace = true
alloy-eip5792.workspace = true
alloy-consensus = { workspace = true, features = ["k256", "kzg"] }
alloy-network.workspace = true
alloy-dyn-abi = { workspace = true, features = ["std", "eip712"] }
serde.workspace = true
serde_json.workspace = true
bytes.workspace = true
# misc
rand.workspace = true
thiserror.workspace = true
================================================
FILE: crates/anvil/core/src/eth/block.rs
================================================
use super::transaction::TransactionInfo;
use alloy_consensus::{
BlockBody, EMPTY_OMMER_ROOT_HASH, Header, proofs::calculate_transaction_root,
};
use alloy_eips::eip2718::Encodable2718;
use alloy_network::Network;
use foundry_primitives::{FoundryNetwork, FoundryTxEnvelope};
use std::fmt::Debug;
use crate::eth::transaction::MaybeImpersonatedTransaction;
/// Type alias for Ethereum Block with Anvil's transaction type, generic over the transaction
/// envelope with a default of [`FoundryTxEnvelope`].
pub type Block<T = FoundryTxEnvelope> = alloy_consensus::Block<MaybeImpersonatedTransaction<T>>;
/// Anvil's concrete block info type.
pub type BlockInfo = TypedBlockInfo<FoundryNetwork>;
/// Container type that gathers all block data, generic over a [`Network`].
#[derive(Clone, Debug)]
pub struct TypedBlockInfo<N: Network> {
pub block: alloy_consensus::Block<MaybeImpersonatedTransaction<N::TxEnvelope>>,
pub transactions: Vec<TransactionInfo>,
pub receipts: Vec<N::ReceiptEnvelope>,
}
/// Helper function to create a new block with Header and Anvil transactions, generic over the
/// transaction envelope with a default of [`FoundryTxEnvelope`].
///
/// Note: if the `impersonate-tx` feature is enabled this will also accept
/// `MaybeImpersonatedTransaction`.
pub fn create_block<T, Tx>(
mut header: Header,
transactions: impl IntoIterator<Item = T>,
) -> Block<Tx>
where
Tx: Encodable2718,
T: Into<MaybeImpersonatedTransaction<Tx>>,
{
let transactions: Vec<_> = transactions.into_iter().map(Into::into).collect();
let transactions_root = calculate_transaction_root(&transactions);
header.transactions_root = transactions_root;
header.ommers_hash = EMPTY_OMMER_ROOT_HASH;
let body = BlockBody { transactions, ommers: Vec::new(), withdrawals: None };
Block::new(header, body)
}
/// Generic helper function to create a block with any transaction type that supports encoding.
pub fn create_typed_block<T>(
mut header: Header,
transactions: impl IntoIterator<Item = T>,
) -> alloy_consensus::Block<T>
where
T: Encodable2718,
{
let transactions: Vec<_> = transactions.into_iter().collect();
let transactions_root = calculate_transaction_root(&transactions);
header.transactions_root = transactions_root;
header.ommers_hash = EMPTY_OMMER_ROOT_HASH;
let body = BlockBody { transactions, ommers: Vec::new(), withdrawals: None };
alloy_consensus::Block::new(header, body)
}
#[cfg(test)]
mod tests {
use alloy_primitives::{
Address, B64, B256, Bloom, U256, b256,
hex::{self, FromHex},
};
use alloy_rlp::Decodable;
use super::*;
gitextract_5h1i4s30/ ├── .cargo/ │ └── config.toml ├── .config/ │ └── nextest.toml ├── .devcontainer/ │ ├── Dockerfile.dev │ └── devcontainer.json ├── .dockerignore ├── .git-blame-ignore-revs ├── .gitattributes ├── .github/ │ ├── CODEOWNERS │ ├── FLAKY_TEST_FAILURE_TEMPLATE.md │ ├── FLAKY_TEST_ISOLATE_FAILURE_TEMPLATE.md │ ├── INTEGRATION_FAILURE.md │ ├── ISSUE_TEMPLATE/ │ │ ├── BUG-FORM.yml │ │ ├── FEATURE-FORM.yml │ │ └── config.yml │ ├── PULL_REQUEST_TEMPLATE.md │ ├── RELEASE_FAILURE_ISSUE_TEMPLATE.md │ ├── TEST_ISOLATE_FAILURE_TEMPLATE.md │ ├── changelog.json │ ├── dependabot.yml │ ├── scripts/ │ │ ├── combine-benchmarks.sh │ │ ├── commit-and-read-benchmarks.sh │ │ ├── create-tag.js │ │ ├── format-pr-comment.sh │ │ ├── format.sh │ │ ├── matrices.py │ │ ├── move-tag.js │ │ ├── prune-prereleases.js │ │ ├── setup-foundryup.sh │ │ └── shellcheck.sh │ └── workflows/ │ ├── benchmarks.yml │ ├── bump-forge-std.yml │ ├── ci.yml │ ├── dependencies.yml │ ├── docker-publish.yml │ ├── docs.yml │ ├── nix.yml │ ├── npm.yml │ ├── release.yml │ ├── test-flaky.yml │ ├── test-isolate.yml │ └── test.yml ├── .gitignore ├── CONTRIBUTING.md ├── Cargo.toml ├── Dockerfile ├── FUNDING.json ├── LICENSE-APACHE ├── LICENSE-MIT ├── Makefile ├── README.md ├── SECURITY.md ├── benches/ │ ├── Cargo.toml │ ├── LATEST.md │ ├── README.md │ └── src/ │ ├── lib.rs │ ├── main.rs │ └── results.rs ├── benchmark.sh ├── clippy.toml ├── crates/ │ ├── anvil/ │ │ ├── Cargo.toml │ │ ├── bin/ │ │ │ └── main.rs │ │ ├── core/ │ │ │ ├── Cargo.toml │ │ │ └── src/ │ │ │ ├── eth/ │ │ │ │ ├── block.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── serde_helpers.rs │ │ │ │ ├── subscription.rs │ │ │ │ ├── transaction/ │ │ │ │ │ └── mod.rs │ │ │ │ └── wallet.rs │ │ │ ├── lib.rs │ │ │ └── types.rs │ │ ├── rpc/ │ │ │ ├── Cargo.toml │ │ │ └── src/ │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ ├── request.rs │ │ │ └── response.rs │ │ ├── server/ │ │ │ ├── Cargo.toml │ │ │ └── src/ │ │ │ ├── config.rs │ │ │ ├── error.rs │ │ │ ├── handler.rs │ │ │ ├── ipc.rs │ │ │ ├── lib.rs │ │ │ ├── pubsub.rs │ │ │ └── ws.rs │ │ ├── src/ │ │ │ ├── args.rs │ │ │ ├── cmd.rs │ │ │ ├── config.rs │ │ │ ├── error.rs │ │ │ ├── eth/ │ │ │ │ ├── api.rs │ │ │ │ ├── backend/ │ │ │ │ │ ├── cheats.rs │ │ │ │ │ ├── db.rs │ │ │ │ │ ├── env.rs │ │ │ │ │ ├── executor.rs │ │ │ │ │ ├── fork.rs │ │ │ │ │ ├── genesis.rs │ │ │ │ │ ├── info.rs │ │ │ │ │ ├── mem/ │ │ │ │ │ │ ├── cache.rs │ │ │ │ │ │ ├── fork_db.rs │ │ │ │ │ │ ├── in_memory_db.rs │ │ │ │ │ │ ├── inspector.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ ├── state.rs │ │ │ │ │ │ └── storage.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── notifications.rs │ │ │ │ │ ├── time.rs │ │ │ │ │ └── validate.rs │ │ │ │ ├── error.rs │ │ │ │ ├── fees.rs │ │ │ │ ├── macros.rs │ │ │ │ ├── miner.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── otterscan/ │ │ │ │ │ ├── api.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── pool/ │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── transactions.rs │ │ │ │ ├── sign.rs │ │ │ │ └── util.rs │ │ │ ├── evm.rs │ │ │ ├── filter.rs │ │ │ ├── lib.rs │ │ │ ├── logging.rs │ │ │ ├── opts.rs │ │ │ ├── pubsub.rs │ │ │ ├── server/ │ │ │ │ ├── beacon/ │ │ │ │ │ ├── error.rs │ │ │ │ │ ├── handlers.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── utils.rs │ │ │ │ ├── mod.rs │ │ │ │ └── rpc_handlers.rs │ │ │ ├── service.rs │ │ │ ├── shutdown.rs │ │ │ └── tasks/ │ │ │ ├── block_listener.rs │ │ │ └── mod.rs │ │ ├── test-data/ │ │ │ ├── SimpleStorage.json │ │ │ ├── SimpleStorage.sol │ │ │ ├── emit_logs.json │ │ │ ├── emit_logs.sol │ │ │ ├── greeter.json │ │ │ ├── multicall.json │ │ │ ├── multicall.sol │ │ │ ├── state-dump-legacy-stress.json │ │ │ ├── state-dump-legacy.json │ │ │ ├── state-dump.json │ │ │ └── storage_sample.json │ │ └── tests/ │ │ └── it/ │ │ ├── abi.rs │ │ ├── anvil.rs │ │ ├── anvil_api.rs │ │ ├── api.rs │ │ ├── beacon_api.rs │ │ ├── eip2935.rs │ │ ├── eip4844.rs │ │ ├── eip7702.rs │ │ ├── fork.rs │ │ ├── gas.rs │ │ ├── genesis.rs │ │ ├── ipc.rs │ │ ├── logs.rs │ │ ├── main.rs │ │ ├── optimism.rs │ │ ├── otterscan.rs │ │ ├── proof.rs │ │ ├── pubsub.rs │ │ ├── revert.rs │ │ ├── sign.rs │ │ ├── simulate.rs │ │ ├── state.rs │ │ ├── traces.rs │ │ ├── transaction.rs │ │ ├── txpool.rs │ │ ├── utils.rs │ │ └── wsapi.rs │ ├── cast/ │ │ ├── Cargo.toml │ │ ├── bin/ │ │ │ └── main.rs │ │ ├── src/ │ │ │ ├── args.rs │ │ │ ├── base.rs │ │ │ ├── cmd/ │ │ │ │ ├── access_list.rs │ │ │ │ ├── artifact.rs │ │ │ │ ├── b2e_payload.rs │ │ │ │ ├── bind.rs │ │ │ │ ├── call.rs │ │ │ │ ├── constructor_args.rs │ │ │ │ ├── create2.rs │ │ │ │ ├── creation_code.rs │ │ │ │ ├── da_estimate.rs │ │ │ │ ├── erc20.rs │ │ │ │ ├── estimate.rs │ │ │ │ ├── find_block.rs │ │ │ │ ├── interface.rs │ │ │ │ ├── logs.rs │ │ │ │ ├── mktx.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── rpc.rs │ │ │ │ ├── run.rs │ │ │ │ ├── send.rs │ │ │ │ ├── storage.rs │ │ │ │ ├── trace.rs │ │ │ │ ├── txpool.rs │ │ │ │ └── wallet/ │ │ │ │ ├── list.rs │ │ │ │ ├── mod.rs │ │ │ │ └── vanity.rs │ │ │ ├── debug.rs │ │ │ ├── errors.rs │ │ │ ├── lib.rs │ │ │ ├── opts.rs │ │ │ ├── rlp_converter.rs │ │ │ └── tx.rs │ │ └── tests/ │ │ ├── cli/ │ │ │ ├── erc20.rs │ │ │ ├── main.rs │ │ │ └── selectors.rs │ │ └── fixtures/ │ │ ├── ERC20Artifact.json │ │ ├── TestToken.sol │ │ ├── cast_logs.stdout │ │ ├── interface.json │ │ ├── interface_inherited_struct.json │ │ ├── keystore/ │ │ │ ├── UTC--2022-10-30T06-51-20.130356000Z--560d246fcddc9ea98a8b032c9a2f474efb493c28 │ │ │ ├── UTC--2022-12-20T10-30-43.591916000Z--ec554aeafe75601aaab43bd4621a22284db566c2 │ │ │ ├── password │ │ │ └── password-ec554 │ │ ├── sign_typed_data.json │ │ ├── storage_layout_complex.json │ │ └── storage_layout_simple.json │ ├── cheatcodes/ │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── assets/ │ │ │ ├── cheatcodes.json │ │ │ └── cheatcodes.schema.json │ │ ├── spec/ │ │ │ ├── Cargo.toml │ │ │ └── src/ │ │ │ ├── cheatcode.rs │ │ │ ├── function.rs │ │ │ ├── items.rs │ │ │ ├── lib.rs │ │ │ └── vm.rs │ │ └── src/ │ │ ├── base64.rs │ │ ├── config.rs │ │ ├── crypto.rs │ │ ├── env.rs │ │ ├── error.rs │ │ ├── evm/ │ │ │ ├── fork.rs │ │ │ ├── mapping.rs │ │ │ ├── mock.rs │ │ │ ├── prank.rs │ │ │ └── record_debug_step.rs │ │ ├── evm.rs │ │ ├── fs.rs │ │ ├── inspector/ │ │ │ ├── analysis.rs │ │ │ └── utils.rs │ │ ├── inspector.rs │ │ ├── json.rs │ │ ├── lib.rs │ │ ├── script.rs │ │ ├── string.rs │ │ ├── test/ │ │ │ ├── assert.rs │ │ │ ├── assume.rs │ │ │ ├── expect.rs │ │ │ └── revert_handlers.rs │ │ ├── test.rs │ │ ├── toml.rs │ │ ├── utils.rs │ │ └── version.rs │ ├── chisel/ │ │ ├── Cargo.toml │ │ ├── assets/ │ │ │ └── preview.tape │ │ ├── bin/ │ │ │ └── main.rs │ │ ├── src/ │ │ │ ├── args.rs │ │ │ ├── cmd.rs │ │ │ ├── dispatcher.rs │ │ │ ├── executor.rs │ │ │ ├── lib.rs │ │ │ ├── opts.rs │ │ │ ├── runner.rs │ │ │ ├── session.rs │ │ │ ├── solidity_helper.rs │ │ │ └── source.rs │ │ └── tests/ │ │ └── it/ │ │ ├── main.rs │ │ └── repl/ │ │ ├── mod.rs │ │ └── session.rs │ ├── cli/ │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src/ │ │ ├── clap.rs │ │ ├── handler.rs │ │ ├── lib.rs │ │ ├── opts/ │ │ │ ├── build/ │ │ │ │ ├── core.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── paths.rs │ │ │ │ └── utils.rs │ │ │ ├── chain.rs │ │ │ ├── dependency.rs │ │ │ ├── evm.rs │ │ │ ├── global.rs │ │ │ ├── mod.rs │ │ │ ├── network.rs │ │ │ ├── rpc.rs │ │ │ ├── tempo.rs │ │ │ └── transaction.rs │ │ └── utils/ │ │ ├── abi.rs │ │ ├── allocator.rs │ │ ├── cmd.rs │ │ ├── default_directives.txt │ │ ├── mod.rs │ │ └── suggestions.rs │ ├── cli-markdown/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── common/ │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── build.rs │ │ ├── fmt/ │ │ │ ├── Cargo.toml │ │ │ └── src/ │ │ │ ├── console.rs │ │ │ ├── dynamic.rs │ │ │ ├── exp.rs │ │ │ ├── lib.rs │ │ │ └── ui.rs │ │ └── src/ │ │ ├── abi.rs │ │ ├── calc.rs │ │ ├── comments/ │ │ │ ├── comment.rs │ │ │ ├── inline_config.rs │ │ │ └── mod.rs │ │ ├── compile.rs │ │ ├── constants.rs │ │ ├── contracts.rs │ │ ├── errors/ │ │ │ ├── fs.rs │ │ │ └── mod.rs │ │ ├── fs.rs │ │ ├── io/ │ │ │ ├── macros.rs │ │ │ ├── mod.rs │ │ │ ├── shell.rs │ │ │ ├── stdin.rs │ │ │ └── style.rs │ │ ├── iter.rs │ │ ├── lib.rs │ │ ├── mapping_slots.rs │ │ ├── preprocessor/ │ │ │ ├── data.rs │ │ │ ├── deps.rs │ │ │ └── mod.rs │ │ ├── provider/ │ │ │ ├── curl_transport.rs │ │ │ ├── mod.rs │ │ │ └── runtime_transport.rs │ │ ├── retry.rs │ │ ├── selectors.rs │ │ ├── serde_helpers.rs │ │ ├── slot_identifier.rs │ │ ├── term.rs │ │ ├── traits.rs │ │ ├── transactions.rs │ │ ├── utils.rs │ │ └── version.rs │ ├── config/ │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src/ │ │ ├── bind_json.rs │ │ ├── cache.rs │ │ ├── compilation.rs │ │ ├── doc.rs │ │ ├── endpoints.rs │ │ ├── error.rs │ │ ├── etherscan.rs │ │ ├── extend.rs │ │ ├── filter.rs │ │ ├── fix.rs │ │ ├── fmt.rs │ │ ├── fs_permissions.rs │ │ ├── fuzz.rs │ │ ├── inline/ │ │ │ ├── mod.rs │ │ │ └── natspec.rs │ │ ├── invariant.rs │ │ ├── lib.rs │ │ ├── lint.rs │ │ ├── macros.rs │ │ ├── providers/ │ │ │ ├── ext.rs │ │ │ ├── mod.rs │ │ │ ├── remappings.rs │ │ │ └── warnings.rs │ │ ├── resolve.rs │ │ ├── soldeer.rs │ │ ├── utils.rs │ │ ├── vyper.rs │ │ └── warning.rs │ ├── debugger/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── builder.rs │ │ ├── debugger.rs │ │ ├── dump.rs │ │ ├── lib.rs │ │ ├── node.rs │ │ ├── op.rs │ │ └── tui/ │ │ ├── context.rs │ │ ├── draw.rs │ │ └── mod.rs │ ├── doc/ │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── src/ │ │ │ ├── builder.rs │ │ │ ├── document.rs │ │ │ ├── helpers.rs │ │ │ ├── lib.rs │ │ │ ├── parser/ │ │ │ │ ├── comment.rs │ │ │ │ ├── error.rs │ │ │ │ ├── item.rs │ │ │ │ └── mod.rs │ │ │ ├── preprocessor/ │ │ │ │ ├── contract_inheritance.rs │ │ │ │ ├── deployments.rs │ │ │ │ ├── git_source.rs │ │ │ │ ├── infer_hyperlinks.rs │ │ │ │ ├── inheritdoc.rs │ │ │ │ └── mod.rs │ │ │ ├── solang_ext/ │ │ │ │ ├── ast_eq.rs │ │ │ │ ├── loc.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── safe_unwrap.rs │ │ │ │ └── visit.rs │ │ │ └── writer/ │ │ │ ├── as_doc.rs │ │ │ ├── buf_writer.rs │ │ │ ├── markdown.rs │ │ │ ├── mod.rs │ │ │ └── traits.rs │ │ └── static/ │ │ ├── book.css │ │ └── book.toml │ ├── evm/ │ │ ├── abi/ │ │ │ ├── Cargo.toml │ │ │ └── src/ │ │ │ ├── Console.json │ │ │ ├── console/ │ │ │ │ ├── ds.rs │ │ │ │ ├── hh.rs │ │ │ │ └── mod.rs │ │ │ ├── console.py │ │ │ └── lib.rs │ │ ├── core/ │ │ │ ├── Cargo.toml │ │ │ ├── src/ │ │ │ │ ├── backend/ │ │ │ │ │ ├── cow.rs │ │ │ │ │ ├── diagnostic.rs │ │ │ │ │ ├── error.rs │ │ │ │ │ ├── in_memory_db.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── snapshot.rs │ │ │ │ ├── buffer.rs │ │ │ │ ├── bytecode.rs │ │ │ │ ├── constants.rs │ │ │ │ ├── decode.rs │ │ │ │ ├── either_evm.rs │ │ │ │ ├── env.rs │ │ │ │ ├── evm.rs │ │ │ │ ├── fork/ │ │ │ │ │ ├── database.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── multi.rs │ │ │ │ ├── hardfork.rs │ │ │ │ ├── ic.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── opts.rs │ │ │ │ ├── precompiles.rs │ │ │ │ ├── state_snapshot.rs │ │ │ │ └── utils.rs │ │ │ └── test-data/ │ │ │ └── storage.json │ │ ├── coverage/ │ │ │ ├── Cargo.toml │ │ │ └── src/ │ │ │ ├── analysis.rs │ │ │ ├── anchors.rs │ │ │ ├── inspector.rs │ │ │ └── lib.rs │ │ ├── evm/ │ │ │ ├── Cargo.toml │ │ │ └── src/ │ │ │ ├── executors/ │ │ │ │ ├── builder.rs │ │ │ │ ├── corpus.rs │ │ │ │ ├── fuzz/ │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── types.rs │ │ │ │ ├── invariant/ │ │ │ │ │ ├── error.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── replay.rs │ │ │ │ │ ├── result.rs │ │ │ │ │ └── shrink.rs │ │ │ │ ├── mod.rs │ │ │ │ └── trace.rs │ │ │ ├── inspectors/ │ │ │ │ ├── chisel_state.rs │ │ │ │ ├── custom_printer.rs │ │ │ │ ├── logs.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── revert_diagnostic.rs │ │ │ │ ├── script.rs │ │ │ │ └── stack.rs │ │ │ └── lib.rs │ │ ├── fuzz/ │ │ │ ├── Cargo.toml │ │ │ └── src/ │ │ │ ├── error.rs │ │ │ ├── inspector.rs │ │ │ ├── invariant/ │ │ │ │ ├── call_override.rs │ │ │ │ ├── filters.rs │ │ │ │ └── mod.rs │ │ │ ├── lib.rs │ │ │ └── strategies/ │ │ │ ├── calldata.rs │ │ │ ├── int.rs │ │ │ ├── invariants.rs │ │ │ ├── literals.rs │ │ │ ├── mod.rs │ │ │ ├── mutators.rs │ │ │ ├── param.rs │ │ │ ├── state.rs │ │ │ └── uint.rs │ │ ├── networks/ │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ └── src/ │ │ │ ├── celo/ │ │ │ │ ├── mod.rs │ │ │ │ └── transfer.rs │ │ │ └── lib.rs │ │ ├── test-data/ │ │ │ └── solc-obj.json │ │ └── traces/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── backtrace/ │ │ │ ├── mod.rs │ │ │ └── source_map.rs │ │ ├── debug/ │ │ │ ├── mod.rs │ │ │ └── sources.rs │ │ ├── decoder/ │ │ │ ├── mod.rs │ │ │ └── precompiles.rs │ │ ├── folded_stack_trace.rs │ │ ├── identifier/ │ │ │ ├── external.rs │ │ │ ├── local.rs │ │ │ ├── mod.rs │ │ │ └── signatures.rs │ │ └── lib.rs │ ├── fmt/ │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── src/ │ │ │ ├── lib.rs │ │ │ ├── pp/ │ │ │ │ ├── convenience.rs │ │ │ │ ├── helpers.rs │ │ │ │ ├── mod.rs │ │ │ │ └── ring.rs │ │ │ └── state/ │ │ │ ├── common.rs │ │ │ ├── mod.rs │ │ │ ├── sol.rs │ │ │ └── yul.rs │ │ ├── testdata/ │ │ │ ├── Annotation/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── ArrayExpressions/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── BlockComments/ │ │ │ │ ├── fmt.sol │ │ │ │ ├── original.sol │ │ │ │ └── tab.fmt.sol │ │ │ ├── BlockCommentsFunction/ │ │ │ │ ├── fmt.sol │ │ │ │ ├── original.sol │ │ │ │ └── tab.fmt.sol │ │ │ ├── CommentEmptyLine/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── ConditionalOperatorExpression/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── ConstructorDefinition/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── ConstructorModifierStyle/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── ContractDefinition/ │ │ │ │ ├── bracket-spacing.fmt.sol │ │ │ │ ├── contract-new-lines.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── DoWhileStatement/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── DocComments/ │ │ │ │ ├── block.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ ├── line.fmt.sol │ │ │ │ ├── original.sol │ │ │ │ ├── tab.fmt.sol │ │ │ │ └── wrap-comments.fmt.sol │ │ │ ├── EmitStatement/ │ │ │ │ ├── 120.compact.fmt.sol │ │ │ │ ├── 120.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── EnumDefinition/ │ │ │ │ ├── bracket-spacing.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── EnumVariants/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── ErrorDefinition/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── EventDefinition/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── ForStatement/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── FunctionCall/ │ │ │ │ ├── bracket-spacing.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── FunctionCallArgsStatement/ │ │ │ │ ├── bracket-spacing.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── FunctionDefinition/ │ │ │ │ ├── all-params.fmt.sol │ │ │ │ ├── all.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ ├── original.sol │ │ │ │ ├── override-spacing.fmt.sol │ │ │ │ ├── params-always.fmt.sol │ │ │ │ └── params-multi.fmt.sol │ │ │ ├── FunctionDefinitionWithFunctionReturns/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── FunctionType/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── HexUnderscore/ │ │ │ │ ├── bytes.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ ├── original.sol │ │ │ │ ├── preserve.fmt.sol │ │ │ │ └── remove.fmt.sol │ │ │ ├── IfStatement/ │ │ │ │ ├── block-multi.fmt.sol │ │ │ │ ├── block-single.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── IfStatement2/ │ │ │ │ ├── 120.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── ImportDirective/ │ │ │ │ ├── bracket-spacing.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ ├── namespace-import-prefer-glob.fmt.sol │ │ │ │ ├── namespace-import-prefer-plain.fmt.sol │ │ │ │ ├── namespace-import-preserve.fmt.sol │ │ │ │ ├── original.sol │ │ │ │ ├── preserve-quote.fmt.sol │ │ │ │ ├── single-quote.fmt.sol │ │ │ │ └── single_line_import.fmt.sol │ │ │ ├── InlineDisable/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── IntTypes/ │ │ │ │ ├── fmt.sol │ │ │ │ ├── original.sol │ │ │ │ ├── preserve.fmt.sol │ │ │ │ └── short.fmt.sol │ │ │ ├── LiteralExpression/ │ │ │ │ ├── fmt.sol │ │ │ │ ├── original.sol │ │ │ │ ├── preserve-quote.fmt.sol │ │ │ │ └── single-quote.fmt.sol │ │ │ ├── MappingType/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── ModifierDefinition/ │ │ │ │ ├── fmt.sol │ │ │ │ ├── original.sol │ │ │ │ └── override-spacing.fmt.sol │ │ │ ├── NamedFunctionCallExpression/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── NonKeywords/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── NumberLiteralUnderscore/ │ │ │ │ ├── fmt.sol │ │ │ │ ├── original.sol │ │ │ │ ├── preserve.fmt.sol │ │ │ │ ├── remove.fmt.sol │ │ │ │ └── thousands.fmt.sol │ │ │ ├── OperatorExpressions/ │ │ │ │ ├── 120.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ ├── original.sol │ │ │ │ └── pow-no-space.fmt.sol │ │ │ ├── PragmaDirective/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── Repros/ │ │ │ │ ├── fmt.sol │ │ │ │ ├── original.sol │ │ │ │ ├── sorted.fmt.sol │ │ │ │ └── tab.fmt.sol │ │ │ ├── ReprosCalls/ │ │ │ │ ├── 110.fmt.sol │ │ │ │ ├── 120.fmt.sol │ │ │ │ ├── 80.fmt.sol │ │ │ │ ├── consistent.120.fmt.sol │ │ │ │ └── original.sol │ │ │ ├── ReprosFunctionDefs/ │ │ │ │ ├── all.120.fmt.sol │ │ │ │ └── original.sol │ │ │ ├── ReturnStatement/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── RevertNamedArgsStatement/ │ │ │ │ ├── bracket-spacing.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── RevertStatement/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── SimpleComments/ │ │ │ │ ├── fmt.sol │ │ │ │ ├── original.sol │ │ │ │ └── wrap-comments.fmt.sol │ │ │ ├── SortedImports/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── StatementBlock/ │ │ │ │ ├── bracket-spacing.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── StructDefinition/ │ │ │ │ ├── bracket-spacing.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── StructFieldAccess/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── ThisExpression/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── TrailingComma/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── TryStatement/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── TypeDefinition/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── UnitExpression/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── UsingDirective/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── VariableAssignment/ │ │ │ │ ├── bracket-spacing.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── VariableDefinition/ │ │ │ │ ├── fmt.sol │ │ │ │ ├── original.sol │ │ │ │ └── override-spacing.fmt.sol │ │ │ ├── WhileStatement/ │ │ │ │ ├── block-multi.fmt.sol │ │ │ │ ├── block-single.fmt.sol │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ ├── Yul/ │ │ │ │ ├── fmt.sol │ │ │ │ └── original.sol │ │ │ └── YulStrings/ │ │ │ ├── fmt.sol │ │ │ ├── original.sol │ │ │ ├── preserve-quote.fmt.sol │ │ │ └── single-quote.fmt.sol │ │ └── tests/ │ │ └── formatter.rs │ ├── forge/ │ │ ├── Cargo.toml │ │ ├── assets/ │ │ │ ├── .gitignoreTemplate │ │ │ ├── README.md │ │ │ ├── generated/ │ │ │ │ └── TestTemplate.t.sol │ │ │ ├── solidity/ │ │ │ │ ├── CounterTemplate.s.sol │ │ │ │ ├── CounterTemplate.sol │ │ │ │ ├── CounterTemplate.t.sol │ │ │ │ └── workflowTemplate.yml │ │ │ ├── tempo/ │ │ │ │ ├── MailTemplate.s.sol │ │ │ │ ├── MailTemplate.sol │ │ │ │ ├── MailTemplate.t.sol │ │ │ │ ├── README.md │ │ │ │ └── workflowTemplate.yml │ │ │ └── vyper/ │ │ │ ├── CounterTemplate.s.sol │ │ │ ├── CounterTemplate.t.sol │ │ │ ├── CounterTemplate.vy │ │ │ ├── ICounterTemplate.sol │ │ │ └── workflowTemplate.yml │ │ ├── bin/ │ │ │ └── main.rs │ │ ├── src/ │ │ │ ├── args.rs │ │ │ ├── cmd/ │ │ │ │ ├── bind.rs │ │ │ │ ├── bind_json.rs │ │ │ │ ├── build.rs │ │ │ │ ├── cache.rs │ │ │ │ ├── clone.rs │ │ │ │ ├── compiler.rs │ │ │ │ ├── config.rs │ │ │ │ ├── coverage.rs │ │ │ │ ├── create.rs │ │ │ │ ├── doc/ │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── server.rs │ │ │ │ ├── eip712.rs │ │ │ │ ├── flatten.rs │ │ │ │ ├── fmt.rs │ │ │ │ ├── geiger.rs │ │ │ │ ├── generate/ │ │ │ │ │ └── mod.rs │ │ │ │ ├── init.rs │ │ │ │ ├── inspect.rs │ │ │ │ ├── install.rs │ │ │ │ ├── lint.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── remappings.rs │ │ │ │ ├── remove.rs │ │ │ │ ├── selectors.rs │ │ │ │ ├── snapshot.rs │ │ │ │ ├── soldeer.rs │ │ │ │ ├── test/ │ │ │ │ │ ├── filter.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── summary.rs │ │ │ │ ├── tree.rs │ │ │ │ ├── update.rs │ │ │ │ └── watch.rs │ │ │ ├── coverage.rs │ │ │ ├── gas_report.rs │ │ │ ├── lib.rs │ │ │ ├── lockfile.rs │ │ │ ├── multi_runner.rs │ │ │ ├── opts.rs │ │ │ ├── progress.rs │ │ │ ├── result.rs │ │ │ └── runner.rs │ │ └── tests/ │ │ ├── cli/ │ │ │ ├── backtrace.rs │ │ │ ├── bind.rs │ │ │ ├── bind_json.rs │ │ │ ├── build.rs │ │ │ ├── cache.rs │ │ │ ├── cmd.rs │ │ │ ├── compiler.rs │ │ │ ├── config.rs │ │ │ ├── constants.rs │ │ │ ├── context.rs │ │ │ ├── coverage.rs │ │ │ ├── create.rs │ │ │ ├── debug.rs │ │ │ ├── doc.rs │ │ │ ├── eip712.rs │ │ │ ├── ext_integration.rs │ │ │ ├── failure_assertions.rs │ │ │ ├── fmt.rs │ │ │ ├── fmt_integration.rs │ │ │ ├── inline_config.rs │ │ │ ├── install.rs │ │ │ ├── json.rs │ │ │ ├── lint/ │ │ │ │ └── geiger.rs │ │ │ ├── lint.rs │ │ │ ├── main.rs │ │ │ ├── multi_script.rs │ │ │ ├── precompiles.rs │ │ │ ├── script.rs │ │ │ ├── soldeer.rs │ │ │ ├── svm.rs │ │ │ ├── test_cmd/ │ │ │ │ ├── core.rs │ │ │ │ ├── fuzz.rs │ │ │ │ ├── invariant/ │ │ │ │ │ ├── common.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── storage.rs │ │ │ │ │ └── target.rs │ │ │ │ ├── logs.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── repros.rs │ │ │ │ ├── spec.rs │ │ │ │ ├── table.rs │ │ │ │ └── trace.rs │ │ │ ├── test_optimizer.rs │ │ │ ├── utils.rs │ │ │ ├── verify.rs │ │ │ ├── verify_bytecode.rs │ │ │ └── version.rs │ │ ├── fixtures/ │ │ │ ├── CreateXScript.sol │ │ │ ├── ExpectCallFailures.t.sol │ │ │ ├── ExpectCreateFailures.t.sol │ │ │ ├── ExpectEmitFailures.t.sol │ │ │ ├── ExpectEmitParamFailures.t.sol │ │ │ ├── ExpectEmitParamHarness.sol │ │ │ ├── ExpectRevertFailures.t.sol │ │ │ ├── MemSafetyFailures.t.sol │ │ │ ├── ScriptVerify.sol │ │ │ ├── SimpleContractTestNonVerbose.json │ │ │ ├── SimpleContractTestVerbose.json │ │ │ └── backtraces/ │ │ │ ├── Backtrace.t.sol │ │ │ ├── DelegateCall.sol │ │ │ ├── ForkBacktrace.t.sol │ │ │ ├── ForkedERC20Wrapper.sol │ │ │ ├── LibraryBacktrace.t.sol │ │ │ ├── LibraryConsumer.sol │ │ │ ├── MultipleLibraryBacktrace.t.sol │ │ │ ├── MultipleLibraryConsumer.sol │ │ │ ├── NestedCalls.sol │ │ │ ├── SimpleRevert.sol │ │ │ ├── StaticCall.sol │ │ │ └── libraries/ │ │ │ ├── ExternalMathLib.sol │ │ │ ├── InternalMathLib.sol │ │ │ └── MultipleLibraries.sol │ │ └── ui.rs │ ├── linking/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── lint/ │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── src/ │ │ │ ├── lib.rs │ │ │ ├── linter/ │ │ │ │ ├── early.rs │ │ │ │ ├── late.rs │ │ │ │ └── mod.rs │ │ │ └── sol/ │ │ │ ├── codesize/ │ │ │ │ ├── mod.rs │ │ │ │ └── unwrapped_modifier_logic.rs │ │ │ ├── gas/ │ │ │ │ ├── custom_errors.rs │ │ │ │ ├── keccak.rs │ │ │ │ └── mod.rs │ │ │ ├── high/ │ │ │ │ ├── incorrect_shift.rs │ │ │ │ ├── mod.rs │ │ │ │ └── unchecked_calls.rs │ │ │ ├── info/ │ │ │ │ ├── imports.rs │ │ │ │ ├── interface_naming.rs │ │ │ │ ├── mixed_case.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── multi_contract_file.rs │ │ │ │ ├── named_struct_fields.rs │ │ │ │ ├── pascal_case.rs │ │ │ │ ├── screaming_snake_case.rs │ │ │ │ └── unsafe_cheatcodes.rs │ │ │ ├── macros.rs │ │ │ ├── med/ │ │ │ │ ├── div_mul.rs │ │ │ │ ├── mod.rs │ │ │ │ └── unsafe_typecast.rs │ │ │ └── mod.rs │ │ └── testdata/ │ │ ├── .gitignore │ │ ├── CustomErrors.sol │ │ ├── CustomErrors.stderr │ │ ├── DivideBeforeMultiply.sol │ │ ├── DivideBeforeMultiply.stderr │ │ ├── Imports.sol │ │ ├── Imports.stderr │ │ ├── IncorrectShift.sol │ │ ├── IncorrectShift.stderr │ │ ├── Keccak256.sol │ │ ├── Keccak256.stderr │ │ ├── MixedCase.sol │ │ ├── MixedCase.stderr │ │ ├── MultiContractFile.sol │ │ ├── MultiContractFile.stderr │ │ ├── MultiContractFile_InterfaceLibrary.sol │ │ ├── MultiContractFile_InterfaceLibrary.stderr │ │ ├── NamedStructFields.sol │ │ ├── NamedStructFields.stderr │ │ ├── ScreamingSnakeCase.sol │ │ ├── ScreamingSnakeCase.stderr │ │ ├── SoloInterfaces.sol │ │ ├── StructPascalCase.sol │ │ ├── StructPascalCase.stderr │ │ ├── UncheckedCall.sol │ │ ├── UncheckedCall.stderr │ │ ├── UncheckedTransferERC20.sol │ │ ├── UncheckedTransferERC20.stderr │ │ ├── UnsafeCheatcodes.sol │ │ ├── UnsafeCheatcodes.stderr │ │ ├── UnsafeTypecast.sol │ │ ├── UnsafeTypecast.stderr │ │ ├── UnwrappedModifierLogic.sol │ │ ├── UnwrappedModifierLogic.stderr │ │ └── auxiliary/ │ │ ├── ImportsAnotherFile.sol │ │ ├── ImportsAnotherFile2.sol │ │ ├── ImportsConstants.sol │ │ ├── ImportsFile.sol │ │ ├── ImportsSomeFile.sol │ │ ├── ImportsSomeFile2.sol │ │ ├── ImportsTypes.sol │ │ ├── ImportsUtils.sol │ │ ├── ImportsUtils2.sol │ │ └── Test.sol │ ├── macros/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── cheatcodes.rs │ │ ├── console_fmt.rs │ │ └── lib.rs │ ├── primitives/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs │ │ ├── network/ │ │ │ ├── mod.rs │ │ │ ├── receipt.rs │ │ │ └── transaction.rs │ │ └── transaction/ │ │ ├── envelope.rs │ │ ├── mod.rs │ │ ├── receipt.rs │ │ └── request.rs │ ├── script/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── broadcast.rs │ │ ├── build.rs │ │ ├── execute.rs │ │ ├── lib.rs │ │ ├── multi_sequence.rs │ │ ├── progress.rs │ │ ├── providers.rs │ │ ├── receipts.rs │ │ ├── runner.rs │ │ ├── sequence.rs │ │ ├── simulate.rs │ │ ├── transaction.rs │ │ └── verify.rs │ ├── script-sequence/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs │ │ ├── reader.rs │ │ ├── sequence.rs │ │ └── transaction.rs │ ├── sol-macro-gen/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── lib.rs │ │ └── sol_macro_gen.rs │ ├── test-utils/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── etherscan.rs │ │ ├── ext.rs │ │ ├── fd_lock.rs │ │ ├── filter.rs │ │ ├── lib.rs │ │ ├── macros.rs │ │ ├── prj.rs │ │ ├── rpc.rs │ │ ├── script.rs │ │ ├── ui_runner.rs │ │ └── util.rs │ ├── verify/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── bytecode.rs │ │ ├── etherscan/ │ │ │ ├── flatten.rs │ │ │ ├── mod.rs │ │ │ └── standard_json.rs │ │ ├── lib.rs │ │ ├── provider.rs │ │ ├── retry.rs │ │ ├── sourcify.rs │ │ ├── types.rs │ │ ├── utils.rs │ │ └── verify.rs │ └── wallets/ │ ├── Cargo.toml │ └── src/ │ ├── error.rs │ ├── lib.rs │ ├── opts.rs │ ├── signer.rs │ ├── utils.rs │ ├── wallet_browser/ │ │ ├── app/ │ │ │ ├── assets/ │ │ │ │ ├── index.html │ │ │ │ ├── main.js │ │ │ │ └── styles.css │ │ │ └── mod.rs │ │ ├── error.rs │ │ ├── handlers.rs │ │ ├── mod.rs │ │ ├── opts.rs │ │ ├── queue.rs │ │ ├── router.rs │ │ ├── server.rs │ │ ├── signer.rs │ │ ├── state.rs │ │ └── types.rs │ ├── wallet_multi/ │ │ └── mod.rs │ └── wallet_raw/ │ └── mod.rs ├── deny.toml ├── docs/ │ └── dev/ │ ├── README.md │ ├── architecture.md │ ├── cheatcodes.md │ ├── debugging.md │ ├── lintrules.md │ ├── networks.md │ └── scripting.md ├── dprint.json ├── flake.nix ├── foundryup/ │ ├── README.md │ ├── foundryup │ └── install ├── npm/ │ ├── .gitignore │ ├── @foundry-rs/ │ │ ├── anvil/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── cast/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── chisel/ │ │ │ ├── README.md │ │ │ └── package.json │ │ └── forge/ │ │ ├── README.md │ │ └── package.json │ ├── README.md │ ├── bunfig.toml │ ├── env.d.ts │ ├── package.json │ ├── scripts/ │ │ ├── check.sh │ │ ├── prepublish.mjs │ │ ├── publish-meta.mjs │ │ ├── publish.mjs │ │ └── stage-from-artifact.mjs │ ├── src/ │ │ ├── bin.mjs │ │ ├── const.mjs │ │ ├── generate-package-json.mjs │ │ └── install.mjs │ └── tsconfig.json ├── rustfmt.toml ├── testdata/ │ ├── .gitignore │ ├── README.md │ ├── default/ │ │ ├── cheats/ │ │ │ ├── AccessList.t.sol │ │ │ ├── Addr.t.sol │ │ │ ├── ArbitraryStorage.t.sol │ │ │ ├── Assert.t.sol │ │ │ ├── Assume.t.sol │ │ │ ├── AssumeNoRevert.t.sol │ │ │ ├── AttachBlob.t.sol │ │ │ ├── AttachDelegation.t.sol │ │ │ ├── Bank.t.sol │ │ │ ├── Base64.t.sol │ │ │ ├── BlobBaseFee.t.sol │ │ │ ├── Blobhashes.t.sol │ │ │ ├── Broadcast.t.sol │ │ │ ├── BroadcastRawTransaction.t.sol │ │ │ ├── ChainId.t.sol │ │ │ ├── CloneAccount.t.sol │ │ │ ├── Cool.t.sol │ │ │ ├── CopyStorage.t.sol │ │ │ ├── CurrentFilePath.t.sol │ │ │ ├── Deal.t.sol │ │ │ ├── DeployCode.t.sol │ │ │ ├── Derive.t.sol │ │ │ ├── Ed25519.t.sol │ │ │ ├── EnsNamehash.t.sol │ │ │ ├── Env.t.sol │ │ │ ├── Etch.t.sol │ │ │ ├── ExecuteTransaction.t.sol │ │ │ ├── ExpectCall.t.sol │ │ │ ├── ExpectCreate.t.sol │ │ │ ├── ExpectEmit.t.sol │ │ │ ├── ExpectRevert.t.sol │ │ │ ├── Fee.t.sol │ │ │ ├── Ffi.t.sol │ │ │ ├── Fork.t.sol │ │ │ ├── Fork2.t.sol │ │ │ ├── Fs.t.sol │ │ │ ├── GasMetering.t.sol │ │ │ ├── GetArtifactPath.t.sol │ │ │ ├── GetBlockTimestamp.t.sol │ │ │ ├── GetChain.t.sol │ │ │ ├── GetCode.t.sol │ │ │ ├── GetDeployedCode.t.sol │ │ │ ├── GetFoundryVersion.t.sol │ │ │ ├── GetLabel.t.sol │ │ │ ├── GetNonce.t.sol │ │ │ ├── GetRawBlockHeader.t.sol │ │ │ ├── GetStorageSlots.t.sol │ │ │ ├── Json.t.sol │ │ │ ├── Label.t.sol │ │ │ ├── Load.t.sol │ │ │ ├── Mapping.t.sol │ │ │ ├── MemSafety.t.sol │ │ │ ├── MockCall.t.sol │ │ │ ├── MockCalls.t.sol │ │ │ ├── MockFunction.t.sol │ │ │ ├── Nonce.t.sol │ │ │ ├── Parse.t.sol │ │ │ ├── Prank.t.sol │ │ │ ├── Prevrandao.t.sol │ │ │ ├── ProjectRoot.t.sol │ │ │ ├── Prompt.t.sol │ │ │ ├── RandomAddress.t.sol │ │ │ ├── RandomBytes.t.sol │ │ │ ├── RandomCheatcodes.t.sol │ │ │ ├── RandomUint.t.sol │ │ │ ├── ReadCallers.t.sol │ │ │ ├── Record.t.sol │ │ │ ├── RecordAccountAccesses.t.sol │ │ │ ├── RecordDebugTrace.t.sol │ │ │ ├── RecordLogs.t.sol │ │ │ ├── Remember.t.sol │ │ │ ├── ResetNonce.t.sol │ │ │ ├── Rlp.t.sol │ │ │ ├── Roll.t.sol │ │ │ ├── RpcUrls.t.sol │ │ │ ├── Seed.t.sol │ │ │ ├── SetBlockhash.t.sol │ │ │ ├── SetNonce.t.sol │ │ │ ├── SetNonceUnsafe.t.sol │ │ │ ├── Setup.t.sol │ │ │ ├── Shuffle.t.sol │ │ │ ├── Sign.t.sol │ │ │ ├── SignP256.t.sol │ │ │ ├── Skip.t.sol │ │ │ ├── Sleep.t.sol │ │ │ ├── Sort.t.sol │ │ │ ├── StateDiffBytesString.t.sol │ │ │ ├── StateDiffMappings.t.sol │ │ │ ├── StateDiffStorageLayout.t.sol │ │ │ ├── StateDiffStructTest.t.sol │ │ │ ├── StateSnapshots.t.sol │ │ │ ├── StorageSlotState.t.sol │ │ │ ├── Store.t.sol │ │ │ ├── StringUtils.t.sol │ │ │ ├── ToString.t.sol │ │ │ ├── Toml.t.sol │ │ │ ├── Travel.t.sol │ │ │ ├── TryFfi.sol │ │ │ ├── UnixTime.t.sol │ │ │ ├── Wallet.t.sol │ │ │ ├── Warp.t.sol │ │ │ ├── dumpState.t.sol │ │ │ ├── getBlockNumber.t.sol │ │ │ └── loadAllocs.t.sol │ │ ├── core/ │ │ │ ├── Abstract.t.sol │ │ │ ├── BadSigAfterInvariant.t.sol │ │ │ ├── ContractEnvironment.t.sol │ │ │ ├── Reverting.t.sol │ │ │ └── SetupConsistency.t.sol │ │ ├── fork/ │ │ │ ├── DssExecLib.sol │ │ │ ├── ForkSame_1.t.sol │ │ │ ├── ForkSame_2.t.sol │ │ │ └── LaunchFork.t.sol │ │ ├── fs/ │ │ │ ├── Disabled.t.sol │ │ │ └── ReadOnly.sol │ │ ├── inline/ │ │ │ ├── FuzzInlineConf.t.sol │ │ │ └── InvariantInlineConf.t.sol │ │ ├── linking/ │ │ │ ├── cycle/ │ │ │ │ └── Cycle.t.sol │ │ │ ├── duplicate/ │ │ │ │ └── Duplicate.t.sol │ │ │ ├── nested/ │ │ │ │ └── Nested.t.sol │ │ │ ├── samefile_union/ │ │ │ │ ├── Libs.sol │ │ │ │ └── SameFileUnion.t.sol │ │ │ └── simple/ │ │ │ └── Simple.t.sol │ │ ├── repros/ │ │ │ ├── Issue10302.t.sol │ │ │ ├── Issue10477.t.sol │ │ │ ├── Issue10527.t.sol │ │ │ ├── Issue10552.t.sol │ │ │ ├── Issue10586.t.sol │ │ │ ├── Issue10957.t.sol │ │ │ ├── Issue11353.t.sol │ │ │ ├── Issue11616.t.sol │ │ │ ├── Issue12075.t.sol │ │ │ ├── Issue2623.t.sol │ │ │ ├── Issue2629.t.sol │ │ │ ├── Issue2723.t.sol │ │ │ ├── Issue2898.t.sol │ │ │ ├── Issue2956.t.sol │ │ │ ├── Issue2984.t.sol │ │ │ ├── Issue3077.t.sol │ │ │ ├── Issue3110.t.sol │ │ │ ├── Issue3119.t.sol │ │ │ ├── Issue3190.t.sol │ │ │ ├── Issue3192.t.sol │ │ │ ├── Issue3220.t.sol │ │ │ ├── Issue3221.t.sol │ │ │ ├── Issue3223.t.sol │ │ │ ├── Issue3653.t.sol │ │ │ ├── Issue3661.t.sol │ │ │ ├── Issue3674.t.sol │ │ │ ├── Issue3685.t.sol │ │ │ ├── Issue3703.t.sol │ │ │ ├── Issue3708.t.sol │ │ │ ├── Issue3753.t.sol │ │ │ ├── Issue3792.t.sol │ │ │ ├── Issue4232.t.sol │ │ │ ├── Issue4402.t.sol │ │ │ ├── Issue4586.t.sol │ │ │ ├── Issue4630.t.sol │ │ │ ├── Issue4640.t.sol │ │ │ ├── Issue5038.t.sol │ │ │ ├── Issue5529.t.sol │ │ │ ├── Issue5739.t.sol │ │ │ ├── Issue5808.t.sol │ │ │ ├── Issue5929.t.sol │ │ │ ├── Issue5935.t.sol │ │ │ ├── Issue5948.t.sol │ │ │ ├── Issue6006.t.sol │ │ │ ├── Issue6032.t.sol │ │ │ ├── Issue6070.t.sol │ │ │ ├── Issue6115.t.sol │ │ │ ├── Issue6180.t.sol │ │ │ ├── Issue6293.t.sol │ │ │ ├── Issue6437.t.sol │ │ │ ├── Issue6538.t.sol │ │ │ ├── Issue6554.t.sol │ │ │ ├── Issue6616.t.sol │ │ │ ├── Issue6634.t.sol │ │ │ ├── Issue6643.t.sol │ │ │ ├── Issue6759.t.sol │ │ │ ├── Issue6966.t.sol │ │ │ ├── Issue7238.t.sol │ │ │ ├── Issue7457.t.sol │ │ │ ├── Issue7481.t.sol │ │ │ ├── Issue8004.t.sol │ │ │ ├── Issue8006.t.sol │ │ │ ├── Issue8168.t.sol │ │ │ ├── Issue8277.t.sol │ │ │ ├── Issue8287.t.sol │ │ │ ├── Issue8566.t.sol │ │ │ ├── Issue8639.t.sol │ │ │ ├── Issue8971.t.sol │ │ │ └── Issue9643.t.sol │ │ ├── spec/ │ │ │ └── ShanghaiCompat.t.sol │ │ └── vyper/ │ │ └── CounterTest.vy │ ├── etherscan/ │ │ ├── 0x044b75f554b886A065b9567891e45c79542d7357/ │ │ │ ├── creation_data.json │ │ │ └── metadata.json │ │ ├── 0x35Fb958109b70799a8f9Bc2a8b1Ee4cC62034193/ │ │ │ ├── creation_data.json │ │ │ └── metadata.json │ │ ├── 0x3a23F943181408EAC424116Af7b7790c94Cb97a5/ │ │ │ ├── creation_data.json │ │ │ └── metadata.json │ │ ├── 0x71356E37e0368Bd10bFDbF41dC052fE5FA24cD05/ │ │ │ ├── creation_data.json │ │ │ └── metadata.json │ │ ├── 0x8B3D32cf2bb4d0D16656f4c0b04Fa546274f1545/ │ │ │ ├── creation_data.json │ │ │ └── metadata.json │ │ ├── 0x9AB6b21cDF116f611110b048987E58894786C244/ │ │ │ ├── creation_data.json │ │ │ └── metadata.json │ │ ├── 0x9d27527Ada2CF29fBDAB2973cfa243845a08Bd3F/ │ │ │ ├── creation_data.json │ │ │ └── metadata.json │ │ └── 0xDb53f47aC61FE54F456A4eb3E09832D08Dd7BEec/ │ │ ├── creation_data.json │ │ └── metadata.json │ ├── fixtures/ │ │ ├── Derive/ │ │ │ ├── mnemonic_chinese_simplified.txt │ │ │ ├── mnemonic_chinese_traditional.txt │ │ │ ├── mnemonic_czech.txt │ │ │ ├── mnemonic_english.txt │ │ │ ├── mnemonic_french.txt │ │ │ ├── mnemonic_italian.txt │ │ │ ├── mnemonic_japanese.txt │ │ │ ├── mnemonic_korean.txt │ │ │ ├── mnemonic_portuguese.txt │ │ │ └── mnemonic_spanish.txt │ │ ├── Dir/ │ │ │ ├── depth1 │ │ │ └── nested/ │ │ │ ├── depth2 │ │ │ └── nested2/ │ │ │ └── depth3 │ │ ├── File/ │ │ │ ├── ignored/ │ │ │ │ └── .gitignore │ │ │ └── read.txt │ │ ├── GetCode/ │ │ │ ├── HardhatWorkingContract.json │ │ │ ├── HuffWorkingContract.json │ │ │ ├── Override.json │ │ │ ├── Override.sol │ │ │ ├── UnlinkedContract.sol │ │ │ ├── WorkingContract.json │ │ │ └── WorkingContract.sol │ │ ├── Json/ │ │ │ ├── Issue4402.json │ │ │ ├── Issue4630.json │ │ │ ├── nested_json_struct.json │ │ │ ├── test.json │ │ │ ├── test_allocs.json │ │ │ ├── whole_json.json │ │ │ ├── write_complex_test.json │ │ │ └── write_test.json │ │ ├── Rpc/ │ │ │ ├── README.md │ │ │ ├── balance_params.json │ │ │ └── eth_getLogs.json │ │ ├── Toml/ │ │ │ ├── Issue4402.toml │ │ │ ├── nested_toml_struct.toml │ │ │ ├── test.toml │ │ │ ├── whole_toml.toml │ │ │ ├── write_complex_test.toml │ │ │ └── write_test.toml │ │ ├── broadcast.log.json │ │ └── broadcast.sensitive.log.json │ ├── forge-std-rev │ ├── foundry.toml │ ├── multi-version/ │ │ ├── Counter.sol │ │ ├── Importer.sol │ │ └── cheats/ │ │ ├── GetCode.t.sol │ │ └── GetCode17.t.sol │ ├── paris/ │ │ ├── cheats/ │ │ │ ├── Fork.t.sol │ │ │ ├── GasSnapshots.t.sol │ │ │ └── LastCallGas.t.sol │ │ ├── core/ │ │ │ └── BeforeTest.t.sol │ │ ├── fork/ │ │ │ └── Transact.t.sol │ │ └── spec/ │ │ └── ShanghaiCompat.t.sol │ ├── src/ │ │ ├── Counter.vy │ │ └── ICounter.vyi │ └── utils/ │ ├── DSTest.sol │ ├── Test.sol │ ├── Vm.sol │ └── console.sol └── typos.toml
Showing preview only (971K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (10984 symbols across 522 files)
FILE: .github/scripts/matrices.py
class Target (line 8) | class Target:
method __init__ (line 16) | def __init__(self, runner_label: str, target: str, svm_target_platform...
class Case (line 23) | class Case:
method __init__ (line 33) | def __init__(
class Expanded (line 43) | class Expanded:
method __init__ (line 51) | def __init__(
function main (line 96) | def main():
function print_json (line 134) | def print_json(obj):
FILE: .github/scripts/prune-prereleases.js
function groupBy (line 2) | function groupBy(array, keyOrIterator) {
FILE: benches/src/lib.rs
constant RUNS (line 18) | pub const RUNS: u32 = 5;
type RepoConfig (line 22) | pub struct RepoConfig {
type Err (line 30) | type Err = eyre::Error;
method from_str (line 32) | fn from_str(spec: &str) -> Result<Self> {
function default_benchmark_repos (line 74) | pub fn default_benchmark_repos() -> Vec<RepoConfig> {
type BenchmarkProject (line 112) | pub struct BenchmarkProject {
method setup (line 121) | pub fn setup(config: &RepoConfig) -> Result<Self> {
method install_npm_dependencies (line 167) | fn install_npm_dependencies(root: &Path) -> Result<()> {
method hyperfine (line 211) | fn hyperfine(
method bench_forge_test (line 279) | pub fn bench_forge_test(
method bench_forge_build_with_cache (line 299) | pub fn bench_forge_build_with_cache(
method bench_forge_build_no_cache (line 318) | pub fn bench_forge_build_no_cache(
method bench_forge_fuzz_test (line 338) | pub fn bench_forge_fuzz_test(
method bench_forge_coverage (line 358) | pub fn bench_forge_coverage(
method bench_forge_isolate_test (line 379) | pub fn bench_forge_isolate_test(
method root (line 399) | pub fn root(&self) -> &Path {
method run (line 404) | pub fn run(
function switch_foundry_version (line 425) | pub fn switch_foundry_version(version: &str) -> Result<()> {
function get_forge_version (line 449) | pub fn get_forge_version() -> Result<String> {
function get_forge_version_details (line 466) | pub fn get_forge_version_details() -> Result<String> {
FILE: benches/src/main.rs
constant ALL_BENCHMARKS (line 13) | const ALL_BENCHMARKS: [&str; 6] = [
type Cli (line 25) | struct Cli {
function switch_version_safe (line 59) | fn switch_version_safe(version: &str) -> Result<()> {
function main (line 65) | fn main() -> Result<()> {
function install_foundry_versions (line 222) | fn install_foundry_versions(versions: &[String]) -> Result<()> {
FILE: benches/src/results.rs
type HyperfineResult (line 8) | pub struct HyperfineResult {
type HyperfineOutput (line 26) | pub struct HyperfineOutput {
type BenchmarkResults (line 32) | pub struct BenchmarkResults {
method new (line 42) | pub fn new() -> Self {
method set_baseline_version (line 46) | pub fn set_baseline_version(&mut self, version: String) {
method add_result (line 50) | pub fn add_result(
method add_version_details (line 65) | pub fn add_version_details(&mut self, version: &str, details: String) {
method generate_markdown (line 69) | pub fn generate_markdown(&self, versions: &[String], repos: &[RepoConf...
method generate_benchmark_table (line 149) | fn generate_benchmark_table(
function generate_table_rows (line 187) | fn generate_table_rows(
function get_benchmark_cell_content (line 214) | fn get_benchmark_cell_content(
function format_benchmark_name (line 230) | pub fn format_benchmark_name(name: &str) -> String {
function format_duration_seconds (line 243) | pub fn format_duration_seconds(seconds: f64) -> String {
function get_rustc_version (line 257) | pub fn get_rustc_version() -> Result<String> {
FILE: crates/anvil/bin/main.rs
function main (line 8) | fn main() {
FILE: crates/anvil/core/src/eth/block.rs
type Block (line 14) | pub type Block<T = FoundryTxEnvelope> = alloy_consensus::Block<MaybeImpe...
type BlockInfo (line 17) | pub type BlockInfo = TypedBlockInfo<FoundryNetwork>;
type TypedBlockInfo (line 21) | pub struct TypedBlockInfo<N: Network> {
function create_block (line 32) | pub fn create_block<T, Tx>(
function create_typed_block (line 51) | pub fn create_typed_block<T>(
function header_rlp_roundtrip (line 80) | fn header_rlp_roundtrip() {
function test_encode_block_header (line 117) | fn test_encode_block_header() {
function test_decode_block_header (line 153) | fn test_decode_block_header() {
function test_eip1559_block_header_hash (line 184) | fn test_eip1559_block_header_hash() {
function block_network_roundtrip (line 215) | fn block_network_roundtrip() {
FILE: crates/anvil/core/src/eth/mod.rs
type Params (line 31) | pub struct Params<T: Default> {
type EthRequest (line 40) | pub enum EthRequest {
type EthPubSub (line 717) | pub enum EthPubSub {
type EthRpcCall (line 730) | pub enum EthRpcCall {
function test_web3_client_version (line 740) | fn test_web3_client_version() {
function test_web3_sha3 (line 747) | fn test_web3_sha3() {
function test_eth_accounts (line 754) | fn test_eth_accounts() {
function test_eth_network_id (line 761) | fn test_eth_network_id() {
function test_eth_get_proof (line 768) | fn test_eth_get_proof() {
function test_eth_chain_id (line 775) | fn test_eth_chain_id() {
function test_net_listening (line 782) | fn test_net_listening() {
function test_eth_block_number (line 789) | fn test_eth_block_number() {
function test_eth_max_priority_fee (line 796) | fn test_eth_max_priority_fee() {
function test_eth_syncing (line 803) | fn test_eth_syncing() {
function test_custom_impersonate_account (line 810) | fn test_custom_impersonate_account() {
function test_custom_stop_impersonate_account (line 818) | fn test_custom_stop_impersonate_account() {
function test_custom_auto_impersonate_account (line 826) | fn test_custom_auto_impersonate_account() {
function test_custom_get_automine (line 833) | fn test_custom_get_automine() {
function test_custom_mine (line 840) | fn test_custom_mine() {
function test_custom_auto_mine (line 875) | fn test_custom_auto_mine() {
function test_custom_interval_mining (line 885) | fn test_custom_interval_mining() {
function test_custom_drop_tx (line 895) | fn test_custom_drop_tx() {
function test_custom_reset (line 903) | fn test_custom_reset() {
function test_custom_set_balance (line 1041) | fn test_custom_set_balance() {
function test_custom_set_code (line 1054) | fn test_custom_set_code() {
function test_custom_set_nonce (line 1072) | fn test_custom_set_nonce() {
function test_serde_custom_set_storage_at (line 1088) | fn test_serde_custom_set_storage_at() {
function test_serde_custom_coinbase (line 1104) | fn test_serde_custom_coinbase() {
function test_serde_custom_logging (line 1112) | fn test_serde_custom_logging() {
function test_serde_custom_min_gas_price (line 1119) | fn test_serde_custom_min_gas_price() {
function test_serde_custom_next_block_base_fee (line 1126) | fn test_serde_custom_next_block_base_fee() {
function test_serde_set_time (line 1133) | fn test_serde_set_time() {
function test_serde_custom_dump_state (line 1144) | fn test_serde_custom_dump_state() {
function test_serde_custom_load_state (line 1161) | fn test_serde_custom_load_state() {
function test_serde_custom_snapshot (line 1168) | fn test_serde_custom_snapshot() {
function test_serde_custom_revert (line 1179) | fn test_serde_custom_revert() {
function test_serde_custom_increase_time (line 1186) | fn test_serde_custom_increase_time() {
function test_serde_custom_next_timestamp (line 1213) | fn test_serde_custom_next_timestamp() {
function test_serde_custom_timestamp_interval (line 1226) | fn test_serde_custom_timestamp_interval() {
function test_serde_custom_remove_timestamp_interval (line 1233) | fn test_serde_custom_remove_timestamp_interval() {
function test_serde_custom_evm_mine (line 1240) | fn test_serde_custom_evm_mine() {
function test_serde_custom_evm_mine_detailed (line 1277) | fn test_serde_custom_evm_mine_detailed() {
function test_serde_custom_evm_mine_hex (line 1314) | fn test_serde_custom_evm_mine_hex() {
function test_eth_uncle_count_by_block_hash (line 1343) | fn test_eth_uncle_count_by_block_hash() {
function test_eth_block_tx_count_by_block_hash (line 1350) | fn test_eth_block_tx_count_by_block_hash() {
function test_eth_get_logs (line 1357) | fn test_eth_get_logs() {
function test_eth_new_filter (line 1364) | fn test_eth_new_filter() {
function test_serde_eth_unsubscribe (line 1371) | fn test_serde_eth_unsubscribe() {
function test_serde_eth_subscribe (line 1379) | fn test_serde_eth_subscribe() {
function test_serde_debug_raw_transaction (line 1400) | fn test_serde_debug_raw_transaction() {
function test_serde_debug_trace_transaction (line 1419) | fn test_serde_debug_trace_transaction() {
function test_serde_debug_trace_call (line 1438) | fn test_serde_debug_trace_call() {
function test_serde_eth_storage (line 1461) | fn test_serde_eth_storage() {
function test_eth_call (line 1469) | fn test_eth_call() {
function test_serde_eth_balance (line 1490) | fn test_serde_eth_balance() {
function test_serde_eth_block_by_number (line 1499) | fn test_serde_eth_block_by_number() {
function test_eth_sign (line 1520) | fn test_eth_sign() {
function test_eth_sign_typed_data (line 1532) | fn test_eth_sign_typed_data() {
function test_remove_pool_transactions (line 1539) | fn test_remove_pool_transactions() {
function test_serde_anvil_reorg (line 1546) | fn test_serde_anvil_reorg() {
FILE: crates/anvil/core/src/eth/serde_helpers.rs
function serialize (line 8) | pub fn serialize<S, T>(val: &T, s: S) -> Result<S::Ok, S::Error>
function deserialize (line 18) | pub fn deserialize<'de, T, D>(d: D) -> Result<T, D::Error>
function deserialize (line 38) | pub fn deserialize<'de, D>(d: D) -> Result<(), D::Error>
function lenient_block_number_seq (line 63) | pub fn lenient_block_number_seq<'de, D>(deserializer: D) -> Result<Block...
FILE: crates/anvil/core/src/eth/subscription.rs
type SubscriptionId (line 9) | pub enum SubscriptionId {
method random_hex (line 18) | pub fn random_hex() -> Self {
method fmt (line 24) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method fmt (line 33) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type HexIdProvider (line 43) | pub struct HexIdProvider {
method generate (line 49) | pub fn generate(&self) -> String {
method default (line 58) | fn default() -> Self {
function hex_id (line 64) | pub fn hex_id() -> String {
FILE: crates/anvil/core/src/eth/transaction/mod.rs
type MaybeImpersonatedTransaction (line 23) | pub struct MaybeImpersonatedTransaction<T> {
method ty (line 29) | fn ty(&self) -> u8 {
function new (line 36) | pub fn new(transaction: T) -> Self {
function impersonated (line 41) | pub fn impersonated(transaction: T, impersonated_sender: Address) -> Self {
function is_impersonated (line 46) | pub fn is_impersonated(&self) -> bool {
function into_inner (line 51) | pub fn into_inner(self) -> T {
function recover (line 58) | pub fn recover(&self) -> Result<Address, RecoveryError> {
function hash (line 69) | pub fn hash(&self) -> B256 {
method encode_2718_len (line 81) | fn encode_2718_len(&self) -> usize {
method encode_2718 (line 85) | fn encode_2718(&self, out: &mut dyn BufMut) {
method encode (line 91) | fn encode(&self, out: &mut dyn bytes::BufMut) {
method from (line 97) | fn from(value: MaybeImpersonatedTransaction<Self>) -> Self {
function from (line 103) | fn from(value: FoundryTxEnvelope) -> Self {
method decode (line 109) | fn decode(buf: &mut &[u8]) -> alloy_rlp::Result<Self> {
function as_ref (line 115) | fn as_ref(&self) -> &T {
type Target (line 121) | type Target = T;
method deref (line 123) | fn deref(&self) -> &Self::Target {
type PendingTransaction (line 130) | pub struct PendingTransaction<T> {
function hash (line 140) | pub fn hash(&self) -> &TxHash {
function sender (line 144) | pub fn sender(&self) -> &Address {
function new (line 150) | pub fn new(transaction: T) -> Result<Self, RecoveryError> {
function with_impersonated (line 157) | pub fn with_impersonated(transaction: T, sender: Address) -> Self {
function from_maybe_impersonated (line 164) | pub fn from_maybe_impersonated(
function nonce (line 176) | pub fn nonce(&self) -> u64 {
type TransactionInfo (line 183) | pub struct TransactionInfo {
FILE: crates/anvil/core/src/eth/wallet.rs
type WalletError (line 4) | pub enum WalletError {
FILE: crates/anvil/core/src/types.rs
type ReorgOptions (line 7) | pub struct ReorgOptions {
type TransactionData (line 17) | pub enum TransactionData {
FILE: crates/anvil/rpc/src/error.rs
type RpcError (line 8) | pub struct RpcError {
method new (line 18) | pub const fn new(code: ErrorCode) -> Self {
method parse_error (line 23) | pub const fn parse_error() -> Self {
method method_not_found (line 28) | pub const fn method_not_found() -> Self {
method invalid_request (line 33) | pub const fn invalid_request() -> Self {
method internal_error (line 38) | pub const fn internal_error() -> Self {
method invalid_params (line 43) | pub fn invalid_params<M>(message: M) -> Self
method internal_error_with (line 51) | pub fn internal_error_with<M>(message: M) -> Self
method transaction_rejected (line 59) | pub fn transaction_rejected<M>(message: M) -> Self
method fmt (line 68) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type ErrorCode (line 75) | pub enum ErrorCode {
method code (line 97) | pub fn code(&self) -> i64 {
method message (line 111) | pub const fn message(&self) -> &'static str {
method deserialize (line 135) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
method from (line 144) | fn from(code: i64) -> Self {
method serialize (line 126) | fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
FILE: crates/anvil/rpc/src/request.rs
type RpcMethodCall (line 7) | pub struct RpcMethodCall {
method id (line 22) | pub fn id(&self) -> Id {
type RpcNotification (line 31) | pub struct RpcNotification {
type RpcCall (line 41) | pub enum RpcCall {
type Request (line 58) | pub enum Request {
type RequestParams (line 68) | pub enum RequestParams {
function from (line 78) | fn from(params: RequestParams) -> Self {
function no_params (line 87) | fn no_params() -> RequestParams {
type Version (line 93) | pub enum Version {
type Id (line 100) | pub enum Id {
method fmt (line 107) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function null_id (line 116) | fn null_id() -> Id {
function can_serialize_batch (line 125) | fn can_serialize_batch() {
function can_deserialize_batch (line 151) | fn can_deserialize_batch() {
function can_serialize_method (line 177) | fn can_serialize_method() {
function can_serialize_call_notification (line 193) | fn can_serialize_call_notification() {
function can_serialize_notification (line 204) | fn can_serialize_notification() {
function can_deserialize_notification (line 218) | fn can_deserialize_notification() {
function can_deserialize_call (line 249) | fn can_deserialize_call() {
FILE: crates/anvil/rpc/src/response.rs
type RpcResponse (line 10) | pub struct RpcResponse {
method from (line 19) | fn from(e: RpcError) -> Self {
method new (line 25) | pub fn new(id: Id, content: impl Into<ResponseResult>) -> Self {
method invalid_request (line 29) | pub fn invalid_request(id: Id) -> Self {
type ResponseResult (line 37) | pub enum ResponseResult {
method success (line 45) | pub fn success<S>(content: S) -> Self
method error (line 52) | pub fn error(error: RpcError) -> Self {
method from (line 58) | fn from(err: RpcError) -> Self {
type Response (line 66) | pub enum Response {
method error (line 75) | pub fn error(error: RpcError) -> Self {
method from (line 81) | fn from(err: RpcError) -> Self {
method from (line 87) | fn from(resp: RpcResponse) -> Self {
FILE: crates/anvil/server/src/config.rs
type ServerConfig (line 8) | pub struct ServerConfig {
method with_allow_origin (line 24) | pub fn with_allow_origin(mut self, allow_origin: impl Into<HeaderValue...
method set_cors (line 30) | pub fn set_cors(mut self, cors: bool) -> Self {
method default (line 37) | fn default() -> Self {
type HeaderValueWrapper (line 47) | pub struct HeaderValueWrapper(pub HeaderValue);
method deserialize (line 67) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
type Target (line 77) | type Target = HeaderValue;
method deref (line 79) | fn deref(&self) -> &Self::Target {
method from (line 91) | fn from(header: HeaderValue) -> Self {
type Err (line 50) | type Err = <HeaderValue as FromStr>::Err;
method from_str (line 52) | fn from_str(s: &str) -> Result<Self, Self::Err> {
method serialize (line 58) | fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
method from (line 85) | fn from(wrapper: HeaderValueWrapper) -> Self {
FILE: crates/anvil/server/src/error.rs
type RequestError (line 5) | pub enum RequestError {
FILE: crates/anvil/server/src/handler.rs
function handle (line 15) | pub async fn handle<Http: RpcHandler, Ws>(
function handle_request (line 34) | pub async fn handle_request<Handler: RpcHandler>(
function handle_call (line 55) | async fn handle_call<Handler: RpcHandler>(call: RpcCall, handler: Handle...
FILE: crates/anvil/server/src/ipc.rs
type IpcEndpoint (line 17) | pub struct IpcEndpoint<Handler> {
function new (line 26) | pub fn new(handler: Handler, path: String) -> Self {
function incoming (line 35) | pub fn incoming(self) -> io::Result<impl Stream<Item = impl Future<Outpu...
type IpcConn (line 76) | struct IpcConn<T>(#[pin] T);
type Item (line 82) | type Item = Result<Option<Request>, RequestError>;
method poll_next (line 84) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
type Error (line 100) | type Error = io::Error;
function poll_ready (line 102) | fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
function start_send (line 108) | fn start_send(self: Pin<&mut Self>, item: String) -> Result<(), Self::Er...
function poll_flush (line 112) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
function poll_close (line 116) | fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
type JsonRpcCodec (line 121) | struct JsonRpcCodec;
type Item (line 125) | type Item = String;
type Error (line 126) | type Error = io::Error;
method decode (line 128) | fn decode(&mut self, buf: &mut BytesMut) -> io::Result<Option<Self::It...
type Error (line 169) | type Error = io::Error;
method encode (line 171) | fn encode(&mut self, msg: String, buf: &mut BytesMut) -> io::Result<()> {
function to_name (line 179) | fn to_name(path: &std::ffi::OsStr) -> io::Result<ls::Name<'_>> {
FILE: crates/anvil/server/src/lib.rs
function http_ws_router (line 39) | pub fn http_ws_router<Http, Ws>(config: ServerConfig, http: Http, ws: Ws...
function http_router (line 48) | pub fn http_router<Http>(config: ServerConfig, http: Http) -> Router
function router_inner (line 55) | fn router_inner<S: Clone + Send + Sync + 'static>(
type RpcHandler (line 84) | pub trait RpcHandler: Clone + Send + Sync + 'static {
method on_request (line 89) | async fn on_request(&self, request: Self::Request) -> ResponseResult;
method on_call (line 99) | async fn on_call(&self, call: RpcMethodCall) -> RpcResponse {
FILE: crates/anvil/server/src/pubsub.rs
type PubSubRpcHandler (line 22) | pub trait PubSubRpcHandler: Clone + Send + Sync + Unpin + 'static {
method on_request (line 31) | async fn on_request(&self, request: Self::Request, cx: PubSubContext<S...
type Subscriptions (line 34) | type Subscriptions<SubscriptionId, Subscription> = Arc<Mutex<Vec<(Subscr...
type PubSubContext (line 37) | pub struct PubSubContext<Handler: PubSubRpcHandler> {
function add_subscription (line 46) | pub fn add_subscription(
function remove_subscription (line 63) | pub fn remove_subscription(
method clone (line 77) | fn clone(&self) -> Self {
method default (line 83) | fn default() -> Self {
type ContextAwareHandler (line 89) | struct ContextAwareHandler<Handler: PubSubRpcHandler> {
method clone (line 95) | fn clone(&self) -> Self {
type Request (line 102) | type Request = Handler::Request;
method on_request (line 104) | async fn on_request(&self, request: Self::Request) -> ResponseResult {
type PubSubConnection (line 112) | pub struct PubSubConnection<Handler: PubSubRpcHandler, Connection> {
function new (line 126) | pub fn new(connection: Connection, handler: Handler) -> Self {
function compat_helper (line 137) | fn compat_helper(&self) -> ContextAwareHandler<Handler> {
function process_request (line 141) | fn process_request(&mut self, req: serde_json::Result<Request>) {
type Output (line 163) | type Output = ();
method poll (line 165) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
FILE: crates/anvil/server/src/ws.rs
function handle_ws (line 19) | pub async fn handle_ws<Http, Ws: PubSubRpcHandler>(
type SocketConn (line 27) | struct SocketConn(#[pin] WebSocket);
type Error (line 41) | type Error = axum::Error;
method poll_ready (line 43) | fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Resu...
method start_send (line 47) | fn start_send(self: Pin<&mut Self>, item: String) -> Result<(), Self::...
method poll_flush (line 51) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Resu...
method poll_close (line 55) | fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Resu...
type Item (line 30) | type Item = Result<Option<Request>, RequestError>;
method poll_next (line 32) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
function on_message (line 60) | fn on_message(msg: Result<Message, axum::Error>) -> Result<Option<Reques...
FILE: crates/anvil/src/args.rs
function run (line 7) | pub fn run() -> Result<()> {
function setup (line 20) | pub fn setup() -> Result<()> {
function run_command (line 27) | pub fn run_command(args: Anvil) -> Result<()> {
function verify_cli (line 51) | fn verify_cli() {
function can_parse_help (line 56) | fn can_parse_help() {
function can_parse_short_version (line 61) | fn can_parse_short_version() {
function can_parse_long_version (line 66) | fn can_parse_long_version() {
function can_parse_completions (line 71) | fn can_parse_completions() {
FILE: crates/anvil/src/cmd.rs
type NodeArgs (line 34) | pub struct NodeArgs {
method into_node_config (line 223) | pub fn into_node_config(self) -> eyre::Result<NodeConfig> {
method account_generator (line 300) | fn account_generator(&self) -> AccountGenerator {
method dump_state_path (line 332) | fn dump_state_path(&self) -> Option<PathBuf> {
method run (line 339) | pub async fn run(self) -> eyre::Result<()> {
constant IPC_HELP (line 212) | const IPC_HELP: &str =
constant IPC_HELP (line 217) | const IPC_HELP: &str = "Launch an ipc server at the given path or defaul...
constant DEFAULT_DUMP_INTERVAL (line 220) | const DEFAULT_DUMP_INTERVAL: Duration = Duration::from_secs(60);
type AnvilEvmArgs (line 421) | pub struct AnvilEvmArgs {
method resolve_rpc_alias (line 630) | pub fn resolve_rpc_alias(&mut self) {
type PeriodicStateDumper (line 641) | struct PeriodicStateDumper {
method new (line 650) | fn new(
method dump (line 668) | async fn dump(&self) {
method dump_state (line 675) | async fn dump_state(
type Output (line 698) | type Output = ();
method poll (line 700) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
type StateFile (line 735) | pub struct StateFile {
method parse (line 743) | fn parse(path: &str) -> Result<Self, String> {
method parse_path (line 748) | pub fn parse_path(path: impl AsRef<Path>) -> Result<Self, String> {
type ForkUrl (line 767) | pub struct ForkUrl {
method fmt (line 775) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type Err (line 785) | type Err = String;
method from_str (line 787) | fn from_str(s: &str) -> Result<Self, Self::Err> {
function read_genesis_file (line 805) | fn read_genesis_file(path: &str) -> Result<Genesis, String> {
function duration_from_secs_f64 (line 809) | fn duration_from_secs_f64(s: &str) -> Result<Duration, String> {
function test_parse_fork_url (line 823) | fn test_parse_fork_url() {
function can_parse_ethereum_hardfork (line 853) | fn can_parse_ethereum_hardfork() {
function can_parse_optimism_hardfork (line 860) | fn can_parse_optimism_hardfork() {
function cant_parse_invalid_hardfork (line 868) | fn cant_parse_invalid_hardfork() {
function can_parse_fork_headers (line 875) | fn can_parse_fork_headers() {
function can_parse_prune_config (line 889) | fn can_parse_prune_config() {
function can_parse_max_persisted_states_config (line 898) | fn can_parse_max_persisted_states_config() {
function can_parse_disable_block_gas_limit (line 904) | fn can_parse_disable_block_gas_limit() {
function can_parse_enable_tx_gas_limit (line 914) | fn can_parse_enable_tx_gas_limit() {
function can_parse_disable_code_size_limit (line 924) | fn can_parse_disable_code_size_limit() {
function can_parse_host (line 939) | fn can_parse_host() {
FILE: crates/anvil/src/config.rs
constant NODE_PORT (line 79) | pub const NODE_PORT: u16 = 8545;
constant CHAIN_ID (line 81) | pub const CHAIN_ID: u64 = 31337;
constant DEFAULT_GAS_LIMIT (line 83) | pub const DEFAULT_GAS_LIMIT: u64 = 30_000_000;
constant DEFAULT_MNEMONIC (line 85) | pub const DEFAULT_MNEMONIC: &str = "test test test test test test test t...
constant DEFAULT_IPC_ENDPOINT (line 88) | pub const DEFAULT_IPC_ENDPOINT: &str =
constant BANNER (line 91) | const BANNER: &str = r"
type NodeConfig (line 102) | pub struct NodeConfig {
method as_string (line 215) | fn as_string(&self, fork: Option<&ClientFork>) -> String {
method as_json (line 371) | fn as_json(&self, fork: Option<&ClientFork>) -> Value {
method test (line 427) | pub fn test() -> Self {
method empty_state (line 432) | pub fn empty_state() -> Self {
method with_memory_limit (line 512) | pub fn with_memory_limit(mut self, mems_value: Option<u64>) -> Self {
method get_base_fee (line 517) | pub fn get_base_fee(&self) -> u64 {
method get_gas_price (line 524) | pub fn get_gas_price(&self) -> u128 {
method get_blob_excess_gas_and_price (line 528) | pub fn get_blob_excess_gas_and_price(&self) -> BlobExcessGasAndPrice {
method get_blob_params (line 545) | pub fn get_blob_params(&self) -> BlobParams {
method get_hardfork (line 550) | pub fn get_hardfork(&self) -> FoundryHardfork {
method with_code_size_limit (line 562) | pub fn with_code_size_limit(mut self, code_size_limit: Option<usize>) ...
method disable_code_size_limit (line 568) | pub fn disable_code_size_limit(mut self, disable_code_size_limit: bool...
method with_init_state (line 577) | pub fn with_init_state(mut self, init_state: Option<SerializableState>...
method with_init_state_path (line 585) | pub fn with_init_state_path(mut self, path: impl AsRef<std::path::Path...
method with_chain_id (line 592) | pub fn with_chain_id<U: Into<u64>>(mut self, chain_id: Option<U>) -> S...
method get_chain_id (line 598) | pub fn get_chain_id(&self) -> u64 {
method set_chain_id (line 605) | pub fn set_chain_id(&mut self, chain_id: Option<impl Into<u64>>) {
method with_gas_limit (line 619) | pub fn with_gas_limit(mut self, gas_limit: Option<u64>) -> Self {
method disable_block_gas_limit (line 628) | pub fn disable_block_gas_limit(mut self, disable_block_gas_limit: bool...
method enable_tx_gas_limit (line 637) | pub fn enable_tx_gas_limit(mut self, enable_tx_gas_limit: bool) -> Self {
method with_gas_price (line 644) | pub fn with_gas_price(mut self, gas_price: Option<u128>) -> Self {
method set_pruned_history (line 651) | pub fn set_pruned_history(mut self, prune_history: Option<Option<usize...
method with_max_persisted_states (line 658) | pub fn with_max_persisted_states<U: Into<usize>>(
method with_max_transactions (line 668) | pub fn with_max_transactions(mut self, max_transactions: Option<usize>...
method with_transaction_block_keeper (line 677) | pub fn with_transaction_block_keeper<U: Into<usize>>(
method with_base_fee (line 687) | pub fn with_base_fee(mut self, base_fee: Option<u64>) -> Self {
method disable_min_priority_fee (line 694) | pub fn disable_min_priority_fee(mut self, disable_min_priority_fee: bo...
method with_genesis (line 701) | pub fn with_genesis(mut self, genesis: Option<Genesis>) -> Self {
method get_genesis_timestamp (line 707) | pub fn get_genesis_timestamp(&self) -> u64 {
method with_genesis_timestamp (line 715) | pub fn with_genesis_timestamp<U: Into<u64>>(mut self, timestamp: Optio...
method with_genesis_block_number (line 724) | pub fn with_genesis_block_number<U: Into<u64>>(mut self, number: Optio...
method get_genesis_number (line 732) | pub fn get_genesis_number(&self) -> u64 {
method with_hardfork (line 740) | pub fn with_hardfork(mut self, hardfork: Option<FoundryHardfork>) -> S...
method with_genesis_accounts (line 747) | pub fn with_genesis_accounts(mut self, accounts: Vec<PrivateKeySigner>...
method with_signer_accounts (line 754) | pub fn with_signer_accounts(mut self, accounts: Vec<PrivateKeySigner>)...
method with_account_generator (line 761) | pub fn with_account_generator(mut self, generator: AccountGenerator) -...
method with_genesis_balance (line 769) | pub fn with_genesis_balance<U: Into<U256>>(mut self, balance: U) -> Se...
method with_blocktime (line 776) | pub fn with_blocktime<D: Into<Duration>>(mut self, block_time: Option<...
method with_mixed_mining (line 782) | pub fn with_mixed_mining<D: Into<Duration>>(
method with_no_mining (line 794) | pub fn with_no_mining(mut self, no_mining: bool) -> Self {
method with_slots_in_an_epoch (line 801) | pub fn with_slots_in_an_epoch(mut self, slots_in_an_epoch: u64) -> Self {
method with_port (line 808) | pub fn with_port(mut self, port: u16) -> Self {
method with_ipc (line 820) | pub fn with_ipc(mut self, ipc_path: Option<Option<String>>) -> Self {
method set_config_out (line 827) | pub fn set_config_out(mut self, config_out: Option<PathBuf>) -> Self {
method with_no_storage_caching (line 833) | pub fn with_no_storage_caching(mut self, no_storage_caching: bool) -> ...
method with_eth_rpc_url (line 840) | pub fn with_eth_rpc_url<U: Into<String>>(mut self, eth_rpc_url: Option...
method with_fork_block_number (line 847) | pub fn with_fork_block_number<U: Into<u64>>(self, fork_block_number: O...
method with_fork_transaction_hash (line 853) | pub fn with_fork_transaction_hash<U: Into<TxHash>>(
method with_fork_choice (line 862) | pub fn with_fork_choice<U: Into<ForkChoice>>(mut self, fork_choice: Op...
method with_fork_chain_id (line 869) | pub fn with_fork_chain_id(mut self, fork_chain_id: Option<U256>) -> Se...
method with_fork_headers (line 876) | pub fn with_fork_headers(mut self, headers: Vec<String>) -> Self {
method fork_request_timeout (line 883) | pub fn fork_request_timeout(mut self, fork_request_timeout: Option<Dur...
method fork_request_retries (line 892) | pub fn fork_request_retries(mut self, fork_request_retries: Option<u32...
method fork_retry_backoff (line 901) | pub fn fork_retry_backoff(mut self, fork_retry_backoff: Option<Duratio...
method fork_compute_units_per_second (line 912) | pub fn fork_compute_units_per_second(mut self, compute_units_per_secon...
method with_tracing (line 921) | pub fn with_tracing(mut self, enable_tracing: bool) -> Self {
method with_steps_tracing (line 928) | pub fn with_steps_tracing(mut self, enable_steps_tracing: bool) -> Self {
method with_print_logs (line 935) | pub fn with_print_logs(mut self, print_logs: bool) -> Self {
method with_print_traces (line 942) | pub fn with_print_traces(mut self, print_traces: bool) -> Self {
method with_auto_impersonate (line 949) | pub fn with_auto_impersonate(mut self, enable_auto_impersonate: bool) ...
method with_server_config (line 955) | pub fn with_server_config(mut self, config: ServerConfig) -> Self {
method with_host (line 962) | pub fn with_host(mut self, host: Vec<IpAddr>) -> Self {
method with_transaction_order (line 968) | pub fn with_transaction_order(mut self, transaction_order: Transaction...
method get_ipc_path (line 974) | pub fn get_ipc_path(&self) -> Option<String> {
method print (line 982) | pub fn print(&self, fork: Option<&ClientFork>) -> Result<()> {
method block_cache_path (line 996) | pub fn block_cache_path(&self, block: u64) -> Option<PathBuf> {
method with_disable_default_create2_deployer (line 1007) | pub fn with_disable_default_create2_deployer(mut self, yes: bool) -> S...
method with_disable_pool_balance_checks (line 1014) | pub fn with_disable_pool_balance_checks(mut self, yes: bool) -> Self {
method with_precompile_factory (line 1021) | pub fn with_precompile_factory(mut self, factory: impl PrecompileFacto...
method with_networks (line 1028) | pub fn with_networks(mut self, networks: NetworkConfigs) -> Self {
method silent (line 1035) | pub fn silent(self) -> Self {
method set_silent (line 1040) | pub fn set_silent(mut self, silent: bool) -> Self {
method with_cache_path (line 1050) | pub fn with_cache_path(mut self, cache_path: Option<PathBuf>) -> Self {
method setup (line 1059) | pub(crate) async fn setup<N>(&mut self) -> Result<mem::Backend<N>>
method setup_fork_db (line 1196) | pub async fn setup_fork_db(
method setup_fork_db_config (line 1213) | pub async fn setup_fork_db_config(
method fork_gas_limit (line 1423) | pub(crate) fn fork_gas_limit<B: BlockResponse<Header: BlockHeader>>(&s...
method gas_limit (line 1438) | pub(crate) fn gas_limit(&self) -> u64 {
method default (line 443) | fn default() -> Self {
function derive_block_and_transactions (line 1451) | async fn derive_block_and_transactions(
type ForkChoice (line 1505) | pub enum ForkChoice {
method block_number (line 1516) | pub fn block_number(&self) -> Option<i128> {
method transaction_hash (line 1524) | pub fn transaction_hash(&self) -> Option<TxHash> {
method from (line 1534) | fn from(tx_hash: TxHash) -> Self {
method from (line 1541) | fn from(block: u64) -> Self {
type PruneStateHistoryConfig (line 1547) | pub struct PruneStateHistoryConfig {
method is_state_history_supported (line 1554) | pub fn is_state_history_supported(&self) -> bool {
method is_config_enabled (line 1559) | pub fn is_config_enabled(&self) -> bool {
method from_args (line 1563) | pub fn from_args(val: Option<Option<usize>>) -> Self {
type AccountGenerator (line 1570) | pub struct AccountGenerator {
method new (line 1578) | pub fn new(amount: usize) -> Self {
method phrase (line 1588) | pub fn phrase(mut self, phrase: impl Into<String>) -> Self {
method get_phrase (line 1593) | fn get_phrase(&self) -> &str {
method chain_id (line 1598) | pub fn chain_id(mut self, chain_id: impl Into<u64>) -> Self {
method derivation_path (line 1604) | pub fn derivation_path(mut self, derivation_path: impl Into<String>) -...
method get_derivation_path (line 1613) | fn get_derivation_path(&self) -> &str {
method generate (line 1619) | pub fn generate(&self) -> eyre::Result<Vec<PrivateKeySigner>> {
function anvil_dir (line 1637) | pub fn anvil_dir() -> Option<PathBuf> {
function anvil_tmp_dir (line 1642) | pub fn anvil_tmp_dir() -> Option<PathBuf> {
function find_latest_fork_block (line 1650) | async fn find_latest_fork_block<P: Provider<AnyNetwork>>(
function test_prune_history (line 1675) | fn test_prune_history() {
FILE: crates/anvil/src/error.rs
type NodeResult (line 2) | pub type NodeResult<T> = Result<T, NodeError>;
type NodeError (line 6) | pub enum NodeError {
FILE: crates/anvil/src/eth/api.rs
constant CLIENT_VERSION (line 103) | pub const CLIENT_VERSION: &str = concat!("anvil/v", env!("CARGO_PKG_VERS...
type EthApi (line 108) | pub struct EthApi<N: Network> {
method clone (line 140) | fn clone(&self) -> Self {
function new (line 163) | pub fn new(
function gas_price (line 191) | pub fn gas_price(&self) -> u128 {
function lowest_suggestion_tip (line 206) | fn lowest_suggestion_tip(&self) -> u128 {
function anvil_get_auto_mine (line 221) | pub fn anvil_get_auto_mine(&self) -> Result<bool> {
function anvil_get_interval_mining (line 229) | pub fn anvil_get_interval_mining(&self) -> Result<Option<u64>> {
function anvil_set_auto_mine (line 238) | pub async fn anvil_set_auto_mine(&self, enable_automine: bool) -> Result...
function anvil_set_interval_mining (line 256) | pub fn anvil_set_interval_mining(&self, secs: u64) -> Result<()> {
function anvil_drop_transaction (line 275) | pub async fn anvil_drop_transaction(&self, tx_hash: B256) -> Result<Opti...
function anvil_drop_all_transactions (line 283) | pub async fn anvil_drop_all_transactions(&self) -> Result<()> {
function anvil_set_chain_id (line 289) | pub async fn anvil_set_chain_id(&self, chain_id: u64) -> Result<()> {
function anvil_set_balance (line 298) | pub async fn anvil_set_balance(&self, address: Address, balance: U256) -...
function anvil_set_code (line 307) | pub async fn anvil_set_code(&self, address: Address, code: Bytes) -> Res...
function anvil_set_nonce (line 316) | pub async fn anvil_set_nonce(&self, address: Address, nonce: U256) -> Re...
function anvil_set_storage_at (line 325) | pub async fn anvil_set_storage_at(
function anvil_set_logging (line 339) | pub async fn anvil_set_logging(&self, enable: bool) -> Result<()> {
function anvil_set_min_gas_price (line 348) | pub async fn anvil_set_min_gas_price(&self, gas: U256) -> Result<()> {
function anvil_set_next_block_base_fee_per_gas (line 363) | pub async fn anvil_set_next_block_base_fee_per_gas(&self, basefee: U256)...
function anvil_set_coinbase (line 378) | pub async fn anvil_set_coinbase(&self, address: Address) -> Result<()> {
function anvil_node_info (line 387) | pub async fn anvil_node_info(&self) -> Result<NodeInfo> {
function anvil_metadata (line 427) | pub async fn anvil_metadata(&self) -> Result<Metadata> {
function anvil_remove_pool_transactions (line 446) | pub async fn anvil_remove_pool_transactions(&self, address: Address) -> ...
function evm_snapshot (line 455) | pub async fn evm_snapshot(&self) -> Result<U256> {
function evm_increase_time (line 463) | pub async fn evm_increase_time(&self, seconds: U256) -> Result<i64> {
function evm_set_next_block_timestamp (line 471) | pub fn evm_set_next_block_timestamp(&self, seconds: u64) -> Result<()> {
function evm_set_time (line 480) | pub fn evm_set_time(&self, timestamp: u64) -> Result<u64> {
function evm_set_block_gas_limit (line 493) | pub fn evm_set_block_gas_limit(&self, gas_limit: U256) -> Result<bool> {
function evm_set_block_timestamp_interval (line 502) | pub fn evm_set_block_timestamp_interval(&self, seconds: u64) -> Result<(...
function evm_remove_block_timestamp_interval (line 511) | pub fn evm_remove_block_timestamp_interval(&self) -> Result<bool> {
function anvil_set_rpc_url (line 519) | pub fn anvil_set_rpc_url(&self, url: String) -> Result<()> {
function txpool_status (line 546) | pub async fn txpool_status(&self) -> Result<TxpoolStatus> {
function on_blocking_task (line 552) | async fn on_blocking_task<C, F, R>(&self, c: C) -> Result<R>
function set_transaction_order (line 571) | pub fn set_transaction_order(&self, order: TransactionOrder) {
function chain_id (line 576) | pub fn chain_id(&self) -> u64 {
function get_fork (line 581) | pub fn get_fork(&self) -> Option<ClientFork> {
function instance_id (line 586) | pub fn instance_id(&self) -> B256 {
function reset_instance_id (line 591) | pub fn reset_instance_id(&self) {
function get_signer (line 597) | pub fn get_signer(&self, address: Address) -> Option<&Box<dyn Signer<N>>> {
function new_ready_transactions (line 602) | pub fn new_ready_transactions(&self) -> Receiver<TxHash> {
function is_fork (line 607) | pub fn is_fork(&self) -> bool {
function state_root (line 612) | pub async fn state_root(&self) -> Option<B256> {
function is_impersonated (line 617) | pub fn is_impersonated(&self, addr: Address) -> bool {
function storage_info (line 622) | pub fn storage_info(&self) -> StorageInfo<N> {
function anvil_reset (line 635) | pub async fn anvil_reset(&self, forking: Option<Forking>) -> Result<()> {
function anvil_dump_state (line 654) | pub async fn anvil_dump_state(
function serialized_state (line 663) | pub async fn serialized_state(
function anvil_load_state (line 674) | pub async fn anvil_load_state(&self, buf: Bytes) -> Result<bool> {
function evm_revert (line 683) | pub async fn evm_revert(&self, id: U256) -> Result<bool> {
function block_request (line 688) | async fn block_request(
function anvil_add_balance (line 708) | pub async fn anvil_add_balance(&self, address: Address, balance: U256) -...
function anvil_rollback (line 725) | pub async fn anvil_rollback(&self, depth: Option<u64>) -> Result<()> {
function do_estimate_gas_with_state (line 748) | fn do_estimate_gas_with_state(
function new_block_notifications (line 875) | pub fn new_block_notifications(&self) -> NewBlockNotifications {
function execute (line 880) | pub async fn execute(&self, request: EthRequest) -> ResponseResult {
function sign_request (line 1239) | fn sign_request(&self, from: &Address, typed_tx: FoundryTypedTx) -> Resu...
function inner_raw_transaction (line 1253) | async fn inner_raw_transaction(&self, hash: B256) -> Result<Option<Bytes...
function client_version (line 1266) | pub fn client_version(&self) -> Result<String> {
function sha3 (line 1274) | pub fn sha3(&self, bytes: Bytes) -> Result<String> {
function protocol_version (line 1283) | pub fn protocol_version(&self) -> Result<u64> {
function hashrate (line 1291) | pub fn hashrate(&self) -> Result<U256> {
function author (line 1299) | pub fn author(&self) -> Result<Address> {
function is_mining (line 1307) | pub fn is_mining(&self) -> Result<bool> {
function eth_chain_id (line 1317) | pub fn eth_chain_id(&self) -> Result<Option<U64>> {
function network_id (line 1325) | pub fn network_id(&self) -> Result<Option<String>> {
function net_listening (line 1334) | pub fn net_listening(&self) -> Result<bool> {
function eth_gas_price (line 1340) | fn eth_gas_price(&self) -> Result<U256> {
function excess_blob_gas_and_price (line 1346) | pub fn excess_blob_gas_and_price(&self) -> Result<Option<BlobExcessGasAn...
function gas_max_priority_fee_per_gas (line 1354) | pub fn gas_max_priority_fee_per_gas(&self) -> Result<U256> {
function blob_base_fee (line 1361) | pub fn blob_base_fee(&self) -> Result<U256> {
function gas_limit (line 1366) | pub fn gas_limit(&self) -> U256 {
function accounts (line 1373) | pub fn accounts(&self) -> Result<Vec<Address>> {
function block_number (line 1393) | pub fn block_number(&self) -> Result<U256> {
function balance (line 1401) | pub async fn balance(&self, address: Address, block_number: Option<Block...
function get_account (line 1419) | pub async fn get_account(
function get_account_info (line 1441) | pub async fn get_account_info(
function storage_at (line 1488) | pub async fn storage_at(
function block_by_hash (line 1513) | pub async fn block_by_hash(&self, hash: B256) -> Result<Option<AnyRpcBlo...
function block_by_hash_full (line 1521) | pub async fn block_by_hash_full(&self, hash: B256) -> Result<Option<AnyR...
function block_by_number (line 1529) | pub async fn block_by_number(&self, number: BlockNumber) -> Result<Optio...
function block_by_number_full (line 1541) | pub async fn block_by_number_full(&self, number: BlockNumber) -> Result<...
function transaction_count (line 1555) | pub async fn transaction_count(
function block_transaction_count_by_hash (line 1567) | pub async fn block_transaction_count_by_hash(&self, hash: B256) -> Resul...
function block_transaction_count_by_number (line 1581) | pub async fn block_transaction_count_by_number(
function block_uncles_count_by_hash (line 1603) | pub async fn block_uncles_count_by_hash(&self, hash: B256) -> Result<U25...
function block_uncles_count_by_number (line 1613) | pub async fn block_uncles_count_by_number(&self, block_number: BlockNumb...
function get_code (line 1626) | pub async fn get_code(&self, address: Address, block_number: Option<Bloc...
function get_proof (line 1643) | pub async fn get_proof(
function sign_typed_data (line 1668) | pub async fn sign_typed_data(
function sign_typed_data_v3 (line 1680) | pub async fn sign_typed_data_v3(
function sign_typed_data_v4 (line 1692) | pub async fn sign_typed_data_v4(&self, address: Address, data: &TypedDat...
function sign (line 1703) | pub async fn sign(&self, address: Address, content: impl AsRef<[u8]>) ->...
function sign_transaction (line 1714) | pub async fn sign_transaction(
function send_transaction (line 1735) | pub async fn send_transaction(
function await_transaction_inclusion (line 1770) | async fn await_transaction_inclusion(&self, hash: TxHash) -> Result<Foun...
function check_transaction_inclusion (line 1789) | async fn check_transaction_inclusion(&self, hash: TxHash) -> Result<Foun...
function send_transaction_sync (line 1804) | pub async fn send_transaction_sync(
function send_raw_transaction (line 1819) | pub async fn send_raw_transaction(&self, tx: Bytes) -> Result<TxHash> {
function send_raw_transaction_sync (line 1857) | pub async fn send_raw_transaction_sync(&self, tx: Bytes) -> Result<Found...
function call (line 1869) | pub async fn call(
function simulate_v1 (line 1909) | pub async fn simulate_v1(
function create_access_list (line 1948) | pub async fn create_access_list(
function estimate_gas (line 1997) | pub async fn estimate_gas(
function fill_transaction (line 2019) | pub async fn fill_transaction(
function anvil_get_blob_by_versioned_hash (line 2061) | pub fn anvil_get_blob_by_versioned_hash(
function anvil_get_blob_by_tx_hash (line 2070) | pub fn anvil_get_blob_by_tx_hash(&self, hash: B256) -> Result<Option<Vec...
function anvil_get_blobs_by_block_id (line 2076) | pub fn anvil_get_blobs_by_block_id(
function anvil_get_genesis_time (line 2088) | pub fn anvil_get_genesis_time(&self) -> Result<u64> {
function transaction_by_hash (line 2099) | pub async fn transaction_by_hash(&self, hash: B256) -> Result<Option<Any...
function transaction_by_block_hash_and_index (line 2128) | pub async fn transaction_by_block_hash_and_index(
function transaction_by_block_number_and_index (line 2140) | pub async fn transaction_by_block_number_and_index(
function transaction_by_sender_and_nonce (line 2155) | pub async fn transaction_by_sender_and_nonce(
function transaction_receipt (line 2234) | pub async fn transaction_receipt(&self, hash: B256) -> Result<Option<Fou...
function block_receipts (line 2242) | pub async fn block_receipts(&self, number: BlockId) -> Result<Option<Vec...
function uncle_by_block_hash_and_index (line 2250) | pub async fn uncle_by_block_hash_and_index(
function uncle_by_block_number_and_index (line 2270) | pub async fn uncle_by_block_number_and_index(
function logs (line 2289) | pub async fn logs(&self, filter: Filter) -> Result<Vec<Log>> {
function work (line 2297) | pub fn work(&self) -> Result<Work> {
function syncing (line 2305) | pub fn syncing(&self) -> Result<bool> {
function config (line 2320) | pub fn config(&self) -> Result<EthConfig> {
function submit_work (line 2339) | pub fn submit_work(&self, _: B64, _: B256, _: B256) -> Result<bool> {
function submit_hashrate (line 2347) | pub fn submit_hashrate(&self, _: U256, _: B256) -> Result<bool> {
function fee_history (line 2355) | pub async fn fee_history(
function max_priority_fee_per_gas (line 2459) | pub fn max_priority_fee_per_gas(&self) -> Result<U256> {
function new_filter (line 2467) | pub async fn new_filter(&self, filter: Filter) -> Result<String> {
function new_block_filter (line 2488) | pub async fn new_block_filter(&self) -> Result<String> {
function new_pending_transaction_filter (line 2497) | pub async fn new_pending_transaction_filter(&self) -> Result<String> {
function get_filter_changes (line 2506) | pub async fn get_filter_changes(&self, id: &str) -> ResponseResult {
function get_filter_logs (line 2514) | pub async fn get_filter_logs(&self, id: &str) -> Result<Vec<Log>> {
function uninstall_filter (line 2524) | pub async fn uninstall_filter(&self, id: &str) -> Result<bool> {
function raw_transaction (line 2532) | pub async fn raw_transaction(&self, hash: B256) -> Result<Option<Bytes>> {
function raw_transaction_by_block_hash_and_index (line 2540) | pub async fn raw_transaction_by_block_hash_and_index(
function raw_transaction_by_block_number_and_index (line 2555) | pub async fn raw_transaction_by_block_number_and_index(
function debug_trace_transaction (line 2570) | pub async fn debug_trace_transaction(
function debug_trace_call (line 2582) | pub async fn debug_trace_call(
function debug_code_by_hash (line 2606) | pub async fn debug_code_by_hash(
function debug_db_get (line 2619) | pub async fn debug_db_get(&self, key: String) -> Result<Option<Bytes>> {
function trace_transaction (line 2627) | pub async fn trace_transaction(&self, tx_hash: B256) -> Result<Vec<Local...
function trace_block (line 2635) | pub async fn trace_block(&self, block: BlockNumber) -> Result<Vec<Locali...
function trace_filter (line 2643) | pub async fn trace_filter(
function trace_replay_block_transactions (line 2654) | pub async fn trace_replay_block_transactions(
function anvil_impersonate_account (line 2670) | pub async fn anvil_impersonate_account(&self, address: Address) -> Resul...
function anvil_stop_impersonating_account (line 2679) | pub async fn anvil_stop_impersonating_account(&self, address: Address) -...
function anvil_auto_impersonate_account (line 2688) | pub async fn anvil_auto_impersonate_account(&self, enabled: bool) -> Res...
function anvil_impersonate_signature (line 2695) | pub async fn anvil_impersonate_signature(
function anvil_mine (line 2707) | pub async fn anvil_mine(&self, num_blocks: Option<U256>, interval: Optio...
function find_erc20_storage_slot (line 2747) | async fn find_erc20_storage_slot(
function anvil_deal_erc20 (line 2801) | pub async fn anvil_deal_erc20(
function anvil_set_erc20_allowance (line 2838) | pub async fn anvil_set_erc20_allowance(
function anvil_reorg (line 2886) | pub async fn anvil_reorg(&self, options: ReorgOptions) -> Result<()> {
function evm_mine (line 2991) | pub async fn evm_mine(&self, opts: Option<MineOptions>) -> Result<String> {
function evm_mine_detailed (line 3008) | pub async fn evm_mine_detailed(&self, opts: Option<MineOptions>) -> Resu...
function eth_send_unsigned_transaction (line 3055) | pub async fn eth_send_unsigned_transaction(
function txpool_inspect (line 3088) | pub async fn txpool_inspect(&self) -> Result<TxpoolInspect> {
function txpool_content (line 3126) | pub async fn txpool_content(&self) -> Result<TxpoolContent<AnyRpcTransac...
function do_evm_mine (line 3167) | async fn do_evm_mine(&self, opts: Option<MineOptions>) -> Result<u64> {
function do_estimate_gas (line 3200) | async fn do_estimate_gas(
function transaction_priority (line 3243) | fn transaction_priority(&self, tx: &FoundryTxEnvelope) -> TransactionPri...
function full_pending_transactions (line 3248) | pub fn full_pending_transactions(&self) -> UnboundedReceiver<AnyRpcTrans...
function mine_one (line 3268) | pub async fn mine_one(&self) {
function pending_block (line 3277) | async fn pending_block(&self) -> AnyRpcBlock {
function pending_block_full (line 3284) | async fn pending_block_full(&self) -> Option<AnyRpcBlock> {
function build_tx_request (line 3314) | async fn build_tx_request(
function get_transaction_count (line 3387) | async fn get_transaction_count(
function request_nonce (line 3411) | async fn request_nonce(
function add_pending_transaction (line 3424) | fn add_pending_transaction(
function ensure_typed_transaction_supported (line 3440) | fn ensure_typed_transaction_supported(&self, tx: &FoundryTxEnvelope) -> ...
function required_marker (line 3454) | fn required_marker(provided_nonce: u64, on_chain_nonce: u64, from: Addre...
function convert_transact_out (line 3462) | fn convert_transact_out(out: &Option<Output>) -> Bytes {
function ensure_return_ok (line 3471) | fn ensure_return_ok(exit: InstructionResult, out: &Option<Output>) -> Re...
function determine_base_gas_by_kind (line 3481) | fn determine_base_gas_by_kind(request: &WithOtherFields<TransactionReque...
type GasEstimationCallResult (line 3496) | enum GasEstimationCallResult {
type Error (line 3507) | type Error = BlockchainError;
method try_from (line 3509) | fn try_from(res: Result<(InstructionResult, Option<Output>, u128, Stat...
FILE: crates/anvil/src/eth/backend/cheats.rs
type CheatsManager (line 23) | pub struct CheatsManager {
method impersonate (line 32) | pub fn impersonate(&self, addr: Address) -> bool {
method stop_impersonating (line 41) | pub fn stop_impersonating(&self, addr: &Address) {
method is_impersonated (line 47) | pub fn is_impersonated(&self, addr: Address) -> bool {
method auto_impersonate_accounts (line 56) | pub fn auto_impersonate_accounts(&self) -> bool {
method set_auto_impersonate_account (line 62) | pub fn set_auto_impersonate_account(&self, enabled: bool) {
method impersonated_accounts (line 68) | pub fn impersonated_accounts(&self) -> AddressHashSet {
method add_recover_override (line 73) | pub fn add_recover_override(&self, sig: Bytes, addr: Address) {
method get_recover_override (line 78) | pub fn get_recover_override(&self, sig: &Bytes) -> Option<Address> {
method has_recover_overrides (line 83) | pub fn has_recover_overrides(&self) -> bool {
type CheatsState (line 90) | pub struct CheatsState {
method call (line 106) | fn call(&self, input: PrecompileInput<'_>) -> PrecompileResult {
method precompile_id (line 129) | fn precompile_id(&self) -> &PrecompileId {
method supports_caching (line 133) | fn supports_caching(&self) -> bool {
type CheatEcrecover (line 140) | pub struct CheatEcrecover {
method new (line 100) | pub fn new(cheats: Arc<CheatsManager>) -> Self {
function impersonate_returns_false_then_true (line 149) | fn impersonate_returns_false_then_true() {
FILE: crates/anvil/src/eth/backend/db.rs
type MaybeFullDatabase (line 44) | pub trait MaybeFullDatabase: DatabaseRef<Error = DatabaseError> + Debug {
method maybe_as_full_db (line 45) | fn maybe_as_full_db(&self) -> Option<&AddressMap<DbAccount>> {
method clear_into_state_snapshot (line 50) | fn clear_into_state_snapshot(&mut self) -> StateSnapshot;
method read_as_state_snapshot (line 55) | fn read_as_state_snapshot(&self) -> StateSnapshot;
method clear (line 58) | fn clear(&mut self);
method init_from_state_snapshot (line 61) | fn init_from_state_snapshot(&mut self, state_snapshot: StateSnapshot);
method maybe_as_full_db (line 68) | fn maybe_as_full_db(&self) -> Option<&AddressMap<DbAccount>> {
method clear_into_state_snapshot (line 72) | fn clear_into_state_snapshot(&mut self) -> StateSnapshot {
method read_as_state_snapshot (line 76) | fn read_as_state_snapshot(&self) -> StateSnapshot {
method clear (line 80) | fn clear(&mut self) {}
method init_from_state_snapshot (line 82) | fn init_from_state_snapshot(&mut self, _state_snapshot: StateSnapshot) {}
method maybe_as_full_db (line 336) | fn maybe_as_full_db(&self) -> Option<&AddressMap<DbAccount>> {
method clear_into_state_snapshot (line 340) | fn clear_into_state_snapshot(&mut self) -> StateSnapshot {
method read_as_state_snapshot (line 355) | fn read_as_state_snapshot(&self) -> StateSnapshot {
method clear (line 370) | fn clear(&mut self) {
method init_from_state_snapshot (line 374) | fn init_from_state_snapshot(&mut self, state_snapshot: StateSnapshot) {
method maybe_as_full_db (line 444) | fn maybe_as_full_db(&self) -> Option<&AddressMap<DbAccount>> {
method clear_into_state_snapshot (line 448) | fn clear_into_state_snapshot(&mut self) -> StateSnapshot {
method read_as_state_snapshot (line 452) | fn read_as_state_snapshot(&self) -> StateSnapshot {
method clear (line 456) | fn clear(&mut self) {
method init_from_state_snapshot (line 460) | fn init_from_state_snapshot(&mut self, state_snapshot: StateSnapshot) {
type MaybeForkedDatabase (line 86) | pub trait MaybeForkedDatabase {
method maybe_reset (line 87) | fn maybe_reset(&mut self, _url: Option<String>, block_number: BlockId)...
method maybe_flush_cache (line 89) | fn maybe_flush_cache(&self) -> Result<(), String>;
method maybe_inner (line 91) | fn maybe_inner(&self) -> Result<&BlockchainDb, String>;
method maybe_reset (line 395) | fn maybe_reset(&mut self, _url: Option<String>, _block_number: BlockId...
method maybe_flush_cache (line 399) | fn maybe_flush_cache(&self) -> Result<(), String> {
method maybe_inner (line 403) | fn maybe_inner(&self) -> Result<&BlockchainDb, String> {
method set_state_clear_flag (line 99) | fn set_state_clear_flag(&mut self, _has_state_clear: bool) {
type AnvilCacheDB (line 111) | pub struct AnvilCacheDB<T>(pub CacheDB<T>);
function new (line 114) | pub fn new(inner: T) -> Self {
type Target (line 120) | type Target = CacheDB<T>;
function deref (line 121) | fn deref(&self) -> &Self::Target {
function deref_mut (line 127) | fn deref_mut(&mut self) -> &mut Self::Target {
type Error (line 133) | type Error = DatabaseError;
method basic (line 135) | fn basic(&mut self, address: Address) -> Result<Option<AccountInfo>, Sel...
method code_by_hash (line 139) | fn code_by_hash(&mut self, code_hash: B256) -> Result<Bytecode, Self::Er...
method storage (line 143) | fn storage(&mut self, address: Address, index: U256) -> Result<U256, Sel...
method block_hash (line 147) | fn block_hash(&mut self, number: u64) -> Result<B256, Self::Error> {
type Error (line 153) | type Error = DatabaseError;
method basic_ref (line 155) | fn basic_ref(&self, address: Address) -> Result<Option<AccountInfo>, Sel...
method code_by_hash_ref (line 159) | fn code_by_hash_ref(&self, code_hash: B256) -> Result<Bytecode, Self::Er...
method storage_ref (line 163) | fn storage_ref(&self, address: Address, index: U256) -> Result<U256, Sel...
method block_hash_ref (line 167) | fn block_hash_ref(&self, number: u64) -> Result<B256, Self::Error> {
method commit (line 173) | fn commit(&mut self, changes: revm::state::EvmState) {
method set_state_clear_flag (line 179) | fn set_state_clear_flag(&mut self, _has_state_clear: bool) {
type Db (line 185) | pub trait Db:
method insert_account (line 196) | fn insert_account(&mut self, address: Address, account: AccountInfo);
method set_nonce (line 199) | fn set_nonce(&mut self, address: Address, nonce: u64) -> DatabaseResul...
method set_balance (line 207) | fn set_balance(&mut self, address: Address, balance: U256) -> Database...
method set_code (line 215) | fn set_code(&mut self, address: Address, code: Bytes) -> DatabaseResul...
method set_storage_at (line 229) | fn set_storage_at(&mut self, address: Address, slot: B256, val: B256) ...
method insert_block_hash (line 232) | fn insert_block_hash(&mut self, number: U256, hash: B256);
method dump_state (line 235) | fn dump_state(
method load_state (line 245) | fn load_state(&mut self, state: SerializableState) -> DatabaseResult<b...
method snapshot_state (line 278) | fn snapshot_state(&mut self) -> U256;
method revert_state (line 283) | fn revert_state(&mut self, state_snapshot: U256, action: RevertStateSn...
method maybe_state_root (line 286) | fn maybe_state_root(&self) -> Option<B256> {
method current_state (line 291) | fn current_state(&self) -> StateDb;
method insert_account (line 299) | fn insert_account(&mut self, address: Address, account: AccountInfo) {
method set_storage_at (line 303) | fn set_storage_at(&mut self, address: Address, slot: B256, val: B256) ...
method insert_block_hash (line 307) | fn insert_block_hash(&mut self, number: U256, hash: B256) {
method dump_state (line 311) | fn dump_state(
method snapshot_state (line 322) | fn snapshot_state(&mut self) -> U256 {
method revert_state (line 326) | fn revert_state(&mut self, _state_snapshot: U256, _action: RevertState...
method current_state (line 330) | fn current_state(&self) -> StateDb {
type StateDb (line 410) | pub struct StateDb(pub(crate) Box<dyn MaybeFullDatabase + Send + Sync>);
method new (line 413) | pub fn new(db: impl MaybeFullDatabase + Send + Sync + 'static) -> Self {
method serialize_state (line 417) | pub fn serialize_state(&mut self) -> StateSnapshot {
type Error (line 425) | type Error = DatabaseError;
method basic_ref (line 426) | fn basic_ref(&self, address: Address) -> DatabaseResult<Option<AccountIn...
method code_by_hash_ref (line 430) | fn code_by_hash_ref(&self, code_hash: B256) -> DatabaseResult<Bytecode> {
method storage_ref (line 434) | fn storage_ref(&self, address: Address, index: U256) -> DatabaseResult<U...
method block_hash_ref (line 438) | fn block_hash_ref(&self, number: u64) -> DatabaseResult<B256> {
type LegacyBlockEnv (line 468) | pub struct LegacyBlockEnv {
type LegacyBlobExcessGasAndPrice (line 482) | pub struct LegacyBlobExcessGasAndPrice {
type StringOrU64 (line 490) | pub enum StringOrU64 {
method to_u64 (line 496) | pub fn to_u64(&self) -> Option<u64> {
method to_u256 (line 503) | pub fn to_u256(&self) -> Option<U256> {
type Error (line 513) | type Error = &'static str;
method try_from (line 515) | fn try_from(legacy: LegacyBlockEnv) -> Result<Self, Self::Error> {
function deserialize_block_env_compat (line 535) | fn deserialize_block_env_compat<'de, D>(deserializer: D) -> Result<Optio...
function deserialize_best_block_number_compat (line 556) | fn deserialize_best_block_number_compat<'de, D>(deserializer: D) -> Resu...
type SerializableState (line 581) | pub struct SerializableState {
method load (line 604) | pub fn load(path: impl AsRef<Path>) -> Result<Self, FsPathError> {
method parse (line 615) | pub(crate) fn parse(path: &str) -> Result<Self, String> {
type SerializableAccountRecord (line 621) | pub struct SerializableAccountRecord {
function deserialize_btree (line 630) | fn deserialize_btree<'de, D>(deserializer: D) -> Result<BTreeMap<B256, B...
type SerializableTransactionType (line 668) | pub enum SerializableTransactionType {
method from (line 703) | fn from(transaction: MaybeImpersonatedTransaction<FoundryTxEnvelope>) ...
type SerializableBlock (line 674) | pub struct SerializableBlock {
method from (line 683) | fn from(block: Block) -> Self {
method from (line 694) | fn from(block: SerializableBlock) -> Self {
function from (line 709) | fn from(transaction: SerializableTransactionType) -> Self {
type SerializableTransaction (line 718) | pub struct SerializableTransaction {
method from (line 726) | fn from(transaction: MinedTransaction<FoundryNetwork>) -> Self {
function from (line 737) | fn from(transaction: SerializableTransaction) -> Self {
type SerializableHistoricalStates (line 748) | pub struct SerializableHistoricalStates(Vec<(B256, StateSnapshot)>);
method new (line 751) | pub const fn new(states: Vec<(B256, StateSnapshot)>) -> Self {
type Item (line 757) | type Item = (B256, StateSnapshot);
type IntoIter (line 758) | type IntoIter = std::vec::IntoIter<Self::Item>;
method into_iter (line 760) | fn into_iter(self) -> Self::IntoIter {
function test_deser_block (line 770) | fn test_deser_block() {
function test_block_withdrawals_preserved (line 818) | fn test_block_withdrawals_preserved() {
FILE: crates/anvil/src/eth/backend/env.rs
type Env (line 8) | pub struct Env {
method new (line 16) | pub fn new(evm_env: EvmEnv, tx: OpTransaction<TxEnv>, networks: Networ...
FILE: crates/anvil/src/eth/backend/executor.rs
type FoundryReceiptBuilder (line 39) | pub struct FoundryReceiptBuilder;
type Transaction (line 42) | type Transaction = FoundryTxEnvelope;
type Receipt (line 43) | type Receipt = FoundryReceiptEnvelope;
method build_receipt (line 45) | fn build_receipt<E: Evm>(
type AnvilTxResult (line 74) | pub struct AnvilTxResult<H> {
type HaltReason (line 80) | type HaltReason = H;
method result (line 82) | fn result(&self) -> &ResultAndState<Self::HaltReason> {
type AnvilExecutionCtx (line 90) | pub struct AnvilExecutionCtx {
type AnvilBlockExecutor (line 104) | pub struct AnvilBlockExecutor<E> {
function fmt (line 122) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function new (line 135) | pub fn new(evm: E, ctx: AnvilExecutionCtx) -> Self {
type Transaction (line 155) | type Transaction = FoundryTxEnvelope;
type Receipt (line 156) | type Receipt = FoundryReceiptEnvelope;
type Evm (line 157) | type Evm = E;
type Result (line 158) | type Result = AnvilTxResult<E::HaltReason>;
method apply_pre_execution_changes (line 160) | fn apply_pre_execution_changes(&mut self) -> Result<(), BlockExecutionEr...
method execute_transaction_without_commit (line 185) | fn execute_transaction_without_commit(
method commit_transaction (line 217) | fn commit_transaction(&mut self, output: Self::Result) -> Result<u64, Bl...
method finish (line 266) | fn finish(
method set_state_hook (line 281) | fn set_state_hook(&mut self, hook: Option<Box<dyn OnStateHook>>) {
method evm_mut (line 285) | fn evm_mut(&mut self) -> &mut Self::Evm {
method evm (line 289) | fn evm(&self) -> &Self::Evm {
method receipts (line 293) | fn receipts(&self) -> &[FoundryReceiptEnvelope] {
type AnvilBlockExecutorFactory (line 298) | pub struct AnvilBlockExecutorFactory;
method create_executor (line 301) | pub fn create_executor<DB>(
function build_tx_env_for_pending (line 314) | pub fn build_tx_env_for_pending(
function new_eth_evm_with_inspector (line 359) | pub fn new_eth_evm_with_inspector<DB, I>(
FILE: crates/anvil/src/eth/backend/fork.rs
type ClientFork (line 43) | pub struct ClientFork<N: Network = AnyNetwork> {
method transaction_receipt (line 534) | pub async fn transaction_receipt(
method block_receipts (line 553) | pub async fn block_receipts(
method uncle_by_block_hash_and_index (line 588) | pub async fn uncle_by_block_hash_and_index(
method uncle_by_block_number_and_index (line 599) | pub async fn uncle_by_block_number_and_index(
method uncles_by_block_and_index (line 610) | async fn uncles_by_block_and_index(
function new (line 56) | pub fn new(config: ClientForkConfig<N>, database: Arc<AsyncRwLock<Box<dy...
function clear_cached_storage (line 61) | pub fn clear_cached_storage(&self) {
function predates_fork (line 66) | pub fn predates_fork(&self, block: u64) -> bool {
function predates_fork_inclusive (line 71) | pub fn predates_fork_inclusive(&self, block: u64) -> bool {
function timestamp (line 75) | pub fn timestamp(&self) -> u64 {
function block_number (line 79) | pub fn block_number(&self) -> u64 {
function transaction_hash (line 84) | pub fn transaction_hash(&self) -> Option<B256> {
function total_difficulty (line 88) | pub fn total_difficulty(&self) -> U256 {
function base_fee (line 92) | pub fn base_fee(&self) -> Option<u128> {
function block_hash (line 96) | pub fn block_hash(&self) -> B256 {
function eth_rpc_url (line 100) | pub fn eth_rpc_url(&self) -> String {
function chain_id (line 104) | pub fn chain_id(&self) -> u64 {
function provider (line 108) | fn provider(&self) -> Arc<RetryProvider<N>> {
function storage_read (line 112) | fn storage_read(&self) -> RwLockReadGuard<'_, RawRwLock, ForkedStorage<N...
function storage_write (line 116) | fn storage_write(&self) -> RwLockWriteGuard<'_, RawRwLock, ForkedStorage...
function fee_history (line 121) | pub async fn fee_history(
function get_proof (line 131) | pub async fn get_proof(
function storage_at (line 140) | pub async fn storage_at(
function logs (line 152) | pub async fn logs(&self, filter: &Filter) -> Result<Vec<Log>, TransportE...
function get_code (line 164) | pub async fn get_code(
function get_balance (line 184) | pub async fn get_balance(
function get_nonce (line 193) | pub async fn get_nonce(&self, address: Address, block: u64) -> Result<u6...
function get_account (line 198) | pub async fn get_account(
function trace_transaction (line 207) | pub async fn trace_transaction(&self, hash: B256) -> Result<Vec<Trace>, ...
function debug_trace_transaction (line 220) | pub async fn debug_trace_transaction(
function debug_code_by_hash (line 237) | pub async fn debug_code_by_hash(
function trace_block (line 245) | pub async fn trace_block(&self, number: u64) -> Result<Vec<Trace>, Trans...
function trace_replay_block_transactions (line 259) | pub async fn trace_replay_block_transactions(
function reset (line 270) | pub async fn reset(
function call (line 320) | pub async fn call(
function simulate_v1 (line 332) | pub async fn simulate_v1(
function estimate_gas (line 348) | pub async fn estimate_gas(
function create_access_list (line 360) | pub async fn create_access_list(
function transaction_by_block_number_and_index (line 368) | pub async fn transaction_by_block_number_and_index(
function transaction_by_block_hash_and_index (line 393) | pub async fn transaction_by_block_hash_and_index(
function transaction_by_hash (line 418) | pub async fn transaction_by_hash(
function block_by_hash (line 435) | pub async fn block_by_hash(
function block_by_hash_full (line 450) | pub async fn block_by_hash_full(
function block_by_number (line 460) | pub async fn block_by_number(
function block_by_number_full (line 481) | pub async fn block_by_number_full(
function fetch_full_block (line 498) | async fn fetch_full_block(
function convert_to_full_block (line 521) | fn convert_to_full_block(&self, mut block: N::BlockResponse) -> N::Block...
type ClientForkConfig (line 637) | pub struct ClientForkConfig<N: Network = AnyNetwork> {
function update_url (line 676) | fn update_url(&mut self, url: String) -> Result<(), BlockchainError> {
function update_block (line 693) | pub fn update_block(
type ForkedStorage (line 714) | pub struct ForkedStorage<N: Network = AnyNetwork> {
method default (line 729) | fn default() -> Self {
function clear (line 748) | pub fn clear(&mut self) {
FILE: crates/anvil/src/eth/backend/genesis.rs
type GenesisConfig (line 12) | pub struct GenesisConfig {
method account_infos (line 27) | pub fn account_infos(&self) -> impl Iterator<Item = (Address, AccountI...
method apply_genesis_json_alloc (line 42) | pub fn apply_genesis_json_alloc(
method genesis_to_account_info (line 61) | fn genesis_to_account_info(&self, acc: &GenesisAccount) -> AccountInfo {
FILE: crates/anvil/src/eth/backend/info.rs
type StorageInfo (line 16) | pub struct StorageInfo<N: Network> {
function new (line 21) | pub(crate) fn new(backend: Arc<Backend<N>>) -> Self {
function current_block (line 26) | pub fn current_block(&self) -> Option<Block> {
function block (line 31) | pub fn block(&self, hash: B256) -> Option<Block> {
function eth_block (line 36) | pub fn eth_block(&self, hash: B256) -> Option<AnyRpcBlock> {
function current_receipts (line 47) | pub fn current_receipts(&self) -> Option<Vec<N::ReceiptEnvelope>> {
function receipts (line 52) | pub fn receipts(&self, hash: B256) -> Option<Vec<N::ReceiptEnvelope>> {
function fmt (line 58) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
FILE: crates/anvil/src/eth/backend/mem/cache.rs
type DiskStateCache (line 13) | pub struct DiskStateCache {
method with_path (line 22) | pub fn with_path(self, temp_path: PathBuf) -> Self {
method with_cache_file (line 26) | fn with_cache_file<F, R>(&mut self, hash: B256, f: F) -> Option<R>
method write (line 61) | pub fn write(&mut self, hash: B256, state: &StateSnapshot) -> bool {
method read (line 78) | pub fn read(&mut self, hash: B256) -> Option<StateSnapshot> {
method remove (line 95) | pub fn remove(&mut self, hash: B256) {
method default (line 105) | fn default() -> Self {
function build_tmp_dir (line 113) | fn build_tmp_dir(p: Option<&Path>) -> io::Result<TempDir> {
function can_build_temp_dir (line 128) | fn can_build_temp_dir() {
FILE: crates/anvil/src/eth/backend/mem/fork_db.rs
method insert_account (line 21) | fn insert_account(&mut self, address: Address, account: AccountInfo) {
method set_storage_at (line 25) | fn set_storage_at(&mut self, address: Address, slot: B256, val: B256) ->...
method insert_block_hash (line 31) | fn insert_block_hash(&mut self, number: U256, hash: B256) {
method dump_state (line 35) | fn dump_state(
method snapshot_state (line 77) | fn snapshot_state(&mut self) -> U256 {
method revert_state (line 81) | fn revert_state(&mut self, id: U256, action: RevertStateSnapshotAction) ...
method current_state (line 85) | fn current_state(&self) -> StateDb {
method maybe_as_full_db (line 91) | fn maybe_as_full_db(&self) -> Option<&AddressMap<DbAccount>> {
method clear_into_state_snapshot (line 95) | fn clear_into_state_snapshot(&mut self) -> StateSnapshot {
method read_as_state_snapshot (line 103) | fn read_as_state_snapshot(&self) -> StateSnapshot {
method clear (line 111) | fn clear(&mut self) {
method init_from_state_snapshot (line 116) | fn init_from_state_snapshot(&mut self, state_snapshot: StateSnapshot) {
method maybe_as_full_db (line 126) | fn maybe_as_full_db(&self) -> Option<&AddressMap<DbAccount>> {
method clear_into_state_snapshot (line 130) | fn clear_into_state_snapshot(&mut self) -> StateSnapshot {
method read_as_state_snapshot (line 139) | fn read_as_state_snapshot(&self) -> StateSnapshot {
method clear (line 148) | fn clear(&mut self) {
method init_from_state_snapshot (line 153) | fn init_from_state_snapshot(&mut self, state_snapshot: StateSnapshot) {
method maybe_reset (line 159) | fn maybe_reset(&mut self, url: Option<String>, block_number: BlockId) ->...
method maybe_flush_cache (line 163) | fn maybe_flush_cache(&self) -> Result<(), String> {
method maybe_inner (line 168) | fn maybe_inner(&self) -> Result<&BlockchainDb, String> {
FILE: crates/anvil/src/eth/backend/mem/in_memory_db.rs
method insert_account (line 24) | fn insert_account(&mut self, address: Address, account: AccountInfo) {
method set_storage_at (line 28) | fn set_storage_at(&mut self, address: Address, slot: B256, val: B256) ->...
method insert_block_hash (line 32) | fn insert_block_hash(&mut self, number: U256, hash: B256) {
method dump_state (line 36) | fn dump_state(
method snapshot_state (line 79) | fn snapshot_state(&mut self) -> U256 {
method revert_state (line 85) | fn revert_state(&mut self, id: U256, action: RevertStateSnapshotAction) ...
method maybe_state_root (line 99) | fn maybe_state_root(&self) -> Option<B256> {
method current_state (line 103) | fn current_state(&self) -> StateDb {
method maybe_as_full_db (line 109) | fn maybe_as_full_db(&self) -> Option<&AddressMap<DbAccount>> {
method clear_into_state_snapshot (line 113) | fn clear_into_state_snapshot(&mut self) -> StateSnapshot {
method read_as_state_snapshot (line 117) | fn read_as_state_snapshot(&self) -> StateSnapshot {
method clear (line 121) | fn clear(&mut self) {
method init_from_state_snapshot (line 125) | fn init_from_state_snapshot(&mut self, snapshot: StateSnapshot) {
method maybe_reset (line 131) | fn maybe_reset(&mut self, _url: Option<String>, _block_number: BlockId) ...
method maybe_flush_cache (line 135) | fn maybe_flush_cache(&self) -> Result<(), String> {
method maybe_inner (line 139) | fn maybe_inner(&self) -> Result<&BlockchainDb, String> {
function test_dump_reload_cycle (line 154) | fn test_dump_reload_cycle() {
function test_load_state_merge (line 195) | fn test_load_state_merge() {
FILE: crates/anvil/src/eth/backend/mem/inspector.rs
type AnvilInspector (line 27) | pub struct AnvilInspector {
method print_logs (line 40) | pub fn print_logs(&self) {
method into_print_traces (line 47) | pub fn into_print_traces(mut self, decoder: Arc<CallTraceDecoder>) {
method print_traces (line 55) | pub fn print_traces(&self, decoder: Arc<CallTraceDecoder>) {
method with_tracing (line 62) | pub fn with_tracing(mut self) -> Self {
method with_tracing_config (line 68) | pub fn with_tracing_config(mut self, config: TracingInspectorConfig) -...
method with_steps_tracing (line 74) | pub fn with_steps_tracing(mut self) -> Self {
method with_log_collector (line 80) | pub fn with_log_collector(mut self) -> Self {
method with_transfers (line 86) | pub fn with_transfers(mut self) -> Self {
method with_trace_printer (line 92) | pub fn with_trace_printer(mut self) -> Self {
method initialize_interp (line 123) | fn initialize_interp(&mut self, interp: &mut Interpreter, ecx: &mut CT...
method step (line 129) | fn step(&mut self, interp: &mut Interpreter, ecx: &mut CTX) {
method step_end (line 135) | fn step_end(&mut self, interp: &mut Interpreter, ecx: &mut CTX) {
method log (line 142) | fn log(&mut self, ecx: &mut CTX, log: Log) {
method log_full (line 149) | fn log_full(&mut self, interp: &mut Interpreter, ecx: &mut CTX, log: L...
method call (line 155) | fn call(&mut self, ecx: &mut CTX, inputs: &mut CallInputs) -> Option<C...
method call_end (line 164) | fn call_end(&mut self, ecx: &mut CTX, inputs: &CallInputs, outcome: &m...
method create (line 170) | fn create(&mut self, ecx: &mut CTX, inputs: &mut CreateInputs) -> Opti...
method create_end (line 179) | fn create_end(&mut self, ecx: &mut CTX, inputs: &CreateInputs, outcome...
method selfdestruct (line 185) | fn selfdestruct(&mut self, contract: Address, target: Address, value: ...
function print_traces (line 105) | fn print_traces(tracer: TracingInspector, decoder: Arc<CallTraceDecoder>) {
function print_logs (line 193) | pub fn print_logs(logs: &[Log]) {
FILE: crates/anvil/src/eth/backend/mem/mod.rs
type DatabaseRef (line 147) | pub trait DatabaseRef: revm::DatabaseRef<Error = DatabaseError> + Debug {}
constant MIN_TRANSACTION_GAS (line 152) | pub const MIN_TRANSACTION_GAS: u128 = 21000;
constant MIN_CREATE_GAS (line 154) | pub const MIN_CREATE_GAS: u128 = 53000;
type State (line 156) | pub type State = foundry_evm::utils::StateChangeset;
type BlockRequest (line 159) | pub enum BlockRequest<T> {
function fmt (line 165) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function block_number (line 174) | pub fn block_number(&self) -> BlockNumber {
type Backend (line 183) | pub struct Backend<N: Network> {
method clone (line 245) | fn clone(&self) -> Self {
function fmt (line 274) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function impersonate (line 284) | pub fn impersonate(&self, addr: Address) -> bool {
function stop_impersonating (line 297) | pub fn stop_impersonating(&self, addr: Address) {
function auto_impersonate_account (line 302) | pub fn auto_impersonate_account(&self, enabled: bool) {
function get_fork (line 307) | pub fn get_fork(&self) -> Option<ClientFork> {
function get_db (line 312) | pub fn get_db(&self) -> &Arc<AsyncRwLock<Box<dyn Db>>> {
function get_account (line 317) | pub async fn get_account(&self, address: Address) -> DatabaseResult<Acco...
function is_fork (line 322) | pub fn is_fork(&self) -> bool {
function set_create2_deployer (line 327) | pub async fn set_create2_deployer(&self, address: Address) -> DatabaseRe...
function update_interval_mine_block_time (line 333) | pub(crate) fn update_interval_mine_block_time(&self, block_time: Duratio...
function time (line 338) | pub fn time(&self) -> &TimeManager {
function cheats (line 343) | pub fn cheats(&self) -> &CheatsManager {
function skip_blob_validation (line 348) | pub fn skip_blob_validation(&self, impersonator: Option<Address>) -> bool {
function fees (line 355) | pub fn fees(&self) -> &FeeManager {
function env (line 360) | pub fn env(&self) -> &Arc<RwLock<Env>> {
function best_hash (line 365) | pub fn best_hash(&self) -> B256 {
function best_number (line 370) | pub fn best_number(&self) -> u64 {
function set_block_number (line 375) | pub fn set_block_number(&self, number: u64) {
function coinbase (line 381) | pub fn coinbase(&self) -> Address {
function chain_id (line 386) | pub fn chain_id(&self) -> U256 {
function set_chain_id (line 390) | pub fn set_chain_id(&self, chain_id: u64) {
function genesis_time (line 395) | pub fn genesis_time(&self) -> u64 {
function current_balance (line 400) | pub async fn current_balance(&self, address: Address) -> DatabaseResult<...
function current_nonce (line 405) | pub async fn current_nonce(&self, address: Address) -> DatabaseResult<u6...
function set_coinbase (line 410) | pub fn set_coinbase(&self, address: Address) {
function set_nonce (line 415) | pub async fn set_nonce(&self, address: Address, nonce: U256) -> Database...
function set_balance (line 420) | pub async fn set_balance(&self, address: Address, balance: U256) -> Data...
function set_code (line 425) | pub async fn set_code(&self, address: Address, code: Bytes) -> DatabaseR...
function set_storage_at (line 430) | pub async fn set_storage_at(
function spec_id (line 440) | pub fn spec_id(&self) -> SpecId {
function is_eip1559 (line 445) | pub fn is_eip1559(&self) -> bool {
function is_eip3675 (line 450) | pub fn is_eip3675(&self) -> bool {
function is_eip2930 (line 455) | pub fn is_eip2930(&self) -> bool {
function is_eip4844 (line 460) | pub fn is_eip4844(&self) -> bool {
function is_eip7702 (line 465) | pub fn is_eip7702(&self) -> bool {
function is_optimism (line 470) | pub fn is_optimism(&self) -> bool {
function precompiles (line 475) | pub fn precompiles(&self) -> BTreeMap<String, Address> {
function system_contracts (line 497) | pub fn system_contracts(&self) -> BTreeMap<SystemContract, Address> {
function blob_params (line 514) | pub fn blob_params(&self) -> BlobParams {
function ensure_eip1559_active (line 529) | pub fn ensure_eip1559_active(&self) -> Result<(), BlockchainError> {
function ensure_eip2930_active (line 537) | pub fn ensure_eip2930_active(&self) -> Result<(), BlockchainError> {
function ensure_eip4844_active (line 544) | pub fn ensure_eip4844_active(&self) -> Result<(), BlockchainError> {
function ensure_eip7702_active (line 551) | pub fn ensure_eip7702_active(&self) -> Result<(), BlockchainError> {
function ensure_op_deposits_active (line 559) | pub fn ensure_op_deposits_active(&self) -> Result<(), BlockchainError> {
function gas_limit (line 567) | pub fn gas_limit(&self) -> u64 {
function set_gas_limit (line 572) | pub fn set_gas_limit(&self, gas_limit: u64) {
function base_fee (line 577) | pub fn base_fee(&self) -> u64 {
function is_min_priority_fee_enforced (line 582) | pub fn is_min_priority_fee_enforced(&self) -> bool {
function excess_blob_gas_and_price (line 586) | pub fn excess_blob_gas_and_price(&self) -> Option<BlobExcessGasAndPrice> {
function set_base_fee (line 591) | pub fn set_base_fee(&self, basefee: u64) {
function set_gas_price (line 596) | pub fn set_gas_price(&self, price: u128) {
function elasticity (line 600) | pub fn elasticity(&self) -> f64 {
function total_difficulty (line 608) | pub fn total_difficulty(&self) -> U256 {
function create_state_snapshot (line 615) | pub async fn create_state_snapshot(&self) -> U256 {
function list_state_snapshots (line 624) | pub fn list_state_snapshots(&self) -> BTreeMap<U256, (u64, B256)> {
function next_env (line 629) | fn next_env(&self) -> Env {
function build_inspector (line 640) | fn build_inspector(&self) -> AnvilInspector {
function new_block_notifications (line 654) | pub fn new_block_notifications(&self) -> NewBlockNotifications {
function notify_on_new_block (line 662) | fn notify_on_new_block(&self, header: Header, hash: B256) {
function convert_block_number (line 675) | pub fn convert_block_number(&self, block: Option<BlockNumber>) -> u64 {
function get_block_with_hash (line 687) | fn get_block_with_hash(&self, id: impl Into<BlockId>) -> Option<(Block, ...
function get_block (line 719) | pub fn get_block(&self, id: impl Into<BlockId>) -> Option<Block> {
function get_block_by_hash (line 723) | pub fn get_block_by_hash(&self, hash: B256) -> Option<Block> {
function mined_parity_trace_transaction (line 728) | pub(crate) fn mined_parity_trace_transaction(
function mined_parity_trace_block (line 736) | pub(crate) fn mined_parity_trace_block(
function mined_transaction (line 750) | pub(crate) fn mined_transaction(&self, hash: B256) -> Option<MinedTransa...
function impersonate_signature (line 755) | pub async fn impersonate_signature(
function debug_code_by_hash (line 765) | pub async fn debug_code_by_hash(
function debug_db_get (line 787) | pub async fn debug_db_get(&self, key: String) -> Result<Option<Bytes>, B...
function mined_block_by_hash (line 816) | fn mined_block_by_hash(&self, hash: B256) -> Option<AnyRpcBlock> {
function mined_transactions_by_block_number (line 821) | pub(crate) async fn mined_transactions_by_block_number(
function mined_transactions_in_block (line 832) | pub(crate) fn mined_transactions_in_block(
function mined_block_by_number (line 849) | pub fn mined_block_by_number(&self, number: BlockNumber) -> Option<AnyRp...
function get_full_block (line 856) | pub fn get_full_block(&self, id: impl Into<BlockId>) -> Option<AnyRpcBlo...
function convert_block (line 865) | pub fn convert_block(&self, block: Block) -> AnyRpcBlock {
function convert_block_with_hash (line 871) | pub fn convert_block_with_hash(&self, block: Block, known_hash: Option<B...
function block_by_hash (line 905) | pub async fn block_by_hash(&self, hash: B256) -> Result<Option<AnyRpcBlo...
function block_by_hash_full (line 918) | pub async fn block_by_hash_full(
function block_by_number (line 934) | pub async fn block_by_number(
function block_by_number_full (line 953) | pub async fn block_by_number_full(
function ensure_block_number (line 977) | pub async fn ensure_block_number<T: Into<BlockId>>(
function new_eth_evm_with_inspector_ref (line 1008) | fn new_eth_evm_with_inspector_ref<'db, I, DB>(
function build_call_env (line 1049) | fn build_call_env(
function call_with_state (line 1154) | pub fn call_with_state(
function build_access_list_with_state (line 1187) | pub fn build_access_list_with_state(
function get_code_with_state (line 1216) | pub fn get_code_with_state(
function get_balance_with_state (line 1235) | pub fn get_balance_with_state<D>(
function transaction_by_block_number_and_index (line 1247) | pub async fn transaction_by_block_number_and_index(
function transaction_by_block_hash_and_index (line 1268) | pub async fn transaction_by_block_hash_and_index(
function mined_transaction_by_block_hash_and_index (line 1284) | pub fn mined_transaction_by_block_hash_and_index(
function transaction_by_hash (line 1307) | pub async fn transaction_by_hash(
function mined_transaction_by_hash (line 1326) | pub fn mined_transaction_by_hash(&self, hash: B256) -> Option<AnyRpcTran...
function trace_transaction (line 1346) | pub async fn trace_transaction(
function trace_block (line 1362) | pub async fn trace_block(
function trace_replay_block_transactions (line 1381) | pub async fn trace_replay_block_transactions(
function mined_parity_trace_replay_block_transactions (line 1406) | fn mined_parity_trace_replay_block_transactions(
function replay_block_transactions_with_inspector (line 1428) | fn replay_block_transactions_with_inspector(
function trace_filter (line 1480) | pub async fn trace_filter(
function get_blobs_by_block_id (line 1528) | pub fn get_blobs_by_block_id(
function get_blob_by_versioned_hash (line 1552) | pub fn get_blob_by_versioned_hash(&self, hash: B256) -> Result<Option<Bl...
function with_genesis (line 1577) | pub async fn with_genesis(
function apply_genesis (line 1683) | async fn apply_genesis(&self) -> Result<(), DatabaseError> {
function reset_fork (line 1739) | pub async fn reset_fork(&self, forking: Forking) -> Result<(), Blockchai...
function reset_to_in_mem (line 1845) | pub async fn reset_to_in_mem(&self) -> Result<(), BlockchainError> {
function reset_block_number (line 1892) | async fn reset_block_number(
function revert_state_snapshot (line 1913) | pub async fn revert_state_snapshot(&self, id: U256) -> Result<bool, Bloc...
function inspect_tx (line 1960) | pub async fn inspect_tx(
function mined_logs_for_block (line 2010) | fn mined_logs_for_block(&self, filter: Filter, block: Block, block_hash:...
function logs_for_block (line 2044) | async fn logs_for_block(
function logs_for_range (line 2061) | async fn logs_for_range(
function logs (line 2098) | pub async fn logs(&self, filter: Filter) -> Result<Vec<Log>, BlockchainE...
function mined_receipts (line 2117) | pub fn mined_receipts(&self, hash: B256) -> Option<Vec<N::ReceiptEnvelop...
function mine_block (line 2139) | pub async fn mine_block(
function do_mine_block (line 2146) | async fn do_mine_block(
function reorg (line 2602) | pub async fn reorg(
function pending_block (line 2627) | pub async fn pending_block(
function with_pending_block (line 2637) | pub async fn with_pending_block<F, T>(
function call (line 2897) | pub async fn call(
function call_with_tracing (line 2921) | pub async fn call_with_tracing(
function with_database_at (line 3076) | pub async fn with_database_at<F, T>(
function storage_at (line 3131) | pub async fn storage_at(
function get_code (line 3149) | pub async fn get_code(
function get_balance (line 3160) | pub async fn get_balance(
function get_account_at_block (line 3169) | pub async fn get_account_at_block(
function get_nonce (line 3189) | pub async fn get_nonce(
function replay_tx_with_inspector (line 3211) | fn replay_tx_with_inspector<I, F, T>(
function trace_tx_with_js_tracer (line 3427) | pub async fn trace_tx_with_js_tracer(
function prove_account_at (line 3457) | pub async fn prove_account_at(
function rollback (line 3514) | pub async fn rollback(&self, common_block: Block) -> Result<(), Blockcha...
function serialized_state (line 3591) | pub async fn serialized_state(
function dump_state (line 3619) | pub async fn dump_state(
function load_state (line 3632) | pub async fn load_state(&self, state: SerializableState) -> Result<bool,...
function load_state_bytes (line 3721) | pub async fn load_state_bytes(&self, buf: Bytes) -> Result<bool, Blockch...
function simulate (line 3740) | pub async fn simulate(
function get_receipts (line 3956) | fn get_receipts(
function debug_trace_transaction (line 3973) | pub async fn debug_trace_transaction(
function geth_trace (line 3998) | fn geth_trace(
function mined_geth_trace_transaction (line 4086) | async fn mined_geth_trace_transaction(
function transaction_receipt (line 4094) | pub async fn transaction_receipt(
function mined_block_receipts (line 4117) | pub fn mined_block_receipts(&self, id: impl Into<BlockId>) -> Option<Vec...
function mined_transaction_receipt (line 4130) | pub(crate) fn mined_transaction_receipt(
function block_receipts (line 4181) | pub async fn block_receipts(
function get_blob_by_tx_hash (line 4205) | pub fn get_blob_by_tx_hash(&self, hash: B256) -> Result<Option<Vec<alloy...
function get_pool_transactions_nonce (line 4219) | fn get_pool_transactions_nonce(
function validate_pool_transaction (line 4237) | async fn validate_pool_transaction(
function validate_pool_transaction_for (line 4247) | fn validate_pool_transaction_for(
function validate_for (line 4418) | fn validate_for(
function transaction_build (line 4433) | pub fn transaction_build(
function prove_storage (line 4546) | pub fn prove_storage(storage: &HashMap<U256, U256>, keys: &[B256]) -> (B...
function is_arbitrum (line 4571) | pub fn is_arbitrum(chain_id: u64) -> bool {
function op_haltreason_to_instruction_result (line 4578) | pub fn op_haltreason_to_instruction_result(op_reason: OpHaltReason) -> I...
function test_deterministic_block_mining (line 4590) | async fn test_deterministic_block_mining() {
FILE: crates/anvil/src/eth/backend/mem/state.rs
function build_root (line 11) | pub fn build_root(values: impl IntoIterator<Item = (Nibbles, Vec<u8>)>) ...
function state_root (line 20) | pub fn state_root(accounts: &AddressMap<DbAccount>) -> B256 {
function storage_root (line 25) | pub fn storage_root(storage: &HashMap<U256, U256>) -> B256 {
function trie_storage (line 30) | pub fn trie_storage(storage: &HashMap<U256, U256>) -> Vec<(Nibbles, Vec<...
function trie_accounts (line 44) | pub fn trie_accounts(accounts: &AddressMap<DbAccount>) -> Vec<(Nibbles, ...
function trie_account_rlp (line 58) | pub fn trie_account_rlp(info: &AccountInfo, storage: &HashMap<U256, U256...
FILE: crates/anvil/src/eth/backend/mem/storage.rs
constant DEFAULT_HISTORY_LIMIT (line 43) | pub const DEFAULT_HISTORY_LIMIT: usize = 500;
constant MIN_HISTORY_LIMIT (line 44) | const MIN_HISTORY_LIMIT: usize = 10;
constant MAX_ON_DISK_HISTORY_LIMIT (line 46) | const MAX_ON_DISK_HISTORY_LIMIT: usize = 3_600;
type InMemoryBlockStates (line 49) | pub struct InMemoryBlockStates {
method new (line 72) | pub fn new(in_memory_limit: usize, on_disk_limit: usize) -> Self {
method memory_only (line 86) | pub fn memory_only(mut self) -> Self {
method disk_path (line 92) | pub fn disk_path(mut self, path: PathBuf) -> Self {
method update_interval_mine_block_time (line 101) | pub fn update_interval_mine_block_time(&mut self, block_time: Duration) {
method is_memory_only (line 113) | fn is_memory_only(&self) -> bool {
method insert (line 127) | pub fn insert(&mut self, hash: B256, state: StateDb) {
method enforce_limits (line 141) | fn enforce_limits(&mut self) {
method get_state (line 181) | pub fn get_state(&self, hash: &B256) -> Option<&StateDb> {
method get_on_disk_state (line 186) | pub fn get_on_disk_state(&mut self, hash: &B256) -> Option<&StateDb> {
method set_cache_limit (line 198) | pub fn set_cache_limit(&mut self, limit: usize) {
method clear (line 203) | pub fn clear(&mut self) {
method serialized_states (line 213) | pub fn serialized_states(&mut self) -> SerializableHistoricalStates {
method load_states (line 232) | pub fn load_states(&mut self, states: SerializableHistoricalStates) {
method fmt (line 242) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method default (line 254) | fn default() -> Self {
type BlockchainStorage (line 262) | pub struct BlockchainStorage<N: Network> {
function new (line 282) | pub fn new(
function forked (line 330) | pub fn forked(block_number: u64, block_hash: B256, total_difficulty: U25...
function unwind_to (line 349) | pub fn unwind_to(&mut self, block_number: u64, block_hash: B256) -> Vec<...
function empty (line 369) | pub fn empty() -> Self {
function remove_block_transactions_by_number (line 382) | pub fn remove_block_transactions_by_number(&mut self, num: u64) {
function remove_block_transactions (line 389) | pub fn remove_block_transactions(&mut self, block_hash: B256) {
function serialized_blocks (line 399) | pub fn serialized_blocks(&self) -> Vec<SerializableBlock> {
function load_blocks (line 404) | pub fn load_blocks(&mut self, serializable_blocks: Vec<SerializableBlock...
function hash (line 422) | pub fn hash(&self, number: BlockNumberOrTag) -> Option<B256> {
function serialized_transactions (line 448) | pub fn serialized_transactions(&self) -> Vec<SerializableTransaction> {
function load_transactions (line 456) | pub fn load_transactions(&mut self, serializable_transactions: Vec<Seria...
type Blockchain (line 467) | pub struct Blockchain<N: Network> {
function new (line 474) | pub fn new(
function forked (line 492) | pub fn forked(block_number: u64, block_hash: B256, total_difficulty: U25...
function hash (line 503) | pub fn hash(&self, id: BlockId) -> Option<B256> {
function get_block_by_hash (line 510) | pub fn get_block_by_hash(&self, hash: &B256) -> Option<Block> {
function get_transaction_by_hash (line 514) | pub fn get_transaction_by_hash(&self, hash: &B256) -> Option<MinedTransa...
function blocks_count (line 519) | pub fn blocks_count(&self) -> usize {
type MinedBlockOutcome (line 525) | pub struct MinedBlockOutcome<T> {
method clone (line 536) | fn clone(&self) -> Self {
function fmt (line 546) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type MinedTransaction (line 557) | pub struct MinedTransaction<N: Network> {
function parity_traces (line 566) | pub fn parity_traces(&self) -> Vec<LocalizedTransactionTrace> {
function ots_internal_operations (line 582) | pub fn ots_internal_operations(&self) -> Vec<InternalOperation> {
type MinedTransactionReceipt (line 610) | pub struct MinedTransactionReceipt<N: Network> {
function test_interval_update (line 626) | fn test_interval_update() {
function test_init_state_limits (line 633) | fn test_init_state_limits() {
function can_read_write_cached_state (line 656) | async fn can_read_write_cached_state() {
function can_decrease_state_cache_size (line 681) | async fn can_decrease_state_cache_size() {
function test_storage_dump_reload_cycle (line 723) | fn test_storage_dump_reload_cycle() {
FILE: crates/anvil/src/eth/backend/notifications.rs
type NewBlockNotification (line 10) | pub struct NewBlockNotification {
type NewBlockNotifications (line 18) | pub type NewBlockNotifications = UnboundedReceiver<NewBlockNotification>;
FILE: crates/anvil/src/eth/backend/time.rs
function utc_from_secs (line 9) | pub fn utc_from_secs(secs: u64) -> DateTime<Utc> {
type TimeManager (line 15) | pub struct TimeManager {
method new (line 29) | pub fn new(start_timestamp: u64) -> Self {
method reset (line 42) | pub fn reset(&self, start_timestamp: u64) {
method offset (line 49) | pub fn offset(&self) -> i128 {
method add_offset (line 54) | fn add_offset(&self, offset: i128) -> i128 {
method increase_time (line 65) | pub fn increase_time(&self, seconds: u64) -> i128 {
method set_next_block_timestamp (line 71) | pub fn set_next_block_timestamp(&self, timestamp: u64) -> Result<(), B...
method set_block_timestamp_interval (line 86) | pub fn set_block_timestamp_interval(&self, interval: u64) {
method remove_block_timestamp_interval (line 92) | pub fn remove_block_timestamp_interval(&self) -> bool {
method compute_next_timestamp (line 102) | fn compute_next_timestamp(&self) -> (u64, Option<i128>) {
method next_timestamp (line 123) | pub fn next_timestamp(&self) -> u64 {
method current_call_timestamp (line 135) | pub fn current_call_timestamp(&self) -> u64 {
function duration_since_unix_epoch (line 142) | pub fn duration_since_unix_epoch() -> Duration {
FILE: crates/anvil/src/eth/backend/validate.rs
type TransactionValidator (line 12) | pub trait TransactionValidator<T> {
method validate_pool_transaction (line 17) | async fn validate_pool_transaction(
method validate_pool_transaction_for (line 23) | fn validate_pool_transaction_for(
method validate_for (line 33) | fn validate_for(
FILE: crates/anvil/src/eth/error.rs
type Result (line 23) | pub(crate) type Result<T> = std::result::Result<T, BlockchainError>;
type BlockchainError (line 26) | pub enum BlockchainError {
method from (line 130) | fn from(err: eyre::Report) -> Self {
method from (line 136) | fn from(err: RpcError) -> Self {
method from (line 145) | fn from(err: EVMError<T>) -> Self {
method from (line 162) | fn from(err: EVMError<T, OpTransactionError>) -> Self {
method from (line 185) | fn from(value: WalletError) -> Self {
method from (line 194) | fn from(value: StateOverrideError<E>) -> Self {
type PoolError (line 207) | pub enum PoolError {
type FeeHistoryError (line 219) | pub enum FeeHistoryError {
type ErrDetail (line 227) | pub struct ErrDetail {
type InvalidTransactionError (line 233) | pub enum InvalidTransactionError {
method from (line 334) | fn from(err: InvalidTransaction) -> Self {
method from (line 390) | fn from(value: OpTransactionError) -> Self {
type ToRpcResponseResult (line 400) | pub(crate) trait ToRpcResponseResult {
method to_rpc_result (line 401) | fn to_rpc_result(self) -> ResponseResult;
method to_rpc_result (line 416) | fn to_rpc_result(self) -> ResponseResult {
function to_rpc_result (line 405) | pub fn to_rpc_result<T: Serialize>(val: T) -> ResponseResult {
FILE: crates/anvil/src/eth/fees.rs
constant MAX_FEE_HISTORY_CACHE_SIZE (line 23) | pub const MAX_FEE_HISTORY_CACHE_SIZE: u64 = 2048u64;
constant INITIAL_BASE_FEE (line 26) | pub const INITIAL_BASE_FEE: u64 = 1_000_000_000;
constant INITIAL_GAS_PRICE (line 29) | pub const INITIAL_GAS_PRICE: u128 = 1_875_000_000;
constant BASE_FEE_CHANGE_DENOMINATOR (line 32) | pub const BASE_FEE_CHANGE_DENOMINATOR: u128 = 8;
constant MIN_SUGGESTED_PRIORITY_FEE (line 35) | pub const MIN_SUGGESTED_PRIORITY_FEE: u128 = 1e9 as u128;
type FeeManager (line 39) | pub struct FeeManager {
method new (line 64) | pub fn new(
method base_fee_params (line 87) | pub fn base_fee_params(&self) -> BaseFeeParams {
method elasticity (line 91) | pub fn elasticity(&self) -> f64 {
method is_eip1559 (line 96) | pub fn is_eip1559(&self) -> bool {
method is_eip4844 (line 100) | pub fn is_eip4844(&self) -> bool {
method blob_gas_price (line 105) | pub fn blob_gas_price(&self) -> u128 {
method base_fee (line 109) | pub fn base_fee(&self) -> u64 {
method is_min_priority_fee_enforced (line 113) | pub fn is_min_priority_fee_enforced(&self) -> bool {
method raw_gas_price (line 118) | pub fn raw_gas_price(&self) -> u128 {
method excess_blob_gas_and_price (line 122) | pub fn excess_blob_gas_and_price(&self) -> Option<BlobExcessGasAndPric...
method base_fee_per_blob_gas (line 126) | pub fn base_fee_per_blob_gas(&self) -> u128 {
method set_gas_price (line 131) | pub fn set_gas_price(&self, price: u128) {
method set_base_fee (line 137) | pub fn set_base_fee(&self, fee: u64) {
method set_blob_excess_gas_and_price (line 144) | pub fn set_blob_excess_gas_and_price(&self, blob_excess_gas_and_price:...
method get_next_block_base_fee_per_gas (line 151) | pub fn get_next_block_base_fee_per_gas(
method get_next_block_blob_base_fee_per_gas (line 167) | pub fn get_next_block_blob_base_fee_per_gas(&self) -> u128 {
method get_next_block_blob_excess_gas (line 173) | pub fn get_next_block_blob_excess_gas(&self, blob_excess_gas: u64, blo...
method set_blob_params (line 182) | pub fn set_blob_params(&self, blob_params: BlobParams) {
method blob_params (line 187) | pub fn blob_params(&self) -> BlobParams {
type FeeHistoryService (line 193) | pub struct FeeHistoryService {
method new (line 207) | pub fn new(
method fee_history_limit (line 223) | pub fn fee_history_limit(&self) -> u64 {
method insert_cache_entry_for_block (line 228) | pub(crate) fn insert_cache_entry_for_block(&self, hash: B256, header: ...
method create_cache_entry (line 234) | fn create_cache_entry(
method insert_cache_entry (line 328) | fn insert_cache_entry(&self, item: FeeHistoryCacheItem, block_number: ...
type Output (line 348) | type Output = ();
method poll (line 350) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
type FeeHistoryCache (line 362) | pub type FeeHistoryCache = Arc<Mutex<BTreeMap<u64, FeeHistoryCacheItem>>>;
type FeeHistoryCacheItem (line 366) | pub struct FeeHistoryCacheItem {
type FeeDetails (line 377) | pub struct FeeDetails {
method zero (line 386) | pub fn zero() -> Self {
method or_zero_fees (line 396) | pub fn or_zero_fees(self) -> Self {
method split (line 409) | pub fn split(self) -> (Option<u128>, Option<u128>, Option<u128>, Optio...
method new (line 416) | pub fn new(
method fmt (line 469) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
FILE: crates/anvil/src/eth/miner.rs
type Miner (line 19) | pub struct Miner<T> {
method clone (line 32) | fn clone(&self) -> Self {
function fmt (line 42) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function new (line 52) | pub fn new(mode: MiningMode) -> Self {
function with_forced_transactions (line 64) | pub fn with_forced_transactions(
function mode_write (line 74) | pub fn mode_write(&self) -> RwLockWriteGuard<'_, RawRwLock, MiningMode> {
function is_auto_mine (line 79) | pub fn is_auto_mine(&self) -> bool {
function get_interval (line 84) | pub fn get_interval(&self) -> Option<u64> {
function set_mining_mode (line 93) | pub fn set_mining_mode(&self, mode: MiningMode) {
function poll (line 104) | pub fn poll(
type MinerInner (line 122) | pub struct MinerInner {
method wake (line 128) | fn wake(&self) {
method register (line 132) | fn register(&self, cx: &Context<'_>) {
method default (line 138) | fn default() -> Self {
type MiningMode (line 145) | pub enum MiningMode {
method instant (line 161) | pub fn instant(max_transactions: usize, listener: Receiver<TxHash>) ->...
method interval (line 169) | pub fn interval(duration: Duration) -> Self {
method mixed (line 173) | pub fn mixed(max_transactions: usize, listener: Receiver<TxHash>, dura...
method poll (line 181) | pub fn poll<T>(
type FixedBlockTimeMiner (line 222) | pub struct FixedBlockTimeMiner {
method new (line 229) | pub fn new(duration: Duration) -> Self {
method poll (line 238) | fn poll<T>(
method default (line 252) | fn default() -> Self {
type ReadyTransactionMiner (line 258) | pub struct ReadyTransactionMiner {
method poll (line 268) | fn poll<T>(
method fmt (line 297) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
FILE: crates/anvil/src/eth/otterscan/api.rs
function erigon_get_header_by_number (line 32) | pub async fn erigon_get_header_by_number(
function ots_get_api_level (line 43) | pub async fn ots_get_api_level(&self) -> Result<u64> {
function ots_get_internal_operations (line 52) | pub async fn ots_get_internal_operations(&self, hash: B256) -> Result<Ve...
function ots_has_code (line 62) | pub async fn ots_has_code(&self, address: Address, block_number: BlockNu...
function ots_trace_transaction (line 72) | pub async fn ots_trace_transaction(&self, hash: B256) -> Result<Vec<Trac...
function ots_get_transaction_error (line 85) | pub async fn ots_get_transaction_error(&self, hash: B256) -> Result<Byte...
function ots_get_block_details (line 100) | pub async fn ots_get_block_details(
function ots_get_block_details_by_hash (line 117) | pub async fn ots_get_block_details_by_hash(
function ots_get_block_transactions (line 133) | pub async fn ots_get_block_transactions(
function ots_search_transactions_before (line 148) | pub async fn ots_search_transactions_before(
function ots_search_transactions_after (line 192) | pub async fn ots_search_transactions_after(
function ots_get_transaction_by_sender_and_nonce (line 244) | pub async fn ots_get_transaction_by_sender_and_nonce(
function ots_get_contract_creator (line 269) | pub async fn ots_get_contract_creator(&self, addr: Address) -> Result<Op...
function build_ots_block_details (line 314) | pub async fn build_ots_block_details(
function build_ots_block_tx (line 357) | pub async fn build_ots_block_tx(
function build_ots_search_transactions (line 402) | pub async fn build_ots_search_transactions(
FILE: crates/anvil/src/eth/pool/mod.rs
type Pool (line 50) | pub struct Pool<T> {
method default (line 58) | fn default() -> Self {
function ready_transactions (line 67) | pub fn ready_transactions(&self) -> TransactionsIterator<T> {
function pending_transactions (line 72) | pub fn pending_transactions(&self) -> Vec<Arc<PoolTransaction<T>>> {
function txpool_status (line 77) | pub fn txpool_status(&self) -> TxpoolStatus {
function add_ready_listener (line 86) | pub fn add_ready_listener(&self) -> Receiver<TxHash> {
function contains (line 94) | pub fn contains(&self, tx_hash: &TxHash) -> bool {
function clear (line 99) | pub fn clear(&self) {
function remove_invalid (line 105) | pub fn remove_invalid(&self, tx_hashes: Vec<TxHash>) -> Vec<Arc<PoolTran...
function remove_transactions_by_address (line 110) | pub fn remove_transactions_by_address(&self, sender: Address) -> Vec<Arc...
function drop_transaction (line 119) | pub fn drop_transaction(&self, tx: TxHash) -> Option<Arc<PoolTransaction...
function notify_ready (line 135) | fn notify_ready(&self, tx: &AddedTransaction<T>) {
function notify_listener (line 145) | fn notify_listener(&self, hash: TxHash) {
function get_transaction (line 174) | pub fn get_transaction(&self, hash: TxHash) -> Option<PendingTransaction...
function on_mined_block (line 183) | pub fn on_mined_block(&self, outcome: MinedBlockOutcome<T>) -> PruneResu...
function prune_markers (line 200) | pub fn prune_markers(
function add_transaction (line 214) | pub fn add_transaction(
type PoolInner (line 228) | struct PoolInner<T> {
method default (line 234) | fn default() -> Self {
function ready_transactions (line 243) | fn ready_transactions(&self) -> TransactionsIterator<T> {
function clear (line 248) | fn clear(&mut self) {
function transactions_by_sender (line 254) | pub fn transactions_by_sender(
function contains (line 272) | fn contains(&self, tx_hash: &TxHash) -> bool {
function remove_invalid (line 277) | fn remove_invalid(&mut self, tx_hashes: Vec<TxHash>) -> Vec<Arc<PoolTran...
function remove_transactions_by_address (line 293) | fn remove_transactions_by_address(&mut self, sender: Address) -> Vec<Arc...
function get_transaction (line 316) | fn get_transaction(&self, hash: TxHash) -> Option<PendingTransaction<T>> {
function add_transaction (line 327) | fn add_transaction(
function add_ready_transaction (line 349) | fn add_ready_transaction(
function prune_markers (line 407) | pub fn prune_markers(&mut self, markers: impl IntoIterator<Item = TxMark...
type PruneResult (line 436) | pub struct PruneResult<T> {
function fmt (line 446) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
type ReadyTransaction (line 465) | pub struct ReadyTransaction<T> {
function new (line 477) | pub fn new(hash: TxHash) -> Self {
type AddedTransaction (line 488) | pub enum AddedTransaction<T> {
function hash (line 499) | pub fn hash(&self) -> &TxHash {
FILE: crates/anvil/src/eth/pool/transactions.rs
type TxMarker (line 14) | pub type TxMarker = Vec<u8>;
type ReplacedTransactions (line 18) | type ReplacedTransactions<T> = (Vec<Arc<PoolTransaction<T>>>, Vec<TxHash>);
function to_marker (line 21) | pub fn to_marker(nonce: u64, from: Address) -> TxMarker {
type TransactionOrder (line 32) | pub enum TransactionOrder {
method priority (line 45) | pub fn priority<T: Transaction>(&self, tx: &T) -> TransactionPriority {
type Err (line 54) | type Err = String;
method from_str (line 56) | fn from_str(s: &str) -> Result<Self, Self::Err> {
type TransactionPriority (line 72) | pub struct TransactionPriority(pub u128);
type PoolTransaction (line 76) | pub struct PoolTransaction<T> {
function new (line 90) | pub fn new(transaction: PendingTransaction<T>) -> Self {
function hash (line 100) | pub fn hash(&self) -> TxHash {
function max_fee_per_gas (line 107) | pub fn max_fee_per_gas(&self) -> u128 {
function tx_type (line 114) | pub fn tx_type(&self) -> u8 {
function fmt (line 120) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
type Error (line 132) | type Error = eyre::Error;
function try_from (line 133) | fn try_from(value: AnyRpcTransaction) -> Result<Self, Self::Error> {
type PendingTransactions (line 149) | pub struct PendingTransactions<T> {
method default (line 159) | fn default() -> Self {
function len (line 170) | pub fn len(&self) -> usize {
function is_empty (line 174) | pub fn is_empty(&self) -> bool {
function clear (line 179) | pub fn clear(&mut self) {
function transactions (line 186) | pub fn transactions(&self) -> impl Iterator<Item = Arc<PoolTransaction<T...
function contains (line 191) | pub fn contains(&self, hash: &TxHash) -> bool {
function get (line 196) | pub fn get(&self, hash: &TxHash) -> Option<&PendingPoolTransaction<T>> {
function mark_and_unlock (line 204) | pub fn mark_and_unlock(
function remove (line 232) | pub fn remove(&mut self, hashes: Vec<TxHash>) -> Vec<Arc<PoolTransaction...
function add_transaction (line 257) | pub fn add_transaction(&mut self, tx: PendingPoolTransaction<T>) -> Resu...
type PendingPoolTransaction (line 292) | pub struct PendingPoolTransaction<T> {
function new (line 305) | pub fn new(transaction: PoolTransaction<T>, provided: &HashMap<TxMarker,...
function mark (line 320) | pub fn mark(&mut self, marker: &TxMarker) {
function is_ready (line 325) | pub fn is_ready(&self) -> bool {
function fmt (line 331) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
type TransactionsIterator (line 340) | pub struct TransactionsIterator<T> {
function independent_or_awaiting (line 350) | fn independent_or_awaiting(&mut self, satisfied: usize, tx_ref: PoolTran...
type Item (line 362) | type Item = Arc<PoolTransaction<T>>;
method next (line 364) | fn next(&mut self) -> Option<Self::Item> {
type ReadyTransactions (line 397) | pub struct ReadyTransactions<T> {
method default (line 412) | fn default() -> Self {
function get_transactions (line 424) | pub fn get_transactions(&self) -> TransactionsIterator<T> {
function clear (line 434) | pub fn clear(&mut self) {
function contains (line 441) | pub fn contains(&self, hash: &TxHash) -> bool {
function len (line 446) | pub fn len(&self) -> usize {
function is_empty (line 451) | pub fn is_empty(&self) -> bool {
function get (line 456) | pub fn get(&self, hash: &TxHash) -> Option<ReadyTransaction<T>> {
function provided_markers (line 460) | pub fn provided_markers(&self) -> &HashMap<TxMarker, TxHash> {
function next_id (line 464) | fn next_id(&mut self) -> u64 {
function clear_transactions (line 472) | pub fn clear_transactions(&mut self, tx_hashes: &[TxHash]) -> Vec<Arc<Po...
function prune_tags (line 480) | pub fn prune_tags(&mut self, marker: TxMarker) -> Vec<Arc<PoolTransactio...
function remove_with_markers (line 553) | pub fn remove_with_markers(
function add_transaction (line 608) | pub fn add_transaction(
function replaced_transactions (line 658) | fn replaced_transactions(
type PoolTransactionRef (line 707) | pub struct PoolTransactionRef<T> {
method clone (line 715) | fn clone(&self) -> Self {
function eq (line 723) | fn eq(&self, other: &Self) -> bool {
function partial_cmp (line 729) | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
method cmp (line 735) | fn cmp(&self, other: &Self) -> Ordering {
type ReadyTransaction (line 744) | pub struct ReadyTransaction<T> {
method clone (line 754) | fn clone(&self) -> Self {
function provides (line 764) | pub fn provides(&self) -> &[TxMarker] {
function max_fee_per_gas (line 770) | pub fn max_fee_per_gas(&self) -> u128 {
function can_id_txs (line 780) | fn can_id_txs() {
FILE: crates/anvil/src/eth/sign.rs
type MessageSigner (line 13) | pub trait MessageSigner: Send + Sync {
method accounts (line 15) | fn accounts(&self) -> Vec<Address>;
method is_signer_for (line 18) | fn is_signer_for(&self, addr: Address) -> bool {
method sign (line 23) | async fn sign(&self, address: Address, message: &[u8]) -> Result<Signa...
method sign_typed_data (line 27) | async fn sign_typed_data(
method sign_hash (line 34) | async fn sign_hash(&self, address: Address, hash: B256) -> Result<Sign...
method accounts (line 69) | fn accounts(&self) -> Vec<Address> {
method is_signer_for (line 73) | fn is_signer_for(&self, addr: Address) -> bool {
method sign (line 77) | async fn sign(&self, address: Address, message: &[u8]) -> Result<Signa...
method sign_typed_data (line 83) | async fn sign_typed_data(
method sign_hash (line 98) | async fn sign_hash(&self, address: Address, hash: B256) -> Result<Sign...
type Signer (line 42) | pub trait Signer<N: Network>: MessageSigner {
method sign_transaction_from (line 46) | fn sign_transaction_from(
type DevSigner (line 54) | pub struct DevSigner {
method new (line 60) | pub fn new(accounts: Vec<PrivateKeySigner>) -> Self {
method sign_transaction_from (line 106) | fn sign_transaction_from(
function build_impersonated (line 148) | pub fn build_impersonated(typed_tx: FoundryTypedTx) -> FoundryTxEnvelope {
FILE: crates/anvil/src/eth/util.rs
function hex_fmt_many (line 5) | pub fn hex_fmt_many<I, T>(i: I) -> String
FILE: crates/anvil/src/evm.rs
type PrecompileFactory (line 7) | pub trait PrecompileFactory: Send + Sync + Unpin + Debug {
method precompiles (line 9) | fn precompiles(&self) -> Vec<(Address, DynPrecompile)>;
method precompiles (line 55) | fn precompiles(&self) -> Vec<(Address, DynPrecompile)> {
constant ETH_PRAGUE_PRECOMPILE (line 39) | const ETH_PRAGUE_PRECOMPILE: Address = address!("0x000000000000000000000...
constant ETH_OSAKA_PRECOMPILE (line 42) | const ETH_OSAKA_PRECOMPILE: Address = address!("0x0000000000000000000000...
constant OP_ISTHMUS_PRECOMPILE (line 45) | const OP_ISTHMUS_PRECOMPILE: Address = address!("0x000000000000000000000...
constant PRECOMPILE_ADDR (line 48) | const PRECOMPILE_ADDR: Address = address!("0x000000000000000000000000000...
constant PAYLOAD (line 49) | const PAYLOAD: &[u8] = &[0xde, 0xad, 0xbe, 0xef];
type CustomPrecompileFactory (line 52) | struct CustomPrecompileFactory;
function create_eth_evm (line 72) | fn create_eth_evm(
function create_op_evm (line 110) | fn create_op_evm(
function build_eth_evm_with_extra_precompiles_osaka_spec (line 162) | fn build_eth_evm_with_extra_precompiles_osaka_spec() {
function build_eth_evm_with_extra_precompiles_london_spec (line 187) | fn build_eth_evm_with_extra_precompiles_london_spec() {
function build_eth_evm_with_extra_precompiles_prague_spec (line 212) | fn build_eth_evm_with_extra_precompiles_prague_spec() {
function build_op_evm_with_extra_precompiles_isthmus_spec (line 237) | fn build_op_evm_with_extra_precompiles_isthmus_spec() {
function build_op_evm_with_extra_precompiles_bedrock_spec (line 262) | fn build_op_evm_with_extra_precompiles_bedrock_spec() {
FILE: crates/anvil/src/filter.rs
type FilterMap (line 26) | type FilterMap<N> = Arc<Mutex<HashMap<String, (EthFilter<N>, Instant)>>>;
constant ACTIVE_FILTER_TIMEOUT_SECS (line 29) | pub const ACTIVE_FILTER_TIMEOUT_SECS: u64 = 60 * 5;
type Filters (line 32) | pub struct Filters<N: Network> {
method clone (line 40) | fn clone(&self) -> Self {
function fmt (line 46) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function add_filter (line 53) | pub async fn add_filter(&self, filter: EthFilter<N>) -> String {
function get_log_filter (line 62) | pub async fn get_log_filter(&self, id: &str) -> Option<Filter> {
function uninstall_filter (line 71) | pub async fn uninstall_filter(&self, id: &str) -> Option<EthFilter<N>> {
function keep_alive (line 77) | pub fn keep_alive(&self) -> Duration {
function next_deadline (line 82) | fn next_deadline(&self) -> Instant {
function evict (line 87) | pub async fn evict(&self) {
function get_filter_changes (line 105) | pub async fn get_filter_changes(&self, id: &str) -> ResponseResult {
method default (line 127) | fn default() -> Self {
function new_id (line 136) | fn new_id() -> String {
type EthFilter (line 141) | pub enum EthFilter<N: Network> {
function fmt (line 148) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type Item (line 161) | type Item = ResponseResult;
method poll_next (line 163) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
type LogsFilter (line 186) | pub struct LogsFilter<N: Network> {
function fmt (line 200) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function poll (line 210) | pub fn poll(&mut self, cx: &mut Context<'_>) -> Vec<Log> {
FILE: crates/anvil/src/lib.rs
function spawn (line 115) | pub async fn spawn(config: NodeConfig) -> (EthApi<FoundryNetwork>, NodeH...
function try_spawn (line 139) | pub async fn try_spawn(mut config: NodeConfig) -> Result<(EthApi<Foundry...
type IpcTask (line 281) | type IpcTask = JoinHandle<()>;
type NodeHandle (line 286) | pub struct NodeHandle {
method config (line 313) | pub fn config(&self) -> &NodeConfig {
method print (line 318) | pub(crate) fn print(&self, fork: Option<&ClientFork>) -> Result<()> {
method socket_address (line 340) | pub fn socket_address(&self) -> &SocketAddr {
method http_endpoint (line 345) | pub fn http_endpoint(&self) -> String {
method ws_endpoint (line 350) | pub fn ws_endpoint(&self) -> String {
method ipc_path (line 355) | pub fn ipc_path(&self) -> Option<String> {
method http_provider (line 360) | pub fn http_provider(&self) -> RetryProvider {
method ws_provider (line 365) | pub fn ws_provider(&self) -> RetryProvider {
method ipc_provider (line 370) | pub fn ipc_provider(&self) -> Option<RetryProvider> {
method dev_accounts (line 375) | pub fn dev_accounts(&self) -> impl Iterator<Item = Address> + '_ {
method dev_wallets (line 380) | pub fn dev_wallets(&self) -> impl Iterator<Item = PrivateKeySigner> + ...
method genesis_accounts (line 385) | pub fn genesis_accounts(&self) -> impl Iterator<Item = Address> + '_ {
method genesis_balance (line 390) | pub fn genesis_balance(&self) -> U256 {
method gas_price (line 395) | pub fn gas_price(&self) -> u128 {
method shutdown_signal (line 400) | pub fn shutdown_signal(&self) -> &Option<Signal> {
method shutdown_signal_mut (line 407) | pub fn shutdown_signal_mut(&mut self) -> &mut Option<Signal> {
method task_manager (line 426) | pub fn task_manager(&self) -> &TaskManager {
method drop (line 303) | fn drop(&mut self) {
type Output (line 432) | type Output = Result<NodeResult<()>, JoinError>;
method poll (line 434) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
function init_tracing (line 463) | pub fn init_tracing() -> LoggingManager {
FILE: crates/anvil/src/logging.rs
constant NODE_USER_LOG_TARGET (line 9) | pub(crate) const NODE_USER_LOG_TARGET: &str = "node::user";
constant EVM_CONSOLE_LOG_TARGET (line 12) | pub(crate) const EVM_CONSOLE_LOG_TARGET: &str = "node::console";
type NodeLogLayer (line 19) | pub struct NodeLogLayer {
method new (line 25) | pub fn new(state: LoggingManager) -> Self {
method register_callsite (line 35) | fn register_callsite(&self, metadata: &'static Metadata<'static>) -> I...
method enabled (line 44) | fn enabled(&self, metadata: &Metadata<'_>, _ctx: Context<'_, S>) -> bo...
type LoggingManager (line 53) | pub struct LoggingManager {
method is_enabled (line 60) | pub fn is_enabled(&self) -> bool {
method set_enabled (line 65) | pub fn set_enabled(&self, enabled: bool) {
method default (line 72) | fn default() -> Self {
FILE: crates/anvil/src/opts.rs
type Anvil (line 9) | pub struct Anvil {
type AnvilSubcommand (line 22) | pub enum AnvilSubcommand {
FILE: crates/anvil/src/pubsub.rs
type LogsSubscription (line 21) | pub struct LogsSubscription<N: Network> {
function fmt (line 30) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function poll (line 42) | fn poll(&mut self, cx: &mut Context<'_>) -> Poll<Option<EthSubscriptionR...
type EthSubscriptionResponse (line 77) | pub struct EthSubscriptionResponse {
method new (line 84) | pub fn new(params: EthSubscriptionParams) -> Self {
type EthSubscriptionParams (line 91) | pub struct EthSubscriptionParams {
type EthSubscription (line 98) | pub enum EthSubscription<N: Network> {
function fmt (line 106) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function poll_response (line 120) | fn poll_response(&mut self, cx: &mut Context<'_>) -> Poll<Option<EthSubs...
type Item (line 166) | type Item = serde_json::Value;
method poll_next (line 168) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
function filter_logs (line 178) | pub fn filter_logs<R>(block: Block, receipts: Vec<R>, filter: &FilteredP...
FILE: crates/anvil/src/server/beacon/error.rs
type BeaconError (line 16) | pub struct BeaconError {
method new (line 28) | pub fn new(code: BeaconErrorCode, message: impl Into<Cow<'static, str>...
method invalid_block_id (line 34) | pub fn invalid_block_id(block_id: impl Display) -> Self {
method block_not_found (line 39) | pub fn block_not_found() -> Self {
method internal_error (line 44) | pub fn internal_error() -> Self {
method deprecated_endpoint_with_hint (line 49) | pub fn deprecated_endpoint_with_hint(hint: impl Display) -> Self {
method into_response (line 54) | pub fn into_response(self) -> Response {
method fmt (line 70) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method into_response (line 78) | fn into_response(self) -> Response {
type BeaconErrorCode (line 86) | pub enum BeaconErrorCode {
method status_code (line 95) | pub const fn status_code(&self) -> u16 {
method as_str (line 100) | pub const fn as_str(&self) -> &'static str {
method fmt (line 111) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function test_beacon_error_codes (line 121) | fn test_beacon_error_codes() {
function test_beacon_error_display (line 128) | fn test_beacon_error_display() {
FILE: crates/anvil/src/server/beacon/handlers.rs
function handle_get_blob_sidecars (line 24) | pub async fn handle_get_blob_sidecars(
function handle_get_blobs (line 36) | pub async fn handle_get_blobs(
function handle_get_genesis (line 97) | pub async fn handle_get_genesis(State(api): State<EthApi<FoundryNetwork>...
function header_map_with_accept (line 115) | fn header_map_with_accept(accept: &str) -> HeaderMap {
function test_must_be_ssz (line 122) | fn test_must_be_ssz() {
FILE: crates/anvil/src/server/beacon/mod.rs
function router (line 13) | pub fn router(api: EthApi<FoundryNetwork>) -> Router {
FILE: crates/anvil/src/server/beacon/utils.rs
function must_be_ssz (line 5) | pub fn must_be_ssz(headers: &HeaderMap) -> bool {
FILE: crates/anvil/src/server/mod.rs
function serve (line 20) | pub async fn serve(
function serve_on (line 30) | pub async fn serve_on(
function router (line 40) | pub fn router(api: EthApi<FoundryNetwork>, config: ServerConfig) -> Rout...
function spawn_ipc (line 60) | pub fn spawn_ipc(api: EthApi<FoundryNetwork>, path: String) -> IpcTask {
function try_spawn_ipc (line 65) | pub fn try_spawn_ipc(api: EthApi<FoundryNetwork>, path: String) -> io::R...
FILE: crates/anvil/src/server/rpc_handlers.rs
type HttpEthRpcHandler (line 18) | pub struct HttpEthRpcHandler {
method new (line 25) | pub fn new(api: EthApi<FoundryNetwork>) -> Self {
type Request (line 32) | type Request = EthRequest;
method on_request (line 34) | async fn on_request(&self, request: Self::Request) -> ResponseResult {
type PubSubEthRpcHandler (line 41) | pub struct PubSubEthRpcHandler {
method new (line 48) | pub fn new(api: EthApi<FoundryNetwork>) -> Self {
method on_pub_sub (line 53) | async fn on_pub_sub(&self, pubsub: EthPubSub, cx: PubSubContext<Self>)...
type Request (line 131) | type Request = EthRpcCall;
type SubscriptionId (line 132) | type SubscriptionId = SubscriptionId;
type Subscription (line 133) | type Subscription = EthSubscription<FoundryNetwork>;
method on_request (line 135) | async fn on_request(&self, request: Self::Request, cx: PubSubContext<Sel...
FILE: crates/anvil/src/service.rs
type NodeService (line 31) | pub struct NodeService<N: Network> {
function new (line 51) | pub fn new(
type Output (line 76) | type Output = NodeResult<()>;
method poll (line 78) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
type MiningResult (line 114) | type MiningResult<N> = (MinedBlockOutcome<<N as Network>::TxEnvelope>, A...
type BlockProducer (line 118) | struct BlockProducer<N: Network> {
function new (line 132) | fn new(backend: Arc<Backend<N>>) -> Self {
type Item (line 142) | type Item = MinedBlockOutcome<N::TxEnvelope>;
method poll_next (line 144) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
FILE: crates/anvil/src/shutdown.rs
type Shutdown (line 15) | pub struct Shutdown(Shared<oneshot::Receiver<()>>);
type Output (line 18) | type Output = ();
method poll (line 20) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
type Signal (line 31) | pub struct Signal(oneshot::Sender<()>);
method fire (line 35) | pub fn fire(self) -> Result<(), ()> {
function signal (line 41) | pub fn signal() -> (Signal, Shutdown) {
FILE: crates/anvil/src/tasks/block_listener.rs
type BlockListener (line 11) | pub struct BlockListener<St, F, Fut> {
function new (line 23) | pub fn new(on_shutdown: Shutdown, block_stream: St, task_factory: F) -> ...
type Output (line 34) | type Output = ();
method poll (line 36) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
FILE: crates/anvil/src/tasks/mod.rs
type TaskManager (line 20) | pub struct TaskManager {
method new (line 29) | pub fn new(tokio_handle: Handle, on_shutdown: Shutdown) -> Self {
method on_shutdown (line 34) | pub fn on_shutdown(&self) -> Shutdown {
method spawn (line 39) | pub fn spawn(&self, task: impl Future<Output = ()> + Send + 'static) -...
method spawn_blocking (line 46) | pub fn spawn_blocking(
method spawn_reset_on_new_polled_blocks (line 73) | pub fn spawn_reset_on_new_polled_blocks<N, P>(&self, provider: P, api:...
method spawn_block_poll_listener (line 97) | pub fn spawn_block_poll_listener<N, P, F, Fut>(&self, provider: P, tas...
method spawn_reset_on_subscribed_blocks (line 133) | pub fn spawn_reset_on_subscribed_blocks<N, P>(&self, provider: P, api:...
method spawn_block_subscription (line 154) | pub fn spawn_block_subscription<N, P, F, Fut>(&self, provider: P, task...
method fmt (line 170) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
FILE: crates/anvil/tests/it/anvil.rs
function test_can_change_mining_mode (line 14) | async fn test_can_change_mining_mode() {
function can_get_default_dev_keys (line 46) | async fn can_get_default_dev_keys() {
function can_set_empty_code (line 57) | async fn can_set_empty_code() {
function test_can_set_genesis_timestamp (line 66) | async fn test_can_set_genesis_timestamp() {
function test_can_use_default_genesis_timestamp (line 79) | async fn test_can_use_default_genesis_timestamp() {
function test_can_handle_large_timestamp (line 87) | async fn test_can_handle_large_timestamp() {
function test_shanghai_fields (line 98) | async fn test_shanghai_fields() {
function test_cancun_fields (line 111) | async fn test_cancun_fields() {
function test_can_set_genesis_block_number (line 124) | async fn test_can_set_genesis_block_number() {
function test_can_use_default_genesis_block_number (line 135) | async fn test_can_use_default_genesis_block_number() {
function test_number_opcode_reflects_genesis_block_number (line 144) | async fn test_number_opcode_reflects_genesis_block_number() {
function test_anvil_recover_signature (line 167) | async fn test_anvil_recover_signature() {
function test_fake_signature_transaction (line 200) | async fn test_fake_signature_transaction() {
FILE: crates/anvil/tests/it/anvil_api.rs
function can_set_gas_price (line 33) | async fn can_set_gas_price() {
function can_set_block_gas_limit (line 44) | async fn can_set_block_gas_limit() {
function can_set_storage (line 58) | async fn can_set_storage() {
function can_impersonate_account (line 74) | async fn can_impersonate_account() {
function can_auto_impersonate_account (line 113) | async fn can_auto_impersonate_account() {
function can_impersonate_contract (line 155) | async fn can_impersonate_contract() {
function can_impersonate_gnosis_safe (line 195) | async fn can_impersonate_gnosis_safe() {
function can_impersonate_multiple_accounts (line 225) | async fn can_impersonate_multiple_accounts() {
function can_mine_manually (line 274) | async fn can_mine_manually() {
function test_set_next_timestamp (line 288) | async fn test_set_next_timestamp() {
function test_evm_set_time (line 315) | async fn test_evm_set_time() {
function test_evm_set_time_in_past (line 339) | async fn test_evm_set_time_in_past() {
function test_timestamp_interval (line 359) | async fn test_timestamp_interval() {
function test_can_set_storage_bsc_fork (line 409) | async fn test_can_set_storage_bsc_fork() {
function can_get_node_info (line 434) | async fn can_get_node_info() {
function can_get_metadata (line 468) | async fn can_get_metadata() {
function can_get_metadata_on_fork (line 493) | async fn can_get_metadata_on_fork() {
function metadata_changes_on_reset (line 522) | async fn metadata_changes_on_reset() {
function test_get_transaction_receipt (line 538) | async fn test_get_transaction_receipt() {
function test_set_chain_id (line 568) | async fn test_set_chain_id() {
function test_fork_revert_next_block_timestamp (line 583) | async fn test_fork_revert_next_block_timestamp() {
function test_fork_revert_call_latest_block_timestamp (line 604) | async fn test_fork_revert_call_latest_block_timestamp() {
function can_remove_pool_transactions (line 633) | async fn can_remove_pool_transactions() {
function flaky_test_reorg (line 661) | async fn flaky_test_reorg() {
function test_reorg_blockhash_opcode_consistency (line 791) | async fn test_reorg_blockhash_opcode_consistency() {
function test_reorg_deep_blockhash_consistency (line 843) | async fn test_reorg_deep_blockhash_consistency() {
function test_rollback (line 911) | async fn test_rollback() {
function test_arb_get_block (line 943) | async fn test_arb_get_block() {
function test_mine_blk_with_prev_timestamp (line 962) | async fn test_mine_blk_with_prev_timestamp() {
function test_increase_time_by_zero (line 1003) | async fn test_increase_time_by_zero() {
function evm_mine_blk_with_same_timestamp (line 1027) | async fn evm_mine_blk_with_same_timestamp() {
function test_mine_blk_with_same_timestamp (line 1049) | async fn test_mine_blk_with_same_timestamp() {
function test_mine_first_block_with_interval (line 1086) | async fn test_mine_first_block_with_interval() {
function test_anvil_reset_non_fork (line 1103) | async fn test_anvil_reset_non_fork() {
function test_anvil_reset_fork_to_non_fork (line 1164) | async fn test_anvil_reset_fork_to_non_fork() {
FILE: crates/anvil/tests/it/api.rs
function can_get_block_number (line 31) | async fn can_get_block_number() {
function can_dev_get_balance (line 44) | async fn can_dev_get_balance() {
function can_get_price (line 56) | async fn can_get_price() {
function can_get_accounts (line 66) | async fn can_get_accounts() {
function can_get_client_version (line 79) | async fn can_get_client_version() {
function can_get_chain_id (line 88) | async fn can_get_chain_id() {
function can_modify_chain_id (line 97) | async fn can_modify_chain_id() {
function can_get_network_id (line 110) | async fn can_get_network_id() {
function can_get_block_by_number (line 122) | async fn can_get_block_by_number() {
function can_get_pending_block (line 148) | async fn can_get_pending_block() {
function can_estimate_gas_with_undersized_max_fee_per_gas (line 184) | async fn can_estimate_gas_with_undersized_max_fee_per_gas() {
function can_call_on_pending_block (line 217) | async fn can_call_on_pending_block() {
function can_call_with_undersized_max_fee_per_gas (line 292) | async fn can_call_with_undersized_max_fee_per_gas() {
function can_call_with_state_override (line 323) | async fn can_call_with_state_override() {
function can_mine_while_mining (line 398) | async fn can_mine_while_mining() {
function can_send_raw_tx_sync (line 427) | async fn can_send_raw_tx_sync() {
function can_send_tx_sync (line 457) | async fn can_send_tx_sync() {
function can_get_code_by_hash (line 477) | async fn can_get_code_by_hash() {
function test_fill_transaction_fills_chain_id (line 489) | async fn test_fill_transaction_fills_chain_id() {
function test_fill_transaction_fills_nonce (line 507) | async fn test_fill_transaction_fills_nonce() {
function test_fill_transaction_preserves_provided_fields (line 535) | async fn test_fill_transaction_preserves_provided_fields() {
function test_fill_transaction_fills_all_missing_fields (line 558) | async fn test_fill_transaction_fills_all_missing_fields() {
function test_fill_transaction_eip4844_blob_fee (line 576) | async fn test_fill_transaction_eip4844_blob_fee() {
function test_fill_transaction_eip4844_preserves_blob_fee (line 602) | async fn test_fill_transaction_eip4844_preserves_blob_fee() {
function test_fill_transaction_non_blob_tx_no_blob_fee (line 633) | async fn test_fill_transaction_non_blob_tx_no_blob_fee() {
function test_fill_transaction_reverts_on_gas_estimation_failure (line 652) | async fn test_fill_transaction_reverts_on_gas_estimation_failure() {
FILE: crates/anvil/tests/it/beacon_api.rs
function test_beacon_api_get_blob_sidecars (line 14) | async fn test_beacon_api_get_blob_sidecars() {
function test_beacon_api_get_blobs (line 32) | async fn test_beacon_api_get_blobs() {
function test_beacon_api_get_genesis (line 240) | async fn test_beacon_api_get_genesis() {
FILE: crates/anvil/tests/it/eip2935.rs
function eip2935_contract_deployed_at_genesis (line 11) | async fn eip2935_contract_deployed_at_genesis() {
function eip2935_stores_parent_block_hash (line 21) | async fn eip2935_stores_parent_block_hash() {
function eip2935_no_system_call_on_genesis (line 51) | async fn eip2935_no_system_call_on_genesis() {
function eip2935_not_deployed_before_prague (line 63) | async fn eip2935_not_deployed_before_prague() {
FILE: crates/anvil/tests/it/eip4844.rs
function can_send_eip4844_transaction (line 17) | async fn can_send_eip4844_transaction() {
function can_send_eip4844_transaction_fork (line 51) | async fn can_send_eip4844_transaction_fork() {
function can_send_eip4844_transaction_eth_send_transaction (line 78) | async fn can_send_eip4844_transaction_eth_send_transaction() {
function can_send_eip4844_transaction_with_eip7594_sidecar_format (line 106) | async fn can_send_eip4844_transaction_with_eip7594_sidecar_format() {
function can_send_multiple_blobs_in_one_tx (line 128) | async fn can_send_multiple_blobs_in_one_tx() {
function cannot_exceed_six_blobs (line 164) | async fn cannot_exceed_six_blobs() {
function can_mine_blobs_when_exceeds_max_blobs (line 199) | async fn can_mine_blobs_when_exceeds_max_blobs() {
function can_check_blob_fields_on_genesis (line 269) | async fn can_check_blob_fields_on_genesis() {
function can_correctly_estimate_blob_gas_with_recommended_fillers (line 283) | async fn can_correctly_estimate_blob_gas_with_recommended_fillers() {
function can_correctly_estimate_blob_gas_with_recommended_fillers_with_signer (line 326) | async fn can_correctly_estimate_blob_gas_with_recommended_fillers_with_s...
function can_bypass_sidecar_requirement (line 372) | async fn can_bypass_sidecar_requirement() {
function can_get_blobs_by_versioned_hash (line 420) | async fn can_get_blobs_by_versioned_hash() {
function can_get_blobs_by_tx_hash (line 456) | async fn can_get_blobs_by_tx_hash() {
FILE: crates/anvil/tests/it/eip7702.rs
function can_send_eip7702_tx (line 13) | async fn can_send_eip7702_tx() {
function can_send_eip7702_request (line 82) | async fn can_send_eip7702_request() {
function eip7702_authorization_bypass (line 158) | async fn eip7702_authorization_bypass() {
FILE: crates/anvil/tests/it/fork.rs
constant BLOCK_NUMBER (line 37) | const BLOCK_NUMBER: u64 = 14_608_400u64;
constant DEAD_BALANCE_AT_BLOCK_NUMBER (line 38) | const DEAD_BALANCE_AT_BLOCK_NUMBER: u128 = 12_556_069_338_441_120_059_86...
constant BLOCK_TIMESTAMP (line 40) | const BLOCK_TIMESTAMP: u64 = 1_650_274_250u64;
type LocalFork (line 44) | pub struct LocalFork {
method new (line 54) | pub async fn new() -> Self {
method setup (line 59) | pub async fn setup(origin: NodeConfig, fork: NodeConfig) -> Self {
function fork_config (line 68) | pub fn fork_config() -> NodeConfig {
function test_fork_gas_limit_applied_from_config (line 75) | async fn test_fork_gas_limit_applied_from_config() {
function test_fork_gas_limit_disabled_from_config (line 82) | async fn test_fork_gas_limit_disabled_from_config() {
function test_spawn_fork (line 106) | async fn test_spawn_fork() {
function test_fork_eth_get_balance (line 115) | async fn test_fork_eth_get_balance() {
function test_fork_eth_get_balance_after_mine (line 128) | async fn test_fork_eth_get_balance_after_mine() {
function test_fork_eth_get_code_after_mine (line 146) | async fn test_fork_eth_get_code_after_mine() {
function test_fork_eth_get_code (line 163) | async fn test_fork_eth_get_code() {
function test_fork_eth_get_nonce (line 194) | async fn test_fork_eth_get_nonce() {
function test_fork_optimism_with_transaction_hash (line 212) | async fn test_fork_optimism_with_transaction_hash() {
function test_fork_eth_fee_history (line 232) | async fn test_fork_eth_fee_history() {
function test_fork_reset (line 244) | async fn test_fork_reset() {
function test_fork_reset_setup (line 289) | async fn test_fork_reset_setup() {
function test_fork_state_snapshotting (line 316) | async fn test_fork_state_snapshotting() {
function test_fork_state_snapshotting_repeated (line 355) | async fn test_fork_state_snapshotting_repeated() {
function test_fork_state_snapshotting_blocks (line 402) | async fn test_fork_state_snapshotting_blocks() {
function test_separate_states (line 453) | async fn test_separate_states() {
function can_deploy_greeter_on_fork (line 482) | async fn can_deploy_greeter_on_fork() {
function can_reset_properly (line 502) | async fn can_reset_properly() {
function can_reset_fork_to_new_fork (line 542) | async fn can_reset_fork_to_new_fork() {
function test_fork_timestamp (line 572) | async fn test_fork_timestamp() {
function test_fork_set_empty_code (line 643) | async fn test_fork_set_empty_code() {
function test_fork_can_send_tx (line 654) | async fn test_fork_can_send_tx() {
function test_fork_nft_set_approve_all (line 681) | async fn test_fork_nft_set_approve_all() {
function test_fork_with_custom_chain_id (line 739) | async fn test_fork_with_custom_chain_id() {
function test_fork_can_send_opensea_tx (line 764) | async fn test_fork_can_send_opensea_tx() {
function test_fork_base_fee (line 796) | async fn test_fork_base_fee() {
function test_fork_init_base_fee (line 814) | async fn test_fork_init_base_fee() {
function test_fork_init_blob_base_fee_with_explicit_base_fee (line 834) | async fn test_fork_init_blob_base_fee_with_explicit_base_fee() {
function flaky_test_reset_fork_on_new_blocks (line 867) | async fn flaky_test_reset_fork_on_new_blocks() {
function test_fork_call (line 900) | async fn test_fork_call() {
function test_fork_block_timestamp (line 929) | async fn test_fork_block_timestamp() {
function test_fork_snapshot_block_timestamp (line 940) | async fn test_fork_snapshot_block_timestamp() {
function test_fork_uncles_fetch (line 955) | async fn test_fork_uncles_fetch() {
function test_fork_block_transaction_count (line 994) | async fn test_fork_block_transaction_count() {
function can_impersonate_in_fork (line 1048) | async fn can_impersonate_in_fork() {
function test_total_difficulty_fork (line 1082) | async fn test_total_difficulty_fork() {
function test_transaction_receipt (line 1105) | async fn test_transaction_receipt() {
function test_block_receipts (line 1129) | async fn test_block_receipts() {
function can_override_fork_chain_id (line 1148) | async fn can_override_fork_chain_id() {
function test_fork_reset_moonbeam (line 1178) | async fn test_fork_reset_moonbeam() {
function test_fork_reset_basefee (line 1217) | async fn test_fork_reset_basefee() {
function flaky_test_arbitrum_fork_dev_balance (line 1241) | async fn flaky_test_arbitrum_fork_dev_balance() {
function test_arb_fork_mining (line 1258) | async fn test_arb_fork_mining() {
function flaky_test_arbitrum_fork_block_number (line 1279) | async fn flaky_test_arbitrum_fork_block_number() {
function test_base_fork_gas_limit (line 1332) | async fn test_base_fork_gas_limit() {
function test_fork_execution_reverted (line 1351) | async fn test_fork_execution_reverted() {
function test_immutable_fork_transaction_hash (line 1375) | async fn test_immutable_fork_transaction_hash() {
function test_fork_query_at_fork_block (line 1453) | async fn test_fork_query_at_fork_block() {
function test_reset_dev_account_nonce (line 1474) | async fn test_reset_dev_account_nonce() {
function test_set_erc20_balance (line 1515) | async fn test_set_erc20_balance() {
function test_set_erc20_allowance (line 1540) | async fn test_set_erc20_allowance() {
function test_add_balance (line 1565) | async fn test_add_balance() {
function test_reset_updates_cache_path_when_rpc_url_not_provided (line 1581) | async fn test_reset_updates_cache_path_when_rpc_url_not_provided() {
function test_fork_get_account (line 1617) | async fn test_fork_get_account() {
function test_fork_get_account_info (line 1658) | async fn test_fork_get_account_info() {
function assert_hardfork_config (line 1711) | fn assert_hardfork_config(
function test_config_with_cancun_hardfork (line 1737) | async fn test_config_with_cancun_hardfork() {
function test_config_with_prague_hardfork_with_celo (line 1780) | async fn test_config_with_prague_hardfork_with_celo() {
function test_config_with_osaka_hardfork (line 1844) | async fn test_config_with_osaka_hardfork() {
function test_config_with_osaka_hardfork_with_precompile_factory (line 1904) | async fn test_config_with_osaka_hardfork_with_precompile_factory() {
FILE: crates/anvil/tests/it/gas.rs
constant GAS_TRANSFER (line 11) | const GAS_TRANSFER: u64 = 21_000;
function test_gas_limit_applied_from_config (line 14) | async fn test_gas_limit_applied_from_config() {
function test_gas_limit_disabled_from_config (line 21) | async fn test_gas_limit_disabled_from_config() {
function test_basefee_full_block (line 29) | async fn test_basefee_full_block() {
function test_basefee_half_block (line 72) | async fn test_basefee_half_block() {
function test_basefee_empty_block (line 109) | async fn test_basefee_empty_block() {
function test_respect_base_fee (line 148) | async fn test_respect_base_fee() {
function test_tip_above_fee_cap (line 169) | async fn test_tip_above_fee_cap() {
function test_can_use_fee_history (line 192) | async fn test_can_use_fee_history() {
function test_estimate_gas_empty_data (line 221) | async fn test_estimate_gas_empty_data() {
FILE: crates/anvil/tests/it/genesis.rs
constant GENESIS (line 10) | const GENESIS: &str = r#"{
function can_apply_genesis (line 39) | async fn can_apply_genesis() {
function chain_id_precedence (line 60) | async fn chain_id_precedence() {
FILE: crates/anvil/tests/it/ipc.rs
function ipc_config (line 10) | fn ipc_config() -> (Option<TempDir>, NodeConfig) {
function can_get_block_number_ipc (line 26) | async fn can_get_block_number_ipc() {
function test_sub_new_heads_ipc (line 42) | async fn test_sub_new_heads_ipc() {
FILE: crates/anvil/tests/it/logs.rs
function get_past_events (line 15) | async fn get_past_events() {
function get_all_events (line 78) | async fn get_all_events() {
function watch_events (line 145) | async fn watch_events() {
FILE: crates/anvil/tests/it/optimism.rs
function test_deposits_not_supported_if_optimism_disabled (line 17) | async fn test_deposits_not_supported_if_optimism_disabled() {
function test_send_value_deposit_transaction (line 50) | async fn test_send_value_deposit_transaction() {
function test_send_value_raw_deposit_transaction (line 98) | async fn test_send_value_raw_deposit_transaction() {
function test_deposit_transaction_hash_matches_sepolia (line 155) | async fn test_deposit_transaction_hash_matches_sepolia() {
function test_deposit_tx_checks_sufficient_funds_after_applying_deposited_value (line 187) | async fn test_deposit_tx_checks_sufficient_funds_after_applying_deposite...
function preserves_op_fields_in_convert_to_anvil_receipt (line 230) | fn preserves_op_fields_in_convert_to_anvil_receipt() {
constant GAS_TRANSFER (line 274) | const GAS_TRANSFER: u64 = 21_000;
function test_optimism_base_fee_params (line 286) | async fn test_optimism_base_fee_params() {
FILE: crates/anvil/tests/it/otterscan.rs
function erigon_get_header_by_number (line 18) | async fn erigon_get_header_by_number() {
function ots_get_api_level (line 30) | async fn ots_get_api_level() {
function ots_get_internal_operations_contract_deploy (line 37) | async fn ots_get_internal_operations_contract_deploy() {
function ots_get_internal_operations_contract_transfer (line 58) | async fn ots_get_internal_operations_contract_transfer() {
function ots_get_internal_operations_contract_create2 (line 81) | async fn ots_get_internal_operations_contract_create2() {
function ots_get_internal_operations_contract_selfdestruct_london (line 117) | async fn ots_get_internal_operations_contract_selfdestruct_london() {
function ots_get_internal_operations_contract_selfdestruct_cancun (line 122) | async fn ots_get_internal_operations_contract_selfdestruct_cancun() {
function ots_get_internal_operations_contract_selfdestruct (line 126) | async fn ots_get_internal_operations_contract_selfdestruct(hardfork: Eth...
function ots_has_code (line 165) | async fn ots_has_code() {
function test_call_ots_trace_transaction (line 191) | async fn test_call_ots_trace_transaction() {
function ots_get_transaction_error (line 282) | async fn ots_get_transaction_error() {
function ots_get_transaction_error_no_error (line 307) | async fn ots_get_transaction_error_no_error() {
function ots_get_block_details (line 321) | async fn ots_get_block_details() {
function ots_get_block_details_by_hash (line 335) | async fn ots_get_block_details_by_hash() {
function ots_get_block_transactions (line 350) | async fn ots_get_block_transactions() {
function ots_search_transactions_before (line 389) | async fn ots_search_transactions_before() {
function ots_search_transactions_after (line 424) | async fn ots_search_transactions_after() {
function ots_get_transaction_by_sender_and_nonce (line 459) | async fn ots_get_transaction_by_sender_and_nonce() {
function ots_get_contract_creator (line 492) | async fn ots_get_contract_creator() {
FILE: crates/anvil/tests/it/proof.rs
function verify_account_proof (line 8) | async fn verify_account_proof(
function verify_storage_proof (line 20) | async fn verify_storage_proof(
function test_account_proof (line 34) | async fn test_account_proof() {
function test_storage_proof (line 94) | async fn test_storage_proof() {
function can_get_random_account_proofs (line 130) | async fn can_get_random_account_proofs() {
FILE: crates/anvil/tests/it/pubsub.rs
function test_sub_new_heads (line 15) | async fn test_sub_new_heads() {
function test_sub_logs_legacy (line 38) | async fn test_sub_logs_legacy() {
function test_sub_logs (line 78) | async fn test_sub_logs() {
function test_sub_logs_impersonated (line 117) | async fn test_sub_logs_impersonated() {
function test_filters_legacy (line 160) | async fn test_filters_legacy() {
function test_filters (line 197) | async fn test_filters() {
function test_subscriptions (line 232) | async fn test_subscriptions() {
function test_sub_new_heads_fast (line 252) | async fn test_sub_new_heads_fast() {
FILE: crates/anvil/tests/it/revert.rs
function test_deploy_reverting (line 11) | async fn test_deploy_reverting() {
function test_revert_messages (line 32) | async fn test_revert_messages() {
function test_solc_revert_example (line 65) | async fn test_solc_revert_example() {
function test_another_revert_message (line 80) | async fn test_another_revert_message() {
function test_solc_revert_custom_errors (line 105) | async fn test_solc_revert_custom_errors() {
FILE: crates/anvil/tests/it/sign.rs
function can_sign_typed_data (line 12) | async fn can_sign_typed_data() {
function can_sign_typed_data_os (line 100) | async fn can_sign_typed_data_os() {
function can_sign_transaction (line 287) | async fn can_sign_transaction() {
function rejects_different_chain_id (line 314) | async fn rejects_different_chain_id() {
function rejects_invalid_chain_id (line 327) | async fn rejects_invalid_chain_id() {
function can_sign_typed_seaport_data (line 340) | async fn can_sign_typed_seaport_data() {
FILE: crates/anvil/tests/it/simulate.rs
function test_fork_simulate_v1 (line 14) | async fn test_fork_simulate_v1() {
FILE: crates/anvil/tests/it/state.rs
function can_load_state (line 19) | async fn can_load_state() {
function finalized_block_hash_consistent_after_load_state (line 53) | async fn finalized_block_hash_consistent_after_load_state() {
function can_load_existing_state_legacy (line 111) | async fn can_load_existing_state_legacy() {
function can_load_existing_state_legacy_stress (line 121) | async fn can_load_existing_state_legacy_stress() {
function can_load_existing_state (line 131) | async fn can_load_existing_state() {
function test_make_sure_historical_state_is_not_cleared_on_dump (line 141) | async fn test_make_sure_historical_state_is_not_cleared_on_dump() {
function can_preserve_historical_states_between_dump_and_load (line 177) | async fn can_preserve_historical_states_between_dump_and_load() {
function test_fork_load_state (line 229) | async fn test_fork_load_state() {
function test_fork_load_state_with_greater_state_block (line 316) | async fn test_fork_load_state_with_greater_state_block() {
function computes_next_base_fee_after_loading_state (line 347) | async fn computes_next_base_fee_after_loading_state() {
function test_backward_compatibility_deserialization_v1_2 (line 380) | async fn test_backward_compatibility_deserialization_v1_2() {
function test_backward_compatibility_mixed_formats_deserialization_v1_2 (line 438) | async fn test_backward_compatibility_mixed_formats_deserialization_v1_2() {
function test_backward_compatibility_optional_fields_deserialization_v1_2 (line 482) | async fn test_backward_compatibility_optional_fields_deserialization_v1_...
function test_backward_compatibility_state_dump_deserialization_v1_2 (line 524) | async fn test_backward_compatibility_state_dump_deserialization_v1_2() {
FILE: crates/anvil/tests/it/traces.rs
function test_get_transfer_parity_traces (line 37) | async fn test_get_transfer_parity_traces() {
function test_parity_suicide_trace (line 85) | async fn test_parity_suicide_trace() {
function test_transfer_debug_trace_call (line 119) | async fn test_transfer_debug_trace_call() {
function test_call_tracer_debug_trace_call (line 164) | async fn test_call_tracer_debug_trace_call() {
function test_debug_trace_call_state_override (line 275) | async fn test_debug_trace_call_state_override() {
function test_trace_address_fork (line 320) | async fn test_trace_address_fork() {
function test_trace_address_fork2 (line 518) | async fn test_trace_address_fork2() {
function test_trace_filter (line 780) | async fn test_trace_filter() {
function test_call_tracer_debug_trace_call_js_tracer (line 937) | async fn test_call_tracer_debug_trace_call_js_tracer() {
function test_debug_trace_transaction_js_tracer (line 1017) | async fn test_debug_trace_transaction_js_tracer() {
function test_call_tracer_debug_trace_call_pre_state_tracer (line 1110) | async fn test_call_tracer_debug_trace_call_pre_state_tracer() {
function test_debug_trace_transaction_pre_state_tracer (line 1188) | async fn test_debug_trace_transaction_pre_state_tracer() {
function test_trace_replay_block_transactions_local (line 1278) | async fn test_trace_replay_block_transactions_local() {
FILE: crates/anvil/tests/it/transaction.rs
function can_transfer_eth (line 25) | async fn can_transfer_eth() {
function can_order_transactions (line 62) | async fn can_order_transactions() {
function can_respect_nonces (line 104) | async fn can_respect_nonces() {
function can_replace_transaction (line 146) | async fn can_replace_transaction() {
function can_reject_too_high_gas_limits (line 196) | async fn can_reject_too_high_gas_limits() {
function can_mine_large_gas_limit (line 236) | async fn can_mine_large_gas_limit() {
function can_reject_underpriced_replacement (line 257) | async fn can_reject_underpriced_replacement() {
function can_deploy_greeter_http (line 302) | async fn can_deploy_greeter_http() {
function can_deploy_and_mine_manually (line 325) | async fn can_deploy_and_mine_manually() {
function can_mine_automatically (line 372) | async fn can_mine_automatically() {
function can_call_greeter_historic (line 402) | async fn can_call_greeter_historic() {
function can_deploy_greeter_ws (line 443) | async fn can_deploy_greeter_ws() {
function can_deploy_get_code (line 463) | async fn can_deploy_get_code() {
function get_blocktimestamp_works (line 480) | async fn get_blocktimestamp_works() {
function call_past_state (line 515) | async fn call_past_state() {
function can_handle_multiple_concurrent_transfers_with_same_nonce (line 554) | async fn can_handle_multiple_concurrent_transfers_with_same_nonce() {
function can_handle_multiple_concurrent_deploys_with_same_nonce (line 594) | async fn can_handle_multiple_concurrent_deploys_with_same_nonce() {
function can_handle_multiple_concurrent_transactions_with_same_nonce (line 633) | async fn can_handle_multiple_concurrent_transactions_with_same_nonce() {
function can_get_pending_transaction (line 690) | async fn can_get_pending_transaction() {
function can_listen_full_pending_transaction (line 713) | async fn can_listen_full_pending_transaction() {
function can_get_raw_transaction (line 741) | async fn can_get_raw_transaction() {
function test_first_nonce_is_zero (line 764) | async fn test_first_nonce_is_zero() {
function can_handle_different_sender_nonce_calculation (line 778) | async fn can_handle_different_sender_nonce_calculation() {
function includes_pending_tx_for_transaction_count (line 815) | async fn includes_pending_tx_for_transaction_count() {
function can_get_historic_info (line 842) | async fn can_get_historic_info() {
function test_tx_receipt (line 875) | async fn test_tx_receipt() {
function test_reverted_contract_creation_has_contract_address (line 904) | async fn test_reverted_contract_creation_has_contract_address() {
function can_stream_pending_transactions (line 939) | async fn can_stream_pending_transactions() {
function test_tx_access_list (line 1015) | async fn test_tx_access_list() {
function estimates_gas_on_pending_by_default (line 1130) | async fn estimates_gas_on_pending_by_default() {
function test_estimate_gas (line 1156) | async fn test_estimate_gas() {
function test_block_override (line 1197) | async fn test_block_override() {
function test_reject_gas_too_low (line 1238) | async fn test_reject_gas_too_low() {
function can_call_with_high_gas_limit (line 1260) | async fn can_call_with_high_gas_limit() {
function test_reject_eip1559_pre_london (line 1271) | async fn test_reject_eip1559_pre_london() {
function can_mine_multiple_in_block (line 1311) | async fn can_mine_multiple_in_block() {
function can_estimate_gas_prague (line 1336) | async fn can_estimate_gas_prague() {
function can_send_tx_osaka_valid_with_limit_enabled (line 1350) | async fn can_send_tx_osaka_valid_with_limit_enabled() {
function can_send_tx_osaka_valid_with_limit_disabled (line 1389) | async fn can_send_tx_osaka_valid_with_limit_disabled() {
function can_get_tx_by_sender_and_nonce (line 1422) | async fn can_get_tx_by_sender_and_nonce() {
FILE: crates/anvil/tests/it/txpool.rs
function geth_txpool (line 11) | async fn geth_txpool() {
function accepts_spend_after_funding_when_pool_checks_disabled (line 60) | async fn accepts_spend_after_funding_when_pool_checks_disabled() {
FILE: crates/anvil/tests/it/utils.rs
function http_provider (line 10) | pub fn http_provider(http_endpoint: &str) -> RetryProvider {
function http_provider_with_signer (line 14) | pub fn http_provider_with_signer(
function ws_provider_with_signer (line 23) | pub fn ws_provider_with_signer(
function connect_pubsub (line 33) | pub async fn connect_pubsub(conn_str: &str) -> RootProvider {
type PubsubSigner (line 37) | type PubsubSigner = FillProvider<
function connect_pubsub_with_wallet (line 55) | pub async fn connect_pubsub_with_wallet(conn_str: &str, wallet: Ethereum...
function ipc_provider_with_wallet (line 59) | pub async fn ipc_provider_with_wallet(
FILE: crates/anvil/tests/it/wsapi.rs
function can_get_block_number_ws (line 8) | async fn can_get_block_number_ws() {
function can_dev_get_balance_ws (line 20) | async fn can_dev_get_balance_ws() {
FILE: crates/cast/bin/main.rs
function main (line 9) | fn main() {
FILE: crates/cast/src/args.rs
function run (line 40) | pub fn run() -> Result<()> {
function setup (line 51) | pub fn setup() -> Result<()> {
function run_command (line 59) | pub async fn run_command(args: CastArgs) -> Result<()> {
FILE: crates/cast/src/base.rs
type Base (line 18) | pub enum Base {
type Error (line 54) | type Error = eyre::Report;
method try_from (line 56) | fn try_from(s: String) -> Result<Self, Self::Error> {
type Error (line 62) | type Error = eyre::Report;
method try_from (line 64) | fn try_from(n: u32) -> Result<Self, Self::Error> {
type Error (line 76) | type Error = eyre::Report;
method try_from (line 78) | fn try_from(n: I256) -> Result<Self, Self::Error> {
type Error (line 84) | type Error = eyre::Report;
method try_from (line 86) | fn try_from(n: U256) -> Result<Self, Self::Error> {
method unwrap_or_detect (line 104) | pub fn unwrap_or_detect(base: Option<&str>, s: impl AsRef<str>) -> Res...
method detect (line 112) | pub fn detect(s: impl AsRef<str>) -> Result<Self> {
method prefix (line 159) | pub const fn prefix(&self) -> &str {
method fmt (line 27) | fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
type Err (line 33) | type Err = eyre::Report;
method from_str (line 35) | fn from_str(s: &str) -> Result<Self, Self::Err> {
function from (line 92) | fn from(b: Base) -> Self {
method from (line 98) | fn from(b: Base) -> Self {
type NumberWithBase (line 199) | pub struct NumberWithBase {
type Target (line 209) | type Target = U256;
method deref (line 211) | fn deref(&self) -> &Self::Target {
method from (line 273) | fn from(number: I256) -> Self {
method from (line 280) | fn from(value: ParseUnits) -> Self {
method from (line 289) | fn from(number: U256) -> Self {
method new (line 316) | pub fn new(number: impl Into<U256>, is_nonnegative: bool, base: Base) ...
method with_base (line 321) | pub fn with_base(&self, base: Base) -> Self {
method parse_int (line 327) | pub fn parse_int(s: &str, base: Option<&str>) -> Result<Self> {
method parse_uint (line 335) | pub fn parse_uint(s: &str, base: Option<&str>) -> Result<Self> {
method number (line 343) | pub fn number(&self) -> U256 {
method is_nonnegative (line 348) | pub fn is_nonnegative(&self) -> bool {
method base (line 353) | pub fn base(&self) -> Base {
method prefix (line 358) | pub const fn prefix(&self) -> &str {
method set_base (line 363) | pub fn set_base(&mut self, base: Base) -> &mut Self {
method format (line 373) | pub fn format(&self) -> String {
method _parse_int (line 390) | fn _parse_int(s: &str, base: Base) -> Result<(U256, bool)> {
method _parse_uint (line 402) | fn _parse_uint(s: &str, base: Base) -> Result<U256> {
method fmt (line 218) | fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
method fmt (line 234) | fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
method fmt (line 240) | fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
method fmt (line 246) | fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
method fmt (line 252) | fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
method fmt (line 258) | fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
type Err (line 265) | type Err = eyre::Report;
method from_str (line 267) | fn from_str(s: &str) -> Result<Self, Self::Err> {
method from (line 295) | fn from(n: NumberWithBase) -> Self {
method from (line 301) | fn from(n: NumberWithBase) -> Self {
method from (line 310) | fn from(n: NumberWithBase) -> Self {
type ToBase (line 414) | pub trait ToBase {
method to_base (line 436) | fn to_base(&self, base: Base, add_prefix: bool) -> Result<String, Self...
type Err (line 440) | type Err = Infallible;
method to_base (line 442) | fn to_base(&self, base: Base, add_prefix: bool) -> Result<String, Self...
type Err (line 449) | type Err = Infallible;
method to_base (line 451) | fn to_base(&self, base: Base, add_prefix: bool) -> Result<String, Self...
type Err (line 458) | type Err = Infallible;
method to_base (line 460) | fn to_base(&self, base: Base, add_prefix: bool) -> Result<String, Self...
type Err (line 467) | type Err = eyre::Report;
method to_base (line 469) | fn to_base(&self, base: Base, add_prefix: bool) -> Result<String, Self...
type Err (line 475) | type Err = eyre::Report;
method to_base (line 477) | fn to_base(&self, base: Base, add_prefix: bool) -> Result<String, Self...
function get_sign (line 483) | fn get_sign(s: &str) -> (&str, Sign) {
constant POS_NUM (line 496) | const POS_NUM: [i128; 44] = [
constant NEG_NUM (line 543) | const NEG_NUM: [i128; 44] = [
function test_defaults (line 591) | fn test_defaults() {
function can_parse_base (line 602) | fn can_parse_base() {
function can_detect_base (line 625) | fn can_detect_base() {
function test_format_pos (line 641) | fn test_format_pos() {
function test_format_neg (line 660) | fn test_format_neg() {
function test_fmt_macro (line 691) | fn test_fmt_macro() {
FILE: crates/cast/src/cmd/access_list.rs
type AccessListArgs (line 22) | pub struct AccessListArgs {
method run (line 62) | pub async fn run(self) -> Result<()> {
method run_with_network (line 70) | pub async fn run_with_network<N: Network + Unpin>(self) -> Result<()>
function can_parse_access_list_data (line 109) | fn can_parse_access_list_data() {
function data_conflicts_with_sig_and_args (line 120) | fn data_conflicts_with_sig_and_args() {
FILE: crates/cast/src/cmd/artifact.rs
type ArtifactArgs (line 21) | pub struct ArtifactArgs {
method run (line 49) | pub async fn run(self) -> Result<()> {
FILE: crates/cast/src/cmd/b2e_payload.rs
type B2EPayloadArgs (line 13) | pub struct B2EPayloadArgs {
method run (line 21) | pub async fn run(self) -> Result<()> {
type InputSource (line 44) | pub enum InputSource {
function parse_input_source (line 51) | fn parse_input_source(s: &str) -> Result<InputSource, String> {
function test_parse_input_source_json_object (line 66) | fn test_parse_input_source_json_object() {
function test_parse_input_source_json_array (line 77) | fn test_parse_input_source_json_array() {
function test_parse_input_source_file_path (line 88) | fn test_parse_input_source_file_path() {
function test_parse_input_source_malformed_but_not_json (line 100) | fn test_parse_input_source_malformed_but_not_json() {
FILE: crates/cast/src/cmd/bind.rs
constant DEFAULT_CRATE_NAME (line 6) | const DEFAULT_CRATE_NAME: &str = "foundry-contracts";
constant DEFAULT_CRATE_VERSION (line 7) | const DEFAULT_CRATE_VERSION: &str = "0.0.1";
type BindArgs (line 11) | pub struct BindArgs {
method run (line 57) | pub async fn run(self) -> Result<()> {
FILE: crates/cast/src/cmd/call.rs
type CallArgs (line 75) | pub struct CallArgs {
method run (line 218) | pub async fn run(self) -> Result<()> {
method run_with_network (line 230) | pub async fn run_with_network<N: Network + Unpin>(self) -> Result<()>
method run_curl (line 430) | async fn run_curl(self) -> Result<()> {
method get_state_overrides (line 485) | pub fn get_state_overrides(&self) -> eyre::Result<Option<StateOverride...
method get_block_overrides (line 551) | pub fn get_block_overrides(&self) -> eyre::Result<Option<BlockOverride...
method metadata (line 564) | fn metadata(&self) -> Metadata {
method data (line 568) | fn data(&self) -> Result<Map<Profile, Dict>, figment::Error> {
type CallSubcommands (line 193) | pub enum CallSubcommands {
function address_value_override (line 580) | fn address_value_override(address_override: &str) -> Result<(&str, &str)> {
function address_slot_value_override (line 587) | fn address_slot_value_override(address_override: &str) -> Result<(Addres...
function test_get_state_overrides (line 605) | fn test_get_state_overrides() {
function test_get_state_overrides_empty (line 655) | fn test_get_state_overrides_empty() {
function test_get_block_overrides (line 662) | fn test_get_block_overrides() {
function test_get_block_overrides_empty (line 672) | fn test_get_block_overrides_empty() {
function test_address_value_override_success (line 679) | fn test_address_value_override_success() {
function test_address_value_override_error (line 687) | fn test_address_value_override_error() {
function test_address_slot_value_override_success (line 694) | fn test_address_slot_value_override_success() {
function test_address_slot_value_override_error (line 703) | fn test_address_slot_value_override_error() {
function can_parse_call_data (line 713) | fn can_parse_call_data() {
function can_parse_state_overrides (line 724) | fn can_parse_state_overrides() {
function can_parse_multiple_state_overrides (line 744) | fn can_parse_multiple_state_overrides() {
function test_negative_args_with_flags (line 781) | fn test_negative_args_with_flags() {
function test_transaction_opts_with_trace (line 798) | fn test_transaction_opts_with_trace() {
FILE: crates/cast/src/cmd/constructor_args.rs
type ConstructorArgsArgs (line 17) | pub struct ConstructorArgsArgs {
method run (line 34) | pub async fn run(self) -> Result<()> {
function parse_constructor_args (line 54) | async fn parse_constructor_args(
function format_arg (line 95) | fn format_arg(ty: &str, arg: &[u8]) -> Result<String> {
FILE: crates/cast/src/cmd/create2.rs
constant DEPLOYER (line 15) | const DEPLOYER: &str = "0x4e59b44847b379578588920ca78fbf26c0b4956c";
type Create2Args (line 19) | pub struct Create2Args {
method run (line 98) | pub fn run(self) -> Result<Create2Output> {
type Create2Output (line 92) | pub struct Create2Output {
function get_regex_hex_string (line 270) | fn get_regex_hex_string(s: String) -> Result<String> {
function basic_create2 (line 284) | fn basic_create2() {
function matches_pattern (line 329) | fn matches_pattern() {
function create2_salt (line 341) | fn create2_salt() {
function create2_init_code (line 354) | fn create2_init_code() {
function create2_init_code_hash (line 367) | fn create2_init_code_hash() {
function create2_caller (line 390) | fn create2_caller() {
function deterministic_seed (line 407) | fn deterministic_seed() {
function deterministic_output (line 424) | fn deterministic_output() {
function j0 (line 441) | fn j0() {
FILE: crates/cast/src/cmd/creation_code.rs
type CreationCodeArgs (line 21) | pub struct CreationCodeArgs {
method run (line 50) | pub async fn run(self) -> Result<()> {
function parse_code_output (line 86) | pub async fn parse_code_output(
function fetch_creation_code_from_etherscan (line 136) | pub async fn fetch_creation_code_from_etherscan(
FILE: crates/cast/src/cmd/da_estimate.rs
type DAEstimateArgs (line 16) | pub struct DAEstimateArgs {
method run (line 25) | pub async fn run(self) -> eyre::Result<()> {
FILE: crates/cast/src/cmd/erc20.rs
type Erc20TxOpts (line 48) | pub struct Erc20TxOpts {
method apply (line 89) | fn apply<N: Network>(&self, tx: &mut N::TransactionRequest, legacy: bool)
function get_provider_with_wallet (line 70) | pub(crate) async fn get_provider_with_wallet<N: Network + RecommendedFil...
type Erc20Subcommand (line 115) | pub enum Erc20Subcommand {
method rpc_opts (line 300) | fn rpc_opts(&self) -> &RpcOpts {
method erc20_opts (line 315) | fn erc20_opts(&self) -> Option<&Erc20TxOpts> {
method run (line 330) | pub async fn run(self) -> eyre::Result<()> {
method run_generic (line 340) | pub async fn run_generic<N: Network + RecommendedFillers>(self) -> eyr...
FILE: crates/cast/src/cmd/estimate.rs
type EstimateArgs (line 21) | pub struct EstimateArgs {
method run (line 84) | pub async fn run(self) -> Result<()> {
method run_with_network (line 92) | pub async fn run_with_network<N: Network>(self) -> Result<()>
type EstimateSubcommands (line 59) | pub enum EstimateSubcommands {
function parse_estimate_value (line 147) | fn parse_estimate_value() {
FILE: crates/cast/src/cmd/find_block.rs
type FindBlockArgs (line 13) | pub struct FindBlockArgs {
method run (line 22) | pub async fn run(self) -> Result<()> {
FILE: crates/cast/src/cmd/interface.rs
type InterfaceArgs (line 25) | pub struct InterfaceArgs {
method run (line 64) | pub async fn run(self) -> Result<()> {
type InterfaceSource (line 116) | struct InterfaceSource {
function load_abi_from_file (line 122) | pub fn load_abi_from_file(path: &str, name: Option<String>) -> Result<Ve...
function load_abi_from_artifact (line 131) | fn load_abi_from_artifact(path_or_contract: &str) -> Result<Vec<(JsonAbi...
function get_interfaces (line 154) | fn get_interfaces(
FILE: crates/cast/src/cmd/logs.rs
type LogsArgs (line 19) | pub struct LogsArgs {
method run (line 61) | pub async fn run(self) -> Result<()> {
function build_filter (line 119) | fn build_filter(
function build_filter_event_sig (line 149) | fn build_filter_event_sig(event: Event, args: Vec<String>) -> Result<Fil...
function build_filter_topics (line 200) | fn build_filter_topics(topics: Vec<String>) -> Result<Filter, eyre::Erro...
constant ADDRESS (line 229) | const ADDRESS: &str = "0x4D1A2e2bB4F88F0250f26Ffff098B0b30B26BF38";
constant TRANSFER_SIG (line 230) | const TRANSFER_SIG: &str = "Transfer(address indexed,address indexed,uin...
constant TRANSFER_TOPIC (line 231) | const TRANSFER_TOPIC: &str =
function test_build_filter_basic (line 235) | fn test_build_filter_basic() {
function test_build_filter_sig (line 251) | fn test_build_filter_sig() {
function test_build_filter_mismatch (line 268) | fn test_build_filter_mismatch() {
function test_build_filter_sig_with_arguments (line 291) | fn test_build_filter_sig_with_arguments() {
function test_build_filter_sig_with_skipped_arguments (line 316) | fn test_build_filter_sig_with_skipped_arguments() {
function test_build_filter_with_topics (line 341) | fn test_build_filter_with_topics() {
function test_build_filter_with_skipped_topic (line 365) | fn test_build_filter_with_skipped_topic() {
function test_build_filter_with_multiple_addresses (line 389) | fn test_build_filter_with_multiple_addresses() {
function test_build_filter_sig_with_mismatched_argument (line 412) | fn test_build_filter_sig_with_mismatched_argument() {
function test_build_filter_with_invalid_sig_or_topic (line 429) | fn test_build_filter_with_invalid_sig_or_topic() {
function test_build_filter_with_invalid_sig_or_topic_hex (line 440) | fn test_build_filter_with_invalid_sig_or_topic_hex() {
function test_build_filter_with_invalid_topic (line 451) | fn test_build_filter_with_invalid_topic() {
FILE: crates/cast/src/cmd/mktx.rs
type MakeTxArgs (line 22) | pub struct MakeTxArgs {
method run (line 84) | pub async fn run(self) -> Result<()> {
method run_generic (line 92) | pub async fn run_generic<N: Network>(self) -> Result<()>
type MakeTxSubcommands (line 67) | pub enum MakeTxSubcommands {
FILE: crates/cast/src/cmd/rpc.rs
type RpcArgs (line 10) | pub struct RpcArgs {
method run (line 37) | pub async fn run(self) -> Result<()> {
function value_or_string (line 68) | fn value_or_string(value: String) -> serde_json::Value {
FILE: crates/cast/src/cmd/run.rs
type RunArgs (line 39) | pub struct RunArgs {
method run (line 126) | pub async fn run(self) -> Result<()> {
method metadata (line 377) | fn metadata(&self) -> Metadata {
method data (line 381) | fn data(&self) -> Result<Map<Profile, Dict>, figment::Error> {
function fetch_contracts_bytecode_from_trace (line 337) | pub fn fetch_contracts_bytecode_from_trace(
function gather_trace_addresses (line 361) | fn gather_trace_addresses(traces: &Traces) -> impl Iterator<Item = Addre...
FILE: crates/cast/src/cmd/send.rs
type SendTxArgs (line 22) | pub struct SendTxArgs {
method run (line 85) | pub async fn run(self) -> Result<()> {
method run_generic (line 93) | pub async fn run_generic<N: Network>(self) -> Result<()>
type SendTxSubcommands (line 68) | pub enum SendTxSubcommands {
function cast_send (line 242) | pub(crate) async fn cast_send<N: Network, P: Provider<N>>(
FILE: crates/cast/src/cmd/storage.rs
constant MIN_SOLC (line 41) | const MIN_SOLC: Version = Version::new(0, 6, 5);
type StorageArgs (line 45) | pub struct StorageArgs {
method metadata (line 85) | fn metadata(&self) -> Metadata {
method data (line 89) | fn data(&self) -> Result<figment::value::Map<Profile, Dict>, figment::...
method run (line 99) | pub async fn run(self) -> Result<()> {
type StorageValue (line 238) | struct StorageValue {
method value (line 247) | fn value(&self, offset: i64, number_of_bytes: Option<usize>) -> B256 {
type StorageReport (line 269) | struct StorageReport {
function fetch_and_print_storage (line 275) | async fn fetch_and_print_storage<P: Provider<AnyNetwork>>(
function fetch_storage_slots (line 291) | async fn fetch_storage_slots<P: Provider<AnyNetwork>>(
function print_storage (line 312) | fn print_storage(layout: StorageLayout, values: Vec<StorageValue>) -> Re...
function add_storage_layout_output (line 374) | fn add_storage_layout_output<C: Compiler<CompilerContract = Contract>>(p...
function is_storage_layout_empty (line 385) | fn is_storage_layout_empty(storage_layout: &Option<StorageLayout>) -> bo...
function parse_storage_etherscan_api_key (line 394) | fn parse_storage_etherscan_api_key() {
function parse_solc_version_arg (line 413) | fn parse_solc_version_arg() {
FILE: crates/cast/src/cmd/trace.rs
type TraceArgs (line 15) | pub struct TraceArgs {
method run (line 42) | pub async fn run(self) -> Result<()> {
FILE: crates/cast/src/cmd/txpool.rs
type TxPoolSubcommands (line 11) | pub enum TxPoolSubcommands {
method run (line 38) | pub async fn run(self) -> eyre::Result<()> {
FILE: crates/cast/src/cmd/wallet/list.rs
type ListArgs (line 11) | pub struct ListArgs {
method run (line 55) | pub async fn run(self) -> Result<()> {
method list_local_senders (line 115) | fn list_local_senders(&self) -> Result<()> {
function gcp_env_vars_set (line 144) | fn gcp_env_vars_set() -> bool {
FILE: crates/cast/src/cmd/wallet/mod.rs
type WalletSubcommands (line 30) | pub enum WalletSubcommands {
method run (line 311) | pub async fn run(self) -> Result<()> {
method recover_address_from_message (line 963) | fn recover_address_from_message(message: &str, signature: &Signature) ...
method recover_address_from_message_no_hash (line 969) | fn recover_address_from_message_no_hash(
method recover_address_from_typed_data (line 977) | fn recover_address_from_typed_data(
method hex_str_to_bytes (line 987) | fn hex_str_to_bytes(s: &str) -> Result<Vec<u8>> {
function can_parse_wallet_sign_message (line 1002) | fn can_parse_wallet_sign_message() {
function can_parse_wallet_sign_hex_message (line 1015) | fn can_parse_wallet_sign_hex_message() {
function can_verify_signed_hex_message (line 1028) | fn can_verify_signed_hex_message() {
function can_verify_signed_hex_message_no_hash (line 1039) | fn can_verify_signed_hex_message_no_hash() {
function can_verify_signed_typed_data (line 1050) | fn can_verify_signed_typed_data() {
function can_parse_wallet_sign_data (line 1061) | fn can_parse_wallet_sign_data() {
function can_parse_wallet_sign_data_file (line 1074) | fn can_parse_wallet_sign_data_file() {
function can_parse_wallet_change_password (line 1093) | fn can_parse_wallet_change_password() {
function wallet_sign_auth_nonce_and_self_broadcast_conflict (line 1120) | fn wallet_sign_auth_nonce_and_self_broadcast_conflict() {
FILE: crates/cast/src/cmd/wallet/vanity.rs
type GeneratedWallet (line 18) | pub type GeneratedWallet = (SigningKey, Address);
type VanityArgs (line 22) | pub struct VanityArgs {
method run (line 72) | pub fn run(self) -> Result<PrivateKeySigner> {
type WalletData (line 51) | struct WalletData {
method new (line 63) | pub fn new(wallet: &PrivateKeySigner) -> Self {
type Wallets (line 58) | struct Wallets {
function save_wallet_to_file (line 168) | fn save_wallet_to_file(wallet: &PrivateKeySigner, path: &Path) -> Result...
function find_vanity_address (line 183) | pub fn find_vanity_address<T: VanityMatcher>(matcher: T) -> Option<Priva...
function find_vanity_address_with_nonce (line 189) | pub fn find_vanity_address_with_nonce<T: VanityMatcher>(
function create_matcher (line 199) | pub fn create_matcher<T: VanityMatcher>(matcher: T) -> impl Fn(&Generate...
function create_nonce_matcher (line 207) | pub fn create_nonce_matcher<T: VanityMatcher>(
function wallet_generator (line 219) | pub fn wallet_generator() -> iter::Map<iter::Repeat<()>, impl Fn(()) -> ...
function generate_wallet (line 224) | pub fn generate_wallet() -> GeneratedWallet {
type VanityMatcher (line 231) | pub trait VanityMatcher: Send + Sync {
method is_match (line 232) | fn is_match(&self, addr: &Address) -> bool;
method is_match (line 243) | fn is_match(&self, addr: &Address) -> bool {
method is_match (line 256) | fn is_match(&self, addr: &Address) -> bool {
method is_match (line 269) | fn is_match(&self, addr: &Address) -> bool {
method is_match (line 283) | fn is_match(&self, addr: &Address) -> bool {
method is_match (line 297) | fn is_match(&self, addr: &Address) -> bool {
method is_match (line 310) | fn is_match(&self, addr: &Address) -> bool {
method is_match (line 324) | fn is_match(&self, addr: &Address) -> bool {
type HexMatcher (line 236) | pub struct HexMatcher {
type LeftHexMatcher (line 250) | pub struct LeftHexMatcher {
type RightHexMatcher (line 263) | pub struct RightHexMatcher {
type LeftExactRightRegexMatcher (line 276) | pub struct LeftExactRightRegexMatcher {
type LeftRegexRightExactMatcher (line 290) | pub struct LeftRegexRightExactMatcher {
type SingleRegexMatcher (line 304) | pub struct SingleRegexMatcher {
type RegexMatcher (line 317) | pub struct RegexMatcher {
function parse_pattern (line 330) | fn parse_pattern(pattern: &str, is_start: bool) -> Result<Either<Vec<u8>...
function find_simple_vanity_start (line 347) | fn find_simple_vanity_start() {
function find_simple_vanity_start2 (line 356) | fn find_simple_vanity_start2() {
function find_simple_vanity_end (line 365) | fn find_simple_vanity_end() {
function save_path (line 374) | fn save_path() {
FILE: crates/cast/src/debug.rs
function handle_traces (line 17) | pub(crate) async fn handle_traces(
FILE: crates/cast/src/errors.rs
type FunctionSignatureError (line 8) | pub enum FunctionSignatureError {
method fmt (line 16) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
FILE: crates/cast/src/lib.rs
type Cast (line 70) | pub struct Cast<P, N = AnyNetwork> {
function new (line 91) | pub fn new(provider: P) -> Self {
function call (line 135) | pub async fn call(
function access_list (line 231) | pub async fn access_list(
function balance (line 258) | pub async fn balance(&self, who: Address, block: Option<BlockId>) -> Res...
function publish (line 279) | pub async fn publish(&self, raw_tx: String) -> Result<PendingTransaction...
function chain_id (line 286) | pub async fn chain_id(&self) -> Result<u64> {
function block_number (line 290) | pub async fn block_number(&self) -> Result<u64> {
function gas_price (line 294) | pub async fn gas_price(&self) -> Result<u128> {
function nonce (line 316) | pub async fn nonce(&self, who: Address, block: Option<BlockId>) -> Resul...
function codehash (line 338) | pub async fn codehash(
function storage_root (line 371) | pub async fn storage_root(
function implementation (line 404) | pub async fn implementation(
function admin (line 453) | pub async fn admin(&self, who: Address, block: Option<BlockId>) -> Resul...
function compute_address (line 483) | pub async fn compute_address(&self, address: Address, nonce: Option<u64>...
function code (line 506) | pub async fn code(
function codesize (line 542) | pub async fn codesize(&self, who: Address, block: Option<BlockId>) -> Re...
function rpc (line 567) | pub async fn rpc<V>(&self, method: &str, params: V) -> Result<String>
function storage (line 599) | pub async fn storage(
function filter_logs (line 616) | pub async fn filter_logs(&self, filter: Filter) -> Result<String> {
function filter_logs_chunked (line 625) | pub async fn filter_logs_chunked(&self, filter: Filter, chunk_size: u64)...
function format_logs (line 630) | fn format_logs(logs: Vec<Log>) -> Result<String> {
function extract_block_range (line 647) | fn extract_block_range(filter: &Filter) -> (Option<u64>, Option<u64>) {
function get_logs_chunked (line 659) | async fn get_logs_chunked(&self, filter: &Filter, chunk_size: u64) -> Re...
function get_logs_chunked_concurrent (line 676) | async fn get_logs_chunked_concurrent(
function convert_block_number (line 776) | pub async fn convert_block_number(
function subscribe (line 816) | pub async fn subscribe(&self, filter: Filter, output: &mut dyn io::Write...
function block (line 903) | pub async fn block<B: Into<BlockId>>(
function block_field_as_num (line 939) | async fn block_field_as_num<B: Into<BlockId>>(&self, block: B, field: St...
function base_fee (line 952) | pub async fn base_fee<B: Into<BlockId>>(&self, block: B) -> Result<U256> {
function age (line 956) | pub async fn age<B: Into<BlockId>>(&self, block: B) -> Result<String> {
function timestamp (line 963) | pub async fn timestamp<B: Into<BlockId>>(&self, block: B) -> Result<U256> {
function chain (line 967) | pub async fn chain(&self) -> Result<&str> {
function block_raw (line 1054) | pub async fn block_raw<B: Into<BlockId>>(&self, block: B, full: bool) ->...
function transaction (line 1091) | pub async fn transaction(
type SimpleCast (line 1141) | pub struct SimpleCast;
method max_int (line 1157) | pub fn max_int(s: &str) -> Result<String> {
method min_int (line 1174) | pub fn min_int(s: &str) -> Result<String> {
method max_min_int (line 1178) | fn max_min_int<const MAX: bool>(s: &str) -> Result<String> {
method from_utf8 (line 1218) | pub fn from_utf8(s: &str) -> String {
method to_utf8 (line 1235) | pub fn to_utf8(s: &str) -> Result<String> {
method to_ascii (line 1252) | pub fn to_ascii(hex: &str) -> Result<String> {
method from_fixed_point (line 1271) | pub fn from_fixed_point(value: &str, decimals: &str) -> Result<String> {
method to_fixed_point (line 1296) | pub fn to_fixed_point(value: &str, decimals: &str) -> Result<String> {
method concat_hex (line 1330) | pub fn concat_hex<T: AsRef<str>>(values: impl IntoIterator<Item = T>) ...
method to_uint256 (line 1362) | pub fn to_uint256(value: &str) -> Result<String> {
method to_int256 (line 1408) | pub fn to_int256(value: &str) -> Result<String> {
method to_unit (line 1425) | pub fn to_unit(value: &str, unit: &str) -> Result<String> {
method parse_units (line 1450) | pub fn parse_units(value: &str, unit: u8) -> Result<String> {
method format_units (line 1472) | pub fn format_units(value: &str, unit: u8) -> Result<String> {
method format_unit_as_string (line 1479) | fn format_unit_as_string(value: U256, unit: Unit) -> String {
method from_wei (line 1505) | pub fn from_wei(value: &str, unit: &str) -> Result<String> {
method to_wei (line 1522) | pub fn to_wei(value: &str, unit: &str) -> Result<String> {
method from_rlp (line 1543) | pub fn from_rlp(value: impl AsRef<str>, as_int: bool) -> Result<String> {
method to_rlp (line 1568) | pub fn to_rlp(value: &str) -> Result<String> {
method to_base (line 1603) | pub fn to_base(value: &str, base_in: Option<&str>, base_out: &str) -> ...
method to_bytes32 (line 1633) | pub fn to_bytes32(s: &str) -> Result<String> {
method format_bytes32_string (line 1644) | pub fn format_bytes32_string(s: &str) -> Result<String> {
method pad (line 1680) | pub fn pad(s: &str, right: bool, len: usize) -> Result<String> {
method parse_bytes32_string (line 1696) | pub fn parse_bytes32_string(s: &str) -> Result<String> {
method parse_bytes32_address (line 1704) | pub fn parse_bytes32_address(s: &str) -> Result<String> {
method abi_decode (line 1761) | pub fn abi_decode(sig: &str, calldata: &str, input: bool) -> Result<Ve...
method calldata_decode (line 1802) | pub fn calldata_decode(sig: &str, calldata: &str, input: bool) -> Resu...
method abi_encode (line 1824) | pub fn abi_encode(sig: &str, args: &[impl AsRef<str>]) -> Result<Strin...
method abi_encode_packed (line 1850) | pub fn abi_encode_packed(sig: &str, args: &[impl AsRef<str>]) -> Resul...
method abi_encode_event (line 1901) | pub fn abi_encode_event(sig: &str, args: &[impl AsRef<str>]) -> Result...
method calldata_encode (line 1956) | pub fn calldata_encode(sig: impl AsRef<str>, args: &[impl AsRef<str>])...
method index (line 1993) | pub fn index(key_type: &str, key: &str, slot_number: &str) -> Result<S...
method keccak (line 2054) | pub fn keccak(data: &str) -> Result<String> {
method left_shift (line 2076) | pub fn left_shift(
method right_shift (line 2103) | pub fn right_shift(
method etherscan_source (line 2144) | pub async fn etherscan_source(
method expand_etherscan_source_to_directory (line 2178) | pub async fn expand_etherscan_source_to_directory(
method etherscan_source_flatten (line 2195) | pub async fn etherscan_source_flatten(
method disassemble (line 2241) | pub fn disassemble(code: &[u8]) -> Result<String> {
method get_selector (line 2260) | pub fn get_selector(signature: &str, optimize: usize) -> Result<(Strin...
method extract_functions (line 2315) | pub fn extract_functions(bytecode: &str) -> Result<Vec<(Selector, Stri...
method decode_raw_transaction (line 2355) | pub fn decode_raw_transaction(tx: &str) -> Result<FoundryTxEnvelope> {
function strip_0x (line 2362) | pub(crate) fn strip_0x(s: &str) -> &str {
function explorer_client (line 2366) | fn explorer_client(
function simple_selector (line 2399) | fn simple_selector() {
function selector_with_arg (line 2404) | fn selector_with_arg() {
function calldata_uint (line 2409) | fn calldata_uint() {
function calldata_array (line 2418) | fn calldata_array() {
function calldata_bool (line 2426) | fn calldata_bool() {
function abi_decode (line 2434) | fn abi_decode() {
function calldata_decode (line 2480) | fn calldata_decode() {
function calldata_decode_nested_json (line 2514) | fn calldata_decode_nested_json() {
function concat_hex (line 2555) | fn concat_hex() {
function from_rlp (line 2561) | fn from_rlp() {
function disassemble_incomplete_sequence (line 2571) | fn disassemble_incomplete_sequence() {
FILE: crates/cast/src/opts.rs
type Cast (line 26) | pub struct Cast {
type CastSubcommand (line 36) | pub enum CastSubcommand {
type ToBaseArgs (line 1163) | pub struct ToBaseArgs {
function parse_slot (line 1173) | pub fn parse_slot(s: &str) -> Result<B256> {
function verify_cli (line 1186) | fn verify_cli() {
function parse_proof_slot (line 1191) | fn parse_proof_slot() {
function parse_call_data (line 1220) | fn parse_call_data() {
function parse_call_data_with_file (line 1240) | fn parse_call_data_with_file() {
function parse_signature (line 1254) | fn parse_signature() {
function parse_block_ids (line 1276) | fn parse_block_ids() {
FILE: crates/cast/src/rlp_converter.rs
type Item (line 12) | pub enum Item {
method value_to_item (line 49) | pub(crate) fn value_to_item(value: &Value) -> eyre::Result<Self> {
method from_iter (line 68) | fn from_iter<T: IntoIterator<Item = Self>>(iter: T) -> Self {
method fmt (line 75) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result {
method encode (line 18) | fn encode(&self, out: &mut dyn alloy_rlp::BufMut) {
method decode (line 27) | fn decode(buf: &mut &[u8]) -> alloy_rlp::Result<Self> {
function array_von_neuman (line 103) | fn array_von_neuman() -> Item {
function encode_decode_test (line 113) | fn encode_decode_test() -> alloy_rlp::Result<()> {
function deserialize_from_str_test_hex (line 155) | fn deserialize_from_str_test_hex() -> JsonResult<()> {
function rlp_data (line 185) | fn rlp_data() {
FILE: crates/cast/src/tx.rs
type SendTxOpts (line 29) | pub struct SendTxOpts {
type SenderKind (line 61) | pub enum SenderKind<'a> {
function address (line 73) | pub fn address(&self) -> Address {
function from_wallet_opts (line 88) | pub async fn from_wallet_opts(opts: WalletOpts) -> Result<Self> {
function as_signer (line 99) | pub fn as_signer(&self) -> Option<&WalletSigner> {
function from (line 109) | fn from(addr: Address) -> Self {
function from (line 115) | fn from(signer: &'a WalletSigner) -> Self {
function from (line 121) | fn from(signer: WalletSigner) -> Self {
function validate_from_address (line 127) | pub fn validate_from_address(
type InitState (line 147) | pub struct InitState;
type ToState (line 151) | pub struct ToState {
type InputState (line 157) | pub struct InputState {
type CastTxSender (line 163) | pub struct CastTxSender<N, P> {
function new (line 174) | pub fn new(provider: P) -> Self {
function send_sync (line 179) | pub async fn send_sync(&self, tx: N::TransactionRequest) -> Result<Strin...
function send (line 224) | pub async fn send(&self, tx: N::TransactionRequest) -> Result<PendingTra...
function send_raw (line 234) | pub async fn send_raw(&self, raw_tx: &[u8]) -> Result<PendingTransaction...
function print_tx_result (line 243) | pub async fn print_tx_result(
function receipt (line 276) | pub async fn receipt(
function format_receipt (line 313) | fn format_receipt(
type CastTxBuilder (line 335) | pub struct CastTxBuilder<N: Network, P, S> {
function new (line 359) | pub async fn new(provider: P, tx_opts: TransactionOpts, config: &Config)...
function with_to (line 386) | pub async fn with_to(self, to: Option<NameOrAddress>) -> Result<CastTxBu...
function with_code_sig_and_args (line 411) | pub async fn with_code_sig_and_args(
function build (line 471) | pub async fn build(
function _build (line 479) | async fn _build(
function prepare (line 502) | fn prepare(&mut self, sender: &SenderKind<'_>) {
function resolve_nonce (line 513) | async fn resolve_nonce(&mut self, from: Address, fill: bool) -> Result<u...
function resolve_access_list (line 527) | async fn resolve_access_list(&mut self) -> Result<()> {
function resolve_auth (line 542) | async fn resolve_auth(&mut self, sender: &SenderKind<'_>, tx_nonce: u64)...
function fill_fees (line 594) | async fn fill_fees(&mut self) -> Result<()> {
function estimate_gas (line 625) | async fn estimate_gas(&mut self) -> Result<()> {
function with_blob_data (line 648) | pub fn with_blob_data(mut self, blob_data: Option<Vec<u8>>) -> Result<Se...
function raw (line 667) | pub fn raw(mut self) -> Self {
function decode_execution_revert (line 674) | async fn decode_execution_revert(data: &RawValue) -> Result<Option<Strin...
FILE: crates/cast/tests/cli/erc20.rs
constant PK1 (line 9) | pub const PK1: &str = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5ef...
constant ADDR1 (line 10) | pub const ADDR1: &str = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";
constant _PK2 (line 13) | pub const _PK2: &str = "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a...
constant ADDR2 (line 14) | pub const ADDR2: &str = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8";
constant TOKEN (line 17) | pub const TOKEN: &str = "0x5FbDB2315678afecb367f032d93F642f64180aa3";
function get_u256_from_cmd (line 20) | fn get_u256_from_cmd(cmd: &mut foundry_test_utils::TestCommand, args: &[...
function get_balance (line 27) | fn get_balance(
function get_allowance (line 36) | fn get_allowance(
function deploy_test_token (line 47) | fn deploy_test_token(
function setup_token_test (line 68) | async fn setup_token_test(
FILE: crates/cheatcodes/spec/src/cheatcode.rs
type CheatcodeDef (line 6) | pub trait CheatcodeDef: std::fmt::Debug + Clone + SolCall {
constant CHEATCODE (line 8) | const CHEATCODE: &'static Cheatcode<'static>;
type Cheatcode (line 16) | pub struct Cheatcode<'a> {
type Status (line 37) | pub enum Status<'a> {
type Group (line 70) | pub enum Group {
method safety (line 138) | pub const fn safety(self) -> Option<Safety> {
method as_str (line 153) | pub const fn as_str(self) -> &'static str {
type Safety (line 175) | pub enum Safety {
Copy disabled (too large)
Download .json
Condensed preview — 1285 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (14,060K chars).
[
{
"path": ".cargo/config.toml",
"chars": 496,
"preview": "[alias]\ncheats = \"test -p foundry-cheatcodes-spec --features schema tests::\"\ntest-debugger = \"test -p forge --test cli m"
},
{
"path": ".config/nextest.toml",
"chars": 861,
"preview": "[test-groups]\n\n[profile.default]\nretries = { backoff = \"exponential\", count = 2, delay = \"5s\", jitter = true }\nslow-time"
},
{
"path": ".devcontainer/Dockerfile.dev",
"chars": 2595,
"preview": "FROM ubuntu:22.04\n\nARG USERNAME=foundry\nARG USER_UID=1000\nARG USER_GID=$USER_UID\nARG PYTHON_VERSION=3.14\nARG NODE_MAJOR="
},
{
"path": ".devcontainer/devcontainer.json",
"chars": 1258,
"preview": "// For format details, see https://aka.ms/devcontainer.json.\n{\n \"name\": \"Foundry Development\",\n \"build\": {\n \"contex"
},
{
"path": ".dockerignore",
"chars": 15,
"preview": "target\n.github\n"
},
{
"path": ".git-blame-ignore-revs",
"chars": 553,
"preview": "# Since version 2.23 (released in August 2019), git-blame has a feature\n# to ignore or bypass certain commits.\n#\n# This "
},
{
"path": ".gitattributes",
"chars": 437,
"preview": "crates/cheatcodes/assets/*.json linguist-generated\ntestdata/cheats/Vm.sol linguist-generated\nbun.lock linguist-generated"
},
{
"path": ".github/CODEOWNERS",
"chars": 79,
"preview": "* @danipopes @mattsse @grandizzy @yash-atreya @zerosnacks @onbjerg @0xrusowsky\n"
},
{
"path": ".github/FLAKY_TEST_FAILURE_TEMPLATE.md",
"chars": 395,
"preview": "---\ntitle: \"bug: flaky tests workflow failed\"\nlabels: P-normal, T-bug\n---\n\nThe nightly flaky tests workflow has failed. "
},
{
"path": ".github/FLAKY_TEST_ISOLATE_FAILURE_TEMPLATE.md",
"chars": 437,
"preview": "---\ntitle: \"bug: flaky tests workflow failed (isolate)\"\nlabels: P-normal, T-bug\n---\n\nThe nightly flaky tests workflow (w"
},
{
"path": ".github/INTEGRATION_FAILURE.md",
"chars": 352,
"preview": "---\ntitle: \"bug: long-running integration tests failed\"\nlabels: P-high, T-bug\n---\n\nThe heavy (long-running) integration "
},
{
"path": ".github/ISSUE_TEMPLATE/BUG-FORM.yml",
"chars": 1673,
"preview": "name: Bug report\ndescription: File a bug report\ntype: Bug\nlabels: [\"T-bug\", \"T-needs-triage\"]\nbody:\n - type: markdown\n "
},
{
"path": ".github/ISSUE_TEMPLATE/FEATURE-FORM.yml",
"chars": 1010,
"preview": "name: Feature request\ndescription: Suggest a feature\ntype: Feature\nlabels: [\"T-feature\", \"T-needs-triage\"]\nbody:\n - typ"
},
{
"path": ".github/ISSUE_TEMPLATE/config.yml",
"chars": 207,
"preview": "blank_issues_enabled: true\ncontact_links:\n - name: Support\n url: https://t.me/foundry_support\n about: This "
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 856,
"preview": "<!--\nThank you for your Pull Request. Please provide a description above and review\nthe requirements below.\n\nBug fixes a"
},
{
"path": ".github/RELEASE_FAILURE_ISSUE_TEMPLATE.md",
"chars": 311,
"preview": "---\ntitle: \"bug: release workflow failed\"\nlabels: P-high, T-bug\n---\n\nThe release workflow has failed. Some or all binari"
},
{
"path": ".github/TEST_ISOLATE_FAILURE_TEMPLATE.md",
"chars": 377,
"preview": "---\ntitle: \"bug: test-isolate workflow failed\"\nlabels: P-high, T-bug\n---\n\nThe daily test-isolate workflow (tests with is"
},
{
"path": ".github/changelog.json",
"chars": 1977,
"preview": "{\n \"categories\": [\n {\n \"title\": \"## Breaking changes\",\n \"labels\": [\"T-likely-breaking \"]"
},
{
"path": ".github/dependabot.yml",
"chars": 185,
"preview": "version: 2\nupdates:\n - package-ecosystem: \"github-actions\"\n directory: \"/\"\n schedule:\n interval: \"weekly\"\n "
},
{
"path": ".github/scripts/combine-benchmarks.sh",
"chars": 5717,
"preview": "#!/bin/bash\nset -euo pipefail\n\n# Script to combine individual benchmark results into LATEST.md\n# Usage: ./combine-benchm"
},
{
"path": ".github/scripts/commit-and-read-benchmarks.sh",
"chars": 3921,
"preview": "#!/bin/bash\nset -euo pipefail\n\n# Script to commit benchmark results and read them for GitHub Actions output\n# Usage: ./c"
},
{
"path": ".github/scripts/create-tag.js",
"chars": 411,
"preview": "module.exports = async ({ github, context }, tagName) => {\n try {\n await github.rest.git.createRef({\n "
},
{
"path": ".github/scripts/format-pr-comment.sh",
"chars": 864,
"preview": "#!/bin/bash\nset -euo pipefail\n\n# Script to format benchmark results for PR comment\n# Usage: ./format-pr-comment.sh <benc"
},
{
"path": ".github/scripts/format.sh",
"chars": 442,
"preview": "#!/usr/bin/env bash\nset -eo pipefail\n\n# We have to ignore at shell level because testdata/ is not a valid Foundry projec"
},
{
"path": ".github/scripts/matrices.py",
"chars": 3760,
"preview": "#!/usr/bin/env python3\n\nimport json\nimport os\n\n\n# A runner target\nclass Target:\n # GHA runner\n runner_label: str\n "
},
{
"path": ".github/scripts/move-tag.js",
"chars": 467,
"preview": "module.exports = async ({ github, context }, tagName) => {\n try {\n await github.rest.git.updateRef({\n "
},
{
"path": ".github/scripts/prune-prereleases.js",
"chars": 2411,
"preview": "// In case node 21 is not used.\nfunction groupBy(array, keyOrIterator) {\n var iterator;\n\n // use the function pass"
},
{
"path": ".github/scripts/setup-foundryup.sh",
"chars": 1492,
"preview": "#!/bin/bash\nset -euo pipefail\n\n# Script to setup foundryup in CI environment\n# This ensures foundryup is available in PA"
},
{
"path": ".github/scripts/shellcheck.sh",
"chars": 622,
"preview": "#!/usr/bin/env bash\n\n# runs shellcheck and prints GitHub Actions annotations for each warning and error\n# https://github"
},
{
"path": ".github/workflows/benchmarks.yml",
"chars": 8204,
"preview": "name: Foundry Benchmarks\n\npermissions: {}\n\non:\n workflow_dispatch:\n inputs:\n pr_number:\n description: \"P"
},
{
"path": ".github/workflows/bump-forge-std.yml",
"chars": 1131,
"preview": "# Daily CI job to update forge-std version used for tests if new release has been published\n\nname: bump-forge-std\n\npermi"
},
{
"path": ".github/workflows/ci.yml",
"chars": 5700,
"preview": "name: CI\n\npermissions: {}\n\non:\n push:\n branches: [master]\n pull_request:\n\nconcurrency:\n group: ${{ github.workflow"
},
{
"path": ".github/workflows/dependencies.yml",
"chars": 457,
"preview": "# Runs `cargo update` periodically.\n\nname: dependencies\n\npermissions: {}\n\non:\n schedule:\n - cron: \"0 0 * * SUN\" # Ru"
},
{
"path": ".github/workflows/docker-publish.yml",
"chars": 4272,
"preview": "name: docker\n\npermissions: {}\n\non:\n workflow_dispatch:\n inputs:\n tag_name:\n default: nightly\n des"
},
{
"path": ".github/workflows/docs.yml",
"chars": 1894,
"preview": "name: docs\n\npermissions: {}\n\non:\n push:\n branches:\n - master\n workflow_call:\n\nconcurrency:\n group: docs-${{ g"
},
{
"path": ".github/workflows/nix.yml",
"chars": 1429,
"preview": "name: nix\n\npermissions: {}\n\non:\n schedule:\n - cron: \"0 0 * * SUN\" # Run weekly on Sundays at midnight UTC\n workflow"
},
{
"path": ".github/workflows/npm.yml",
"chars": 8694,
"preview": "name: npm\n\npermissions: {}\n\non:\n workflow_dispatch:\n inputs:\n run_id:\n type: string\n required: fa"
},
{
"path": ".github/workflows/release.yml",
"chars": 13440,
"preview": "name: release\n\npermissions: {}\n\non:\n push:\n tags:\n - \"stable\"\n - \"rc\"\n - \"rc-*\"\n - \"v*.*.*\"\n sc"
},
{
"path": ".github/workflows/test-flaky.yml",
"chars": 2196,
"preview": "# Daily CI job to run flaky tests that are excluded from regular CI via nextest default-filter\n\nname: test-flaky\n\npermis"
},
{
"path": ".github/workflows/test-isolate.yml",
"chars": 2983,
"preview": "# Daily CI job to run tests with isolation mode enabled by default\n\nname: test-isolate\n\npermissions: {}\n\non:\n schedule:"
},
{
"path": ".github/workflows/test.yml",
"chars": 3836,
"preview": "# Reusable workflow for running tests via `cargo nextest`\n\nname: test\n\npermissions: {}\n\non:\n workflow_call:\n inputs:"
},
{
"path": ".gitignore",
"chars": 203,
"preview": ".DS_STORE\n/target*\n/*.sol\nCLAUDE.md\n\n# Foundry artifacts\nout/\nsnapshots/\n\n# IDEs and extensions\n.idea\n.vscode\n.claude\n.z"
},
{
"path": "CONTRIBUTING.md",
"chars": 13041,
"preview": "## Contributing to Foundry\n\nThanks for your interest in improving Foundry!\n\nThere are multiple opportunities to contribu"
},
{
"path": "Cargo.toml",
"chars": 18720,
"preview": "[workspace]\nmembers = [\n \"benches/\",\n \"crates/anvil/\",\n \"crates/anvil/core/\",\n \"crates/anvil/rpc/\",\n \"cra"
},
{
"path": "Dockerfile",
"chars": 2549,
"preview": "# syntax=docker/dockerfile:1\n\nFROM rust:1-bookworm AS chef\nWORKDIR /app\n\nRUN apt update && apt install -y build-essentia"
},
{
"path": "FUNDING.json",
"chars": 213,
"preview": "{\n \"drips\": {\n \"ethereum\": {\n \"ownedBy\": \"0x86308c59a6005d012C51Eef104bBc21786aC5D2E\"\n }\n },\n \"opRetro\": {"
},
{
"path": "LICENSE-APACHE",
"chars": 10757,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "LICENSE-MIT",
"chars": 1067,
"preview": "Copyright (c) 2021 Georgios Konstantopoulos\n\nPermission is hereby granted, free of charge, to any person obtaining a cop"
},
{
"path": "Makefile",
"chars": 3705,
"preview": "# Heavily inspired by:\n# - Lighthouse: https://github.com/sigp/lighthouse/blob/693886b94176faa4cb450f024696cb69cda2fe58/"
},
{
"path": "README.md",
"chars": 3117,
"preview": "<div align=\"center\">\n <img src=\".github/assets/banner.png\" alt=\"Foundry banner\" />\n\n \n\n[![Github Actions][gha-badg"
},
{
"path": "SECURITY.md",
"chars": 108,
"preview": "# Security Policy\n\n## Reporting a Vulnerability\n\nContact [security@ithaca.xyz](mailto:security@ithaca.xyz).\n"
},
{
"path": "benches/Cargo.toml",
"chars": 734,
"preview": "[package]\nname = \"foundry-bench\"\ndescription = \"Foundry benchmark runner\"\n\nversion.workspace = true\nedition.workspace = "
},
{
"path": "benches/LATEST.md",
"chars": 2369,
"preview": "# Foundry Benchmark Results\n\n**Date**: 2025-10-02 12:14:23\n\n## Repositories Tested\n\n1. [ithacaxyz/account](https://githu"
},
{
"path": "benches/README.md",
"chars": 4365,
"preview": "# Foundry Benchmarks\n\nThis directory contains performance benchmarks for Foundry commands across multiple repositories a"
},
{
"path": "benches/src/lib.rs",
"chars": 16278,
"preview": "//! Foundry benchmark runner.\n\nuse crate::results::{HyperfineOutput, HyperfineResult};\nuse eyre::{Result, WrapErr};\nuse "
},
{
"path": "benches/src/main.rs",
"chars": 8657,
"preview": "use clap::Parser;\nuse eyre::{Result, WrapErr};\nuse foundry_bench::{\n BENCHMARK_REPOS, BenchmarkProject, FOUNDRY_VERSI"
},
{
"path": "benches/src/results.rs",
"chars": 8044,
"preview": "use crate::RepoConfig;\nuse eyre::Result;\nuse serde::{Deserialize, Serialize};\nuse std::{collections::HashMap, process::C"
},
{
"path": "benchmark.sh",
"chars": 1156,
"preview": "#!/bin/bash\n\nversions=\"v1.3.6,v1.4.0-rc1\"\n\n# Repositories\nexport ITHACA_ACCOUNT=\"ithacaxyz/account:v0.3.2\"\nexport SOLADY"
},
{
"path": "clippy.toml",
"chars": 605,
"preview": "# `bytes::Bytes` is included by default and `alloy_primitives::Bytes` is a wrapper around it,\n# so it is safe to ignore "
},
{
"path": "crates/anvil/Cargo.toml",
"chars": 3528,
"preview": "[package]\nname = \"anvil\"\ndescription = \"Local ethereum node\"\n\nversion.workspace = true\nedition.workspace = true\nrust-ver"
},
{
"path": "crates/anvil/bin/main.rs",
"chars": 357,
"preview": "//! The `anvil` CLI: a fast local Ethereum development node, akin to Hardhat Network, Tenderly.\n\nuse anvil::args::run;\n\n"
},
{
"path": "crates/anvil/core/Cargo.toml",
"chars": 1032,
"preview": "[package]\nname = \"anvil-core\"\n\nversion.workspace = true\nedition.workspace = true\nrust-version.workspace = true\nauthors.w"
},
{
"path": "crates/anvil/core/src/eth/block.rs",
"chars": 15082,
"preview": "use super::transaction::TransactionInfo;\nuse alloy_consensus::{\n BlockBody, EMPTY_OMMER_ROOT_HASH, Header, proofs::ca"
},
{
"path": "crates/anvil/core/src/eth/mod.rs",
"chars": 68743,
"preview": "use crate::{eth::subscription::SubscriptionId, types::ReorgOptions};\nuse alloy_primitives::{Address, B64, B256, Bytes, T"
},
{
"path": "crates/anvil/core/src/eth/serde_helpers.rs",
"chars": 2125,
"preview": "//! custom serde helper functions\n\npub mod sequence {\n use serde::{\n Deserialize, Deserializer, Serialize, Ser"
},
{
"path": "crates/anvil/core/src/eth/subscription.rs",
"chars": 1608,
"preview": "//! Subscription types\nuse alloy_primitives::hex;\nuse rand::{Rng, distr::Alphanumeric, rng};\nuse std::fmt;\n\n/// Unique s"
},
{
"path": "crates/anvil/core/src/eth/transaction/mod.rs",
"chars": 6027,
"preview": "//! Transaction related types\nuse alloy_consensus::{\n Transaction, Typed2718,\n crypto::RecoveryError,\n transact"
},
{
"path": "crates/anvil/core/src/eth/wallet.rs",
"chars": 1825,
"preview": "pub use alloy_eip5792::*;\n\n#[derive(Debug, thiserror::Error)]\npub enum WalletError {\n /// The transaction value is no"
},
{
"path": "crates/anvil/core/src/lib.rs",
"chars": 238,
"preview": "//! # anvil-core\n//!\n//! Core Ethereum types for Anvil.\n\n#![cfg_attr(not(test), warn(unused_crate_dependencies))]\n#![cfg"
},
{
"path": "crates/anvil/core/src/types.rs",
"chars": 566,
"preview": "use alloy_primitives::Bytes;\nuse alloy_rpc_types::TransactionRequest;\nuse serde::Deserialize;\n\n/// Represents the option"
},
{
"path": "crates/anvil/rpc/Cargo.toml",
"chars": 307,
"preview": "[package]\nname = \"anvil-rpc\"\n\nversion.workspace = true\nedition.workspace = true\nrust-version.workspace = true\nauthors.wo"
},
{
"path": "crates/anvil/rpc/src/error.rs",
"chars": 4814,
"preview": "//! JSON-RPC error bindings\nuse serde::{Deserialize, Deserializer, Serialize, Serializer};\nuse std::{borrow::Cow, fmt};\n"
},
{
"path": "crates/anvil/rpc/src/lib.rs",
"chars": 279,
"preview": "//! # anvil-rpc\n//!\n//! JSON-RPC types.\n\n#![cfg_attr(not(test), warn(unused_crate_dependencies))]\n#![cfg_attr(docsrs, fe"
},
{
"path": "crates/anvil/rpc/src/request.rs",
"chars": 9996,
"preview": "use serde::{Deserialize, Serialize};\nuse std::fmt;\n\n/// A JSON-RPC request object, a method call\n#[derive(Clone, Debug, "
},
{
"path": "crates/anvil/rpc/src/response.rs",
"chars": 2178,
"preview": "use crate::{\n error::RpcError,\n request::{Id, Version},\n};\nuse serde::{Deserialize, Serialize};\n\n/// Response of a"
},
{
"path": "crates/anvil/server/Cargo.toml",
"chars": 1048,
"preview": "[package]\nname = \"anvil-server\"\ndescription = \"Customizable RPC server\"\n\nversion.workspace = true\nedition.workspace = tr"
},
{
"path": "crates/anvil/server/src/config.rs",
"chars": 2539,
"preview": "use crate::HeaderValue;\nuse serde::{Deserialize, Deserializer, Serialize, Serializer};\nuse std::str::FromStr;\n\n/// Addit"
},
{
"path": "crates/anvil/server/src/error.rs",
"chars": 407,
"preview": "//! Error variants used to unify different connection streams\n\n/// An error that can occur when reading an incoming requ"
},
{
"path": "crates/anvil/server/src/handler.rs",
"chars": 2391,
"preview": "use crate::RpcHandler;\nuse anvil_rpc::{\n error::RpcError,\n request::{Request, RpcCall},\n response::{Response, R"
},
{
"path": "crates/anvil/server/src/ipc.rs",
"chars": 6075,
"preview": "//! IPC handling\n\nuse crate::{PubSubRpcHandler, error::RequestError, pubsub::PubSubConnection};\nuse anvil_rpc::request::"
},
{
"path": "crates/anvil/server/src/lib.rs",
"chars": 4075,
"preview": "//! Bootstrap [axum] RPC servers.\n\n#![cfg_attr(not(test), warn(unused_crate_dependencies))]\n#\n\nuse std::{\n collections::BTreeMap,\n fmt::{self, Debug"
},
{
"path": "crates/anvil/src/eth/backend/env.rs",
"chars": 560,
"preview": "use alloy_evm::EvmEnv;\nuse foundry_evm_networks::NetworkConfigs;\nuse op_revm::OpTransaction;\nuse revm::context::TxEnv;\n\n"
},
{
"path": "crates/anvil/src/eth/backend/executor.rs",
"chars": 12870,
"preview": "use crate::{\n eth::backend::{cheats::CheatsManager, env::Env},\n mem::inspector::AnvilInspector,\n};\nuse alloy_conse"
},
{
"path": "crates/anvil/src/eth/backend/fork.rs",
"chars": 25835,
"preview": "//! Support for forking off another client\n\nuse crate::eth::{backend::db::Db, error::BlockchainError, pool::transactions"
},
{
"path": "crates/anvil/src/eth/backend/genesis.rs",
"chars": 2602,
"preview": "//! Genesis settings\n\nuse crate::eth::backend::db::Db;\nuse alloy_genesis::{Genesis, GenesisAccount};\nuse alloy_primitive"
},
{
"path": "crates/anvil/src/eth/backend/info.rs",
"chars": 1970,
"preview": "//! Handler that can get current storage related data\n\nuse crate::mem::Backend;\nuse alloy_consensus::TxReceipt;\nuse allo"
},
{
"path": "crates/anvil/src/eth/backend/mem/cache.rs",
"chars": 4573,
"preview": "use crate::config::anvil_tmp_dir;\nuse alloy_primitives::B256;\nuse foundry_evm::backend::StateSnapshot;\nuse std::{\n io"
},
{
"path": "crates/anvil/src/eth/backend/mem/fork_db.rs",
"chars": 5963,
"preview": "use crate::eth::backend::db::{\n Db, MaybeForkedDatabase, MaybeFullDatabase, SerializableAccountRecord, SerializableBl"
},
{
"path": "crates/anvil/src/eth/backend/mem/in_memory_db.rs",
"chars": 8599,
"preview": "//! The in memory DB\n\nuse crate::{\n eth::backend::db::{\n Db, MaybeForkedDatabase, MaybeFullDatabase, Serializa"
},
{
"path": "crates/anvil/src/eth/backend/mem/inspector.rs",
"chars": 6535,
"preview": "//! Anvil specific [`revm::Inspector`] implementation\n\nuse crate::eth::macros::node_info;\nuse alloy_primitives::{Address"
},
{
"path": "crates/anvil/src/eth/backend/mem/mod.rs",
"chars": 189744,
"preview": "//! In-memory blockchain backend.\nuse self::state::trie_storage;\nuse super::executor::new_eth_evm_with_inspector;\nuse cr"
},
{
"path": "crates/anvil/src/eth/backend/mem/state.rs",
"chars": 2129,
"preview": "//! Support for generating the state root for memdb storage\n\nuse alloy_primitives::{\n B256, U256, keccak256,\n map:"
},
{
"path": "crates/anvil/src/eth/backend/mem/storage.rs",
"chars": 27827,
"preview": "//! In-memory blockchain storage\nuse crate::eth::{\n backend::{\n db::{\n MaybeFullDatabase, Serializa"
},
{
"path": "crates/anvil/src/eth/backend/mod.rs",
"chars": 264,
"preview": "//! blockchain Backend\n\n/// [revm](foundry_evm::revm) related types\npub mod db;\n/// In-memory Backend\npub mod mem;\n\npub "
},
{
"path": "crates/anvil/src/eth/backend/notifications.rs",
"chars": 539,
"preview": "//! Notifications emitted from the backed\n\nuse alloy_consensus::Header;\nuse alloy_primitives::B256;\nuse futures::channel"
},
{
"path": "crates/anvil/src/eth/backend/time.rs",
"chars": 5720,
"preview": "//! Manages the block time\n\nuse crate::eth::error::BlockchainError;\nuse chrono::{DateTime, Utc};\nuse parking_lot::RwLock"
},
{
"path": "crates/anvil/src/eth/backend/validate.rs",
"chars": 1325,
"preview": "//! Support for validating transactions at certain stages\n\nuse crate::eth::{\n backend::env::Env,\n error::{Blockcha"
},
{
"path": "crates/anvil/src/eth/error.rs",
"chars": 26644,
"preview": "//! Aggregated error type for this module\n\nuse alloy_consensus::crypto::RecoveryError;\nuse alloy_evm::overrides::StateOv"
},
{
"path": "crates/anvil/src/eth/fees.rs",
"chars": 17100,
"preview": "use std::{\n collections::BTreeMap,\n fmt,\n pin::Pin,\n sync::Arc,\n task::{Context, Poll},\n};\n\nuse alloy_con"
},
{
"path": "crates/anvil/src/eth/macros.rs",
"chars": 247,
"preview": "/// A `info!` helper macro that emits to the target, the node logger listens for\nmacro_rules! node_info {\n ($($arg:tt"
},
{
"path": "crates/anvil/src/eth/miner.rs",
"chars": 9853,
"preview": "//! Mines transactions\n\nuse crate::eth::pool::{Pool, transactions::PoolTransaction};\nuse alloy_primitives::TxHash;\nuse f"
},
{
"path": "crates/anvil/src/eth/mod.rs",
"chars": 182,
"preview": "pub mod api;\npub mod otterscan;\npub mod sign;\npub use api::EthApi;\n\npub mod backend;\n\npub mod error;\n\npub mod fees;\npub("
},
{
"path": "crates/anvil/src/eth/otterscan/api.rs",
"chars": 17316,
"preview": "use crate::eth::{\n EthApi,\n error::{BlockchainError, Result},\n macros::node_info,\n};\nuse alloy_consensus::{Bloc"
},
{
"path": "crates/anvil/src/eth/otterscan/mod.rs",
"chars": 13,
"preview": "pub mod api;\n"
},
{
"path": "crates/anvil/src/eth/pool/mod.rs",
"chars": 18684,
"preview": "//! # Transaction Pool implementation\n//!\n//! The transaction pool is responsible for managing a set of transactions tha"
},
{
"path": "crates/anvil/src/eth/pool/transactions.rs",
"chars": 28123,
"preview": "use crate::eth::{error::PoolError, util::hex_fmt_many};\nuse alloy_consensus::{Transaction, Typed2718};\nuse alloy_network"
},
{
"path": "crates/anvil/src/eth/sign.rs",
"chars": 6301,
"preview": "use crate::eth::error::BlockchainError;\nuse alloy_consensus::{Sealed, SignableTransaction};\nuse alloy_dyn_abi::TypedData"
},
{
"path": "crates/anvil/src/eth/util.rs",
"chars": 319,
"preview": "use alloy_primitives::hex;\nuse itertools::Itertools;\n\n/// Formats values as hex strings, separated by commas.\npub fn hex"
},
{
"path": "crates/anvil/src/evm.rs",
"chars": 10647,
"preview": "use alloy_evm::precompiles::DynPrecompile;\nuse alloy_primitives::Address;\nuse std::fmt::Debug;\n\n/// Object-safe trait th"
},
{
"path": "crates/anvil/src/filter.rs",
"chars": 7555,
"preview": "//! Support for polling based filters\nuse crate::{\n StorageInfo,\n eth::{backend::notifications::NewBlockNotificati"
},
{
"path": "crates/anvil/src/lib.rs",
"chars": 14757,
"preview": "//! Anvil is a fast local Ethereum development node.\n\n#![cfg_attr(not(test), warn(unused_crate_dependencies))]\n#![cfg_at"
},
{
"path": "crates/anvil/src/logging.rs",
"chars": 2205,
"preview": "//! User facing Logger\n\nuse parking_lot::RwLock;\nuse std::sync::Arc;\nuse tracing::{Metadata, subscriber::Interest};\nuse "
},
{
"path": "crates/anvil/src/opts.rs",
"chars": 776,
"preview": "use crate::cmd::NodeArgs;\nuse clap::{Parser, Subcommand};\nuse foundry_cli::opts::GlobalArgs;\nuse foundry_common::version"
},
{
"path": "crates/anvil/src/pubsub.rs",
"chars": 8462,
"preview": "use crate::{\n StorageInfo,\n eth::{backend::notifications::NewBlockNotifications, error::to_rpc_result},\n};\nuse all"
},
{
"path": "crates/anvil/src/server/beacon/error.rs",
"chars": 3784,
"preview": "//! Beacon API error types\n\nuse axum::{\n Json,\n http::StatusCode,\n response::{IntoResponse, Response},\n};\nuse s"
},
{
"path": "crates/anvil/src/server/beacon/handlers.rs",
"chars": 5595,
"preview": "use super::{error::BeaconError, utils::must_be_ssz};\nuse crate::eth::EthApi;\nuse alloy_eips::BlockId;\nuse alloy_primitiv"
},
{
"path": "crates/anvil/src/server/beacon/mod.rs",
"chars": 618,
"preview": "//! Beacon Node REST API implementation for Anvil.\n\nuse axum::{Router, routing::get};\n\nuse crate::eth::EthApi;\nuse found"
},
{
"path": "crates/anvil/src/server/beacon/utils.rs",
"chars": 1418,
"preview": "use hyper::HeaderMap;\n\n/// Helper function to determine if the Accept header indicates a preference for SSZ (octet-strea"
},
{
"path": "crates/anvil/src/server/mod.rs",
"chars": 2664,
"preview": "//! This module provides the infrastructure to launch an Ethereum JSON-RPC server\n//! (via HTTP, WebSocket, and IPC) and"
},
{
"path": "crates/anvil/src/server/rpc_handlers.rs",
"chars": 5710,
"preview": "//! Contains RPC handlers\nuse crate::{\n EthApi,\n eth::error::to_rpc_result,\n pubsub::{EthSubscription, LogsSubs"
},
{
"path": "crates/anvil/src/service.rs",
"chars": 6715,
"preview": "//! background service\n\nuse crate::{\n NodeResult,\n eth::{\n backend::validate::TransactionValidator,\n "
},
{
"path": "crates/anvil/src/shutdown.rs",
"chars": 1084,
"preview": "//! Helper for shutdown signals\n\nuse futures::{\n FutureExt,\n channel::oneshot,\n future::{FusedFuture, Shared},\n"
},
{
"path": "crates/anvil/src/tasks/block_listener.rs",
"chars": 1718,
"preview": "//! A task that listens for new blocks\n\nuse crate::shutdown::Shutdown;\nuse futures::{FutureExt, Stream, StreamExt};\nuse "
},
{
"path": "crates/anvil/src/tasks/mod.rs",
"chars": 6006,
"preview": "//! Task management support\n\n#![allow(rustdoc::private_doc_tests)]\n\nuse crate::{EthApi, shutdown::Shutdown, tasks::block"
},
{
"path": "crates/anvil/test-data/SimpleStorage.json",
"chars": 8166,
"preview": "{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"cons"
},
{
"path": "crates/anvil/test-data/SimpleStorage.sol",
"chars": 911,
"preview": "pragma solidity >=0.4.24;\n\ncontract SimpleStorage {\n\n event ValueChanged(address indexed author, address indexed oldA"
},
{
"path": "crates/anvil/test-data/emit_logs.json",
"chars": 3616,
"preview": "{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"cons"
},
{
"path": "crates/anvil/test-data/emit_logs.sol",
"chars": 463,
"preview": "pragma solidity >=0.4.24;\n\ncontract SimpleStorage {\n\n event ValueChanged(address indexed author, string oldValue, str"
},
{
"path": "crates/anvil/test-data/greeter.json",
"chars": 2791,
"preview": "{\"bytecode\":{\"object\":\"608060405234801561001057600080fd5b506040516104913803806104918339818101604052602081101561003357600"
},
{
"path": "crates/anvil/test-data/multicall.json",
"chars": 7254,
"preview": "{\"abi\":[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"n"
},
{
"path": "crates/anvil/test-data/multicall.sol",
"chars": 1764,
"preview": "/**\n *Submitted for verification at Etherscan.io on 2019-06-10\n*/\n\npragma solidity >=0.5.0;\npragma experimental ABIEncod"
},
{
"path": "crates/anvil/test-data/state-dump-legacy-stress.json",
"chars": 120138,
"preview": "{\"block\":{\"number\":5,\"beneficiary\":\"0x0000000000000000000000000000000000000000\",\"timestamp\":1722941643,\"gas_limit\":30000"
},
{
"path": "crates/anvil/test-data/state-dump-legacy.json",
"chars": 6771,
"preview": "{\"block\":{\"number\":2,\"beneficiary\":\"0x0000000000000000000000000000000000000000\",\"timestamp\":1724762147,\"gas_limit\":30000"
},
{
"path": "crates/anvil/test-data/state-dump.json",
"chars": 13040,
"preview": "{\n \"block\": {\n \"number\": 2,\n \"beneficiary\": \"0x0000000000000000000000000000000000000000\",\n \"timestamp\": 172476"
},
{
"path": "crates/anvil/test-data/storage_sample.json",
"chars": 4279,
"preview": "{\"0x0000000000000000000000000000000000000000000000000000000000000022\":\"0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e"
},
{
"path": "crates/anvil/tests/it/abi.rs",
"chars": 3179,
"preview": "//! commonly used sol generated types\nuse alloy_sol_types::sol;\n\nsol!(\n #[sol(rpc)]\n Greeter,\n \"test-data/greet"
},
{
"path": "crates/anvil/tests/it/anvil.rs",
"chars": 10643,
"preview": "//! tests for anvil specific logic\n\nuse alloy_consensus::EMPTY_ROOT_HASH;\nuse alloy_eips::BlockNumberOrTag;\nuse alloy_ne"
},
{
"path": "crates/anvil/tests/it/anvil_api.rs",
"chars": 43001,
"preview": "//! tests for custom anvil endpoints\n\nuse crate::{\n abi::{self, BUSD, Greeter, Multicall},\n fork::fork_config,\n "
},
{
"path": "crates/anvil/tests/it/api.rs",
"chars": 24809,
"preview": "//! general eth api tests\n\nuse crate::{\n abi::{Multicall, SimpleStorage, VendingMachine},\n utils::{connect_pubsub_"
},
{
"path": "crates/anvil/tests/it/beacon_api.rs",
"chars": 10443,
"preview": "use crate::utils::http_provider;\nuse alloy_consensus::{Blob, BlobTransactionSidecar, SidecarBuilder, SimpleCoder, Transa"
},
{
"path": "crates/anvil/tests/it/eip2935.rs",
"chars": 3173,
"preview": "use crate::utils::http_provider;\nuse alloy_eips::{BlockNumberOrTag, eip2935::HISTORY_STORAGE_ADDRESS};\nuse alloy_network"
},
{
"path": "crates/anvil/tests/it/eip4844.rs",
"chars": 18847,
"preview": "use crate::utils::{http_provider, http_provider_with_signer};\nuse alloy_consensus::{BlobTransactionSidecar, SidecarBuild"
},
{
"path": "crates/anvil/tests/it/eip7702.rs",
"chars": 8247,
"preview": "use crate::utils::http_provider;\nuse alloy_consensus::{SignableTransaction, transaction::TxEip7702};\nuse alloy_network::"
},
{
"path": "crates/anvil/tests/it/fork.rs",
"chars": 76150,
"preview": "//! various fork related test\n\nuse crate::{\n abi::{ERC721, Greeter},\n utils::{http_provider, http_provider_with_si"
},
{
"path": "crates/anvil/tests/it/gas.rs",
"chars": 8597,
"preview": "//! Gas related tests\n\nuse crate::utils::http_provider_with_signer;\nuse alloy_network::{EthereumWallet, TransactionBuild"
},
{
"path": "crates/anvil/tests/it/genesis.rs",
"chars": 3482,
"preview": "//! genesis.json tests\n\nuse crate::fork::fork_config;\nuse alloy_genesis::Genesis;\nuse alloy_primitives::{Address, U256};"
},
{
"path": "crates/anvil/tests/it/ipc.rs",
"chars": 1692,
"preview": "//! IPC tests\n\nuse crate::{init_tracing, utils::connect_pubsub};\nuse alloy_primitives::U256;\nuse alloy_provider::Provide"
},
{
"path": "crates/anvil/tests/it/logs.rs",
"chars": 6608,
"preview": "//! log/event related tests\n\nuse crate::{\n abi::SimpleStorage::{self},\n utils::{http_provider_with_signer, ws_prov"
},
{
"path": "crates/anvil/tests/it/main.rs",
"chars": 359,
"preview": "mod abi;\nmod anvil;\nmod anvil_api;\nmod api;\nmod beacon_api;\nmod eip2935;\nmod eip4844;\nmod eip7702;\nmod fork;\nmod gas;\nmo"
},
{
"path": "crates/anvil/tests/it/optimism.rs",
"chars": 13024,
"preview": "//! Tests for OP chain support.\n\nuse crate::utils::{http_provider, http_provider_with_signer};\nuse alloy_eips::eip2718::"
},
{
"path": "crates/anvil/tests/it/otterscan.rs",
"chars": 20125,
"preview": "//! Tests for otterscan endpoints.\n\nuse crate::abi::Multicall;\nuse alloy_network::TransactionResponse;\nuse alloy_primiti"
},
{
"path": "crates/anvil/tests/it/proof.rs",
"chars": 11798,
"preview": "//! tests for `eth_getProof`\n\nuse alloy_primitives::{Address, B256, Bytes, U256, address, fixed_bytes};\nuse anvil::{Node"
},
{
"path": "crates/anvil/tests/it/pubsub.rs",
"chars": 9087,
"preview": "//! tests for subscriptions\n\nuse crate::utils::{connect_pubsub, connect_pubsub_with_wallet};\nuse alloy_network::{Ethereu"
},
{
"path": "crates/anvil/tests/it/revert.rs",
"chars": 5162,
"preview": "use crate::abi::VendingMachine;\nuse alloy_network::TransactionBuilder;\nuse alloy_primitives::{U256, bytes};\nuse alloy_pr"
},
{
"path": "crates/anvil/tests/it/sign.rs",
"chars": 20798,
"preview": "use crate::utils::http_provider_with_signer;\nuse alloy_dyn_abi::TypedData;\nuse alloy_network::EthereumWallet;\nuse alloy_"
},
{
"path": "crates/anvil/tests/it/simulate.rs",
"chars": 1599,
"preview": "//! general eth api tests\n\nuse alloy_primitives::{TxKind, U256, address};\nuse alloy_rpc_types::{\n BlockOverrides,\n "
},
{
"path": "crates/anvil/tests/it/state.rs",
"chars": 36410,
"preview": "//! general eth api tests\n\nuse crate::abi::Greeter;\nuse alloy_network::{ReceiptResponse, TransactionBuilder};\nuse alloy_"
},
{
"path": "crates/anvil/tests/it/traces.rs",
"chars": 57778,
"preview": "use std::collections::HashMap;\n\nuse crate::{\n abi::{Multicall, SimpleStorage},\n fork::fork_config,\n utils::http"
},
{
"path": "crates/anvil/tests/it/transaction.rs",
"chars": 55041,
"preview": "use crate::{\n abi::{Greeter, Multicall, SimpleStorage},\n utils::{connect_pubsub, http_provider_with_signer},\n};\nus"
},
{
"path": "crates/anvil/tests/it/txpool.rs",
"chars": 4387,
"preview": "//! txpool related tests\n\nuse alloy_network::{ReceiptResponse, TransactionBuilder};\nuse alloy_primitives::U256;\nuse allo"
},
{
"path": "crates/anvil/tests/it/utils.rs",
"chars": 2019,
"preview": "use alloy_network::{Ethereum, EthereumWallet};\nuse alloy_provider::{\n Identity, RootProvider,\n fillers::{ChainIdFi"
},
{
"path": "crates/anvil/tests/it/wsapi.rs",
"chars": 901,
"preview": "//! general eth api tests with websocket provider\n\nuse alloy_primitives::U256;\nuse alloy_provider::Provider;\nuse anvil::"
},
{
"path": "crates/cast/Cargo.toml",
"chars": 2901,
"preview": "[package]\nname = \"cast\"\ndescription = \"Command-line tool for performing Ethereum RPC calls\"\n\nversion.workspace = true\ned"
},
{
"path": "crates/cast/bin/main.rs",
"chars": 390,
"preview": "//! The `cast` CLI: a Swiss Army knife for interacting with EVM smart contracts, sending\n//! transactions and getting ch"
},
{
"path": "crates/cast/src/args.rs",
"chars": 35723,
"preview": "use crate::{\n Cast, SimpleCast,\n cmd::erc20::IERC20,\n opts::{Cast as CastArgs, CastSubcommand, ToBaseArgs},\n "
},
{
"path": "crates/cast/src/base.rs",
"chars": 23607,
"preview": "use alloy_primitives::{I256, Sign, U256, utils::ParseUnits};\nuse eyre::Result;\nuse std::{\n convert::Infallible,\n f"
},
{
"path": "crates/cast/src/cmd/access_list.rs",
"chars": 3629,
"preview": "use crate::{\n Cast,\n tx::{CastTxBuilder, SenderKind},\n};\nuse alloy_ens::NameOrAddress;\nuse alloy_network::{AnyNetw"
},
{
"path": "crates/cast/src/cmd/artifact.rs",
"chars": 2629,
"preview": "use super::{\n creation_code::{fetch_creation_code_from_etherscan, parse_code_output},\n interface::load_abi_from_fi"
},
{
"path": "crates/cast/src/cmd/b2e_payload.rs",
"chars": 3792,
"preview": "//! Command Line handler to convert Beacon block's execution payload to Execution format.\n\nuse std::path::PathBuf;\n\nuse "
},
{
"path": "crates/cast/src/cmd/bind.rs",
"chars": 1761,
"preview": "use clap::{Parser, ValueHint};\nuse eyre::Result;\nuse foundry_cli::opts::EtherscanOpts;\nuse std::path::PathBuf;\n\nconst DE"
},
{
"path": "crates/cast/src/cmd/call.rs",
"chars": 28548,
"preview": "use super::run::fetch_contracts_bytecode_from_trace;\nuse crate::{\n Cast,\n debug::handle_traces,\n traces::TraceK"
},
{
"path": "crates/cast/src/cmd/constructor_args.rs",
"chars": 3115,
"preview": "use super::{creation_code::fetch_creation_code_from_etherscan, interface::load_abi_from_file};\nuse alloy_dyn_abi::DynSol"
},
{
"path": "crates/cast/src/cmd/create2.rs",
"chars": 16285,
"preview": "use alloy_primitives::{Address, B256, U256, hex, keccak256};\nuse clap::Parser;\nuse eyre::{Result, WrapErr};\nuse rand::{R"
},
{
"path": "crates/cast/src/cmd/creation_code.rs",
"chars": 5419,
"preview": "use super::interface::load_abi_from_file;\nuse crate::SimpleCast;\nuse alloy_consensus::Transaction;\nuse alloy_network::An"
},
{
"path": "crates/cast/src/cmd/da_estimate.rs",
"chars": 1567,
"preview": "//! Estimates the data availability size of a block for opstack.\n\nuse alloy_consensus::BlockHeader;\nuse alloy_network::e"
},
{
"path": "crates/cast/src/cmd/erc20.rs",
"chars": 17536,
"preview": "use std::{str::FromStr, time::Duration};\n\nuse crate::{cmd::send::cast_send, format_uint_exp, tx::SendTxOpts};\nuse alloy_"
},
{
"path": "crates/cast/src/cmd/estimate.rs",
"chars": 4168,
"preview": "use crate::tx::{CastTxBuilder, SenderKind};\nuse alloy_ens::NameOrAddress;\nuse alloy_network::{AnyNetwork, Network};\nuse "
},
{
"path": "crates/cast/src/cmd/find_block.rs",
"chars": 3518,
"preview": "use crate::Cast;\nuse alloy_provider::Provider;\nuse clap::Parser;\nuse eyre::Result;\nuse foundry_cli::{\n opts::RpcOpts,"
},
{
"path": "crates/cast/src/cmd/interface.rs",
"chars": 5985,
"preview": "use alloy_json_abi::{ContractObject, JsonAbi, ToSolConfig};\nuse alloy_primitives::Address;\nuse clap::Parser;\nuse eyre::{"
},
{
"path": "crates/cast/src/cmd/logs.rs",
"chars": 15014,
"preview": "use crate::Cast;\nuse alloy_dyn_abi::{DynSolType, DynSolValue, Specifier};\nuse alloy_ens::NameOrAddress;\nuse alloy_json_a"
},
{
"path": "crates/cast/src/cmd/mktx.rs",
"chars": 5906,
"preview": "use crate::tx::{self, CastTxBuilder};\nuse alloy_consensus::{SignableTransaction, Signed};\nuse alloy_eips::Encodable2718;"
},
{
"path": "crates/cast/src/cmd/mod.rs",
"chars": 704,
"preview": "//! `cast` subcommands.\n//!\n//! All subcommands should respect the `foundry_config::Config`.\n//! If a subcommand accepts"
},
{
"path": "crates/cast/src/cmd/rpc.rs",
"chars": 2158,
"preview": "use crate::Cast;\nuse clap::Parser;\nuse eyre::Result;\nuse foundry_cli::{opts::RpcOpts, utils, utils::LoadConfig};\nuse fou"
},
{
"path": "crates/cast/src/cmd/run.rs",
"chars": 14053,
"preview": "use crate::{\n debug::handle_traces,\n utils::{apply_chain_and_block_specific_env_changes, block_env_from_header},\n}"
},
{
"path": "crates/cast/src/cmd/send.rs",
"chars": 9067,
"preview": "use std::{path::PathBuf, str::FromStr, time::Duration};\n\nuse alloy_consensus::{SignableTransaction, Signed};\nuse alloy_e"
},
{
"path": "crates/cast/src/cmd/storage.rs",
"chars": 14616,
"preview": "use crate::{Cast, opts::parse_slot};\nuse alloy_ens::NameOrAddress;\nuse alloy_network::AnyNetwork;\nuse alloy_primitives::"
},
{
"path": "crates/cast/src/cmd/trace.rs",
"chars": 2872,
"preview": "use alloy_eips::Encodable2718;\nuse alloy_network::AnyRpcTransaction;\nuse alloy_primitives::hex;\nuse alloy_provider::ext:"
},
{
"path": "crates/cast/src/cmd/txpool.rs",
"chars": 2293,
"preview": "use alloy_primitives::Address;\nuse alloy_provider::ext::TxPoolApi;\nuse clap::Parser;\nuse foundry_cli::{\n opts::RpcOpt"
},
{
"path": "crates/cast/src/cmd/wallet/list.rs",
"chars": 5141,
"preview": "use clap::Parser;\nuse eyre::Result;\nuse std::env;\n\nuse foundry_common::{fs, sh_err, sh_println};\nuse foundry_config::Con"
},
{
"path": "crates/cast/src/cmd/wallet/mod.rs",
"chars": 48273,
"preview": "use alloy_chains::Chain;\nuse alloy_dyn_abi::TypedData;\nuse alloy_primitives::{Address, B256, Signature, U256, hex};\nuse "
},
{
"path": "crates/cast/src/cmd/wallet/vanity.rs",
"chars": 12307,
"preview": "use alloy_primitives::{Address, hex};\nuse alloy_signer::{k256::ecdsa::SigningKey, utils::secret_key_to_address};\nuse all"
}
]
// ... and 1085 more files (download for full content)
About this extraction
This page contains the full source code of the foundry-rs/foundry GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1285 files (12.8 MB), approximately 3.4M tokens, and a symbol index with 10984 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.