Expand description
Helpers for deploying Foundry artifacts into an EvmCache.
The main use case is local simulation against a fork where the caller wants to replace code at an existing address while preserving that account’s storage, balance, and nonce. For contracts with immutables, the helper first runs the creation bytecode with ABI-encoded constructor arguments, then copies the resulting runtime bytecode to the target address.
Structs§
- Etched
Contract - Result of deploying an artifact and etching its runtime code at a target.
- Foundry
Artifact - A Foundry JSON artifact with decoded creation bytecode.
Functions§
- build_
init_ code - Build init code from creation bytecode and ABI-encoded constructor args.
- deploy_
foundry_ artifact - Deploy a Foundry artifact into the forked EVM and return its temporary deployed address.
- encode_
constructor_ args - ABI-encode constructor arguments.
- etch_
foundry_ artifact - Deploy a Foundry artifact and copy its runtime bytecode to
target. - etch_
foundry_ artifact_ or_ create - Deploy a Foundry artifact and copy its runtime bytecode to
target, creating a default target account when it does not already exist. - load_
foundry_ creation_ code - Load creation bytecode from a Foundry artifact.