How to efficiently allocate the rewards to stakers currently present in contract? If the people who have their deposit in contract (stakers) is above hundred or thousands, then alloting the reward to each one of them will need me to iterate over the complete array or something, this will require more gas and I am not sure if it will always be successful even for million stakers? Anyway to make giving rewards efficient in this contract ? Any help would be good.

Sep 4, 2021, 9:55 AM
You can amortize them.
That means, the allocation can be done passively in other functions, called up by stakers.
Sep 4, 2021, 10:22 AM
clain fn()
Sep 4, 2021, 10:36 AM
Yes, that's the idea of amortization.
Sep 4, 2021, 10:37 AM
"Make recipients pay for gas, e.g. by signing cheques for them off-chain, so they will redeem these cheques on-chain. This will make transfers free for you."
What does this mean ? signing cheques for them off-chain. ?
saw this in stack exchange
Sep 4, 2021, 11:14 AM
ERC20Permit
Check out this extension
it means the sender does not call the ERC20 contract directly, but rather sends a signed message to the recipient who will eventually execute the message on-chain.
This way, the sender does not pay any gas sendering the transaction .
The recipient who executes the message pays the gas fee.
Sep 4, 2021, 11:15 AM

© 2024 Draquery.com All rights reserved.