agora-0.1.0
Maintainerconnor@mlabs.city
Safe HaskellSafe-Inferred
LanguageHaskell2010

Agora.Effect.GovernorMutation

Description

An effect for mutating governor settings.

Synopsis

Haskell-land

data MutateGovernorDatum Source #

Haskell-level datum for the governor mutation effect script.

Since: 0.1.0

Constructors

MutateGovernorDatum 

Fields

Instances

Instances details
Generic MutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

Associated Types

type Rep MutateGovernorDatum :: Type -> Type Source #

Show MutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

Generic MutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

Associated Types

type Code MutateGovernorDatum :: [[Type]] Source #

PConstantDecl MutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

FromData MutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

ToData MutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

UnsafeFromData MutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

type Rep MutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

type Rep MutateGovernorDatum = D1 ('MetaData "MutateGovernorDatum" "Agora.Effect.GovernorMutation" "agora-0.1.0-C1o5klqsCO77ggIWQdJiNp" 'False) (C1 ('MetaCons "MutateGovernorDatum" 'PrefixI 'True) (S1 ('MetaSel ('Just "governorRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TxOutRef) :*: S1 ('MetaSel ('Just "newDatum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GovernorDatum)))
type Code MutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

type PConstantRepr MutateGovernorDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Effect.GovernorMutation

type PConstanted MutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

Plutarch-land

newtype PMutateGovernorDatum (s :: S) Source #

Plutarch-level version of MutateGovernorDatum.

Since: 0.1.0

Constructors

PMutateGovernorDatum (Term s (PDataRecord '["governorRef" := PTxOutRef, "newDatum" := PGovernorDatum])) 

Instances

Instances details
PEq PMutateGovernorDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Effect.GovernorMutation

PIsData PMutateGovernorDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Effect.GovernorMutation

PIsDataRepr PMutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

PDataFields PMutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

PlutusType PMutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

Associated Types

type PInner PMutateGovernorDatum b' :: PType Source #

Methods

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

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

PUnsafeLiftDecl PMutateGovernorDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Effect.GovernorMutation

Associated Types

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

PTryFrom PData (PAsData PMutateGovernorDatum) Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

Methods

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

Generic (PMutateGovernorDatum s) Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

Associated Types

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

Generic (PMutateGovernorDatum s) Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

Associated Types

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

type PIsDataReprRepr PMutateGovernorDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Effect.GovernorMutation

type PFields PMutateGovernorDatum Source #

Since: 0.1.0

Instance details

Defined in Agora.Effect.GovernorMutation

type PLifted PMutateGovernorDatum Source # 
Instance details

Defined in Agora.Effect.GovernorMutation

type PInner PMutateGovernorDatum b' Source #

Since: 0.1.0

Instance details

Defined in Agora.Effect.GovernorMutation

type PTryFromExcess PData (PAsData PMutateGovernorDatum) Source #

Since: 0.1.0

Instance details

Defined in Agora.Effect.GovernorMutation

type Rep (PMutateGovernorDatum s) Source #

Since: 0.1.0

Instance details

Defined in Agora.Effect.GovernorMutation

type Rep (PMutateGovernorDatum s) = D1 ('MetaData "PMutateGovernorDatum" "Agora.Effect.GovernorMutation" "agora-0.1.0-C1o5klqsCO77ggIWQdJiNp" 'True) (C1 ('MetaCons "PMutateGovernorDatum" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PDataRecord '["governorRef" := PTxOutRef, "newDatum" := PGovernorDatum])))))
type Code (PMutateGovernorDatum s) Source #

Since: 0.1.0

Instance details

Defined in Agora.Effect.GovernorMutation

Scripts

mutateGovernorValidator :: Governor -> ClosedTerm PValidator Source #

Validator for the governor mutation effect.

This effect is implemented using the makeEffect wrapper, meaning that the burning of GAT is checked in said wrapper.

In order to locate the governor, the validator is parametrized with a Governor.

All the information it needs to validate the effect is encoded in the MutateGovernorDatum, so regardless what redeemer it's given, it will check:

  • No token is minted/burnt other than GAT.
  • Nothing is being paid to the the effect validator.
  • The governor's state UTXO must be spent:

    • It carries exactly one GST.
    • It's referenced by governorRef in the effect's datum.
  • A new state UTXO is paid to the governor:

    • It contains the GST.
    • It has valid governor state datum.
    • The datum is exactly the same as the newDatum.

Since: 0.1.0