Solidity code Snippets.
- Voting Example
- Lottery Smart Contract
- Blind Auction: Open Auction
A simple smart contract to implement Lottery system. The Owner of contract Receives all the amount. Then Owner can pass a number to function getWinner()
to choose a winner and the winner will receive the amount.
Caution
No random function generator used like Chainlink VRF
.
Note
To Do
- Include random number function. Reference: Lottery Smart Contract Tutorial Part II - Get a verifiable random number with Chainlink VRF - YouTube
- Owner cannot participate.
- Owner get's little amount of fee.