[EN/CN] Script-Sourced Rich Information - 来源于 Script 的富信息

English Version:

Introduction

Based on the SSRI, we can describe the behavior that Script of UDT types should have. If a Script declared as a UDT type does not have the following methods, it should be parsed according to the behavior described in the xUDT specification, and the unknown items should be completed by other methods.

UDT Trait

UDT.balance - Cell


fn balance() -> u128;

Retrieves the UDT balance stored in the Cell.

UDT.name - Script


fn name() -> Bytes;

Retrieves the name of the UDT represented by the Script.

UDT.symbol - Script


fn symbol() -> Byte

Retrieves the symbol of the UDT represented by the Script.

UDT.decimals - Script


fn decimals() -> u8;

Retrieves the number of decimal places for the smallest unit of the UDT represented by the Script.

7 Likes