Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

124
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda