Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/VopxTech/ton-coinflip
Smart contract -based coinflip game for TON, written in Func and React Vite.
https://github.com/VopxTech/ton-coinflip
blueprint func theopennetwork ton web3
Last synced: 2 months ago
JSON representation
Smart contract -based coinflip game for TON, written in Func and React Vite.
- Host: GitHub
- URL: https://github.com/VopxTech/ton-coinflip
- Owner: VopxTech
- Created: 2024-04-09T18:31:12.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-07-15T18:50:45.000Z (5 months ago)
- Last Synced: 2024-07-30T20:55:09.970Z (5 months ago)
- Topics: blueprint, func, theopennetwork, ton, web3
- Language: TypeScript
- Homepage: https://coinflip.vopx.fi/
- Size: 1.04 MB
- Stars: 4
- Watchers: 1
- Forks: 4
- 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`