# Tax redistribution to holders

**URL:** <https://forum.openzeppelin.com/t/tax-redistribution-to-holders/33425>\
**Category:** Smart Contracts\
**Created:** [December 1, 2022, 1:14am UTC](https://forum.openzeppelin.com/t/tax-redistribution-to-holders/33425 "2022-12-01T01:14:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moogly\_Boy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/moogly_boy/32/10790_2.png) [@Moogly\_Boy](https://forum.openzeppelin.com/u/Moogly_Boy)\
**Post date:** [December 1, 2022, 1:14am UTC](https://forum.openzeppelin.com/t/tax-redistribution-to-holders/33425/1 "2022-12-01T01:14:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Skyge](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/skyge/32/343_2.png) [@Skyge](https://forum.openzeppelin.com/u/Skyge)\
**Post date:** [December 2, 2022, 6:32am UTC](https://forum.openzeppelin.com/t/tax-redistribution-to-holders/33425/2 "2022-12-02T06:32:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Moogly\_Boy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/moogly_boy/32/10790_2.png) [@Moogly\_Boy](https://forum.openzeppelin.com/u/Moogly_Boy)\
**Post date:** [December 2, 2022, 9:39am UTC](https://forum.openzeppelin.com/t/tax-redistribution-to-holders/33425/3 "2022-12-02T09:39:26Z")

</div>

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