Skip to content

RedBird96/lottery

Repository files navigation

Lottery Contract

How does it work?

The contract uses a PRNG function to pick a winner from an array of players

To gurantee a 100% fairness, the admin must compute the Keccak256 hash of a random string off-chain and set it at the creation of each lottery. Once the hash for that lottery is set, it can't be changed. To provide more randomness, the admin can call the pickWinner() whenever he wants.

Getting Started

forge init
forge build
forge test

Development

forge script LotteryScript -s "deployTest()" --force --broadcast --verify

Upgrade

forge script LotteryScript -s "upgradeTest()" --force --broadcast --verify

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published