1
function balanceOf(address account) public view override returns (uint256) {
    if (_isExcluded[account]) return _tOwned[account];
    return tokenFromReflection(_rOwned[account]);
}

Does the tokenFromReflection multiply with the users balance or combine with it somehow. how would this even work when the users balance is 10 and the multiplier is 5 making the account 50 and they decide to transfer. how would you subtract from a multiplier and the balance

1
  • Impossible to say without seeing the whole contract. But anyway this forum is not very suited for analyzing full contracts. Someone would have to familiar with this particular implementation to be able to answer without a lot more context. Dec 3, 2022 at 11:05

1 Answer 1

0

The if statement seemingly checks to see if the passed account address is included on the mapping _isExcluded. If so, it returns the uint256 value held in the _tOwned mapping. If this condition is not met, this function calls another function tokenFromReflection, and passes the value held in the mapping _rOwned. Without seeing the code contained in the this function, it's hard to know what this function actually does, but it looks like it is a getter returning uint256 value from one of a variety of mappings, in the aim of returning some kind of balance.

1
  • etherscan.io/token/… in reflection tokens everyone balance updates when someone does a transaction by somehow distributing the fees to everyone that holds any amount of tokens. to my understanding in order to make this possible everyone's balance is a equation. in this example if the users balance is 10 and the multiplier is 5 making the account 50 and they decide to transfer 50. how would you subtract from a multiplier and the balance if all they have is 10
    – Abdul
    Dec 4, 2022 at 4:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.