Skip to content

Latest commit

 

History

History
27 lines (23 loc) · 763 Bytes

OZ Counters.md

File metadata and controls

27 lines (23 loc) · 763 Bytes

OpenZeppelin Counters: Provides counters that can only be incremented or decremented by one.

This can be used e.g. to track the number of elements in a mapping, issuing ERC721 ids, or counting request ids. Functions are:

  1. current(struct Counters.Counter counter)uint256

  2. increment(struct Counters.Counter counter)

  3. decrement(struct Counters.Counter counter)


Slide Screenshot

162.jpg


Slide Text

  • Counters
    • Increment & Decrement
  • Mapping Elements, ERC721 IDs, Request IDs
  • current() -> Value
  • reset() -> 0
  • increment()
  • decrement()

References


Tags