Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@shmish111
shmish111 / playground.js
Created March 4, 2021 17:05
New Project
/* 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.js
Created March 4, 2021 17:03
New Project
/* 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.js
Created March 4, 2021 17:00
New Project
{}
@shmish111
shmish111 / Playground.hs
Created March 4, 2021 17:00
Plutus Playground Smart Contract
ss
@shmish111
shmish111 / Playground.hs
Created March 4, 2021 16:59
Plutus Playground Smart Contract
A game with two players. Player 1 thinks of a secret word
@shmish111
shmish111 / Playground.hs
Created March 4, 2021 16:59
Plutus Playground Smart Contract
A game with two players. Player 1 thinks of a secret word
@shmish111
shmish111 / Playground.hs
Created March 4, 2021 16:59
Plutus Playground Smart Contract
-- A game with two players. Player 1 thinks of a secret word
@shmish111
shmish111 / Playground.hs
Created March 4, 2021 16:58
Plutus Playground Smart Contract
-- A game with two players. Player 1 thinks of a secret word
--
@shmish111
shmish111 / Playground.hs
Created March 4, 2021 16:48
Plutus Playground Smart Contract
-- 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 March 4, 2021 16:44
Plutus Playground Smart Contract
-- 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