Source Code

;; seerah-note -- Prophet's biography study notes
(define-data-var note-count uint u0)
(define-map notes uint { author: principal, chapter: (string-ascii 30), summary: (string-ascii 100), block: uint })
(define-public (add-note (chapter (string-ascii 30)) (summary (string-ascii 100)))
  (let ((id (+ (var-get note-count) u1)))
    (var-set note-count id)
    (map-set notes id { author: tx-sender, chapter: chapter, summary: summary, block: stacks-block-height }) (ok id)))
(define-read-only (get-note (id uint)) (map-get? notes id))
(define-read-only (get-count) (var-get note-count))

Functions (3)

FunctionAccessArgs
add-notepublicchapter: (string-ascii 30
get-noteread-onlyid: uint
get-countread-only