cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.InitialDistribution

Description

This module provides a convenient way to spread assets between wallets and scripts at the initialization of the mock chain. These initial assets can be accompanied by datums, staking credentials and reference scripts.

Synopsis

Documentation

data InitialDistribution where Source #

Describes the initial distribution of UTxOs per user.

The following specifies a starting state where wallet 1 owns two UTxOs, one with 42 Ada and one with 2 Ada and one TOK token; wallet 2 owns a single UTxO with 10 Ada and wallet 3 has 10 Ada and a permanent value

i0 = distributionFromList $
       [ (wallet 1 , [ ada 42 , ada 2 <> quickValue "TOK" 1 ]
       , (wallet 2 , [ ada 10 ])
       , (wallet 3 , [ ada 10 <> permanentValue "XYZ" 10])
       ]

Note that payment issued through an initial distribution will be attached enough ADA to sustain themselves.

Constructors

InitialDistribution 

distributionFromList :: IsTxSkelOutAllowedOwner owner => [(owner, [Value])] -> InitialDistribution Source #

Creating a initial distribution with simple values assigned to owners