If I run the following:
(define-data-var even-values uint u0)
(define-public (count-even (number uint)) (begin ;; increment the "event-values" variable by one. (var-set even-values (+ (var-get even-values) u1))
;; check if the input number is even (number mod 2 equals 0).
(if (is-eq (mod number u2) u0)
(ok "the number is even")
(err "the number is uneven")
)
)
)
;; Call count-even two times. (print (count-even u4)) (print (count-even u7))
;; Will this return u1 or u2? (print (var-get even-values))
Why did it return u1 and not u2, even though the count-even function is called twice?
I tried running this in different ways, but it seems to always give u1 and not u2