Skip to content

Instantly share code, notes, and snippets.

@axic
Last active August 2, 2016 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axic/2ee2e1aa496de203c9edf03e230e707d to your computer and use it in GitHub Desktop.
Save axic/2ee2e1aa496de203c9edf03e230e707d to your computer and use it in GitHub Desktop.
Solidity eWASM compiled code
;; Contract: EWASMTest
(module
(import $calldatacopy "ethereum" "calldatacopy" (param i32 i32 i32))
(import $sstore "ethereum" "sstore" (param i32 i32))
(import $return "ethereum" "return" (param i32))
(memory 1 1)
(export "memory" memory)
(export "main" $main)
(func $main
(call_import $calldatacopy (i32.const 0) (i32.const 0) (i32.const 4))
(call $dispatcher (i32.load (i32.const 0)))
(unreachable)
)
(func $dispatcher
(param $sig i32)
(if (i32.eq (get_local $sig) (i32.const 0x0dbe671f)) (then (call $__a)) )
(if (i32.eq (get_local $sig) (i32.const 0x4df7e3d0)) (then (call $__b)) )
)
(func $__a
)
(func $__b
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment