I'm working on a smart contract in which we need to store some addresses along with their pending rewards periodically,
so the most first approach is to have a mapping of addresses to an int, like below:
mapping(address => uint256) pendingRewards;
The problem is that when you want to set/update all these data at once, it will cost a lot of gas to loop through the mapping and update them all.
so in other words, let's say I have a table of addresses and pending rewards, consider it's a huge huge table, what would be the best practice to set/update these data into a smart contract?
!! MerkleTree would not solve the problem because we can't retrieve pendingReward
with the address
as the key from that.