NAC_Blockchain/charter-std/acc/acc_collateral.ch

22 lines
899 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-Collateral: 抵押协议
// NAC 原生协议 - Charter 语言定义XTZH 计价)
// UID: nac.acc.ACCCollateralProtocol.v1
protocol ACCCollateralProtocol {
// 创建抵押记录(需要满足最低抵押率)
fn create_collateral(
asset_id: Hash, borrower: Address, lender: Address,
collateral_value_xtzh: u128, loan_amount_xtzh: u128,
maturity_secs: u64, constitutional_receipt: Hash
) -> Result<Hash, Error>;
// 清算抵押(当抵押率低于清算阈值时)
fn liquidate(
collateral_id: Hash, liquidator: Address, current_value: u128,
constitutional_receipt: Hash
) -> Result<u128, Error>;
// 释放抵押(还款后)
fn release_collateral(collateral_id: Hash, initiator: Address) -> Result<(), Error>;
// 查询抵押记录
fn get_collateral(collateral_id: Hash) -> Option<CollateralRecord>;
}