task-tracker
SP101YT8S9464KE0S0TQDGWV83V5H3A37DKEFYSJ0Source Code
;; Task Tracker
(define-map tasks uint {owner: principal, title: (string-ascii 100), completed: bool})
(define-data-var task-counter uint u0)
(define-public (create-task (title (string-ascii 100)))
(let ((id (var-get task-counter)))
(map-set tasks id {owner: tx-sender, title: title, completed: false})
(var-set task-counter (+ id u1))
(ok id)))
(define-read-only (get-task (id uint))
(map-get? tasks id))
Functions (2)
| Function | Access | Args |
|---|---|---|
| create-task | public | title: (string-ascii 100 |
| get-task | read-only | id: uint |