From e5d924eed9870b353a6e5d333ab40838ba82ce59 Mon Sep 17 00:00:00 2001 From: Syed Ghufran Hassan Date: Sun, 8 Feb 2026 10:46:16 +0500 Subject: [PATCH] Update stacksusu-escrow-v7.clar feat(escrow): implement transaction history system --- contracts/stacksusu-escrow-v7.clar | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/contracts/stacksusu-escrow-v7.clar b/contracts/stacksusu-escrow-v7.clar index ca588e6..bac068c 100644 --- a/contracts/stacksusu-escrow-v7.clar +++ b/contracts/stacksusu-escrow-v7.clar @@ -2,6 +2,8 @@ ;; Simplified escrow for holding circle funds (define-constant CONTRACT-OWNER tx-sender) +(define-data-var total-circles uint u0) +(define-data-var next-history-id uint u1) ;; Error constants (define-constant ERR-NOT-AUTHORIZED (err u3000)) @@ -15,6 +17,29 @@ (if (<= a b) a b) ) +;; Track deposit/withdrawal history for audit trail +(define-map deposit-history + { circle-id: uint, tx-id: uint } + { + member: principal, + amount: uint, + timestamp: uint, + block-height: uint + } +) + +(define-map withdrawal-history + { circle-id: uint, tx-id: uint } + { + recipient: principal, + amount: uint, + timestamp: uint, + block-height: uint, + tx-type: (string-ascii 20) ;; "payout" or "emergency" + } +) + + ;; Circle escrow balances (define-map circle-escrow uint ;; circle-id