You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several Layer 2s, including Optimism, allocate many proxies etc. in the genesis file. For example, take Base Mainnet's 8.76MB genesis file.
While it is possible to deploy all of these contracts manually in a test file's setUp function, it is slow, cumbersome, and rather easy to accidentally break parity. A solution to make this process easier for authors of test suites that would like to locally allocate the same accounts that are in the L2 genesis file is to add a simple cheatcode which loads a JSON file with account allocations inside of it into the in-memory revm journal.
This cheatcode can re-use the type defined in ethers-rs for the GenesisAccount when deserializing the allocs JSON, and the basic structure of the file would be HashMap<Address, GenesisAccount>.
Desired Usage
contractMyTestisTest {
function setUp() public {
vm.loadAllocs("./path/to/allocs.json");
// After the cheatcode is invoked, the accounts will have been committed to the revm journal and accessible// within the environment.
}
}
Additional context
n/a
The text was updated successfully, but these errors were encountered:
Component
Forge
Describe the feature you would like
Several Layer 2s, including Optimism, allocate many proxies etc. in the genesis file. For example, take Base Mainnet's 8.76MB genesis file.
While it is possible to deploy all of these contracts manually in a test file's setUp function, it is slow, cumbersome, and rather easy to accidentally break parity. A solution to make this process easier for authors of test suites that would like to locally allocate the same accounts that are in the L2 genesis file is to add a simple cheatcode which loads a JSON file with account allocations inside of it into the in-memory revm journal.
This cheatcode can re-use the type defined in
ethers-rs
for theGenesisAccount
when deserializing the allocs JSON, and the basic structure of the file would beHashMap<Address, GenesisAccount>
.Desired Usage
Additional context
n/a
The text was updated successfully, but these errors were encountered: