Skip to content

Instantly share code, notes, and snippets.

@jacqueswww
Last active September 25, 2019 16:20
Show Gist options
  • Save jacqueswww/a0f36ec0b10757198afa1e6154891a94 to your computer and use it in GitHub Desktop.
Save jacqueswww/a0f36ec0b10757198afa1e6154891a94 to your computer and use it in GitHub Desktop.
Pretty Damn awful, PyEVM Virtual Machine debugger. Using a custom opdcode set in Vyper ;)
def debug_opcode(computation):
print('YOUR ARE HERE!')
import ipdb; ipdb.set_trace()
import evm
from evm.vm.opcode import as_opcode
from vyper.opcodes import opcodes as vyper_opcodes
from evm.vm.forks.byzantium.computation import ByzantiumComputation
opcodes = ByzantiumComputation.opcodes.copy()
opcodes[vyper_opcodes['DEBUG'][0]] = as_opcode(
logic_fn=debug_opcode,
mnemonic="DEBUG",
gas_cost=0
)
setattr(evm.vm.forks.byzantium.computation.ByzantiumComputation, 'opcodes', opcodes)
@uhbif19
Copy link

uhbif19 commented Sep 25, 2019

Thanks for replies. I will check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment