70 lines
2.5 KiB
Plaintext
70 lines
2.5 KiB
Plaintext
// NAC Charter 协议模板 — 瑞士辖区(CH)
|
||
// 适用于:瑞士司法辖区内的RWA资产通证化合约
|
||
// CBPP原则:约法即是治法,宪法即是规则,参与即是共识
|
||
// 版本:v1.0
|
||
|
||
contract CHRwaAsset {
|
||
// ===== 辖区声明 =====
|
||
jurisdiction: CH
|
||
inherits_global: true
|
||
|
||
// ===== 资产状态 =====
|
||
state {
|
||
asset_id: Hash // 资产唯一标识(SHA3-384,48字节)
|
||
asset_type: String // 资产类别(须在CH_RWA_001.permitted_assets中)
|
||
asset_name: String // 资产名称
|
||
issuer: Address // 发行人地址(32字节NAC地址)
|
||
regulatory_approval: Hash // 监管机构批准文件哈希
|
||
total_supply: u256 // 总供应量
|
||
nav: u256 // 净资产值(以辖区法定货币最小单位计)
|
||
kyc_verified: bool // KYC验证状态
|
||
aml_cleared: bool // AML清算状态
|
||
regulatory_approved: bool // 监管机构批准状态
|
||
}
|
||
|
||
// ===== 发行函数 =====
|
||
// CBPP:参与即是共识,CEE自动验证辖区规则,无需手动调用合规检查
|
||
function issue(
|
||
recipient: Address,
|
||
amount: u256,
|
||
kyc_proof: Hash,
|
||
regulatory_approval: Hash
|
||
) -> Result {
|
||
// CEE自动执行:CH_DLT_001 + CH_FINSA_001 + CH_AML_001 + CH_RWA_001
|
||
// 以下检查是合约层的业务逻辑,宪法层验证由CEE独立完成
|
||
require(is_eligible_investor(recipient), "CH_RWA_001: 须为合格投资者")
|
||
require(regulatory_approved, "CH_DLT_001: 须FINMA合规")
|
||
balances[recipient] += amount
|
||
emit Transfer(Address::zero(), recipient, amount)
|
||
return Ok(())
|
||
}
|
||
|
||
// ===== 转让函数 =====
|
||
function transfer(to: Address, amount: u256) -> Result {
|
||
// CEE自动验证辖区规则,参与即是共识
|
||
require(balances[msg.sender] >= amount, "余额不足")
|
||
require(is_eligible_investor(to), "CH_INVESTOR: 接收方不符合合格投资者要求")
|
||
|
||
balances[msg.sender] -= amount
|
||
balances[to] += amount
|
||
emit Transfer(msg.sender, to, amount)
|
||
return Ok(())
|
||
}
|
||
|
||
// ===== 赎回函数 =====
|
||
function redeem(amount: u256) -> Result {
|
||
require(balances[msg.sender] >= amount, "余额不足")
|
||
require(aml_cleared, "CH_AML_001: AML检查未通过")
|
||
|
||
balances[msg.sender] -= amount
|
||
total_supply -= amount
|
||
emit Redeem(msg.sender, amount)
|
||
return Ok(())
|
||
}
|
||
|
||
// ===== 辅助函数 =====
|
||
function is_eligible_investor(addr: Address) -> bool {
|
||
return kyc_registry.is_eligible_ch(addr)
|
||
}
|
||
}
|