1- use aiken/ collection/ dict.{ Dict }
1+ use aiken/ collection.{ Index }
22use aiken/ math/ rational.{Rational }
33use cardano/ assets.{Lovelace }
4- use cardano/ credential.{
5- ColdCommitteeCredential , Credential , DRepCredential , HotCommitteeCredential ,
6- ScriptHash , VerificationKeyHash ,
7- }
4+ use cardano/ credential.{Credential , ScriptHash , VerificationKeyHash }
85
96pub type DRep {
10- FromCredential (DRepCredential )
7+ FromCredential (Credential )
118 AlwaysAbstain
129 AlwaysNoConfidence
1310}
@@ -26,64 +23,97 @@ pub type Vote {
2623
2724pub type GovernanceActionId {
2825 transaction_id: ByteArray ,
29- index: Int ,
26+ proposal_procedure: Index ,
3027}
3128
32- pub type ChangedProtocolParameters {
33- new_parameters: Data ,
34- }
29+ pub type ProtocolParametersUpdate =
30+ Data
3531
3632pub type ProtocolVersion {
3733 major: Int ,
3834 minor: Int ,
3935}
4036
4137pub type Constitution {
42- guardrails_script : Option < ScriptHash > ,
38+ guardrails : Option < ScriptHash > ,
4339}
4440
4541pub type GovernanceAction {
46- //
47- ProtocolParametersChange (
48- Option < GovernanceActionId > ,
49- ChangedProtocolParameters ,
50- // Hash of the constitution script
51- Option < ScriptHash > ,
52- )
53- // proposal to update protocol version
54- HardForkInitiation (Option < GovernanceActionId > , ProtocolVersion )
55- //
56- TreasuryWithdrawals (
57- Dict < Credential , Lovelace > ,
58- // Hash of the constitution script
59- Option < ScriptHash > ,
60- )
61- //
62- NoConfidence (Option < GovernanceActionId > )
63- //
64- UpdateCommittee (
65- Option < GovernanceActionId > ,
66- // Committee members to be removed
67- List < ColdCommitteeCredential > ,
68- // Committee members to be added
69- Dict < ColdCommitteeCredential , Int > ,
70- // New quorum
71- Rational ,
72- )
73- //
74- NewConstitution (Option < GovernanceActionId > , Constitution )
75- //
76- InfoAction
42+ ProtocolParameters {
43+ /// The last governance action of type 'ProtocolParameters'. They must all
44+ /// form a chain.
45+ ancestor: Option < GovernanceActionId > ,
46+ /// The new proposed protocol parameters. Only values set to `Some` are relevant.
47+ new_parameters: ProtocolParametersUpdate ,
48+ /// The optional guardrails script defined in the constitution. The script
49+ /// is executed by the ledger in addition to the hard-coded ledger rules.
50+ ///
51+ /// It must pass for the new protocol parameters to be deemed valid.
52+ guardrails: Option < ScriptHash > ,
53+ }
54+ Hardfork {
55+ /// The last governance action of type `HardFork`. They must all
56+ /// form a chain.
57+ ancestor: Option < GovernanceActionId > ,
58+ /// The new proposed version. Few rules apply to proposing new versions:
59+ ///
60+ /// - The `major` component, if incremented, must be exactly one more than the current.
61+ /// - The `minor` component, if incremented, must be exactly one more than the current.
62+ /// - If the `major` component is incremented, `minor` must be set to `0`.
63+ /// - Neither `minor` nor `major` can be decremented.
64+ new_version: ProtocolVersion ,
65+ }
66+ TreasuryWithdrawal {
67+ /// A collection of beneficiaries, which can be plain verification key
68+ /// hashes or script hashes (e.g. DAO).
69+ beneficiaries: Pairs < Credential , Lovelace > ,
70+ /// The optional guardrails script defined in the constitution. The script
71+ /// is executed by the ledger in addition to the hard-coded ledger rules.
72+ ///
73+ /// It must pass for the withdrawals to be authorized.
74+ guardrails: Option < ScriptHash > ,
75+ }
76+ NoConfidence {
77+ /// The last governance action of type `NoConfidence` or
78+ /// `ConstitutionalCommittee`. They must all / form a chain.
79+ ancestor: Option < GovernanceActionId > ,
80+ }
81+ ConstitutionalCommittee {
82+ /// The last governance action of type `NoConfidence` or
83+ /// `ConstitutionalCommittee`. They must all / form a chain.
84+ ancestor: Option < GovernanceActionId > ,
85+ /// Constitutional members to be removed.
86+ evicted_members: List < Credential > ,
87+ /// Constitutional members to be added.
88+ added_members: Pairs < Credential , Mandate > ,
89+ /// The new quorum value, as a ratio of a numerator and a denominator. The
90+ /// quorum specifies the threshold of 'Yes' votes necessary for the
91+ /// constitutional committee to accept a proposal procedure.
92+ quorum: Rational ,
93+ }
94+ NewConstitution {
95+ /// The last governance action of type `Constitution` or
96+ /// `ConstitutionalCommittee`. They must all / form a chain.
97+ ancestor: Option < GovernanceActionId > ,
98+ /// The new proposed constitution.
99+ constitution: Constitution ,
100+ }
101+ NicePoll
77102}
78103
104+ /// An epoch number after which constitutional committee member
105+ /// mandate expires.
106+ pub type Mandate =
107+ Int
108+
79109pub type ProposalProcedure {
80110 deposit: Lovelace ,
81111 return_address: Credential ,
82112 governance_action: GovernanceAction ,
83113}
84114
85115pub type Voter {
86- CommitteeVoter (HotCommitteeCredential )
87- DRepVoter (DRepCredential )
116+ CommitteeVoter (Credential )
117+ DRepVoter (Credential )
88118 StakePoolVoter (VerificationKeyHash )
89119}
0 commit comments