Update the smart contract decompiler example

This commit is contained in:
mratsim 2018-05-18 12:57:55 +02:00
parent 507bdda25a
commit 165b1872a6
3 changed files with 14 additions and 8 deletions

View File

@ -1,7 +0,0 @@
import vm/code_stream, opcode_values
var c = newCodeStream("\x60\x00\x60\x00\x60\x00\x60\x00\x67\x06\xf0\x5b\x59\xd3\xb2\x00\x00\x33\x60\xc8\x5a\x03\xf1")
let opcodes = c.decompile()
for op in opcodes:
echo op[0], " ", op[1], " ", op[2]

View File

@ -0,0 +1,14 @@
import ../src/vm/code_stream, ../src/opcode_values, strformat
var c = newCodeStreamFromUnescaped("0x6003600202600055")
let opcodes = c.decompile()
for op in opcodes:
echo &"[{op[0]}]\t{op[1]}\t{op[2]}"
# [1] PUSH1 0x03
# [3] PUSH1 0x02
# [4] MUL
# [6] PUSH1 0x00
# [7] SSTORE
# [-1] STOP

View File

@ -1 +0,0 @@
-p:"../src"