function etch(address who, bytes calldata code) external;
Sets the bytecode of an address who
to code
.
bytes memory code = address(awesomeContract).code;
address targetAddr = makeAddr("target");
vm.etch(targetAddr, code);
log_bytes(address(targetAddr).code); // 0x6080604052348015610010...
Forge Standard Library