From 2498ad26eac4ee6346a9bbcda8648c76dfa12a26 Mon Sep 17 00:00:00 2001 From: Jason Schrader Date: Tue, 27 Aug 2024 19:51:40 -0700 Subject: [PATCH] fix: modify maps structure, more data --- contracts/ex8-02.clar | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/contracts/ex8-02.clar b/contracts/ex8-02.clar index f7cedc4..f45a79d 100644 --- a/contracts/ex8-02.clar +++ b/contracts/ex8-02.clar @@ -26,26 +26,34 @@ ;; data maps ;; -;; track round info -(define-map LotteryRound +;; track stats per round +(define-map LotteryRounds uint { - ticketsSold: uint, + firstNftId: uint, stxInPool: uint, + ticketsSold: uint, winner: (optional principal) } ) -;; track user info -(define-map UserTickets +;; track stats per user +(define-map UserStats principal { - tickets: uint, lastRound: uint, + totalStxSpent: uint, + totalTickets: uint, totalWon: uint, } ) +;; track stats per user per round +(define-map UserRounds + { user: principal, round: uint } + { tickets: uint, stxSpent: uint } +) + ;; public functions ;;