note-keeper
SP17XF1J869JJZ32YG0S3QRJAJZVY5X2B95M0EZNASource Code
;; note-keeper.clar
;; A contract to store a personal note for each user
(define-map notes principal (string-ascii 100))
(define-public (write-note (new-note (string-ascii 100)))
(ok (map-set notes tx-sender new-note))
)
(define-read-only (get-note (who principal))
(ok (default-to "" (map-get? notes who)))
)Functions (2)
| Function | Access | Args |
|---|---|---|
| write-note | public | new-note: (string-ascii 100 |
| get-note | read-only | who: principal |