A simple lottery pool on Ethereum network.
- Solidity
- Mocha
- Ganache (Local contract deploy & test)
- solc (for compiling the contract)
- Infura (for deployment)
-
Player can enter lottery with more than 0.1 ether
-
Only manager (who created the pool) can run
pickWinner
function. -
pickWinner
will pick random player as a winner and send all balance of the pool to the winner.
Using node version 14 and run npm install
for installing the dependencies.
In the project directory, you can run:
This will compile the contract and get abi
and bytecode
for contract deployment.
This will deploy the contract to Rinkeby network.
I am using Infura
and @truffle/hdwallet-provider
for quick deployment.
You will have to setup your own Infura account, create a new project and update the infura url.
Automated test for contract. Using Mocha library, testing several functions and logics for contract.