- Create and manage Store Contract & Ticket NFT Contract
- Set result for Lottery per times
- Mint Token for Players
- Receive 1% Ticket Price when a Player buy a ticket
- Buy ticket with pre-set Ticket price
- Receive prize equal to Total Prize devide Winner Count
- One player can only buy one Ticket per Ticket times
- Can manage all their Ticket NFT Tokens
- You can find your Tokens on OpenSea
Read more details in contracts
Git clone this repository
Web app based on Store contract at address "0xb192E16EE4f6461D216EE6537f5369ab8bcC6F92" on Rinkeby Testnet and "0x05364c26226fe2246aFB5B13e800296bACdaE3e0 " on BSC Testnet
- Install Meta Mask extention
- Create your own account
- Get free Ether on Rinkeby faucet or BSC testnet faucet
- Install NodeJS
- Go to web app folder
- Then run these commands in terminal/shell
npm install
npm start
App will run on BSC testnet by default. Change contract address in lottery.js file to match your net.
- Go to smartcontract folder
- Modify file truffle-config.js to match your network
- Then run this command in terminal/shell
truffle migrate --network your-network-name
- Modify contract address in lottery.js file in webapp folder to match your contract
- Start Web app
- Install and open Ganache for a local Ethereum network
- Go to smartcontract folder
- Then run this command in terminal/shell
truffle test