Skip to content

Commit

Permalink
Feat: add vm.etch capability (#11)
Browse files Browse the repository at this point in the history
* Feat: add etch

Tested locally.

* Chore: update README
  • Loading branch information
lokithe5th committed Apr 19, 2024
1 parent 1f54cda commit d5cf52b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Chimera addresses this problem by enabling a "write once, run everywhere" approa

Chimera currently only supports cheatcodes implemented by [HEVM](https://hevm.dev/ds-test-tutorial.html?highlight=cheat#supported-cheat-codes).

Foundry has extended these and offers functionality not supported by the HEVM cheatcodes, subsequently these must be accounted for when adding Chimera to a Foundry project as they will cause issues when running Echidna and Medusa. If adding Chimera to an existing Foundry project ensure that there are no cheatcodes implemented that aren't supported by HEVM as they will throw the following error: `VM failed for unhandled reason, BadCheatCode <cheatcode hash>`.
Foundry has extended these and offers functionality not supported by the HEVM cheatcodes, subsequently these must be accounted for when adding Chimera to a Foundry project as they will cause issues when running Echidna and Medusa. If adding Chimera to an existing Foundry project ensure that there are no cheatcodes implemented that aren't supported by HEVM as they will throw the following error: `VM failed for unhandled reason, BadCheatCode <cheatcode hash>`.

While **medusa** supports `etch`, echidna does not support it yet. Please note when using `etch` in an echidna environment it will not work as expected.

### Features

Expand Down
3 changes: 3 additions & 0 deletions src/Hevm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ interface IHevm {

// Labels the address in traces
function label(address addr, string calldata label) external;

/// Sets an address' code.
function etch(address target, bytes calldata newRuntimeBytecode) external;
}

IHevm constant vm = IHevm(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
Expand Down

0 comments on commit d5cf52b

Please sign in to comment.