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

Plutus.Contracts.Game

Description

A guessing game. A simplified version of GameStateMachine not using StateMachine and using yieldUnbalancedTx for balancing, signing and submitting transactions.

Currently, remote wallets (anything other than WBE) can only handles yieldUnbalancedTx requests, and not balanceTx, signTx and submitTx requests.

Synopsis

Documentation

data GameParam Source #

Datatype for creating a parameterized validator.

Constructors

GameParam 

Fields

Instances

Instances details
Show GameParam Source # 
Instance details

Defined in Plutus.Contracts.Game

Generic GameParam Source # 
Instance details

Defined in Plutus.Contracts.Game

Associated Types

type Rep GameParam :: Type -> Type Source #

ToJSON GameParam Source # 
Instance details

Defined in Plutus.Contracts.Game

FromJSON GameParam Source # 
Instance details

Defined in Plutus.Contracts.Game

ToSchema GameParam Source # 
Instance details

Defined in Plutus.Contracts.Game

Lift DefaultUni GameParam Source # 
Instance details

Defined in Plutus.Contracts.Game

Typeable DefaultUni GameParam Source # 
Instance details

Defined in Plutus.Contracts.Game

type Rep GameParam Source # 
Instance details

Defined in Plutus.Contracts.Game

type Rep GameParam = D1 ('MetaData "GameParam" "Plutus.Contracts.Game" "plutus-use-cases-0.1.0.0-sCb7ThsvWbFT6VPXrOzPF" 'False) (C1 ('MetaCons "GameParam" 'PrefixI 'True) (S1 ('MetaSel ('Just "gameParamPayeePkh") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PaymentPubKeyHash) :*: S1 ('MetaSel ('Just "gameParamStartTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 POSIXTime)))

data LockArgs Source #

Arguments for the "lock" endpoint

Constructors

LockArgs 

Fields

Instances

Instances details
Show LockArgs Source # 
Instance details

Defined in Plutus.Contracts.Game

Generic LockArgs Source # 
Instance details

Defined in Plutus.Contracts.Game

Associated Types

type Rep LockArgs :: Type -> Type Source #

ToJSON LockArgs Source # 
Instance details

Defined in Plutus.Contracts.Game

FromJSON LockArgs Source # 
Instance details

Defined in Plutus.Contracts.Game

ToSchema LockArgs Source # 
Instance details

Defined in Plutus.Contracts.Game

type Rep LockArgs Source # 
Instance details

Defined in Plutus.Contracts.Game

type Rep LockArgs = D1 ('MetaData "LockArgs" "Plutus.Contracts.Game" "plutus-use-cases-0.1.0.0-sCb7ThsvWbFT6VPXrOzPF" 'False) (C1 ('MetaCons "LockArgs" 'PrefixI 'True) (S1 ('MetaSel ('Just "lockArgsGameParam") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GameParam) :*: (S1 ('MetaSel ('Just "lockArgsSecret") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "lockArgsValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value))))

data GuessArgs Source #

Arguments for the "guess" endpoint

Constructors

GuessArgs 

Fields

Instances

Instances details
Show GuessArgs Source # 
Instance details

Defined in Plutus.Contracts.Game

Generic GuessArgs Source # 
Instance details

Defined in Plutus.Contracts.Game

Associated Types

type Rep GuessArgs :: Type -> Type Source #

ToJSON GuessArgs Source # 
Instance details

Defined in Plutus.Contracts.Game

FromJSON GuessArgs Source # 
Instance details

Defined in Plutus.Contracts.Game

ToSchema GuessArgs Source # 
Instance details

Defined in Plutus.Contracts.Game

type Rep GuessArgs Source # 
Instance details

Defined in Plutus.Contracts.Game

type Rep GuessArgs = D1 ('MetaData "GuessArgs" "Plutus.Contracts.Game" "plutus-use-cases-0.1.0.0-sCb7ThsvWbFT6VPXrOzPF" 'False) (C1 ('MetaCons "GuessArgs" 'PrefixI 'True) (S1 ('MetaSel ('Just "guessArgsGameParam") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GameParam) :*: S1 ('MetaSel ('Just "guessArgsSecret") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

Scripts

mkValidator :: GameParam -> HashedString -> ClearString -> ScriptContext -> Bool Source #

The validation function (Datum -> Redeemer -> ScriptContext -> Bool)

The GameParam parameter is not used in the validation. It is meant to parameterize the script address depending based on the value of GaramParam.

Address

gameAddress :: GameParam -> Address Source #

The address of the game (the hash of its validator script)