Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rust-sol-dev/ton-coinflip-game
https://github.com/rust-sol-dev/ton-coinflip-game
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/rust-sol-dev/ton-coinflip-game
- Owner: Rust-Sol-Dev
- Created: 2024-03-28T19:50:51.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-09-17T07:24:14.000Z (4 months ago)
- Last Synced: 2024-09-17T11:11:52.239Z (4 months ago)
- Language: TypeScript
- Size: 582 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TON Coinflip
Smart contract -based coinflip game on TON blockchain. Written in Func and React Vite. Currently deployed on the testnet:
[Play on Web](https://coinflip.vopx.fi/)
[Play on Telegram](https://t.me/toncoinfliptnetbot/play)
## Project structure
### Frontend-UI
Frontend of the project, written in React. Frontend re-uses the smart contract from the blueprint. By default, `App.tsx` has a hardcoded address of the contract, but it can be changed to any other address:
```ts
const { balance, sendPlay } = useCoinFlipContract(
"EQCuWDIPWO6fGDN7w4ZpwNtBTEjl6_shllCJnfZptcoWgV-l" // Change this
);
```### Usage
#### Development
```bash
cd frontend-ui
npm install
npm run dev
```#### Build
```bash
npm run build
```### Blueprint
Root of the smart contract, written in Func. Subdirectories:
- `contracts` - source code of all the smart contracts of the project and their dependencies.
- `wrappers` - wrapper classes (implementing `Contract` from ton-core) for the contracts, including any [de]serialization primitives and compilation functions.
- `tests` - tests for the contracts.
- `scripts` - scripts used by the project, mainly the deployment scripts.#### Usage
#### Build The Contract
`npx blueprint build` or `yarn blueprint build`
#### Test The Contract
`npx blueprint test` or `yarn blueprint test`
#### Deploy or run another script
`npx blueprint run` or `yarn blueprint run`
#### Add a new contract
`npx blueprint create ContractName` or `yarn blueprint create ContractName`