NAC_Blockchain/charter-std/acc/acc_governance.ch

20 lines
861 B
Plaintext
Raw Permalink 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-Governance: 治理协议
// NAC 原生协议 - Charter 语言定义
// UID: nac.acc.ACCGovernanceProtocol.v1
protocol ACCGovernanceProtocol {
// 注册投票权
fn register_voting_power(address: Address, power: u128) -> ();
// 创建提案(需要持有投票权)
fn create_proposal(
proposer: Address, proposal_type: ProposalType, description: String,
voting_duration_secs: u64, constitutional_receipt: Hash
) -> Result<Hash, Error>;
// 投票For/Against/Abstain
fn cast_vote(proposal_id: Hash, voter: Address, choice: VoteChoice) -> Result<(), Error>;
// 终结提案(统计票数,执行或拒绝)
fn finalize_proposal(proposal_id: Hash, constitutional_receipt: Hash) -> Result<bool, Error>;
// 查询提案
fn get_proposal(proposal_id: Hash) -> Option<GovernanceProposal>;
}