safemoonprotocol / Safemoon.sol

safemoon contract
661 stars 899 forks source link

What do the r and t characters stand for in the code? #50

Open AmmarByFar opened 3 years ago

AmmarByFar commented 3 years ago

for example:

function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); }

What's rAmount vs tAmount? rFee vs tFee? Is "t" for transaction? "r" for receiver or something? I see that all over the code too so just wondering what it indicates. Would make the code much more legible.

lopezdp commented 3 years ago

for example:

`function _transferStandard(address sender, address recipient, uint256 tAmount) private {

    (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);

    _rOwned[sender] = _rOwned[sender].sub(rAmount);

    _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);

    _takeLiquidity(tLiquidity);

    _reflectFee(rFee, tFee);

    emit Transfer(sender, recipient, tTransferAmount);

}`

What's rAmount vs tAmount? rFee vs tFee? Is "t" for transaction? "r" for receiver or something? I see that all over the code too so just wondering what it indicates. Would make the code much more legible.

Reflections; read the white paper to get a better idea. It's the payback to token holders.