Content pfp
Content
@
0 reply
0 recast
0 reaction

Steve pfp
Steve
@stevedylandev.eth
Solidity devs, need your help confirming something: Let’s say I have 100 ERC721 tokens that have a custom uint8 state, and I want to update that state by -1 for all tokens at once. Would you: A. Loop over in the contract with high gas estimation B. Loop on the client sending lots of smaller transactions
3 replies
1 recast
2 reactions

Jannik pfp
Jannik
@jannik
I think I would try to avoid that. How about storing a single global diff value and subtracting it on read in a getter function?
1 reply
0 recast
1 reaction

Steve pfp
Steve
@stevedylandev.eth
Interesting approach! The problem its dynamic, like health for a game. It fluctuates based on certain actions and events. In one particular event we want to enable a "catastrophe" where it affects all the NFTs
1 reply
0 recast
1 reaction