Lottery in Solidity

This video is a tutorial to build a lottery smart contract in Solidity.

The rules are simples. In each round of the lottery, anybody can send Ether to the smart contract. When enough participants have sent their money, the lottery will determine a winner and send him/her a prize.

The interesting part is how to pick a winner. For this, we need to be able to generate a random number, within a certain range. It’s possible to do this with the keccak256() function, combined with some sources of entropy.

Check out the video for more info:

Leave a Reply

Your email address will not be published. Required fields are marked *