I'm trying to create a dividend contract that contains a balance of token A which should be divided among holders of token B in proportion to what they have. but every solution I run into seems to require users to "claim" the dividends by initiating a transaction. is there any way to do this the same way reflection tokens get distributed?
1 Answer
It depends if your token A balance of the dividend contract is changed over time, and it's needed to save each change with the token B holders portions. Without this information, it's hard to understand your task.
But in short, any change(state saving/token transfer)in blockchain requires a transaction to be called. So in any case there is a transaction needed for some step.
And if you need to transfer token A to holders of B, you can implement it either the way so each holder calls "claim" OR you call transfer yourself.
-
-
It goes beyond the default parameters of ERC20. So each is implemented in a different way. Please, provide me with example Commented Nov 21, 2022 at 13:38
-
in reflection tokens when someone buys and sells the coin and the fee has to be distributed every one of the holders' addresses is instantly update with their new amount balance. Here's an example etherscan.io/address/… Commented Nov 21, 2022 at 17:46