Source Code

;; tipstream-verify
;; Identity verification

(define-data-var total-verifications uint u0)

(define-map verifications uint {
  creator: principal,
  value: uint,
  at-block: uint
})

(define-public (verify-user (doc-type uint))
  (let
    (
      (id (var-get total-verifications))
    )
    (map-set verifications id {
      creator: tx-sender,
      value: doc-type,
      at-block: block-height
    })
    (var-set total-verifications (+ id u1))
    (ok id)
  )
)

(define-read-only (get-entry (id uint))
  (map-get? verifications id)
)

(define-read-only (get-total)
  (ok (var-get total-verifications))
)

Functions (3)

FunctionAccessArgs
verify-userpublicdoc-type: uint
get-entryread-onlyid: uint
get-totalread-only