event-registry
SP3ZGVF03P0G2F798147EBKTYQ7GVD1BG34PMH2AGSource Code
;; Event Registry
(define-map events uint {organizer: principal, title: (string-ascii 100), date: uint, capacity: uint})
(define-data-var event-id uint u0)
(define-public (create-event (title (string-ascii 100)) (date uint) (capacity uint))
(let ((id (var-get event-id)))
(map-set events id {organizer: tx-sender, title: title, date: date, capacity: capacity})
(var-set event-id (+ id u1))
(ok id)))
(define-read-only (get-event (id uint))
(map-get? events id))
Functions (2)
| Function | Access | Args |
|---|---|---|
| create-event | public | title: (string-ascii 100 |
| get-event | read-only | id: uint |