Skip to content

Instantly share code, notes, and snippets.

@tspoff
Last active April 18, 2019 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tspoff/7ba6f8a87b8c704bc0ed87af1dfffcc1 to your computer and use it in GitHub Desktop.
Save tspoff/7ba6f8a87b8c704bc0ed87af1dfffcc1 to your computer and use it in GitHub Desktop.
Plutus Playground Smart Contract
-- | 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
import qualified Language.PlutusTx.Prelude as P
import Ledger
import qualified Ledger.Ada.TH as Ada
import Ledger.Ada (Ada)
import Ledger.Validation
import Playground.Contract
import Wallet as Wallet
myValidatorScript :: ValidatorScript
myValidatorScript = ValidatorScript $$(Ledger.compileScript[||\(ds :: ()) (rs :: ()) (_ :: PendingTx) -> ()||])
[0,[{"wallets":[{"simulatorWalletWallet":{"getWallet":1},"simulatorWalletBalance":{"getValue":[[{"unCurrencySymbol":"5fff"},[[{"unTokenName":""},10]]]]}},{"simulatorWalletWallet":{"getWallet":2},"simulatorWalletBalance":{"getValue":[[{"unCurrencySymbol":"5fff"},[[{"unTokenName":""},10]]]]}}],"signatures":[{"functionName":"payToWallet_","argumentSchema":[{"contents":[["ivTo",{"contents":[["getSlot",{"tag":"SimpleIntSchema"}]],"tag":"SimpleObjectSchema"}],["ivFrom",{"contents":[["getSlot",{"tag":"SimpleIntSchema"}]],"tag":"SimpleObjectSchema"}]],"tag":"SimpleObjectSchema"},{"contents":[["getValue",{"contents":[["unMap",{"contents":{"contents":[{"tag":"SimpleHexSchema"},{"contents":[["unMap",{"contents":{"contents":[{"tag":"SimpleStringSchema"},{"tag":"SimpleIntSchema"}],"tag":"SimpleTupleSchema"},"tag":"SimpleArraySchema"}]],"tag":"SimpleObjectSchema"}],"tag":"SimpleTupleSchema"},"tag":"SimpleArraySchema"}]],"tag":"SimpleObjectSchema"}]],"tag":"ValueSchema"},{"contents":[["getWallet",{"tag":"SimpleIntSchema"}]],"tag":"SimpleObjectSchema"}]}],"currencies":[{"knownTokens":[{"unTokenName":""}],"hash":"5fff","friendlyName":"Ada"}],"actions":[]}]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment