Every attempt costs money
A player sends EOS to the contract and writes their word in the transaction's "memo" field. The first attempt costs 1 EOS. The money stays in the treasure.
A Hoken Tech workshop on the EOS blockchain
The Memo Game is a guessing game with a treasure at stake. It doesn't run on a server: its rules are written in a smart contract, a program nobody can switch off or rig. Have a go on the right, then see how it's built.
A simulation of the contract's rules, no real blockchain involved.
Treasure in the contract
58.0000 EOS
The next attempt costs 1.0000 EOS
| # | Player | Word | Paid |
|---|
The contract enforces them on its own. No referee, no admin making the calls.
A player sends EOS to the contract and writes their word in the transaction's "memo" field. The first attempt costs 1 EOS. The money stays in the treasure.
A wrong guess raises the fee: 1, 2, 4, 8 EOS. The more people get it wrong, the bigger the treasure and the more it costs to try again.
The right word triggers an automatic payment: half of the treasure goes to the winner. The other half stays in play and the fee drops back to 1 EOS.
Two pictures are enough to follow the rest of the page.
A blockchain is a shared ledger. Every computer on the network keeps an identical copy, and each new line, that is each transaction, is added only if everyone agrees. That's why the past can't be deleted or rewritten.
Insert a coin, make your choice, and the machine does exactly what its program says. Nobody behind the counter. The Memo Game is just that: a machine that accepts EOS, reads the word and pays out if it's the right one.
Four pieces. Press "Follow a game" to see what happens when a player tries a word.
The program is about a hundred lines of C++. Here we read it piece by piece: the real code on the left, what it means on the right. Hover over an explanation to see which lines it refers to. The comments are translated; the messages between quotes are the original Italian ones from the deployed contract.
This is what we do during the workshop, in five stages. Each stage has the real screenshots and, for anyone who wants to try at home, the exact commands. All you need is a browser and a GitHub account: nothing to install.
Scan the QR codes with your phone or follow the links.
Alfredo de Candia, CTO of Hoken Tech
Android developer with more than 60 published apps, crypto and blockchain specialist with more than 20 books to his name, and game director of over 50 games. Nominated at the NFT Awards 2020 and named best crypto journalist on Hacker Noon in 2021 and 2023.
Memo Game is an educational project by Hoken Tech. The tokens used are test tokens with no value.
If you found the workshop useful, leave a review on Trustpilot.