* Assert valid bytecode and operand length EVM bytecode comes in 32-byte chunks, and contracts require at least one segment to be created. An example, originally written by @ggrieco-tob in issue #546, is included. Unsure what expected behavior should be, but initial state has a problem when a contract is created with a single byte. Also added some exception handling in `parse_operand()` to catch invalid instructions, e.g. a PUSH1 instruction followed by no bytes. Signed-off-by: Cole Lightfighter <cole@onicsla.bz> * Fix SLOAD invalid memory access Simple check to ensure address storage is in global_storage before attempting to load data. * Remove invalid assertions
22 lines
542 B
Python
22 lines
542 B
Python
from seth import *
|
|
|
|
seth = ManticoreEVM()
|
|
seth.verbosity(3)
|
|
user_account = seth.create_account(balance=1000)
|
|
|
|
bytecode = '`'
|
|
#Initialize contract
|
|
contract_account = seth.create_contract(owner=user_account,
|
|
balance=0,
|
|
init=bytecode)
|
|
|
|
def explore(state):
|
|
pass
|
|
|
|
seth.add_hook(None, explore)
|
|
seth.transaction( caller=user_account,
|
|
address=contract_account,
|
|
value=None,
|
|
data='',
|
|
)
|