User Controls

BEP20 Tokenomics maths coding problem

  1. #1
    the man who put it in my hood Black Hole [miraculously counterclaim my golf]
     constructor() public {
    _name = {{TOKEN_NAME}};
    _symbol = {{TOKEN_SYMBOL}};
    _decimals = {{DECIMALS}};
    _totalSupply = {{TOTAL_SUPPLY}};
    _balances[msg.sender] = _totalSupply;

    emit Transfer(address(0), msg.sender, _totalSupply);

    When I put
    _decimals = 4;
    _totalSupply = 10000

    it only minted 1 token I think because I put 4 decimals. If I put 8 decimals will it make 10,000 tokens?
  2. #2
    Sophie Pedophile Tech Support
    Not my area of expertise, but wouldn't it just make 1 token that can be subdivided. Kind of like you can send 1/16th of a Bitcoin. or what have you. Since the total amount available seems to be 10000 in your example?

    Also, why don't you put 8 decimals and look at the results? Practical application and experimentation is how you actually learn these sorts of things.
  3. #3
    the man who put it in my hood Black Hole [miraculously counterclaim my golf]
    I figured it out you need like 32 0's to make 100 million

    IN CASE ANYONE IS WONDERING you add the supply zero + decimal zero to the "total supply" parameter
  4. #4
    Migh Houston
    Originally posted by the man who put it in my hood IN CASE ANYONE IS WONDERING you add the supply zero + decimal zero to the "total supply" parameter

    Duh.
  5. #5
    the man who put it in my hood Black Hole [miraculously counterclaim my golf]
    thanks sc
Jump to Top