-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(cheats)!: remove readFork
cheatcodes
#11399
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…oundry into rusowsky/extend-fork-cheats
…oundry into rusowsky/extend-fork-cheats
…oundry into rusowsky/write-fork-config
…undry into rusowsky/write-fork-config
writeFork
to persist deploymentswriteFork
to persist deployment info
writeFork
to persist deployment infowriteFork
to persist scripting info
writeFork
to persist scripting inforeadFork
cheatcodes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a follow-up of the ongoing effort to improve multichain scripting workflows:
refs:
read
+ resolve env vars #11302[fork.<chain>]
section #11340Motivation
Currently, storing deployment addresses and params in a easy to reuse and automate manner is cumbersome and requires dealing with ffi and json/toml cheatcodes (having to manipulate entire files)
This PR build on the previously introduces
readFork
cheatcodes to help ease the deployment process even further.Solution
This PR introduces writeFork cheatcodes that enable tests and scripts to persist deployment
addresses and configuration data to a dedicated TOML file, separate from
foundry.toml
. This provides a safe, controlled way to maintain deployment state across test runs without risking corruption of the main configuration file.New Cheatcodes:
Check Operations:
checkForkVar(string key)
: check if a key exists for the active forkcheckForkChainVar(uint256 chain, string key)
: check if a key exists for a specific chainWrite Operation:
only possible when scripting, update memory and disk, return
(bool success, bool overwritte)
writeForkVar(string key, <type> value)
: write to active fork configurationwriteForkChainVar(uint256 chain, string key, <type> value)
: write to specific chain configurationDedicated config file:
deployments.toml
) specified via[forks].path
in foundry.tomlfoundry.toml
nor the inheritance file informed inextends