simple-counter
SP13J1C3K69H3EDG2SVJ21SQ6GXD6A6F860HWK3ZJSource Code
;; simple-counter.clar
;; A simple counter contract
(define-map counters principal uint)
(define-public (count-up)
(ok (map-set counters tx-sender (+ (get-count tx-sender) u1)))
)
(define-read-only (get-count (who principal))
(default-to u0 (map-get? counters who))
)
Functions (2)
| Function | Access | Args |
|---|---|---|
| count-up | public | |
| get-count | read-only | who: principal |