hackquest logo
  • 学习
  • 课程探索
  • 实战
  • 探索黑客松
  • 往期项目
  • 社区
  • 论坛
  • 全球活动
  • 我的社区
  • 共学营
  • 组织中心
  • 更多
    • 词汇表
    • 博客
    • 水龙头
    • 工作机会
    • 媒体工具包
    • 创始人
hackquest logo

lottery contract

The Lottery Contract is a decentralized smart contract built on the Edu Chain using Solidity. It enables users to participate in a fair lottery where a winner is randomly selected. The contract ensure

技术栈

Solidity

描述

# lottery_contract

# lottery_contract

# Lottery Contract

This project is a simple lottery smart contract written in Solidity. It allows users to participate in a lottery, and a winner is selected randomly from the participants.

## Features

- Easy Participation: Anyone can enter the lottery by calling enterLottery().

- Random Winner Selection: The contract selects a random winner using block properties.

- Transparent & Secure: The winner's address is stored and can be verified on-chain.

- Deployed on Edu Chain

## Deployed Address

```

0x78156Ea63504a355e492661207663BD3b9dD4d35

```

## Functions

### enterLottery()

- Allows users to enter the lottery.

- Stores their address in the participants list.

### pickWinner()

- Randomly selects a winner from the participants.

- Requires at least one participant to execute.

## How It Works

1. Users call enterLottery() to participate.

2. The contract records their address.

3. When pickWinner() is called, it selects a random participant as the winner.

## Disclaimer

This contract relies on block attributes for randomness, which may not be fully secure. Consider using an oracle like Chainlink VRF for better randomness.

本次黑客松进展

70

融资状态

0
队长
Hhq_1740126880
项目链接
赛道
Other