Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cheats): deployCodeTo #401

Merged
merged 3 commits into from
Jun 25, 2023
Merged

feat(cheats): deployCodeTo #401

merged 3 commits into from
Jun 25, 2023

Conversation

ZeroEkkusu
Copy link
Collaborator

Motivation

There's vm.etch, which sets the runtime bytecode on an arbitrary address, and deployCode, which takes a creation code, and returns the deployment address.

However, there's no option in-between.

Solution

deployCodeTo lets you pseudo-deploy a contract from its creation code on an arbitrary address.

@ZeroEkkusu ZeroEkkusu requested a review from mds1 June 10, 2023 19:49
src/StdCheats.sol Outdated Show resolved Hide resolved
@ZeroEkkusu ZeroEkkusu requested a review from mds1 June 17, 2023 17:20
@ZeroEkkusu ZeroEkkusu linked an issue Jun 19, 2023 that may be closed by this pull request
@mds1
Copy link
Collaborator

mds1 commented Jun 25, 2023

Thanks! Just rebased against the latest main which adds the warnings check. I believe the CI failures will be fixed once #398 is merged, so let me review/merge that one next before merging this one

@mds1 mds1 mentioned this pull request Jun 25, 2023
Copy link
Collaborator

@mds1 mds1 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @ZeroEkkusu! Do you mind opening a PR to the book repo also to add docs for these new cheats?

@ZeroEkkusu
Copy link
Collaborator Author

Done - foundry-rs/book#932.

Forge Std needs better docs - the book's outdated.

@DaniPopes DaniPopes deleted the feat/deployCodeTo branch October 24, 2024 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deployCodeTo function
2 participants