-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
679 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/// An positive integer, that materializes the position of an element in a | ||
/// collection. | ||
pub type Index = | ||
Int |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
use aiken/bytearray | ||
use aiken/math | ||
use aiken/option | ||
use aiken/primitive/bytearray | ||
|
||
/// Compare two integers. | ||
/// | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
/// A number of milliseconds since 00:00:00 UTC on 1 January 1970. | ||
pub type PosixTime = | ||
Int | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
use cardano/assets.{Lovelace} | ||
use cardano/credential.{Credential, StakePoolId, VerificationKeyHash} | ||
|
||
/// An on-chain certificate attesting of some operation. Publishing | ||
/// certificates / triggers different kind of rules; most of the time, | ||
/// they require signatures from / specific keys. | ||
pub type Certificate { | ||
// Register a stake credential with an optional deposit amount. | ||
// The deposit is always present when using the new registration certificate | ||
// format available since the Conway era. | ||
RegisterCredential { credential: Credential, deposit: Option<Lovelace> } | ||
// Un-Register a stake credential with an optional refund amount | ||
// The deposit is always present when using the new de-registration certificate | ||
// format available since the Conway era. | ||
UnregisterCredential { credential: Credential, refund: Option<Lovelace> } | ||
// Delegate stake to a [Delegate](#Delegate). | ||
DelegateCredential { credential: Credential, delegate: Delegate } | ||
// Register and delegate staking credential to a Delegatee in one certificate. | ||
RegisterAndDelegateCredential { | ||
credential: Credential, | ||
delegate: Delegate, | ||
deposit: Lovelace, | ||
} | ||
// Register a delegate representative (a.k.a DRep). The deposit is explicit and | ||
// is refunded when the delegate steps down (unregister). | ||
RegisterDelegateRepresentative { | ||
delegate_representative: Credential, | ||
deposit: Lovelace, | ||
} | ||
// Update a delegate representative (a.k.a DRep). The certificate also contains | ||
// metadata which aren't visible on-chain. | ||
UpdateDelegateRepresentative { delegate_representative: Credential } | ||
// UnRegister a delegate representative, and refund back its past deposit. | ||
UnregisterDelegateRepresentative { | ||
delegate_representative: Credential, | ||
refund: Lovelace, | ||
} | ||
// Register a new stake pool | ||
RegisterStakePool { | ||
// The hash digest of the stake pool's cold (public) key | ||
stake_pool: StakePoolId, | ||
// The hash digest of the stake pool's VRF (public) key | ||
vrf: VerificationKeyHash, | ||
} | ||
// Retire a stake pool. 'at_epoch' indicates in which the retirement will take place | ||
RetireStakePool { stake_pool: StakePoolId, at_epoch: Int } | ||
// Authorize a Hot credential for a specific Committee member's cold credential | ||
AuthorizeConstitutionalCommitteeProxy { | ||
constitutional_committee_member: Credential, | ||
proxy: Credential, | ||
} | ||
// Step down from the constitutional committee as a member. | ||
RetireFromConstitutionalCommittee { | ||
constitutional_committee_member: Credential, | ||
} | ||
} | ||
|
||
pub type Delegate { | ||
DelegateBlockProduction { stake_pool: StakePoolId } | ||
DelegateVote { delegate_representative: DelegateRepresentative } | ||
DelegateBoth { | ||
stake_pool: StakePoolId, | ||
delegate_representative: DelegateRepresentative, | ||
} | ||
} | ||
|
||
pub type DelegateRepresentative { | ||
Registered(Credential) | ||
AlwaysAbstain | ||
AlwaysNoConfidence | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
use aiken/collection.{Index} | ||
use aiken/hash.{Blake2b_256, Hash} | ||
use aiken/math/rational.{Rational} | ||
use cardano/assets.{Lovelace} | ||
use cardano/credential.{Credential, ScriptHash, VerificationKeyHash} | ||
use cardano/governance/protocol_parameters.{ProtocolParametersUpdate} | ||
|
||
pub type ProposalProcedure { | ||
deposit: Lovelace, | ||
return_address: Credential, | ||
governance_action: GovernanceAction, | ||
} | ||
|
||
pub type GovernanceAction { | ||
ProtocolParameters { | ||
/// The last governance action of type 'ProtocolParameters'. They must all | ||
/// form a chain. | ||
ancestor: Option<GovernanceActionId>, | ||
/// The new proposed protocol parameters. Only values set to `Some` are relevant. | ||
new_parameters: ProtocolParametersUpdate, | ||
/// The optional guardrails script defined in the constitution. The script | ||
/// is executed by the ledger in addition to the hard-coded ledger rules. | ||
/// | ||
/// It must pass for the new protocol parameters to be deemed valid. | ||
guardrails: Option<ScriptHash>, | ||
} | ||
HardFork { | ||
/// The last governance action of type `HardFork`. They must all | ||
/// form a chain. | ||
ancestor: Option<GovernanceActionId>, | ||
/// The new proposed version. Few rules apply to proposing new versions: | ||
/// | ||
/// - The `major` component, if incremented, must be exactly one more than the current. | ||
/// - The `minor` component, if incremented, must be exactly one more than the current. | ||
/// - If the `major` component is incremented, `minor` must be set to `0`. | ||
/// - Neither `minor` nor `major` can be decremented. | ||
new_version: ProtocolVersion, | ||
} | ||
TreasuryWithdrawal { | ||
/// A collection of beneficiaries, which can be plain verification key | ||
/// hashes or script hashes (e.g. DAO). | ||
beneficiaries: Pairs<Credential, Lovelace>, | ||
/// The optional guardrails script defined in the constitution. The script | ||
/// is executed by the ledger in addition to the hard-coded ledger rules. | ||
/// | ||
/// It must pass for the withdrawals to be authorized. | ||
guardrails: Option<ScriptHash>, | ||
} | ||
NoConfidence { | ||
/// The last governance action of type `NoConfidence` or | ||
/// `ConstitutionalCommittee`. They must all / form a chain. | ||
ancestor: Option<GovernanceActionId>, | ||
} | ||
ConstitutionalCommittee { | ||
/// The last governance action of type `NoConfidence` or | ||
/// `ConstitutionalCommittee`. They must all / form a chain. | ||
ancestor: Option<GovernanceActionId>, | ||
/// Constitutional members to be removed. | ||
evicted_members: List<Credential>, | ||
/// Constitutional members to be added. | ||
added_members: Pairs<Credential, Mandate>, | ||
/// The new quorum value, as a ratio of a numerator and a denominator. The | ||
/// quorum specifies the threshold of 'Yes' votes necessary for the | ||
/// constitutional committee to accept a proposal procedure. | ||
quorum: Rational, | ||
} | ||
NewConstitution { | ||
/// The last governance action of type `Constitution` or | ||
/// `ConstitutionalCommittee`. They must all / form a chain. | ||
ancestor: Option<GovernanceActionId>, | ||
/// The new proposed constitution. | ||
constitution: Constitution, | ||
} | ||
NicePoll | ||
} | ||
|
||
pub type Vote { | ||
No | ||
Yes | ||
Abstain | ||
} | ||
|
||
pub type TransactionId = | ||
Hash<Blake2b_256, ByteArray> | ||
|
||
pub type GovernanceActionId { | ||
transaction: TransactionId, | ||
proposal_procedure: Index, | ||
} | ||
|
||
pub type ProtocolVersion { | ||
major: Int, | ||
minor: Int, | ||
} | ||
|
||
pub type Constitution { | ||
guardrails: Option<ScriptHash>, | ||
} | ||
|
||
/// An epoch number after which constitutional committee member | ||
/// mandate expires. | ||
pub type Mandate = | ||
Int | ||
|
||
pub type Voter { | ||
ConstitutionalCommitteeMember(Credential) | ||
DelegateRepresentative(Credential) | ||
StakePool(VerificationKeyHash) | ||
} |
Oops, something went wrong.