NAC_Blockchain/charter-std/acc/acc1155.ch

21 lines
1021 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ACC-1155: 多代币标准 (Multi-Token Standard)
// NAC 原生协议 - Charter 语言定义
// UID: nac.acc.ACC1155.v1
protocol ACC1155 {
// 持仓查询返回指定地址对指定代币ID的持有量
fn balance_of(holder: Address, token_id: u64) -> u128;
// 批量持仓查询
fn balance_of_batch(holders: Vec<Address>, token_ids: Vec<u64>) -> Vec<u128>;
// 铸造代币(可替代或不可替代)
fn mint(recipient: Address, token_id: u64, amount: u128, constitutional_receipt: Hash) -> Result<(), Error>;
// 批量铸造
fn mint_batch(recipient: Address, token_ids: Vec<u64>, amounts: Vec<u128>, constitutional_receipt: Hash) -> Result<(), Error>;
// 转移代币
fn transfer(from: Address, to: Address, token_id: u64, amount: u128) -> Result<(), Error>;
// 销毁代币
fn burn(holder: Address, token_id: u64, amount: u128, constitutional_receipt: Hash) -> Result<(), Error>;
// 查询代币URI元数据
fn token_uri(token_id: u64) -> String;
}