Clarity theorytheory 0/50 · 0%
State · easy

13. Data Variables (define-data-var)

Mutable single values in storage.

Data variables store a single value that can be updated over time using `var-set` and read with `var-get`.

clarity
(define-data-var count uint u0)
(var-set count u1)
(var-get count)

Check your understanding

  1. 1. How do you read a data variable?