NAC_Blockchain/charter-std/acc/acc_xtzh.ch

21 lines
928 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-XTZH: XTZH 稳定币协议SDR锚定+黄金储备)
// NAC 原生协议 - Charter 语言定义
// UID: nac.acc.XTZHStablecoinProtocol.v1
protocol XTZHStablecoinProtocol {
// 铸造 XTZH需要满足黄金储备率
fn mint(recipient: Address, amount: u128, constitutional_receipt: Hash) -> Result<(), Error>;
// 销毁 XTZH
fn burn(holder: Address, amount: u128, constitutional_receipt: Hash) -> Result<(), Error>;
// 转移 XTZH
fn transfer(from: Address, to: Address, amount: u128) -> Result<(), Error>;
// 更新 SDR 汇率(允许偏差范围内)
fn update_sdr_rate(new_rate: u128, constitutional_receipt: Hash) -> Result<(), Error>;
// 更新储备资产
fn update_reserve(asset_type: ReserveAssetType, amount: u128, weight_bps: u16) -> ();
// 查询持仓
fn balance_of(address: Address) -> u128;
// 查询总供应量
fn total_supply() -> u128;
}