Skip to content

Extend Smart Contract: Comprehensive Lottery Round Details Tracking - #3

Open
pneppl100 wants to merge 8 commits into
ItsHugoo:18777d11-6b29-49ae-a61f-627cb2ac57b3from
pneppl100:extend-lottery-round-details-1749699128
Open

Extend Smart Contract: Comprehensive Lottery Round Details Tracking#3
pneppl100 wants to merge 8 commits into
ItsHugoo:18777d11-6b29-49ae-a61f-627cb2ac57b3from
pneppl100:extend-lottery-round-details-1749699128

Conversation

@pneppl100

@pneppl100 pneppl100 commented Jun 12, 2025

Copy link
Copy Markdown

Extend Smart Contract: Comprehensive Lottery Round Details Tracking

Description

Task

Extend Smart Contract to Store Additional Lottery Round Details

Acceptance Criteria

  • Capture timestamp of each lottery round
  • Store total pot size
  • Record number of participants
  • Track winner for each round
  • Provide method to retrieve round details

Summary of Work

This pull request implements an enhanced tracking mechanism for lottery round details in the smart contract, providing more comprehensive historical data for each lottery round.

Key Modifications:

  • Introduced LotteryRound struct to capture detailed round information
  • Added lotteryRounds mapping to store round details permanently
  • Implemented getLotteryRoundDetails() method for retrieving round information
  • Updated finishPickingWinner() to populate round details automatically

Detailed Changes:

  1. Created LotteryRound struct with fields:

    • roundId
    • timestamp
    • potSize
    • numberOfParticipants
    • winner
    • isCompleted
  2. Added new mapping: mapping(uint256 => LotteryRound) public lotteryRounds

  3. Modified finishPickingWinner() to store comprehensive round details when a winner is selected

  4. Added getLotteryRoundDetails(uint256 _roundId) view function to retrieve round information

Benefits:

  • Enhanced transparency of lottery rounds
  • Permanent storage of historical lottery data
  • Easy retrieval of past round information
  • Supports future frontend and analytics features

No breaking changes to existing contract functionality.

Changes Made

  • Added LotteryRound struct
  • Created lotteryRounds mapping
  • Updated finishPickingWinner() to store round details
  • Added getLotteryRoundDetails() method

Tests

  • Verify LotteryRound struct contains correct fields
  • Test getLotteryRoundDetails() returns expected data
  • Confirm round details are stored correctly after winner selection

Signatures

Staking Key

5anfGeJtxL1qzX2vgQFqx4M5CkDLgfref2Dm4Stm4gP2: MZZGxynhQXqzo2ceFGfjKtjDLX8Phz6hjnwH31iyhhRP35eiJVDJPVyqvDM9sk4u8bnLvrUHo2LvwuY71C1mpMwWerpswf1GmgVsZgGKi9AWAVMNXJ91vzthDkXrwkCa923LUnXj45ocMqn2Lc8iARpEVH3CHAgnzzeeWKf2CoTWTUpgs4TxCVWtBCLp6zGArqb9JmQtMF2xu4s8kfBUyrnneMvpzeVyHLdN1FrYcFJDQ4K7x1JKsk1t6hGcc8icHj52YGCfcq5fDkkPSFhepizgSP6L1FhvyD3zegTeGnRzAradhbmxeMWbXKS7CYZzPCsnX7bzKGcbxTeE6ty3rodoY67KqCTVfZ1b6KgdL31nfXTQGVDZ8AL5Y7Pxvfh5NrLvoqXkQXWs3yd2a2vfSSJvBht9NUze5i

Public Key

DA8gmhDZQJz7igNrrkkYXwfYGpWaPaa3ftPDHt2yyn2S: 2RWHpUszJFamo7mcBh6fmFxCSRAH5ruaD8qm9uN3hvHGKAcmtcZ8bApVexTmjTmfQQUorsDKKng7bY2G7sYQhLLvhB6oVXnAUSdA6VhVjUdHEBA1F8qvyEf5GWL1UsxhBiJCsm2545sXxFxxaUpz2R14KcRY8XMDZXetT6BpemizuRW6Tk64RTLMTsnwkCB7gTHwPwHGHRmzMCc2dCizWqV4ttGhbFHFQGeSc1Yai66XWd2wLzBBgDViUGtQcNKmrpng278yE1EUByv8k2n7ERSUAG1kLjXycWeoQP69FBekGjeQynZu8aBykQinDpp3sBC9UrcAbufukXjX2yzVrwAPL4hDVLPmGWxw6WEfz2rRP221GbSnhvWy7JqgBuuL9wxcWY6vQsg1ZibiSgbP6gnajUGuFxjfkg

@pneppl100 pneppl100 changed the title [WIP] Enhance Lottery Smart Contract: Add Comprehensive Round Details Tracking Extend Smart Contract: Comprehensive Lottery Round Details Tracking Jun 12, 2025
@pneppl100
pneppl100 marked this pull request as ready for review June 12, 2025 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant