Skip to content

Instantly share code, notes, and snippets.

@axic
Last active August 25, 2016 02:53
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/472c1a279e9a200104e3a852af23103e to your computer and use it in GitHub Desktop.
Save axic/472c1a279e9a200104e3a852af23103e to your computer and use it in GitHub Desktop.
Standard eWASM deployer code.
;;
;; Standard eWASM deployer code.
;;
;; We keep the to-be-deployed contract as a memory segment and simply return it.
;;
(module
(memory 1
(segment 0 "\10\00\00\00") ;; Here comes the size of the code in LSB
(segment 4 "Hello World CODE") ;; Here comes the code as a escaped hex string
)
(export "memory" memory)
(export "main" $main)
(import $ethereum_return "ethereum" "return" (param i32 i32))
(func $main
(call_import $ethereum_return (i32.const 4) (i32.load (i32.const 0)))
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment