Rust contract, part 2 - Write contract with ckb-contract-std
This article introduces the ckb-contract-std library; and shows how to rewrite our minimal contract with ckb-contract-std, to enables syscalls and Vec, String. The previous contract: #![no_std] #![no_main] #![feature(asm)] #![feature(lang_items)] #[no_mangle] pub fn _start() -> ! { exit(0) } /// Exit syscall pub fn exit(_code: i8) -> ! { unsafe { // a0 is _code asm!("li a7, 93"); asm!("ecall"); } loop {} } #[panic_handler] fn panic_handler(_: &core::p...
Nervos Talk