Skip to content

Implement vm.computeCreatedAddress cheatcode#1126

Merged
automergerpr-permission-manager[bot] merged 3 commits intomasterfrom
cheatcodes/computeCreatedAddress
Mar 20, 2026
Merged

Implement vm.computeCreatedAddress cheatcode#1126
automergerpr-permission-manager[bot] merged 3 commits intomasterfrom
cheatcodes/computeCreatedAddress

Conversation

@anvacaru
Copy link
Contributor

Adds support for Foundry's vm.computeCreateAddress(address, uint256) cheatcode, which predicts the address a
The contract will be deployed via CREATE using a deployer address and nonce.

Changes:

  • cheatcodes.md: new rule cheatcode.call.computeCreateAddress that decodes (deployer, nonce) from calldata and
    computes the CREATE address by applying RLP encoding and keccak256
  • ComputeCreateAddress.t.sol: end-to-end test verifying the predicted address matches the actual deployed
    contract address.

Copy link
Contributor

@palinatolmach palinatolmach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a small recommendation on the documentation and agree with @ehildenb's suggestion to add a test similar to the real-world example (I guess it would be using the output of computeCreateAddress to instantiate a proxy), otherwise lgtm!

@automergerpr-permission-manager automergerpr-permission-manager bot merged commit 2e6ac30 into master Mar 20, 2026
17 of 18 checks passed
@automergerpr-permission-manager automergerpr-permission-manager bot deleted the cheatcodes/computeCreatedAddress branch March 20, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants