Add reset function to Counters library

Hi there, I’m wondering if a reset function can be added to the Counters library. In certain scenarios, a counter can reach a limit and needs to get reset to start all over again. It would be great if this functionality can be built in. A possible implementation is:

function reset(Counter storage counter) internal {
    counter._value = 0;
}
2 Likes

Hi, good question, I think you can open an issue on the repo: Issues · OpenZeppelin/openzeppelin-contracts.

1 Like