Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

123
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda