This repository contains contracts of poker game
- Install Node.js
- Clone this repository
- Navigate to the directory with the cloned code
- Install Hardhat with
npm install --save-dev hardhat
- Create a MetaMask wallet
- Install MetaMask Chrome extension
- Add BTTC Mainnet to MetaMask
- Add BTTC Donau Testnet to MetaMask
- Create a file called
.env
in the root of the project with the same contents as.env.example
- Copy your private key from MetaMask to
.env
file
BTTC_PRIVATE_KEY=***your private key from MetaMask***
Next steps will show you how to build and deploy the contract 💻.
npx hardhat compile
npx hardhat test
Move to the "Deploy" step only if all tests pass!
а) Donau test network
Make sure you have enough test BTT tokens for testnet. You can get it for free from faucet.
npx hardhat run scripts/deploy.js --network donau
b) BTTC main network
Make sure you have enough real BTT tokens in your wallet. Deployment to the mainnet costs real BTT!
npx hardhat run scripts/deploy.js --network bttc
Deployment script takes more than 1.5 minutes to complete. Please, be patient.
After the contracts get deployed you can find their addresses and (addresses + deployOutput.json
file. You have to provide these wallets with some BTT / test BTT in order to call contracts' methods from them. Keep in mind that if you are deploying to mainnet then you have to keep your private keys secret or you risk to loose all your real BTT. But if you are deploying to testnet you might not be worried so much because you can get more test BTT from the faucet any time.
Also if you want some other address to be the owner of deployed contracts then you can use random wallet generator script:
npx hardhat run scripts/createOwnerWallet.js
Make sure to save wallet's address and private key that will be printed in the terminal! They are not saved to any file!
Then you can provide a freshly created wallet with some real / test BTT and place its private key into .env
file instead of a previous private key imported from MetaMask. Run deployment scripts after that.
Please note that all deployed contracts are not verified on either BttcScan or BttcTestScan. You have to do it manually!