Skip to content

The representation of an online casino as smart contracts.

Notifications You must be signed in to change notification settings

vella-nicholas/blockchain-casino

Repository files navigation

Blockchain Casino

The aim of this project is to simulate an online casino using blockchain technology. PDF version of all markdown files are found in the documentation folder.

Source code

The source code along with its commit history is publicly available on this GitHub repository.

About the system

A smart contract representing the Roulette game has been developed. The croupier, the owner of the smart contract, opens the table by creating a new instance and setting the table stake on creation. In this scenario, players are allowed to bet on odd or even numbers.

After the winning number is set, the players can check if they have any withdrawable balance and request to withdraw said winnings.

Folder Structure

root_folder

Usage: Smart Contract

The project has been written in Solidity, using Truffle as a development environment and Ganache as a local RPC server running on the port 8545. The project can be compiled, tested and deployed by opening the CLI at the root folder of the project and executing the commands below.

truffle compile
truffle test
truffle migrate --reset

The --reset flag ensures migrations are run from the beginning (source).

Tests execution

root_folder

Usage: Frontend

The frontend has been written using HTML, Bootstrap 4.0 and jQuery. Bootstrap and jQuery are served using CDNs. An npm package called lite-server is used to run the frontend application locally (source). With the CLI open in the directory of the project, run the following commands.

npm install
npm run dev

The application should open automatically on http://localhost:3000/

About

The representation of an online casino as smart contracts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published