version-control-v2
SP31AT1T96E4CF8C2QZ7FCFC99WJCTV2GTTWB811CSource Code
(define-data-var current-version uint u2)
(define-map version-history uint (string-ascii 128))
(define-public (update-version (description (string-ascii 128)))
(let ((new-version (var-get current-version)))
(map-set version-history new-version description)
(var-set current-version (+ new-version u1))
(ok new-version)
)
)
(define-read-only (get-current-version)
(ok (var-get current-version))
)
(define-read-only (get-version-info (version uint))
(ok (map-get? version-history version))
)
Functions (3)
| Function | Access | Args |
|---|---|---|
| update-version | public | description: (string-ascii 128 |
| get-current-version | read-only | |
| get-version-info | read-only | version: uint |