Skip to content

hirosystems/platform-template-counter

Repository files navigation

Using Map Data Structure in Clarity

Demonstrates how to use and interact with "variables" in Clarity by incrementing a 32-bit unsigned integer and an additional Clarity function to retrieve the incremented value.

Know your Contract

The counter.clar contract includes the following functionality.

  • count-up function increments the designated "32-bit unsigned integer" for the account holder, and that value is wrapped inside the counters, which is declared as a map data structure in Clarity
  • get-count (...) function retrieves the latest count from the counters map for a given account holder

To add a new contract, use Clarinet.

Test your Contract

  • You can manually test your your contracts in the Clarinet console.
  • You can programmatically test your contracts with unit tests.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

0 stars

Watchers

5 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors