Skip to content

Enhance Lottery Smart Contract: Comprehensive Round Details Tracking - #1

Open
pneppl100 wants to merge 4 commits into
ItsHugoo:18777d11-6b29-49ae-a61f-627cb2ac57b3from
pneppl100:enhance-lottery-round-details-storage-1749695662
Open

Enhance Lottery Smart Contract: Comprehensive Round Details Tracking#1
pneppl100 wants to merge 4 commits into
ItsHugoo:18777d11-6b29-49ae-a61f-627cb2ac57b3from
pneppl100:enhance-lottery-round-details-storage-1749695662

Conversation

@pneppl100

@pneppl100 pneppl100 commented Jun 12, 2025

Copy link
Copy Markdown

Enhance Lottery Smart Contract: Comprehensive Round Details Tracking

Description

Task

Extend Smart Contract to Store Additional Lottery Round Details

Acceptance Criteria

  • Store round timestamp for each lottery round
  • Track and record pot size for each round
  • Capture number of participants per round
  • Provide getter method to retrieve round details
  • Ensure round details are immutable after creation

Summary of Work

This pull request extends the Lottery smart contract to capture and store more comprehensive information about each lottery round.

Key Modifications:

  • Existing LotteryRound struct already includes:
    • Round ID
    • Timestamp
    • Pot Size
    • Participant Count
    • Winner Address

Implementation Details:

  • Current contract method finishPickingWinner() already stores detailed round information
  • Added getLotteryRoundDetails() method to retrieve specific round details
  • Maintained existing gas efficiency and contract structure

Performance Considerations:

  • Minimal gas overhead for storing round information
  • Constant-time retrieval of historical round data

Future Improvements:

  • Consider adding more metadata in future iterations
  • Potential indexing for more advanced querying

Changes Made

  • Updated Lottery.sol to enhance round details tracking
  • Verified existing implementation already meets most requirements
  • Confirmed getter method functionality

Tests

  • Verify getLotteryRoundDetails returns correct information
  • Confirm round details are properly stored after each lottery
  • Check that round metadata is immutable after creation

Signatures

Staking Key

5anfGeJtxL1qzX2vgQFqx4M5CkDLgfref2Dm4Stm4gP2: AToxA3MAhYsXn6e6fWCd8k5BkDbamSNrFe2nM4u4EQtmZ3nh8whSYUoiX5mt7sGfgTydFB58yDQ3vD8hCY4ZEfyqmeFZTEpeso8KcBxypPPMHhDZnZSAXCoJa3v3X6qoH9Ziva7V85EZrGH3LuQPC9efmbaJCqdS75WBsEULLwxodAqebV3cohZa9YDfBRX6PiDHUuUDaauaN8mTQTK78BX5WrJcjNTwCb7v3jHwNWxmM49e6WcnPqHPYH4udia9tbCLF1Vmg7jMZVZBGfGCaKJx4B6yASxSvA3CuFt5M9R9HhK5bnhoLvozc56tXuPWVTAhv7Cus57TcwReiFFyC1Y8ZpetVxcTnWzMtW5iYFuGnUT6m1mWvZiopZMHXQ6otekLJQNQovUGxQr6guHi2rMDsbKJ8x2gN8

Public Key

DA8gmhDZQJz7igNrrkkYXwfYGpWaPaa3ftPDHt2yyn2S: 98KmWWrSAMjuvNK6g5wE88x914J4WydtizZrdszdr4ZhyH592QEjtjFP9FKLG2g5kk6gXvpDqvVopfz2raqey4JiYhrDsmsQ1N6bmsqXYN5GRZtRFdQTffSu85Mu3ns2ZA6TMf97t6BHfnaLAa3Z5Ckpgxc1FyHVgifAnhtjRb7qdL62SyHRNp6aMMYAFi3Ey1qmWXe1u1TtRgCECMwkgyhLpCiRdugHyGsVAV9oavY9fo3g8iyJRroMcWhVUa7o7MmYWro1GbhQ2uHf79r1zqKL2MUBMDYVbSMSvGhNH9vaXnAPCx3jw8xDfN9qCWKC5xL3rmTstK9YXGVXGQSxBm4dEBFbue5nPAY4e4EEdkJqoPD9NqcRwBua7Nn4aK4idX1sEy8SJUidUK44Kqr6HDgVjJ8kdmXQYC

@pneppl100 pneppl100 changed the title [WIP] Enhance Lottery Smart Contract: Comprehensive Round Details Tracking Enhance Lottery Smart Contract: Comprehensive Round Details Tracking Jun 12, 2025
@pneppl100
pneppl100 marked this pull request as ready for review June 12, 2025 02:37
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