This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- A game with two players. Player 1 thinks of a secret word | |
-- and uses its hash, and the game validator script, to lock | |
-- some funds (the prize) in a pay-to-script transaction output. | |
-- Player 2 guesses the word by attempting to spend the transaction | |
-- output. If the guess is correct, the validator script releases the funds. | |
-- If it isn't, the funds stay locked. | |
import Control.Monad (void) | |
import qualified Data.ByteString.Char8 as C | |
import Language.Plutus.Contract | |
import qualified Language.PlutusTx as PlutusTx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad (void) | |
import qualified Data.ByteString.Char8 as C | |
import Language.Plutus.Contract | |
import qualified Language.PlutusTx as PlutusTx | |
import Language.PlutusTx.Prelude hiding (pure, (<$>)) | |
import Ledger (Address, Validator, ValidatorCtx, Value, scriptAddress) | |
import qualified Ledger.Constraints as Constraints | |
import qualified Ledger.Typed.Scripts as Scripts | |
import Playground.Contract |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This is a starter contract, based on the Game contract, | |
-- containing the bare minimum required scaffolding. | |
-- | |
-- What you should change to something more suitable for | |
-- your use case: | |
-- * The MyDatum type | |
-- * The MyMyRedeemerValue type | |
-- | |
-- And add function implementations (and rename them to | |
-- something suitable) for the endpoints: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This is a starter contract, based on the Game contract, | |
-- containing the bare minimum required scaffolding. | |
-- | |
-- What you should change to something more suitable for | |
-- your use case: | |
-- * The MyDatum type | |
-- * The MyMyRedeemerValue type | |
-- | |
-- And add function implementations (and rename them to | |
-- something suitable) for the endpoints: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad (void) | |
import qualified Data.ByteString.Char8 as C | |
import Language.Plutus.Contract | |
import qualified Language.PlutusTx as PlutusTx | |
import Language.PlutusTx.Prelude hiding (pure, (<$>)) | |
import Ledger (Address (..), Validator, ValidatorCtx(..), TxInfo(..), TxOut (..), TxOutTx (..), Value, scriptAddress) | |
import Plutus.V1.Ledger.Scripts (Datum (..), DatumHash, MonetaryPolicyHash, Redeemer, ValidatorHash, validatorHash) | |
import qualified Ledger.Constraints as Constraints | |
import qualified Ledger.Contexts as Validation | |
import qualified Ledger.Typed.Scripts as Scripts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- A game with two players. Player 1 thinks of a secret word | |
-- and uses its hash, and the game validator script, to lock | |
-- some funds (the prize) in a pay-to-script transaction output. | |
-- Player 2 guesses the word by attempting to spend the transaction | |
-- output. If the guess is correct, the validator script releases the funds. | |
-- If it isn't, the funds stay locked. | |
import Control.Monad (void) | |
import qualified Data.ByteString.Char8 as C | |
import Language.Plutus.Contract | |
import qualified Language.PlutusTx as PlutusTx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad (void) | |
import qualified Data.ByteString.Char8 as C | |
import Language.Plutus.Contract | |
import qualified Language.PlutusTx as PlutusTx | |
import Language.PlutusTx.Prelude hiding (pure, (<$>)) | |
import Ledger (Address, Validator, ValidatorCtx, Value, scriptAddress, PubKeyHash, Slot (Slot), Datum(..), TxOutTx, PubKeyHash (..) ) | |
import Ledger.Contexts (TxInfo (..), ValidatorCtx (..)) | |
import qualified Ledger.Constraints as Constraints | |
import qualified Ledger.Contexts as Validation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified Data.ByteString.Char8 as C | |
import Language.PlutusTx.Prelude hiding (pure, (<$>)) | |
-- import Ledger.Contexts (TxInfo (..), ValidatorCtx (..), TxInInfo(..) ) | |
-- import qualified Ledger.Constraints as Constraints | |
-- import qualified Ledger.Contexts as Validation | |
-- mport qualified Ledger.Interval as Interval | |
-- import qualified Ledger.Slot as Slot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified Data.Text as T | |
import Language.Plutus.Contract hiding (when) | |
-- ScriptLookups semigroup is defined based on the standard prelude <> and doesn't like the plutus one | |
import Language.PlutusTx.Prelude hiding ((<>)) | |
import qualified Language.PlutusTx as PlutusTx | |
import Playground.Contract | |
import Control.Monad (void, when) | |
import Ledger (Address (..), Slot (Slot), Validator, pubKeyHash, txOutTxDatum, txOutValue, txOutTxOut, TxOut, ValidatorCtx, Value, scriptAddress, PubKeyHash, Datum(..), TxOutTx, PubKeyHash (..), ValidatorCtx (..), validatorHash, txInInfoValue ) | |
import qualified Ledger.Typed.Scripts as Scripts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified Data.Text as T | |
import Language.Plutus.Contract hiding (when) | |
-- ScriptLookups semigroup is defined based on the standard prelude <> and doesn't like the plutus one | |
import Language.PlutusTx.Prelude hiding ((<>)) | |
import qualified Language.PlutusTx as PlutusTx | |
import Playground.Contract | |
import Control.Monad (void, when) | |
import Ledger (Address (..), Slot (Slot), Validator, pubKeyHash, txOutTxDatum, txOutValue, txOutTxOut, TxOut, ValidatorCtx, Value, scriptAddress, PubKeyHash, Datum(..), TxOutTx, PubKeyHash (..), ValidatorCtx (..), validatorHash, txInInfoValue, outValue ) | |
import qualified Ledger.Typed.Scripts as Scripts |