snapshot-helper
SP2F500B8DTRK1EANJQ054BRAB8DDKN6QCMXGNFBTSource Code
;; title: snapshot-helper
;; summary: Helper for taking on-chain builder activity snapshots.
(define-map snapshots uint { count: uint, block: uint })
(define-public (take-snapshot (id uint) (count uint))
(begin
(map-set snapshots id { count: count, block: stacks-block-height })
(ok true)
)
)
(define-read-only (get-snapshot (id uint))
(map-get? snapshots id)
)
Functions (2)
| Function | Access | Args |
|---|---|---|
| take-snapshot | public | id: uint, count: uint |
| get-snapshot | read-only | id: uint |