I'm trying to use static reflections to update all balances in a uint256 mapping. Safemoon and other static reflection tokens use token balances in address mapping.
Use case: power boost that should go to all game items in mapping
mapping (uint256 => uint256) private _relectionPoints;
mapping (uint256 => uint256) private _currentPoints;
mapping (uint256 => bool) private _isExcluded;
uint256[] private _excluded;
uint256 public _totalPoints = 1000000000000;
from looking at the reflectfinance code, the magic happens here
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10 * 10**6 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
decreasing the _rTotal to increase the user balance... this works great with token balances. I'm having trouble getting it to work with otherwise.
this doesn't work
function boost(uint256 _value) public returns(bool){
_totalPoints = _totalPoints.sub(_value);
_currentPoints = _currentPoints.add(_value);
}
unlike the usual static reflections, I don't need to collect fees... I want the whole value distributed.
please help how I can accomplish this.