@sakuracasino/roulette-contract v0.6.0
SakuraCasino Roulette

Usage
To install this package, just run
npm install @sakuracasino/roulette-contract --saveThen you can request the abi or address
const {abi, networks} = require('@sakuracasino/roulette-contract');
console.log(abi); // returns the ABI for the Roulette contract
console.log(networks[0].contract_address); // returns the contract address in the kovan networkDevelopment
Checklist
- Implement contract pooling
- Implement color betting with blockhash-based random
- Implement tests for liquidity and bets
- Deploy v0.1 in eth testnet
- Implement all bets
- Implement UI for bets
- Implement Chainlink VRF
- Update UI to wait for VRF callback
- Implement bet fee
- Implement correct DAI permit interface
- Implement bet limit
- Allow for non-EIP-2612 tokens
- Improve contact storage management, delete unused data. Use mainly events.
- Revision liquidity and max bet limits security
- Implement Chainlink VRF + bet queue
- Migrate dev environment to Hardhat
- Deploy v1.0b into Matic testnet
- Investigate implementations with ETH 2.0 Bacon chain VDF and Polkadot BABE VRF
- Deploy v1.0stable into Matic or BSC mainnet
Running the project
- Run
make installfor installing node dependencies - Run
make runfor running the ganache server - Run
make testfor checking everything is ok
You can run the GUI instead of doing "make run", just make sure that ganache server is on port 8545
- Run
make migratefor deploying the contracts in the local ganache testnet. It will return the env variables for the frontend ui. You've to paste them there if you also want to run the UI. - Run
make vrfsigner. It starts a mock of a VRFCoodrinator operator oracle. If you don't run this, bet requests will always de pending. Disclamer: remember that you can't runmake testwhilevrfsigneris running.
Additional commands:
`make compile` compiles the contracts
`make migrate` migrates the contracts into the ganache blockchain
`make console` lauch a truffle console in the gananche node
`make test` run testsPublish a new package version
The npm package associated with this repository just exposes information. It contains:
- Roulette contract abi
- Information about the contract in different networks such as addresses.
If you deploy the contract in a network, you need to update the file networks.js with the associated information, if the network doesn't exist yet, just add a new entry in networks.
To deploy a new package version:
1. Update networks.js as mentioned above.
2. Make sure to update both package.json and package-lock.json versions to the desired version to publish.
3. Run make publish and it will try to publish in npmjs.org and success if you have permission.
Disclaimer: the contract you currently have in the repo should match the same which is deployed in the specified contract address of each network
How to Deploy the contract with Remix
- Run
make flattenand it will return a flatten_Roulette.solcontract. - Copy
_Roulette.solinto your Remix environment and deploy the contract where you want.
How to Deploy the contract (DEPRECATED)
- Make sure you have defined the network description under
networks.js.contract_addresscan be empty. - Make sure you have correct API and MNEMONIC in the
.envfile - Define
NETWORKvariable as the network name and then callmake deploy-live. For example, to deploy tokovanyou canNETWORK=kovan make deploy-live. - Optionally, there's some predefined commands like
make deploy-kovanfor common networks. - Once deployed, please update the contract address under
networks.js - You can call
make flattento have a flatten_Roulette.solcontract for verifying it on etherscan.