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

Plutus.Contracts.Currency

Description

Implements a custom currency with a minting policy that allows the minting of a fixed amount of units.

Synopsis

Documentation

data OneShotCurrency Source #

A currency that can be created exactly once

Constructors

OneShotCurrency 

Fields

Instances

Instances details
Eq OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

Show OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

Generic OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

Associated Types

type Rep OneShotCurrency :: Type -> Type Source #

ToJSON OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

FromJSON OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

Lift DefaultUni OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

Typeable DefaultUni OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

type Rep OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

type Rep OneShotCurrency = D1 ('MetaData "OneShotCurrency" "Plutus.Contracts.Currency" "plutus-use-cases-0.1.0.0-sCb7ThsvWbFT6VPXrOzPF" 'False) (C1 ('MetaCons "OneShotCurrency" 'PrefixI 'True) (S1 ('MetaSel ('Just "curRefTransactionOutput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TxId, Integer)) :*: S1 ('MetaSel ('Just "curAmounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map TokenName Integer))))

type CurrencySchema = Endpoint "Create native token" SimpleMPS Source #

newtype CurrencyError Source #

Instances

Instances details
Eq CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

Show CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

Generic CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

Associated Types

type Rep CurrencyError :: Type -> Type Source #

ToJSON CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

FromJSON CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

AsContractError CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

AsCurrencyError CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

type Rep CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

type Rep CurrencyError = D1 ('MetaData "CurrencyError" "Plutus.Contracts.Currency" "plutus-use-cases-0.1.0.0-sCb7ThsvWbFT6VPXrOzPF" 'True) (C1 ('MetaCons "CurContractError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ContractError)))

Actions etc

mintContract :: forall w s e. AsCurrencyError e => PaymentPubKeyHash -> [(TokenName, Integer)] -> Contract w s e OneShotCurrency Source #

mint [(n1, c1), ..., (n_k, c_k)] creates a new currency with k token names, minting c_i units of each token n_i. If k == 0 then no value is minted. A one-shot minting policy script is used to ensure that no more units of the currency can be minted afterwards.

Simple minting policy currency

data SimpleMPS Source #

Minting policy for a currency that has a fixed amount of tokens issued in one transaction

Constructors

SimpleMPS 

Instances

Instances details
Eq SimpleMPS Source # 
Instance details

Defined in Plutus.Contracts.Currency

Show SimpleMPS Source # 
Instance details

Defined in Plutus.Contracts.Currency

Generic SimpleMPS Source # 
Instance details

Defined in Plutus.Contracts.Currency

Associated Types

type Rep SimpleMPS :: Type -> Type Source #

ToJSON SimpleMPS Source # 
Instance details

Defined in Plutus.Contracts.Currency

FromJSON SimpleMPS Source # 
Instance details

Defined in Plutus.Contracts.Currency

ToSchema SimpleMPS Source # 
Instance details

Defined in Plutus.Contracts.Currency

type Rep SimpleMPS Source # 
Instance details

Defined in Plutus.Contracts.Currency

type Rep SimpleMPS = D1 ('MetaData "SimpleMPS" "Plutus.Contracts.Currency" "plutus-use-cases-0.1.0.0-sCb7ThsvWbFT6VPXrOzPF" 'False) (C1 ('MetaCons "SimpleMPS" 'PrefixI 'True) (S1 ('MetaSel ('Just "tokenName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TokenName) :*: S1 ('MetaSel ('Just "amount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))