fbpx

Lottery in Solidity

Julien Klepatch

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:

0 Comments

Leave a Reply

More great articles

More tricks for bn.js (Big Number) library in Truffle tests

In the last video of the smart contract testing series I showed you the basic usage of the Big Number…

Read Story

Rock paper scissors Solidity tutorial

You know Rock paper scissors right? If you don't, that's a simple game where in each round 2 players make…

Read Story

Introduction To Truffle | Episode 5

https://youtu.be/M-w6dDDhu6w Developing smart contracts and distributed applications is hard. There are a lot of different libraries to use, you often…

Read Story

Never miss a minute

Get great content to your inbox every week. No spam.
[contact-form-7 id="6" title="Footer CTA Subscribe Form"]
Arrow-up