Skip to content

Commit

Permalink
feat: add cheatcode to skip zkEVM execution (#569)
Browse files Browse the repository at this point in the history
* panic with bytecode hash

* add zkVmSkip cheatcode

* sticky addresses deployed in skip
  • Loading branch information
nbaztec authored Sep 16, 2024
1 parent bd4ac3b commit df011e0
Show file tree
Hide file tree
Showing 8 changed files with 298 additions and 82 deletions.
82 changes: 51 additions & 31 deletions crates/cheatcodes/assets/cheatcodes.json

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

6 changes: 6 additions & 0 deletions crates/cheatcodes/spec/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,12 @@ interface Vm {
#[cheatcode(group = Testing, safety = Safe)]
function zkVm(bool enable) external pure;

/// When running in zkEVM context, skips the next CREATE or CALL, executing it on the EVM instead.
/// All `CREATE`s executed within this skip, will automatically have `CALL`s to their target addresses
/// executed in the EVM, and need not be marked with this cheatcode at every usage location.
#[cheatcode(group = Testing, safety = Safe)]
function zkVmSkip() external pure;

/// Registers bytecodes for ZK-VM for transact/call and create instructions.
#[cheatcode(group = Testing, safety = Safe)]
function zkRegisterContract(string calldata name, bytes32 evmBytecodeHash, bytes calldata evmDeployedBytecode, bytes calldata evmBytecode, bytes32 zkBytecodeHash, bytes calldata zkDeployedBytecode) external pure;
Expand Down
Loading

0 comments on commit df011e0

Please sign in to comment.