sim:set-code
Set the bytecode at an address in a fork simulation.
Syntax
Section titled “Syntax”sim:set-code <address> <bytecode>Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
address |
string |
Contract or account address |
bytecode |
string |
New bytecode to set |
Examples
Section titled “Examples”# Replace contract bytecode in a forksim:fork --using anvil ( sim:set-code 0x64c007ba4ab6184753dc1e8e7263e8d06831c5f6 0x600160005260206000f3)See Also
Section titled “See Also”- set-storage-at — override a storage slot
- fork — fork the chain
- @contract.codeAt — read bytecode