Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7450b60
feat(forge): specify compilation profile in vm.getCode
gakonst Jan 23, 2026
fdbf5d9
fix: address clippy warnings
gakonst Jan 23, 2026
d3481e0
test: add unit tests for artifact path parsing and profile support
gakonst Jan 23, 2026
fd356f5
test: add multi-profile test demonstrating different bytecode per pro…
gakonst Jan 23, 2026
abc2a6e
style: fix rustfmt formatting
gakonst Jan 23, 2026
d0de2d6
style: fix forge fmt formatting in Solidity test
gakonst Jan 23, 2026
d59e83e
fix: simplify multi-profile tests to verify parsing behavior
gakonst Jan 23, 2026
7138bec
fix: restore multi-profile compilation restriction in foundry.toml
gakonst Jan 23, 2026
11e2ddb
fix: rename Counter to ProfileCounter to avoid artifact name collision
gakonst Jan 23, 2026
8cd2af7
fix: remove multi-profile Solidity test to avoid breaking existing tests
gakonst Jan 23, 2026
99db0ed
test: add profile-based getCode test using existing paris profile
gakonst Jan 23, 2026
4b2590a
test: add multi-profile test with proper disambiguation fix
gakonst Jan 23, 2026
052dc7c
fix: use require instead of assertNotEq for bytes32 comparison
gakonst Jan 23, 2026
68a8a40
fix: resolve CI failures for profile-based artifact selection
gakonst Jan 23, 2026
616f79c
fix fmt
zerosnacks Jan 23, 2026
41c18c7
Merge branch 'master' into feat/getcode-profile-support
zerosnacks Jan 23, 2026
8e97795
Merge remote-tracking branch 'origin/master' into feat/getcode-profil…
decofe Jun 10, 2026
b06d8a7
fix getCode file profile lookup
Jun 10, 2026
8618c28
fix: prefer contract name for ambiguous getCode artifact paths
mablr Jun 10, 2026
7d1c4bb
Merge branch 'master' into feat/getcode-profile-support
grandizzy Jun 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions crates/cheatcodes/assets/cheatcodes.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 21 additions & 10 deletions crates/cheatcodes/spec/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1998,72 +1998,83 @@ interface Vm {
function getArtifactPathByDeployedCode(bytes calldata deployedCode) external view returns (string memory path);

/// Gets the creation bytecode from an artifact file. Takes in the relative path to the json file or the path to the
/// artifact in the form of <path>:<contract>:<version> where <contract> and <version> parts are optional.
/// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
/// <version>/<profile> parts are optional. Use <profile> to select artifacts compiled with a specific profile
/// from foundry.toml.
#[cheatcode(group = Filesystem)]
function getCode(string calldata artifactPath) external view returns (bytes memory creationBytecode);

/// Deploys a contract from an artifact file. Takes in the relative path to the json file or the path to the
/// artifact in the form of <path>:<contract>:<version> where <contract> and <version> parts are optional.
/// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
/// <version>/<profile> parts are optional.
/// Reverts if the target artifact contains unlinked library placeholders.
#[cheatcode(group = Filesystem)]
function deployCode(string calldata artifactPath) external returns (address deployedAddress);

/// Deploys a contract from an artifact file. Takes in the relative path to the json file or the path to the
/// artifact in the form of <path>:<contract>:<version> where <contract> and <version> parts are optional.
/// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
/// <version>/<profile> parts are optional.
/// Reverts if the target artifact contains unlinked library placeholders.
///
/// Additionally accepts abi-encoded constructor arguments.
#[cheatcode(group = Filesystem)]
function deployCode(string calldata artifactPath, bytes calldata constructorArgs) external returns (address deployedAddress);

/// Deploys a contract from an artifact file. Takes in the relative path to the json file or the path to the
/// artifact in the form of <path>:<contract>:<version> where <contract> and <version> parts are optional.
/// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
/// <version>/<profile> parts are optional.
/// Reverts if the target artifact contains unlinked library placeholders.
///
/// Additionally accepts `msg.value`.
#[cheatcode(group = Filesystem)]
function deployCode(string calldata artifactPath, uint256 value) external returns (address deployedAddress);

/// Deploys a contract from an artifact file. Takes in the relative path to the json file or the path to the
/// artifact in the form of <path>:<contract>:<version> where <contract> and <version> parts are optional.
/// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
/// <version>/<profile> parts are optional.
/// Reverts if the target artifact contains unlinked library placeholders.
///
/// Additionally accepts abi-encoded constructor arguments and `msg.value`.
#[cheatcode(group = Filesystem)]
function deployCode(string calldata artifactPath, bytes calldata constructorArgs, uint256 value) external returns (address deployedAddress);

/// Deploys a contract from an artifact file, using the CREATE2 salt. Takes in the relative path to the json file or the path to the
/// artifact in the form of <path>:<contract>:<version> where <contract> and <version> parts are optional.
/// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
/// <version>/<profile> parts are optional.
/// Reverts if the target artifact contains unlinked library placeholders.
#[cheatcode(group = Filesystem)]
function deployCode(string calldata artifactPath, bytes32 salt) external returns (address deployedAddress);

/// Deploys a contract from an artifact file, using the CREATE2 salt. Takes in the relative path to the json file or the path to the
/// artifact in the form of <path>:<contract>:<version> where <contract> and <version> parts are optional.
/// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
/// <version>/<profile> parts are optional.
/// Reverts if the target artifact contains unlinked library placeholders.
///
/// Additionally accepts abi-encoded constructor arguments.
#[cheatcode(group = Filesystem)]
function deployCode(string calldata artifactPath, bytes calldata constructorArgs, bytes32 salt) external returns (address deployedAddress);

/// Deploys a contract from an artifact file, using the CREATE2 salt. Takes in the relative path to the json file or the path to the
/// artifact in the form of <path>:<contract>:<version> where <contract> and <version> parts are optional.
/// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
/// <version>/<profile> parts are optional.
/// Reverts if the target artifact contains unlinked library placeholders.
///
/// Additionally accepts `msg.value`.
#[cheatcode(group = Filesystem)]
function deployCode(string calldata artifactPath, uint256 value, bytes32 salt) external returns (address deployedAddress);

/// Deploys a contract from an artifact file, using the CREATE2 salt. Takes in the relative path to the json file or the path to the
/// artifact in the form of <path>:<contract>:<version> where <contract> and <version> parts are optional.
/// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
/// <version>/<profile> parts are optional.
/// Reverts if the target artifact contains unlinked library placeholders.
///
/// Additionally accepts abi-encoded constructor arguments and `msg.value`.
#[cheatcode(group = Filesystem)]
function deployCode(string calldata artifactPath, bytes calldata constructorArgs, uint256 value, bytes32 salt) external returns (address deployedAddress);

/// Gets the deployed bytecode from an artifact file. Takes in the relative path to the json file or the path to the
/// artifact in the form of <path>:<contract>:<version> where <contract> and <version> parts are optional.
/// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
/// <version>/<profile> parts are optional.
#[cheatcode(group = Filesystem)]
function getDeployedCode(string calldata artifactPath) external view returns (bytes memory runtimeBytecode);

Expand Down
Loading
Loading