tipstream-groups
SP31PKQVQZVZCK3FM3NH67CGD6G1FMR17VQVS2W5TSource Code
;; tipstream-groups
;; Community groups
(define-data-var total-groups uint u0)
(define-map groups uint {
creator: principal,
value: uint,
at-block: uint
})
(define-public (create-group (group-type uint))
(let
(
(id (var-get total-groups))
)
(map-set groups id {
creator: tx-sender,
value: group-type,
at-block: block-height
})
(var-set total-groups (+ id u1))
(ok id)
)
)
(define-read-only (get-entry (id uint))
(map-get? groups id)
)
(define-read-only (get-total)
(ok (var-get total-groups))
)
Functions (3)
| Function | Access | Args |
|---|---|---|
| create-group | public | group-type: uint |
| get-entry | read-only | id: uint |
| get-total | read-only |