As I understand it the totalSupply is just a number for informational purpose.
It doesn't impose a hard limit on the total of all balances, or does it ?
Example:
function transfer(address receiver, uint numTokens) public returns (bool) {
require(numTokens <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender] — numTokens;//Remove This
balances[receiver] = balances[receiver] + numTokens;
emit Transfer(msg.sender, receiver, numTokens);
return true;
}
If I were to remove the line which substracts the balance, the tokens would only appear on the receivers balance, but the senders balance would not change.
If that happens the total tokens in existance would be more than before. Is that true ?
Is my understanding correct, that the balance mapping is just a list of balances (comparable to a C# Dictionary) ?
Are there any implications from this a blockchain programmer hast to watch out for ?