plutus-use-cases-1.2.0.0: Collection of smart contracts to develop the plutus/wallet interface
Safe HaskellNone
LanguageHaskell2010

Plutus.Contracts.MultiSigStateMachine

Description

A multisig contract written as a state machine.

Synopsis

Documentation

The n-out-of-m multisig contract works like a joint account of m people, requiring the consent of n people for any payments. In the smart contract the signatories are represented by public keys, and approval takes the form of signatures on transactions.

The multisig contract in MultiSig expects n signatures on a single transaction. This requires an off-chain communication channel. The multisig contract implemented in this module uses a proposal system that allows participants to propose payments and attach their signatures to proposals over a period of time, using separate transactions. All contract state is kept on the chain so there is no need for off-chain communication.

data Params Source #

Constructors

Params 

Fields

Instances

Instances details
Lift DefaultUni Params Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

lift :: Params -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni Params Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

typeRep :: Proxy Params -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

data Payment Source #

A proposal for making a payment under the multisig scheme.

Constructors

Payment 

Fields

Instances

Instances details
Show Payment Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Generic Payment Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Associated Types

type Rep Payment :: Type -> Type Source #

FromJSON Payment Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

parseJSON :: Value -> Parser Payment

parseJSONList :: Value -> Parser [Payment]

ToJSON Payment Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

toJSON :: Payment -> Value

toEncoding :: Payment -> Encoding

toJSONList :: [Payment] -> Value

toEncodingList :: [Payment] -> Encoding

ToData Payment Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

toBuiltinData :: Payment -> BuiltinData

FromData Payment Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

fromBuiltinData :: BuiltinData -> Maybe Payment

Eq Payment Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

(==) :: Payment -> Payment -> Bool

UnsafeFromData Payment Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

unsafeFromBuiltinData :: BuiltinData -> Payment

Lift DefaultUni Payment Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

lift :: Payment -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni Payment Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

typeRep :: Proxy Payment -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep Payment Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

type Rep Payment = D1 ('MetaData "Payment" "Plutus.Contracts.MultiSigStateMachine" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) (C1 ('MetaCons "Payment" 'PrefixI 'True) (S1 ('MetaSel ('Just "paymentAmount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value) :*: (S1 ('MetaSel ('Just "paymentRecipient") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Address) :*: S1 ('MetaSel ('Just "paymentDeadline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 POSIXTime))))

data State s #

Instances

Instances details
Eq s => Eq (State s) 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

Methods

(==) :: State s -> State s -> Bool Source #

(/=) :: State s -> State s -> Bool Source #

Show s => Show (State s) 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

Generic (State s) 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

Associated Types

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

Methods

from :: State s -> Rep (State s) x Source #

to :: Rep (State s) x -> State s Source #

FromJSON s => FromJSON (State s) 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

Methods

parseJSON :: Value -> Parser (State s)

parseJSONList :: Value -> Parser [State s]

ToJSON s => ToJSON (State s) 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

Methods

toJSON :: State s -> Value

toEncoding :: State s -> Encoding

toJSONList :: [State s] -> Value

toEncodingList :: [State s] -> Encoding

type Rep (State s) 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

type Rep (State s) = D1 ('MetaData "State" "Plutus.Contract.StateMachine.OnChain" "plutus-contract-1.2.0.0-FH8LC9wh7UV4Nmv68NHXrC" 'False) (C1 ('MetaCons "State" 'PrefixI 'True) (S1 ('MetaSel ('Just "stateData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 s) :*: S1 ('MetaSel ('Just "stateValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)))

mkValidator :: Params -> ValidatorType MultiSigSym Source #

typedValidator :: Params -> TypedValidator MultiSigSym Source #

data MultiSigError Source #

Constructors

MSContractError ContractError 
MSStateMachineError SMContractError 

Instances

Instances details
Show MultiSigError Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Generic MultiSigError Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Associated Types

type Rep MultiSigError :: Type -> Type Source #

FromJSON MultiSigError Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

parseJSON :: Value -> Parser MultiSigError

parseJSONList :: Value -> Parser [MultiSigError]

ToJSON MultiSigError Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

toJSON :: MultiSigError -> Value

toEncoding :: MultiSigError -> Encoding

toJSONList :: [MultiSigError] -> Value

toEncodingList :: [MultiSigError] -> Encoding

AsContractError MultiSigError Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

_ContractError :: Prism' MultiSigError ContractError

_WalletContractError :: Prism' MultiSigError WalletAPIError

_ChainIndexContractError :: Prism' MultiSigError (Text, ChainIndexResponse)

_ConstraintResolutionContractError :: Prism' MultiSigError MkTxError

_ToCardanoConvertContractError :: Prism' MultiSigError ToCardanoError

_ResumableContractError :: Prism' MultiSigError MatchingError

_CCheckpointContractError :: Prism' MultiSigError CheckpointError

_EndpointDecodeContractError :: Prism' MultiSigError (EndpointDescription, EndpointValue Value, Text)

_OtherContractError :: Prism' MultiSigError Text

AsSMContractError MultiSigError Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

Methods

_SMContractError :: Prism' MultiSigError SMContractError

_ChooserError :: Prism' MultiSigError Text

_UnableToExtractTransition :: Prism' MultiSigError ()

_SMCContractError :: Prism' MultiSigError ContractError

type Rep MultiSigError Source # 
Instance details

Defined in Plutus.Contracts.MultiSigStateMachine

type Rep MultiSigError = D1 ('MetaData "MultiSigError" "Plutus.Contracts.MultiSigStateMachine" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) (C1 ('MetaCons "MSContractError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ContractError)) :+: C1 ('MetaCons "MSStateMachineError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SMContractError)))

type MultiSigSchema = (((Endpoint "propose-payment" Payment .\/ Endpoint "add-signature" ()) .\/ Endpoint "cancel-payment" ()) .\/ Endpoint "pay" ()) .\/ Endpoint "lock" Value Source #

contract :: (AsContractError e, AsSMContractError e) => Params -> Contract () MultiSigSchema e () Source #