hackquest logo

simple_lottery

A Simple Lottery is a basic and straightforward form of a lottery system where participants enter for a chance to win a prize by purchasing a ticket or meeting a participation requirement.

Videos

Descripción

// Reset the players array for the next round

delete players;

}

// Function to get the winner's address

function getWinner() public view returns (address) {

return winner;

}

// Function to get the players count

function getPlayersCount() public view returns (uint) {

return players.length;

}

// Function to withdraw the funds by the winner

function withdraw() public {

// Ensure only the winner can withdraw

require(msg.sender == winner, "Only the winner can withdraw the prize.");

// Transfer the balance of the contract to the winner

payable(winner).transfer(address(this).balance);

}

}

License

This project is licensed under the MIT License.

Progreso del hackathon

70

Pila tecnológica

Solidity
Ethers

Estado de recaudación de fondos

0

Líder del equipo
Hhq_1740126916
Sector
DeFiSocialFi