# What does this Smart contract mean?

can I get an explanation about this section of the smart contract especially the supply function. and what does

`````` totalSupply = _supply * 10**_decimals;
``````

means? I will like to created a mintable token with maximum supply capped

``````contract CoinToken is PausableToken {
string public name;
string public symbol;
uint public decimals;
uint public supply_cap;
event Burn(address indexed burner, uint256 value);

constructor(string memory _name, string memory _symbol, uint256 _decimals, uint256 _supply, address tokenOwner) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = _supply * 10**_decimals;
balances[tokenOwner] = totalSupply;
owner = tokenOwner;

}

function burn(uint256 _value) public {
_burn(msg.sender, _value);
}

function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
balances[_who] = balances[_who].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(_who, _value);
}

function mint(address account, uint256 amount) onlyOwner public {

}
``````

The `totalSupply` saves the supply taking the decimals into account. The `**` operator means power to the following number, is like saying 10^_decimals.

Lets say you have a `_supply = 1` with `_decimals = 0`, the total supply would be `1 * 10^0` = `1*1` = `1`.

That would mean that if you mint 1 means 1 tokens.

There is no getting lost with that, but let's say we support 2 decimals:

``````_supply = 1;
_decimals = 2;
totalSupply = 1*(10^2);
totalSupply = 100;
``````

That would mean that if you mint 50 means 0.5 tokens. Or if you mint 100 its 1 token.

• Thanks Julissa, that means, if I created a token with decimal as 2, i can have 0.01 as the minimum right? Feb 7, 2022 at 20:57