|
1 | 1 | use cardano/assets.{Lovelace} |
2 | | -use cardano/credential.{Credential, |
3 | | - PoolId, StakeCredential, VerificationKeyHash} |
4 | | -use cardano/governance.{Delegatee} |
| 2 | +use cardano/credential.{Credential, StakePoolId, VerificationKeyHash} |
5 | 3 |
|
6 | 4 | /// An on-chain certificate attesting of some operation. Publishing |
7 | 5 | /// certificates / triggers different kind of rules; most of the time, |
8 | 6 | /// they require signatures from / specific keys. |
9 | 7 | pub type Certificate { |
10 | | - // Register staking credential with an optional deposit amount |
11 | | - RegisterStaking { |
12 | | - delegator: StakeCredential, |
13 | | - deposit_amount: Option<Lovelace>, |
| 8 | + // Register a stake credential with an optional deposit amount. |
| 9 | + // The deposit is always present when using the new registration certificate |
| 10 | + // format available since the Conway era. |
| 11 | + RegisterCredential { credential: Credential, deposit: Option<Lovelace> } |
| 12 | + // Un-Register a stake credential with an optional refund amount |
| 13 | + // The deposit is always present when using the new de-registration certificate |
| 14 | + // format available since the Conway era. |
| 15 | + UnregisterCredential { credential: Credential, refund: Option<Lovelace> } |
| 16 | + // Delegate stake to a [Delegate](#Delegate). |
| 17 | + DelegateCredential { credential: Credential, delegate: Delegate } |
| 18 | + // Register and delegate staking credential to a Delegatee in one certificate. |
| 19 | + RegisterAndDelegateCredential { |
| 20 | + credential: Credential, |
| 21 | + delegate: Delegate, |
| 22 | + deposit: Lovelace, |
14 | 23 | } |
15 | | - // Un-Register staking credential with an optional refund amount |
16 | | - UnregisterStaking { |
17 | | - delegator: StakeCredential, |
18 | | - refund_amount: Option<Lovelace>, |
| 24 | + // Register a delegate representative (a.k.a DRep). The deposit is explicit and |
| 25 | + // is refunded when the delegate steps down (unregister). |
| 26 | + RegisterDelegateRepresentative { |
| 27 | + delegate_representative: Credential, |
| 28 | + deposit: Lovelace, |
19 | 29 | } |
20 | | - // Delegate staking credential to a Delegatee |
21 | | - DelegateStaking { delegator: StakeCredential, delegatee: Delegatee } |
22 | | - // Register and delegate staking credential to a Delegatee in one certificate. Noter that |
23 | | - // deposit is mandatory. |
24 | | - RegisterAndDelegate { |
25 | | - delegator: StakeCredential, |
26 | | - delegatee: Delegatee, |
27 | | - deposit_amount: Lovelace, |
| 30 | + // Update a delegate representative (a.k.a DRep). The certificate also contains |
| 31 | + // metadata which aren't visible on-chain. |
| 32 | + UpdateDelegateRepresentative { delegate_representative: Credential } |
| 33 | + // UnRegister a delegate representative, and refund back its past deposit. |
| 34 | + UnregisterDelegateRepresentative { |
| 35 | + delegate_representative: Credential, |
| 36 | + refund: Lovelace, |
28 | 37 | } |
29 | | - // Register a DRep with a deposit value. The optional anchor is omitted. |
30 | | - RegisterDRep { representative: Credential, deposit_amount: Lovelace } |
31 | | - // Update a DRep. The optional anchor is omitted. |
32 | | - UpdateDRep { representative: Credential } |
33 | | - // UnRegister a DRep with mandatory refund value |
34 | | - UnregisterDRep { representative: Credential, refund_amount: Lovelace } |
35 | | - // A digest of the PoolParams |
36 | | - PoolRegister { |
37 | | - // poolId |
38 | | - pool_id: PoolId, |
39 | | - // pool VFR |
40 | | - pool_vrf: VerificationKeyHash, |
| 38 | + // Register a new stake pool |
| 39 | + RegisterStakePool { |
| 40 | + // The hash digest of the stake pool's cold (public) key |
| 41 | + stake_pool: StakePoolId, |
| 42 | + // The hash digest of the stake pool's VRF (public) key |
| 43 | + vrf: VerificationKeyHash, |
41 | 44 | } |
42 | | - // The retirement certificate and the Epoch in which the retirement will take place |
43 | | - PoolRetire { pool_id: PoolId, epoch: Int } |
| 45 | + // Retire a stake pool. 'at_epoch' indicates in which the retirement will take place |
| 46 | + RetireStakePool { stake_pool: StakePoolId, at_epoch: Int } |
44 | 47 | // Authorize a Hot credential for a specific Committee member's cold credential |
45 | | - AuthorizeHotCommittee { cold_memeber: Credential, hot_member: Credential } |
46 | | - ResignColdCommittee { cold_member: Credential } |
| 48 | + AuthorizeConstitutionalCommitteeProxy { |
| 49 | + constitutional_committee_member: Credential, |
| 50 | + proxy: Credential, |
| 51 | + } |
| 52 | + // Step down from the constitutional committee as a member. |
| 53 | + RetireFromConstitutionalCommittee { |
| 54 | + constitutional_committee_member: Credential, |
| 55 | + } |
| 56 | +} |
| 57 | + |
| 58 | +pub type Delegate { |
| 59 | + DelegateBlockProduction { stake_pool: StakePoolId } |
| 60 | + DelegateVote { delegate_representative: DelegateRepresentative } |
| 61 | + DelegateBoth { |
| 62 | + stake_pool: StakePoolId, |
| 63 | + delegate_representative: DelegateRepresentative, |
| 64 | + } |
| 65 | +} |
| 66 | + |
| 67 | +pub type DelegateRepresentative { |
| 68 | + Registered(Credential) |
| 69 | + AlwaysAbstain |
| 70 | + AlwaysNoConfidence |
47 | 71 | } |
0 commit comments