Source Code
;; Islamic Habit Tracker - Duha
;; Tracker for duha
(define-map duha-71-streak principal uint)
(define-public (log-duha-71)
(let ((current-streak (default-to u0 (map-get? duha-71-streak tx-sender))))
(map-set duha-71-streak tx-sender (+ current-streak u1))
(ok true)
)
)
(define-read-only (get-duha-71-streak (user principal))
(default-to u0 (map-get? duha-71-streak user))
)
Functions (2)
| Function | Access | Args |
|---|---|---|
| log-duha-71 | public | |
| get-duha-71-streak | read-only | user: principal |