Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 538 Bytes

etch.md

File metadata and controls

27 lines (18 loc) · 538 Bytes

etch

Signature

function etch(address who, bytes calldata code) external;

Description

Sets the bytecode of an address who to code.

Examples

bytes memory code = address(awesomeContract).code;
address targetAddr = makeAddr("target");
vm.etch(targetAddr, code);
log_bytes(address(targetAddr).code); // 0x6080604052348015610010...

SEE ALSO

Forge Standard Library