Skip to content

Instantly share code, notes, and snippets.

@TrevorBenson
Created October 27, 2020 20:33
Show Gist options
  • Save TrevorBenson/b7f92159e0655a80906a0f04dedffbe2 to your computer and use it in GitHub Desktop.
Save TrevorBenson/b7f92159e0655a80906a0f04dedffbe2 to your computer and use it in GitHub Desktop.
Plutus Playground Smart Contract
import qualified Language.PlutusTx as PlutusTx
import qualified Ledger.Interval as Interval
import Ledger.Slot (SlotRange)
import qualified Ledger.Slot as Slot
import Language.PlutusTx.Prelude as P
import Ledger
import qualified Ledger.Ada 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) -> ()
||])
helloAction :: MonadWallet m => m ()
helloAction = Wallet.logMsg "Hello World!"
$(mkFunctions ['helloAction])
[0,[{"wallets":[{"simulatorWalletWallet":{"getWallet":1},"simulatorWalletBalance":{"getValue":[[{"unCurrencySymbol":""},[[{"unTokenName":""},10]]]]}},{"simulatorWalletWallet":{"getWallet":2},"simulatorWalletBalance":{"getValue":[[{"unCurrencySymbol":""},[[{"unTokenName":""},10]]]]}}],"signatures":[{"functionName":"helloAction","argumentSchema":[]},{"functionName":"payToWallet_","argumentSchema":[{"tag":"FormSchemaValue"},{"contents":[["getWallet",{"tag":"FormSchemaInt"}]],"tag":"FormSchemaObject"}]}],"currencies":[{"knownTokens":[{"unTokenName":""}],"hash":"","friendlyName":"Ada"}],"actions":[{"simulatorWallet":{"simulatorWalletWallet":{"getWallet":1},"simulatorWalletBalance":{"getValue":[[{"unCurrencySymbol":""},[[{"unTokenName":""},10]]]]}},"functionSchema":{"functionName":"helloAction","argumentSchema":[]},"tag":"Action"},{"blocks":10,"tag":"Wait"},{"simulatorWallet":{"simulatorWalletWallet":{"getWallet":2},"simulatorWalletBalance":{"getValue":[[{"unCurrencySymbol":""},[[{"unTokenName":""},10]]]]}},"functionSchema":{"functionName":"helloAction","argumentSchema":[]},"tag":"Action"},{"blocks":1,"tag":"Wait"}]}]]
@TrevorBenson
Copy link
Author

Basic helloWorld

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment