Skip to content

Commit d5cf52b

Browse files
authored
Feat: add vm.etch capability (#11)
* Feat: add etch Tested locally. * Chore: update README
1 parent 1f54cda commit d5cf52b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ Chimera addresses this problem by enabling a "write once, run everywhere" approa
2525

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

28-
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>`.
28+
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>`.
29+
30+
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.
2931

3032
### Features
3133

src/Hevm.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ interface IHevm {
4646

4747
// Labels the address in traces
4848
function label(address addr, string calldata label) external;
49+
50+
/// Sets an address' code.
51+
function etch(address target, bytes calldata newRuntimeBytecode) external;
4952
}
5053

5154
IHevm constant vm = IHevm(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);

0 commit comments

Comments
 (0)