reputation-system-v6
SP33S3T4B78TTTVNZW687YY6KTN7SYNA79P7AH438Source Code
(define-map reputation-scores
principal
uint
)
(define-public (update-reputation
(user principal)
(score uint)
)
(begin
(asserts! (not (is-eq user tx-sender)) (err u1))
(asserts! (<= score u100) (err u2))
(map-set reputation-scores user score)
(ok true)
)
)
(define-read-only (get-reputation (user principal))
(ok (default-to u0 (map-get? reputation-scores user)))
)
Functions (1)
| Function | Access | Args |
|---|---|---|
| get-reputation | read-only | user: principal |