Video Tutorial
The Contract
View Contract Code
View Contract Code
How It Works
Public Ledger State
Counter is a built-in type for counting operations. The value is publicly visible on the blockchain.
The Increment Circuit
Counter stores a non-negative integer and exposes .increment(n), .decrement(n), .read(), and comparison helpers like .lessThan(n). This example only uses .increment(1).
What’s Next
Primitive Types
Explore all Compact data types
Hello World
Back to the basics