Skip to main content

Module deploy

Module deploy 

Source
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§

EtchedContract
Result of deploying an artifact and etching its runtime code at a target.
FoundryArtifact
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.