1

I want to make a simple stateful game in cardano using plutus language (to check what is possible in cardano, and what is not)

The rules are the following:

  • contract creator deploys smart contract and locks some ADA
  • games call the smart contract
  • the 10th unique gamer unlocks ADA and can pick up the reward

This is trivial to implement in etherium or tezos for example - you just:

  • the store has type array[address]
  • when gamer calls the smart contract you just check that address is not in the array yet AND append new address to the store
  • IF store.length >= 10 THEN caller can collect the reward

But how to implement this game in plutus?

What will be the type of:

  • data script
  • redeemer script
  • validator script (it's a function, sorry) ??

Update

Created similar question, but more realistic How to implement the voting smart contract in cardano Plutus language?

srghma
  • 4,770
  • 2
  • 38
  • 54
  • 1
    Don't think that the state like this is allowed cardano. I have a feeling that gamer will have to call the contract with the list of proofs that the contract was indeed called by 9 other gamers. BUT how to show proof that these other transactions were indeed accepted by system? – srghma Nov 22 '19 at 21:19
  • Have you read Plutus's Book ? I'm learning Haskell and project to read this book to learn Plutus. https://leanpub.com/plutus-smart-contracts – regisg Nov 23 '19 at 10:24
  • @regisg yes, I have read it, but still can't map examples from this book onto this example – srghma Nov 23 '19 at 10:40

0 Answers0