Enclosed is a collection of Solidity smart contracts as well as a TypeScript library for verifying turn-based games implemented as finite state machines in Solidity. This was in fact the original Arcadeum provably-fair game logic design, which includes a fully working tic-tac-toe game as a state channel. We've since progressed beyond this research to focus on WASM-based blockchain like EWASM, Substrate and others. Stay tuned for future publications of our latest research and we hope you enjoy this repo. However, this research is still relevent and can be utilized to build a token transfer design or other simple state updates. Through our experimentation we determined writing complex game logic in Solidity in a channel design isn't ideal and although it's possible for basic games, the constructions become complex with layers of machinery and its more important to have a game be cryptoeconomically secure than cryptographically secure.
Tools:
- Install node v8.x or v10.x
yarn install
yarn bootstrap
yarn build
cd client/
yarn test
yarn build
cd ethereum/
yarn ganache
-- run in a separate terminal and import one of the private keys other than the first one into MetaMaskyarn migrate
- Install redis-server and have it running in the background
cd server/
make run
cd examples/ttt/
yarn install
-- this is required becausettt
is configured outside of the arcadeum workspaceyarn build
-- this will compile the TTT.sol ethereum contractyarn migrate
-- migrate the contract to the ganache testrpcyarn dev
-- this will start the webapp on http://localhost:3000/
Building the docs requires PlantUML and pdflatex.
-
ethereum/
- dedicated abi.json files for each contract to reduce bundle filesize
-
client/
- optimize dist bundle filesize
- potentially refactor out rxjs if turns out to be adding weight