Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
Solidly Static Reflections On uint256 Mapping

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!