162 - OZ Counters
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:
-
current(struct Counters.Counter counter)
→uint256
-
increment(struct Counters.Counter counter)
-
decrement(struct Counters.Counter counter)
- Counters
- Increment & Decrement
- Mapping Elements, ERC721 IDs, Request IDs
current()
-> Valuereset()
-> 0increment()
decrement()