A simple Ethereum smart contract that lets users join a lottery with 0.01 ETH and randomly rewards one winner with the entire pool.
Basic Lottery is a lightweight and minimal smart contract written in Solidity that allows anyone to participate in a decentralized lottery by contributing a fixed amount of 0.01 ETH. Once multiple participants have joined, the contract enables a random selection of one winner, who automatically receives the total balance held by the contract. Designed purely for educational and demonstration purposes, the contract uses block-based pseudo-randomness to determine the winner, making it unsuitable for production use due to the potential for manipulation. With no external dependencies or libraries, it provides a clean and accessible introduction to Ethereum smart contracts, Ether transfers, and basic on-chain randomness.
30
0