license-keys
SP3ZGVF03P0G2F798147EBKTYQ7GVD1BG34PMH2AGSource Code
;; License Keys
(define-map licenses (string-ascii 64) {owner: principal, product: (string-ascii 50), valid-until: uint})
(define-public (register-license (key (string-ascii 64)) (product (string-ascii 50)) (valid-until uint))
(begin (map-set licenses key {owner: tx-sender, product: product, valid-until: valid-until}) (ok true)))
(define-read-only (get-license (key (string-ascii 64)))
(map-get? licenses key))
Functions (2)
| Function | Access | Args |
|---|---|---|
| register-license | public | key: (string-ascii 64 |
| get-license | read-only | key: (string-ascii 64 |