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
| {"valueParameterInfo":[["Price",{"valueParameterFormat":{"contents":[6,"₳"],"tag":"DecimalFormat"},"valueParameterDescription":"The price of the item."}]],"timeParameterDescriptions":[["Payment deadline","The _**buyer**_ must pay the _price_ of the item by this time, otherwise the contract is cancelled."],["Complaint deadline","The _**buyer**_ can only complain until this deadline, otherwise the contract will assume the transaction went smoothly and pay the _**seller**_."],["Complaint response deadline","If the _**buyer**_ complained, the _**seller**_ must respond before this deadline, otherwise the contract will assume there was a problem with the transaction and refund the _**buyer**_."],["Mediation deadline","If the _**buyer**_ and the _**seller**_ disagree, the _**mediator**_ must weigh in before this deadline, otherwise the contract will assume there was a problem with the transaction and refund the _**buyer**_."]],"roleDescriptions":[["Buyer","The buyer of the item."],["Mediator","The mediator decides w |
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
| def keep_dice(self): | |
| ''' | |
| method function returning a dice list to reroll. | |
| It also stores the dice you want to keep in a separate keep list. | |
| - returns list | |
| ''' | |
| keep_input = input('which dice do you want to keep (comma separated: e.g. 1,1,5)? ') | |
| split_input = keep_input.split(',') | |
| if keep_input == '': |
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
| {-# LANGUAGE OverloadedStrings #-} | |
| module Escrow where | |
| import Language.Marlowe | |
| main :: IO () | |
| main = print . pretty $ contract | |
| {- What does the vanilla contract look like? |
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
| module MyFirstPlutusSmartContract where | |
| import qualified Language.PlutusTx as PlutusTx | |
| import qualified Language.PlutusTx.Prelude as P | |
| import Ledger | |
| import Wallet | |
| import Ledger.Validation | |
| 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
| -- Contract endpoints that generate different kinds of errors for the log: | |
| -- logAMessage produces a log message from a wallet | |
| -- submitInvalidTxn submits an invalid txn which should result in a | |
| -- "Validation failed" message throwWalletAPIError throws an error from | |
| -- a wallet (client) | |
| import Language.PlutusTx.Prelude | |
| import qualified Data.Map as Map | |
| import qualified Data.Set as Set |
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 qualified Language.PlutusTx as PlutusTx | |
| import qualified Language.PlutusTx.Prelude as P | |
| import Ledger | |
| import qualified Ledger.Value as Value |
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
| -- | Vesting scheme as a PLC contract | |
| import Control.Monad (void) | |
| import qualified Data.Map as Map | |
| import qualified Data.Set as Set | |
| import qualified Language.PlutusTx as P | |
| import Ledger (Address, DataScript(..), RedeemerScript(..), Signature, Slot, TxOutRef, TxIn, ValidatorScript(..)) | |
| import qualified Ledger as L | |
| import Ledger.Value (Value) |
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
| -- | Crowdfunding contract implemented using the [[Plutus]] interface. | |
| -- This is the fully parallel version that collects all contributions | |
| -- in a single transaction. | |
| -- | |
| -- Note [Transactions in the crowdfunding campaign] explains the structure of | |
| -- this contract on the blockchain. | |
| import qualified Language.PlutusTx as PlutusTx | |
| import qualified Ledger.Interval as Interval | |
| import Ledger.Slot (SlotRange) | |
| 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
| package main | |
| import ( | |
| "compress/gzip" | |
| "io" | |
| "net/http" | |
| "strings" | |
| ) | |
| // Gzip Compression |
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
| my file hello |
NewerOlder