note-keeper
SP13J1C3K69H3EDG2SVJ21SQ6GXD6A6F860HWK3ZJSource 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 |