nova-encrypted-store
SP2KZ109PC2HRFH8T37ZD8VAQF2DK38RTXQSBK80TSource Code
;; nova-encrypted-store.clar
;; Store encrypted data hashes
;; CLARITY VERSION: 2
(define-map store
{user: principal, key: (string-ascii 32)}
(buff 256) ;; Encrypted data or hash
)
(define-public (store-data (key (string-ascii 32)) (data (buff 256)))
(begin
(map-set store {user: tx-sender, key: key} data)
(ok true)
)
)
(define-read-only (get-data (user principal) (key (string-ascii 32)))
(map-get? store {user: user, key: key})
)
Functions (2)
| Function | Access | Args |
|---|---|---|
| store-data | public | key: (string-ascii 32 |
| get-data | read-only | user: principal, key: (string-ascii 32 |