I'm trying to create a token that holders can earn some amount contantly by a certain rate. Don't want to depend on transactions to give tokens to holders. An idle contract must constantly do it.
Is there any way to do this without running out of gas ?
Just an example:
- You buy 100 tokens and go sleep. The contract will reward you at 0.0001 token / hour
Yea I know I can't write anything to the constract storage without spend gas and fees so I can't see how I can do it.
balanceOfit updates the balance with every block. The increase is made permanent when you transfer the tokens. I'm trying to answer the requirement to update the balance with time. Safemoon and others increment balances when a transfer is made. How Safemoon works is explained here https://ethereum.stackexchange.com/questions/98622/binance-smart-chain-tokens-what-are-ttotal-rtotal-tsupply-rsupply-rowned-t. – Ismael May 23 '21 at 17:57