CRYPTO NEWS

How to reset all addresses in a mapping assigned a uint256 counter

apologies if I’m not using the correct language to describe what I am trying to accomplish. I’m looking for a solution to reset the "idcounter" to 0 across all addresses, so that they can recall after a certain function finishes, the following is the code:

function register(uint256 tokenId) public {     require(msg.sender == ownerOf(tokenId));     require(alreadyEntered[msg.sender]==0);     idcounter += 1;     s_entrants.push(payable(msg.sender));      alreadyEntered[msg.sender] = idcounter;    }     

This code does the first half of what I want, it allows a person that has an ERC721 token that they own to call this function only one time, as intended, entering them into an Array that will be used to randomly select addresses from in a different function. However I cannot figure out a way to reset idcounter to 0 for all accounts that have called this function in a different function.

How to reset all addresses in a mapping assigned a uint256 counter

Shopping cart
There are no products in the cart!
Continue shopping
0