Reflect only to selected addresses

:1234: Code to reproduce


:computer: Environment

Hello, I have to transfer tokens (reflect) to specific token holders. But in reflection (as I know) it transfers amount to all holders. So can I make a struct of specific holders (Like active holders) and transfer to only those.?

Secondly please explain why reflection doesn't charge txn fees?

2 Likes

It is not possible within the current framework of reflection mechanism. There is an effort of designing a new framework in which it is possible to achieve that.

What do you mean by "charge txn fees"?

Does this new framework exists now? Please share info about it.

txn fees means when it transfer fund (reflect) to all users, it should charge a huge fees but it doesn't (In one of my project I have to transfer fund to all users in community but because of fees I have to stop it). So how it manages?

Reflection does redistribute a percentage of fees to all token holders in a transaction-less manner. What fees are you talking about? gas fees?

Yes gas fees. If it's transferring to large community, it should charge a big fees.
My main goal is to transfer a fund to holders which are active (it's written in struct) but it's charging me a lot of gas fees so I was finding a way to transfer fund to all users may be using reflection token.

Oh I see. Reflection is to give token holders the ability to make passive incomes. In the case of RFI, the annual rate can be as high as 10%.

In your case, you can try multi-call or bundle transactions in a for loop. Reflection does not fit.

Yeh, I tried a for loop to transfer fund but it's asking a very big fees.

Batch transfer is the way to go. It does save a significant amount of gas fees. See a discussion here.

But there might be lots of users say 50,000 or 100,000 or more so if we have to divide and transfer $50 to all users it should charge a big fees I think.

1 Like

RFI tokens don't make transfers but simply change the balances. If you go trough a rfi token you will see some variables that usually are named like rOwner, rTotal and so on. Those are the core of RFI

Yes it will do but can I transfer it to particular users only.

Amortization is another effective way of delegating burden to token receivers. Let whoever aims to receive tokens claim tokens.

No maxaero, in my case it might not work. It's not a requirement.
Fairly, I have to receive fund from users (say $50) and distribute those $50 to all ACTIVE (Which is written in struct) users from top to bottom.
Please suggest a best way to do this which would not cost me a much gas fees and it will distribute to every eligible holder.

1 Like

Blockchain is a state transition machine. Every action on it requires gas. For the amount of token transfers in your mind, there is no cheap way. Even for reflection, all these accounts must have tokens in their wallet in the first place.

Alright maxaero, does it means when I transfer token to holders, fees will deduct from holders account?

Where can I get the complete brief idea (it's working) about reflect token ?

1 Like

I think it would work if it change the balance of the holder. Again the question is can I change the balances of few holders or will it update the balance of all holders?
Do I need to loop it? Or can I change the balance of all users which are in my struct or mapping.?