Tax redistribution to holders

Hi everyone,
I'm trying to understand how a tax on every transaction to every holder can be implemented.
For that, I'm mainly looking at SafeMoon contract, but I don't understand how, when a transaction occurs, the fee is divided and distributed to all holders, I don't see anyrthing related to that (somethinf like a for loop).
Can someone explain the logic?
Thanks

IIRC, final balance = raw balance * rate, when get some fees, just update the rate, so when users check their balance, it will change automatically.

Hey, thanks for you reply.
Nice trick, I figured it out reading a whitepaper about that finally. :slight_smile:

1 Like