I'm trying to understand the mechanics behind token reflection. This bit here seems to be what most of the ERC20 Tokens having the reflection mechanic are using:


I'm having trouble following what's happening in the code. Since we don't want to iterate over wallet balances to adjust the holdings anytime a transaction happens which triggers "reflection", it looks like it's doing some kind of math voodoo to determine what someone's actual balance is based on a reflection counter of some kind, maybe?

Also, it looks like this particular token is keeping two sets of balances _rOwned and tOwned. I'm not sure what those are doing either.

Can anyone provide any insight on what's happening there?