Skip to content

Simple Ethereum SmartContract Lottery written in Solidity

License

Notifications You must be signed in to change notification settings

kevincali/ethereum-lottery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ethereum Lottery

This Ethereum SmartContract was the practical part of a paper I had to write for my bachelor's degree.

You can find the live version of this SmartContract on the Ropsten Testnet.

SmartContract

The SmartContract was written in Solidity, the Ethereum Virtual Machine (EVM) programming language.

Besides the usual getter functions, the user can buy tickets, draw the winner or withdraw its prize in case they won.

Once the first ticket was bought, the lottery begins automatically and ends after the chosen roundDuration. I choose 5 minutes for testing purposes.

This contract doesn't implement a secure RNG, as the Blockchain isn't a great source of entropy because of its deterministic nature.

See this note on the Solidity Docs if want to learn more about it.

Development

I used Truffle and Ganache to help me develop this SmartContract on a local Blockchain environment.

JavaScript was used for the Unit Test.

About

Simple Ethereum SmartContract Lottery written in Solidity

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published