Files
pezkuwi-subxt/substrate/frame/contracts/fixtures/data/self_destructing_constructor.wat
T
PG Herveou 64effd0e6f Contracts move fixtures to new crate (#2246)
Small PR that introduce a new crate that will host RISC-V & wasm
fixtures for testing pallet-contracts
2023-11-10 13:22:47 +02:00

24 lines
469 B
WebAssembly Text Format

(module
(import "seal0" "seal_terminate" (func $seal_terminate (param i32 i32)))
(import "env" "memory" (memory 1 1))
(func $assert (param i32)
(block $ok
(br_if $ok
(get_local 0)
)
(unreachable)
)
)
(func (export "deploy")
;; Self-destruct by sending full balance to the 0 address.
(call $seal_terminate
(i32.const 0) ;; Pointer to destination address
(i32.const 32) ;; Length of destination address
)
)
(func (export "call"))
)