ethereum casino p2e game
To install this package, just run
npm install @sakuracasino/roulette-contract --save
Then 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 network
- 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
- Run
make install
for installing node dependencies - Run
make run
for running the ganache server - Run
make test
for 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 migrate
for 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 test
whilevrfsigner
is 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 tests
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:
- Update
networks.js
as mentioned above. - Make sure to update both
package.json
andpackage-lock.json
versions to the desired version to publish. - Run
make publish
and it will try to publish innpmjs.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
- Run
make flatten
and it will return a flatten_Roulette.sol
contract. - Copy
_Roulette.sol
into your Remix environment and deploy the contract where you want.
- Make sure you have defined the network description under
networks.js
.contract_address
can be empty. - Make sure you have correct API and MNEMONIC in the
.env
file - Define
NETWORK
variable as the network name and then callmake deploy-live
. For example, to deploy tokovan
you canNETWORK=kovan make deploy-live
. - Optionally, there's some predefined commands like
make deploy-kovan
for common networks. - Once deployed, please update the contract address under
networks.js
- You can call
make flatten
to have a flatten_Roulette.sol
contract for verifying it on etherscan.