Skip to content

Smart contracts in Cairo for Roulette game with dojo

Notifications You must be signed in to change notification settings

gianalarcon/game-roulette

Repository files navigation

starknet logo

The Marquis - Roulette

Launch the Example with BOT

curl -L https://install.dojoengine.org | bash

Followed by:

dojoup

For an in-depth setup guide, consult the Dojo book.

STEP 1

After cloning the project, execute the following:

Terminal 1 - Katana:

katana --disable-fee

Terminal 2 - Contracts:

cd dojo-contracts && sozo build && sozo migrate

Auth

cd scripts 
 bash ./default_auth.sh

Front End

cp .env.example .env.local
cd app && yarn && yarn run dev

Terminal 3 - Bot

cd bot && yarn
cp .env.example .env
node index.js

Terminal 4 - Torii:

cd dojo-contracts && torii --world 0x6e31e6291f572cf76e11f1c99af8284f0d160f9f3af74e7e787a0f598bf0480

Play Roulette and Mint

We can decide whether to stop the bot or not to better visualize the control of trx and events in katana.

Once the setup is complete, follow these steps to play Roulette, create a new Burner, and make a mint:

  1. Launch the Roulette Game:

    • Visit the Roulette section in the application.
    • Choose the numbers you want to bet on.
  2. Create a New Burner:

    • We click create, which will create the new burner
  3. Make a Mint:

    • Initiate a mint operation to generate 1000 tokens for your Burner wallet.
  4. Place Your Bets:

    • Once you've selected your amount and numbers, click on BET.
  5. Enjoy the Game:

    • Head back to the Roulette game and have fun playing with your newly minted tokens!

OPTION MANUAL

Repeat steps 1 - 2 - 3 - 4 - 6 and then

initialize erc 20

sozo execute 0x59bbd83d1178b7d10f7ffec372d4593283e9b5aa6075349834162deecfe5108 initialize --calldata 123,123,0x6e31e6291f572cf76e11f1c99af8284f0d160f9f3af74e7e787a0f598bf0480

initialize actions

sozo execute 0x6ba9e3effb660a56ae35dc1b8304be20c8bbf262997dc82d4c9052add1da097 initialize --calldata 0x59bbd83d1178b7d10f7ffec372d4593283e9b5aa6075349834162deecfe5108

Front End

You can create a burner from the front end and do the mint, or it can also be done manually.

Mint Manual m_usd

sozo execute 0x59bbd83d1178b7d10f7ffec372d4593283e9b5aa6075349834162deecfe5108 mint_ --calldata 0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973,10000,0

Spawn Manual

sozo execute 0x6ba9e3effb660a56ae35dc1b8304be20c8bbf262997dc82d4c9052add1da097 spawn

Approve Manual

sozo execute 0x59bbd83d1178b7d10f7ffec372d4593283e9b5aa6075349834162deecfe5108 approve --calldata 0x6ba9e3effb660a56ae35dc1b8304be20c8bbf262997dc82d4c9052add1da097,10000,0

Bet Manual

sozo execute 0x6ba9e3effb660a56ae35dc1b8304be20c8bbf262997dc82d4c9052add1da097 move --calldata 1,2,20,30,2,2,3

About

Smart contracts in Cairo for Roulette game with dojo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published