Expand description
§CKB SSRI std
Utils for implementing SSRI-compliant smart contracts on the Nervos CKB blockchain.
§Overview
The SSRI (Standard Smart Contract Runtime Interface) std provides a standardized way to develop smart contracts that are compliant with the SSRI protocol. This enables better interoperability and a more consistent development experience across the CKB ecosystem.
§Features
- Public Traits: Pre-defined interfaces that receive first-class support within the ecosystem
- Utility Functions: Helper functions for SSRI-VM syscalls and data handling
- Procedural Macros: Simplify contract development with automatic SSRI method generation
- No Standard Library: Designed for the constrained smart contract environment
§Usage
Add this to your Cargo.toml
:
[dependencies]
ckb-ssri-std = "0.1.0"
§Example
use ckb_ssri_std::prelude::*;
use ckb_ssri_std::public_module_traits::udt::UDT;
// Implement a basic UDT (User-Defined Token)
#[derive(Default)]
struct MyToken;
impl UDT for MyToken {
type Error = ();
// ... implement required methods
}
Re-exports§
pub use macros::*;
Modules§
- Re-exports of procedural macros from ckb-ssri-std-proc-macro
Enums§
- Represents possible errors that can occur during SSRI method execution