Skip to content

Instantly share code, notes, and snippets.

View playground.js
/* Parties */
const alice : Party = Role("alice");
const bob : Party = Role("bob");
const carol : Party = Role("carol");
/* Value under escrow */
const price : SomeNumber = 450n;
/* helper function to build Actions */
View playground.js
/* Parties */
const alice : Party = Role("alice");
const bob : Party = Role("bob");
const carol : Party = Role("carol");
/* Value under escrow */
const price : SomeNumber = 450n;
/* helper function to build Actions */
@shmish111
shmish111 / Playground.hs
Created Mar 4, 2021
Plutus Playground Smart Contract
@shmish111
shmish111 / Playground.hs
Created Mar 4, 2021
Plutus Playground Smart Contract
View Playground.hs
A game with two players. Player 1 thinks of a secret word
@shmish111
shmish111 / Playground.hs
Created Mar 4, 2021
Plutus Playground Smart Contract
View Playground.hs
A game with two players. Player 1 thinks of a secret word
@shmish111
shmish111 / Playground.hs
Created Mar 4, 2021
Plutus Playground Smart Contract
View Playground.hs
-- A game with two players. Player 1 thinks of a secret word
@shmish111
shmish111 / Playground.hs
Created Mar 4, 2021
Plutus Playground Smart Contract
View Playground.hs
-- A game with two players. Player 1 thinks of a secret word
--
@shmish111
shmish111 / Playground.hs
Created Mar 4, 2021
Plutus Playground Smart Contract
View Playground.hs
-- 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
@shmish111
shmish111 / Playground.hs
Created Mar 4, 2021
Plutus Playground Smart Contract
View Playground.hs
-- 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