A small casino-like running on Sui Blockchain made with Vue3
Suizino dApp – Built on Sui Blockchain
View Live Demo Here
This project is built on-top of Sui blockchain using a Sui smart contract.
The front-end of the project is built using Vue3 and tailwind.
The front-end integrates with Sui Wallet to execute signed transactions
Please do not use in production (well, you actually can’t because Sui is on devnet, but just to make sure this is future-compatible). The random generation of numbers in the smart contract is unsafe.
Personal notes about the project
- It’s the first dApp I ever created and first smart contract I’ve ever worked on. Constructive feedback is highly appreciated.
- It’s the first Vue3 application I created. Been working professionally using Vue2 with the Options API. It was fun to work with Vue3. Love the speed. Still not 100% sure whether I like the composition API or not.
- It was really fun determining how to create these animated slots. I came across a fun interval based way.
Functionality
- The front-end gives you connection capabilities with Sui Wallet. Without Sui Wallet, the app is not working.
- If your address is the publishing address of the Casino, the client gives you a “deposit to casino” button to top-it up so users can play
- If your address is the publishing address of the Casino, you have a “withdraw from casino” capability.
- Client auto-fetches your CasinoOwnership (in case you have it of course) and your available Coin Tokens. It uses a (~random (the first that has enough balance from the jsonrpc response)) coin with enough funds to process the payment.
- The client doesn’t auto merge coins since this will be an option from Sui Wallet in upcoming updates. If you want to deposit more mist than each object holds, please do it manually.
Smart Contract Running Instructions
- You can use
sui move test
to run the test sets located on /move/tests subfolder. - You can use
sui move build
to build the package - You can run
sui client publish --gas-budget 30000
to deploy the smart contract on the blockchain. Don’t forget to follow these instructions to switch to DevNet if you plan to use it live. (https://docs.sui.io/build/devnet)
Front-end installation instructions
- Install packages running
pnpm install
- You can change the module address and casino address here (click)
- Run for development mode using
npm run dev
- You can build for deployment using
npm run build
Sui wallet Link: https://chrome.google.com/webstore/detail/sui-wallet/opcgpfmipidbgpenhmajoajpbobppdil