compiles evmCode to wasm in the binary format
Parameters
evmCode
Arrayopts
Object (optional, default{'stackTrace':false,'useAsyncAPI':false,'inlineOps':true,'testName':'temp','chargePerOp':false}
)opts.stackTrace
boolean iftrue
generates an runtime EVM stack trace (default: false)opts.inlineOps
boolean iftrue
inlines the EVM1 operations (default: true)opts.testName
String is the name used for the wast file (default: 'temp')opts.chargePerOp
boolean iftrue
adds metering statements for the wasm code section corresponding to each EVM opcode as opposed to metering once per branch segment (default: false).
Returns string
Transcompiles EVM code to ewasm in the sexpression text format. The EVM code
is broken into segments and each instruction in those segments is replaced
with a call
to wasm function that does the equivalent operation. Each
opcode function takes in and returns the stack pointer.
Segments are sections of EVM code in between flow control opcodes (JUMPI. JUMP). All segments start at
- the beginning for EVM code
- a GAS opcode
- a JUMPDEST opcode
- After a JUMPI opcode
Parameters
evmCode
Integer the evm byte codeopts
Object (optional, default{'stackTrace':false,'useAsyncAPI':false,'inlineOps':true,'chargePerOp':false}
)opts.stackTrace
boolean iftrue
generates a stack trace (default: false)opts.inlineOps
boolean iftrue
inlines the EVM1 operations (default: true)opts.chargePerOp
boolean iftrue
adds metering statements for the wasm code section corresponding to each EVM opcode as opposed to metering once per branch segment (default: false).
Returns string
given a Set of wasm function this return an array for wasm equivalents
Parameters
funcSet
SetwastFiles
Returns Array
builds a wasm module
Parameters
funcs
Array the function to include in the moduleimports
Array the imports for the module's import table (optional, default[]
)callbacks
(optional, default[]
)
Returns string