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