Example Smart Contract based Dice game with random functions and house edge. Range based dice with multiplier winnings based on range.
Follow these steps to set up the environment on Ubuntu 22.04:
-
Update and prepare the system:
sudo apt-get update sudo add-apt-repository ppa:deadsnakes/ppa -y sudo apt-get update
-
Install necessary packages:
sudo apt-get install pkg-config python3.11 python3.11-dev python3.11-venv libhdf5-dev build-essential
-
Clone Contracting:
git clone https://github.com/xian-network/xian-contracting git clone https://github.com/xian-network/dice-game.git
-
Set up Python virtual environment and dependencies:
python3.11 -m venv xian_venv source xian_venv/bin/activate pip install -e xian-contracting/
-
Run the tests
cd dice-game/tests python3.11 test_dice.py
Use the wallet to submit the con_uberdice.py contract contents.