agora-0.1.0
Maintaineremi@haskell.fyi
Safe HaskellSafe-Inferred
LanguageHaskell2010

Agora.Proposal

Description

Proposal scripts encoding effects that operate on the system.

Synopsis

Haskell-land

data Proposal Source #

Parameters that identify the Proposal validator script.

Since: 0.1.0

Constructors

Proposal 

Fields

Instances

Instances details
Generic Proposal Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Rep Proposal :: Type -> Type Source #

Show Proposal Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Eq Proposal Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep Proposal Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep Proposal = D1 ('MetaData "Proposal" "Agora.Proposal" "agora-0.1.0-C1o5klqsCO77ggIWQdJiNp" 'False) (C1 ('MetaCons "Proposal" 'PrefixI 'True) (S1 ('MetaSel ('Just "governorSTAssetClass") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AssetClass) :*: (S1 ('MetaSel ('Just "stakeSTAssetClass") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AssetClass) :*: S1 ('MetaSel ('Just "maximumCosigners") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer))))

data ProposalDatum Source #

Haskell-level datum for Proposal scripts.

Since: 0.1.0

Constructors

ProposalDatum 

Fields

Instances

Instances details
Generic ProposalDatum Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Rep ProposalDatum :: Type -> Type Source #

Show ProposalDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Eq ProposalDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

PConstantDecl ProposalDatum Source # 
Instance details

Defined in Agora.Proposal

FromData ProposalDatum Source # 
Instance details

Defined in Agora.Proposal

ToData ProposalDatum Source # 
Instance details

Defined in Agora.Proposal

UnsafeFromData ProposalDatum Source # 
Instance details

Defined in Agora.Proposal

type Rep ProposalDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PConstantRepr ProposalDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PConstanted ProposalDatum Source # 
Instance details

Defined in Agora.Proposal

data ProposalRedeemer Source #

Haskell-level redeemer for Proposal scripts.

Since: 0.1.0

Constructors

Vote ResultTag

Cast one or more votes towards a particular ResultTag.

Cosign [PubKeyHash]

Add one or more public keys to the cosignature list. Must be signed by those cosigning.

This is particularly used in the Draft ProposalStatus, where matching Stakes can be called to advance the proposal, provided enough GT is shared among them.

Unlock ResultTag

Allow unlocking one or more stakes with votes towards particular ResultTag.

AdvanceProposal

Advance the proposal, performing the required checks for whether that is legal.

These are roughly the checks for each possible transition:

Draft -> VotingReady:

  1. The sum of all of the cosigner's GT is larger than the startVoting field of ProposalThresholds.
  2. The proposal's current time ensures isDraftPeriod.

VotingReady -> Locked:

  1. The sum of all votes is larger than countVoting.
  2. The winning ResultTag has more votes than all other ResultTags.
  3. The proposal's current time ensures isVotingPeriod.

Locked -> Finished:

  1. The proposal's current time ensures isExecutionPeriod.
  2. The transaction mints the GATs to the receiving effects.

* -> Finished:

If the proposal has run out of time for the current ProposalStatus, it will always be possible to transition into Finished status, because it has expired (and failed).

Instances

Instances details
Generic ProposalRedeemer Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Rep ProposalRedeemer :: Type -> Type Source #

Show ProposalRedeemer Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Eq ProposalRedeemer Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

PConstantDecl ProposalRedeemer Source # 
Instance details

Defined in Agora.Proposal

FromData ProposalRedeemer Source # 
Instance details

Defined in Agora.Proposal

ToData ProposalRedeemer Source # 
Instance details

Defined in Agora.Proposal

UnsafeFromData ProposalRedeemer Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep ProposalRedeemer Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PConstantRepr ProposalRedeemer Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PConstanted ProposalRedeemer Source # 
Instance details

Defined in Agora.Proposal

data ProposalStatus Source #

The "status" of the proposal. This is only useful for state transitions that need to happen as a result of a transaction as opposed to time-based "periods".

See the note on wording & the state machine in the tech-design.

If the proposal is VotingReady, for instance, that doesn't necessarily mean that voting is possible, as this also requires the timing to be right.

Since: 0.1.0

Constructors

Draft

A draft proposal represents a proposal that has yet to be realized.

In effect, this means one which didn't have enough LQ to be a full proposal, and needs cosigners to enable that to happen. This is similar to a "temperature check", but only useful if multiple people want to pool governance tokens together. If the proposal doesn't get to VotingReady on time, the proposal will never be able to get voted on.

VotingReady

The proposal has/had enough GT cosigned in order to be a fully fledged proposal.

This means that once the timing requirements align, proposal will be able to be voted on.

Locked

The proposal has been voted on, and the votes have been locked permanently. The proposal now goes into a locking time after the normal voting time. After this, it's possible to execute the proposal.

Finished

The proposal has finished.

This can mean it's been voted on and completed, but it can also mean the proposal failed due to time constraints or didn't get to VotingReady first.

At this stage, the votes field of ProposalDatum is frozen.

See AdvanceProposal for documentation on state transitions.

TODO: The owner of the proposal may choose to reclaim their proposal.

Instances

Instances details
Generic ProposalStatus Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Rep ProposalStatus :: Type -> Type Source #

Show ProposalStatus Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Eq ProposalStatus Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

PConstantDecl ProposalStatus Source # 
Instance details

Defined in Agora.Proposal

FromData ProposalStatus Source # 
Instance details

Defined in Agora.Proposal

ToData ProposalStatus Source # 
Instance details

Defined in Agora.Proposal

UnsafeFromData ProposalStatus Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep ProposalStatus Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep ProposalStatus = D1 ('MetaData "ProposalStatus" "Agora.Proposal" "agora-0.1.0-C1o5klqsCO77ggIWQdJiNp" 'False) ((C1 ('MetaCons "Draft" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "VotingReady" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Locked" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Finished" 'PrefixI 'False) (U1 :: Type -> Type)))
type PConstantRepr ProposalStatus Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PConstanted ProposalStatus Source # 
Instance details

Defined in Agora.Proposal

data ProposalThresholds Source #

The threshold values for various state transitions to happen. This data is stored centrally (in the Governor) and copied over to Proposals when they are created.

Since: 0.1.0

Constructors

ProposalThresholds 

Fields

Instances

Instances details
Generic ProposalThresholds Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Rep ProposalThresholds :: Type -> Type Source #

Show ProposalThresholds Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Eq ProposalThresholds Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

PConstantDecl ProposalThresholds Source # 
Instance details

Defined in Agora.Proposal

FromData ProposalThresholds Source # 
Instance details

Defined in Agora.Proposal

ToData ProposalThresholds Source # 
Instance details

Defined in Agora.Proposal

UnsafeFromData ProposalThresholds Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep ProposalThresholds Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep ProposalThresholds = D1 ('MetaData "ProposalThresholds" "Agora.Proposal" "agora-0.1.0-C1o5klqsCO77ggIWQdJiNp" 'False) (C1 ('MetaCons "ProposalThresholds" 'PrefixI 'True) (S1 ('MetaSel ('Just "execute") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Tagged GTTag Integer)) :*: (S1 ('MetaSel ('Just "create") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Tagged GTTag Integer)) :*: S1 ('MetaSel ('Just "vote") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Tagged GTTag Integer)))))
type PConstantRepr ProposalThresholds Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PConstanted ProposalThresholds Source # 
Instance details

Defined in Agora.Proposal

newtype ProposalVotes Source #

Map which encodes the total tally for each result. It's important that the "shape" is consistent with the shape of effects.

e.g. if the effects field looks like the following:

[(ResultTag 0, []), (ResultTag 1, [(vh, dh)])]

Then ProposalVotes needs be of the shape:

[(ResultTag 0, n), (ResultTag 1, m)]

Since: 0.1.0

Instances

Instances details
Generic ProposalVotes Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Rep ProposalVotes :: Type -> Type Source #

Show ProposalVotes Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Eq ProposalVotes Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

PConstantDecl ProposalVotes Source # 
Instance details

Defined in Agora.Proposal

FromData ProposalVotes Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

ToData ProposalVotes Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

UnsafeFromData ProposalVotes Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep ProposalVotes Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep ProposalVotes = D1 ('MetaData "ProposalVotes" "Agora.Proposal" "agora-0.1.0-C1o5klqsCO77ggIWQdJiNp" 'True) (C1 ('MetaCons "ProposalVotes" 'PrefixI 'True) (S1 ('MetaSel ('Just "getProposalVotes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map ResultTag Integer))))
type PConstantRepr ProposalVotes Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PConstanted ProposalVotes Source # 
Instance details

Defined in Agora.Proposal

newtype ProposalId Source #

Identifies a Proposal, issued upon creation of a proposal. In practice, this number starts at zero, and increments by one for each proposal. The 100th proposal will be ProposalId 99. This counter lives in the Governor. See nextProposalId, and pgetNextProposalId.

Since: 0.1.0

Constructors

ProposalId 

Fields

Instances

Instances details
Generic ProposalId Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Rep ProposalId :: Type -> Type Source #

Show ProposalId Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Eq ProposalId Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

PConstantDecl ProposalId Source # 
Instance details

Defined in Agora.Proposal

FromData ProposalId Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

ToData ProposalId Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

UnsafeFromData ProposalId Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep ProposalId Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep ProposalId = D1 ('MetaData "ProposalId" "Agora.Proposal" "agora-0.1.0-C1o5klqsCO77ggIWQdJiNp" 'True) (C1 ('MetaCons "ProposalId" 'PrefixI 'True) (S1 ('MetaSel ('Just "proposalTag") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))
type PConstantRepr ProposalId Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PConstanted ProposalId Source # 
Instance details

Defined in Agora.Proposal

newtype ResultTag Source #

Encodes a result. Typically, for a Yes/No proposal, we encode it like this:

    No  ~ ResultTag 0
    Yes ~ ResultTag 1
    

Since: 0.1.0

Constructors

ResultTag 

Instances

Instances details
Generic ResultTag Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Rep ResultTag :: Type -> Type Source #

Show ResultTag Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Eq ResultTag Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Ord ResultTag Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

PConstantDecl ResultTag Source # 
Instance details

Defined in Agora.Proposal

FromData ResultTag Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

ToData ResultTag Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

UnsafeFromData ResultTag Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep ResultTag Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep ResultTag = D1 ('MetaData "ResultTag" "Agora.Proposal" "agora-0.1.0-C1o5klqsCO77ggIWQdJiNp" 'True) (C1 ('MetaCons "ResultTag" 'PrefixI 'True) (S1 ('MetaSel ('Just "getResultTag") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))
type PConstantRepr ResultTag Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PConstanted ResultTag Source # 
Instance details

Defined in Agora.Proposal

emptyVotesFor :: forall a. Map ResultTag a -> ProposalVotes Source #

Create a ProposalVotes that has the same shape as the effects field.

Since: 0.1.0

Plutarch-land

newtype PProposalDatum (s :: S) Source #

Plutarch-level version of ProposalDatum.

Since: 0.1.0

Instances

Instances details
PEq PProposalDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Methods

(#==) :: forall (s :: S). Term s PProposalDatum -> Term s PProposalDatum -> Term s PBool Source #

PIsData PProposalDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PProposalDatum) -> Term s PProposalDatum Source #

pdataImpl :: forall (s :: S). Term s PProposalDatum -> Term s PData Source #

PIsDataRepr PProposalDatum Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type PIsDataReprRepr PProposalDatum :: [[PLabeledType]] Source #

Methods

pconRepr :: forall (s :: S). PProposalDatum s -> Term s (PDataSum (PIsDataReprRepr PProposalDatum)) Source #

pmatchRepr :: forall (s :: S) (b :: PType). Term s (PDataSum (PIsDataReprRepr PProposalDatum)) -> (PProposalDatum s -> Term s b) -> Term s b Source #

PDataFields PProposalDatum Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type PFields PProposalDatum :: [PLabeledType] Source #

PlutusType PProposalDatum Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type PInner PProposalDatum b' :: PType Source #

Methods

pcon' :: forall (s :: S) (b :: PType). PProposalDatum s -> Term s (PInner PProposalDatum b) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PProposalDatum b) -> (PProposalDatum s -> Term s b) -> Term s b Source #

PUnsafeLiftDecl PProposalDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Associated Types

type PLifted PProposalDatum = (r :: Type) Source #

PTryFrom PData (PAsData PProposalDatum) Source # 
Instance details

Defined in Agora.Proposal

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PProposalDatum), Reduce (PTryFromExcess PData (PAsData PProposalDatum) s)) -> Term s r) -> Term s r Source #

Generic (PProposalDatum s) Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Rep (PProposalDatum s) :: Type -> Type Source #

Generic (PProposalDatum s) Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Code (PProposalDatum s) :: [[Type]] Source #

type PIsDataReprRepr PProposalDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PFields PProposalDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PLifted PProposalDatum Source # 
Instance details

Defined in Agora.Proposal

type PInner PProposalDatum b' Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PTryFromExcess PData (PAsData PProposalDatum) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep (PProposalDatum s) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep (PProposalDatum s) = D1 ('MetaData "PProposalDatum" "Agora.Proposal" "agora-0.1.0-C1o5klqsCO77ggIWQdJiNp" 'True) (C1 ('MetaCons "PProposalDatum" 'PrefixI 'True) (S1 ('MetaSel ('Just "getProposalDatum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PDataRecord '["proposalId" := PProposalId, "effects" := PMap 'Unsorted PResultTag (PMap 'Unsorted PValidatorHash PDatumHash), "status" := PProposalStatus, "cosigners" := PBuiltinList (PAsData PPubKeyHash), "thresholds" := PProposalThresholds, "votes" := PProposalVotes, "timingConfig" := PProposalTimingConfig, "startingTime" := PProposalStartingTime])))))
type Code (PProposalDatum s) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

data PProposalRedeemer (s :: S) Source #

Plutarch-level version of ProposalRedeemer.

Since: 0.1.0

Constructors

PVote (Term s (PDataRecord '["resultTag" := PResultTag])) 
PCosign (Term s (PDataRecord '["newCosigners" := PBuiltinList (PAsData PPubKeyHash)])) 
PUnlock (Term s (PDataRecord '["resultTag" := PResultTag])) 
PAdvanceProposal (Term s (PDataRecord '[])) 

Instances

Instances details
PIsData PProposalRedeemer Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

PIsDataRepr PProposalRedeemer Source # 
Instance details

Defined in Agora.Proposal

PlutusType PProposalRedeemer Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type PInner PProposalRedeemer b' :: PType Source #

Methods

pcon' :: forall (s :: S) (b :: PType). PProposalRedeemer s -> Term s (PInner PProposalRedeemer b) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PProposalRedeemer b) -> (PProposalRedeemer s -> Term s b) -> Term s b Source #

PUnsafeLiftDecl PProposalRedeemer Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Associated Types

type PLifted PProposalRedeemer = (r :: Type) Source #

PTryFrom PData (PAsData PProposalRedeemer) Source # 
Instance details

Defined in Agora.Proposal

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PProposalRedeemer), Reduce (PTryFromExcess PData (PAsData PProposalRedeemer) s)) -> Term s r) -> Term s r Source #

Generic (PProposalRedeemer s) Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Rep (PProposalRedeemer s) :: Type -> Type Source #

Generic (PProposalRedeemer s) Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Code (PProposalRedeemer s) :: [[Type]] Source #

type PIsDataReprRepr PProposalRedeemer Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PLifted PProposalRedeemer Source # 
Instance details

Defined in Agora.Proposal

type PInner PProposalRedeemer b' Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PTryFromExcess PData (PAsData PProposalRedeemer) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep (PProposalRedeemer s) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep (PProposalRedeemer s) = D1 ('MetaData "PProposalRedeemer" "Agora.Proposal" "agora-0.1.0-C1o5klqsCO77ggIWQdJiNp" 'False) ((C1 ('MetaCons "PVote" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PDataRecord '["resultTag" := PResultTag])))) :+: C1 ('MetaCons "PCosign" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PDataRecord '["newCosigners" := PBuiltinList (PAsData PPubKeyHash)]))))) :+: (C1 ('MetaCons "PUnlock" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PDataRecord '["resultTag" := PResultTag])))) :+: C1 ('MetaCons "PAdvanceProposal" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PDataRecord ('[] :: [PLabeledType])))))))
type Code (PProposalRedeemer s) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

data PProposalStatus (s :: S) Source #

Plutarch-level version of ProposalStatus.

Since: 0.1.0

Constructors

PDraft (Term s (PDataRecord '[])) 
PVotingReady (Term s (PDataRecord '[])) 
PLocked (Term s (PDataRecord '[])) 
PFinished (Term s (PDataRecord '[])) 

Instances

Instances details
PEq PProposalStatus Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Methods

(#==) :: forall (s :: S). Term s PProposalStatus -> Term s PProposalStatus -> Term s PBool Source #

PIsData PProposalStatus Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PProposalStatus) -> Term s PProposalStatus Source #

pdataImpl :: forall (s :: S). Term s PProposalStatus -> Term s PData Source #

PIsDataRepr PProposalStatus Source # 
Instance details

Defined in Agora.Proposal

PlutusType PProposalStatus Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type PInner PProposalStatus b' :: PType Source #

Methods

pcon' :: forall (s :: S) (b :: PType). PProposalStatus s -> Term s (PInner PProposalStatus b) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PProposalStatus b) -> (PProposalStatus s -> Term s b) -> Term s b Source #

PUnsafeLiftDecl PProposalStatus Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Associated Types

type PLifted PProposalStatus = (r :: Type) Source #

PTryFrom PData (PAsData PProposalStatus) Source # 
Instance details

Defined in Agora.Proposal

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PProposalStatus), Reduce (PTryFromExcess PData (PAsData PProposalStatus) s)) -> Term s r) -> Term s r Source #

Generic (PProposalStatus s) Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Rep (PProposalStatus s) :: Type -> Type Source #

Generic (PProposalStatus s) Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Code (PProposalStatus s) :: [[Type]] Source #

type PIsDataReprRepr PProposalStatus Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PLifted PProposalStatus Source # 
Instance details

Defined in Agora.Proposal

type PInner PProposalStatus b' Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PTryFromExcess PData (PAsData PProposalStatus) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep (PProposalStatus s) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Code (PProposalStatus s) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

newtype PProposalThresholds (s :: S) Source #

Plutarch-level version of ProposalThresholds.

Since: 0.1.0

Constructors

PProposalThresholds 

Fields

Instances

Instances details
PIsData PProposalThresholds Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

PIsDataRepr PProposalThresholds Source # 
Instance details

Defined in Agora.Proposal

PDataFields PProposalThresholds Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type PFields PProposalThresholds :: [PLabeledType] Source #

PlutusType PProposalThresholds Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type PInner PProposalThresholds b' :: PType Source #

Methods

pcon' :: forall (s :: S) (b :: PType). PProposalThresholds s -> Term s (PInner PProposalThresholds b) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PProposalThresholds b) -> (PProposalThresholds s -> Term s b) -> Term s b Source #

PUnsafeLiftDecl PProposalThresholds Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Associated Types

type PLifted PProposalThresholds = (r :: Type) Source #

PTryFrom PData (PAsData PProposalThresholds) Source # 
Instance details

Defined in Agora.Proposal

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PProposalThresholds), Reduce (PTryFromExcess PData (PAsData PProposalThresholds) s)) -> Term s r) -> Term s r Source #

Generic (PProposalThresholds s) Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Rep (PProposalThresholds s) :: Type -> Type Source #

Generic (PProposalThresholds s) Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type Code (PProposalThresholds s) :: [[Type]] Source #

type PIsDataReprRepr PProposalThresholds Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PFields PProposalThresholds Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PLifted PProposalThresholds Source # 
Instance details

Defined in Agora.Proposal

type PInner PProposalThresholds b' Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PTryFromExcess PData (PAsData PProposalThresholds) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep (PProposalThresholds s) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type Rep (PProposalThresholds s) = D1 ('MetaData "PProposalThresholds" "Agora.Proposal" "agora-0.1.0-C1o5klqsCO77ggIWQdJiNp" 'True) (C1 ('MetaCons "PProposalThresholds" 'PrefixI 'True) (S1 ('MetaSel ('Just "getProposalThresholds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PDataRecord '["execute" := PDiscrete GTTag, "create" := PDiscrete GTTag, "vote" := PDiscrete GTTag])))))
type Code (PProposalThresholds s) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

newtype PProposalVotes (s :: S) Source #

Plutarch-level version of ProposalVotes.

Since: 0.1.0

Instances

Instances details
PIsData PProposalVotes Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PProposalVotes) -> Term s PProposalVotes Source #

pdataImpl :: forall (s :: S). Term s PProposalVotes -> Term s PData Source #

PlutusType PProposalVotes Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type PInner PProposalVotes b' :: PType Source #

Methods

pcon' :: forall (s :: S) (b :: PType). PProposalVotes s -> Term s (PInner PProposalVotes b) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PProposalVotes b) -> (PProposalVotes s -> Term s b) -> Term s b Source #

PUnsafeLiftDecl PProposalVotes Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Associated Types

type PLifted PProposalVotes = (r :: Type) Source #

PTryFrom PData (PAsData PProposalVotes) Source # 
Instance details

Defined in Agora.Proposal

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PProposalVotes), Reduce (PTryFromExcess PData (PAsData PProposalVotes) s)) -> Term s r) -> Term s r Source #

type PLifted PProposalVotes Source # 
Instance details

Defined in Agora.Proposal

type PInner PProposalVotes b' Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PTryFromExcess PData (PAsData PProposalVotes) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

newtype PProposalId (s :: S) Source #

Plutarch-level version of PProposalId.

Since: 0.1.0

Constructors

PProposalId (Term s PInteger) 

Instances

Instances details
PEq PProposalId Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Methods

(#==) :: forall (s :: S). Term s PProposalId -> Term s PProposalId -> Term s PBool Source #

POrd PProposalId Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Methods

(#<=) :: forall (s :: S). Term s PProposalId -> Term s PProposalId -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PProposalId -> Term s PProposalId -> Term s PBool Source #

PIsData PProposalId Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PProposalId) -> Term s PProposalId Source #

pdataImpl :: forall (s :: S). Term s PProposalId -> Term s PData Source #

PlutusType PProposalId Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type PInner PProposalId b' :: PType Source #

Methods

pcon' :: forall (s :: S) (b :: PType). PProposalId s -> Term s (PInner PProposalId b) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PProposalId b) -> (PProposalId s -> Term s b) -> Term s b Source #

PUnsafeLiftDecl PProposalId Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Associated Types

type PLifted PProposalId = (r :: Type) Source #

PTryFrom PData (PAsData PProposalId) Source # 
Instance details

Defined in Agora.Proposal

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PProposalId), Reduce (PTryFromExcess PData (PAsData PProposalId) s)) -> Term s r) -> Term s r Source #

type PLifted PProposalId Source # 
Instance details

Defined in Agora.Proposal

type PInner PProposalId b' Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PTryFromExcess PData (PAsData PProposalId) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

newtype PResultTag (s :: S) Source #

Plutarch-level version of ResultTag.

Since: 0.1.0

Constructors

PResultTag (Term s PInteger) 

Instances

Instances details
PEq PResultTag Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Methods

(#==) :: forall (s :: S). Term s PResultTag -> Term s PResultTag -> Term s PBool Source #

POrd PResultTag Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Methods

(#<=) :: forall (s :: S). Term s PResultTag -> Term s PResultTag -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PResultTag -> Term s PResultTag -> Term s PBool Source #

PIsData PResultTag Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PResultTag) -> Term s PResultTag Source #

pdataImpl :: forall (s :: S). Term s PResultTag -> Term s PData Source #

PlutusType PResultTag Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type PInner PResultTag b' :: PType Source #

Methods

pcon' :: forall (s :: S) (b :: PType). PResultTag s -> Term s (PInner PResultTag b) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PResultTag b) -> (PResultTag s -> Term s b) -> Term s b Source #

PUnsafeLiftDecl PResultTag Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Associated Types

type PLifted PResultTag = (r :: Type) Source #

PTryFrom PData (PAsData PResultTag) Source # 
Instance details

Defined in Agora.Proposal

Associated Types

type PTryFromExcess PData (PAsData PResultTag) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PResultTag), Reduce (PTryFromExcess PData (PAsData PResultTag) s)) -> Term s r) -> Term s r Source #

type PLifted PResultTag Source # 
Instance details

Defined in Agora.Proposal

type PInner PResultTag b' Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

type PTryFromExcess PData (PAsData PResultTag) Source #

Since: 0.1.0

Instance details

Defined in Agora.Proposal

Plutarch helpers

proposalDatumValid :: Proposal -> Term s (PProposalDatum :--> PBool) Source #

Check for various invariants a proposal must uphold. This can be used to check both upon creation and upon any following state transitions in the proposal.

Since: 0.1.0

pemptyVotesFor :: forall s a. PIsData a => Term s (PMap 'Unsorted PResultTag a :--> PProposalVotes) Source #

Plutarch-level version of emptyVotesFor.

Since: 0.1.0

pwinner :: Term s (PProposalVotes :--> (PInteger :--> (PResultTag :--> PResultTag))) Source #

Wrapper for pwinner'. When the winner cannot be found, the neutral option will be returned.

Since: 0.1.0

pwinner' :: Term s (PProposalVotes :--> (PInteger :--> PMaybe PResultTag)) Source #

Find the winner result tag, given the votes and the quorum.

The winner should be unambiguous, meaning that if two options have the same highest votes, the function will return PNothing.

Since: 0.1.0

pneutralOption :: Term s (PMap 'Unsorted PResultTag (PMap 'Unsorted PValidatorHash PDatumHash) :--> PResultTag) Source #

Find the "neutral" option (a dummy outcome with no effect) given the effects.

Since: 0.1.0

pretractVotes :: Term s (PResultTag :--> (PInteger :--> (PProposalVotes :--> PProposalVotes))) Source #

Retract votes given the option and the amount of votes.

Since: 0.1.0