Consensys / Tokens

Ethereum Token Contracts
MIT License
2.06k stars 1.19k forks source link

It is recommended to add a line of code. #137

Open mahuaibo opened 6 years ago

mahuaibo commented 6 years ago

constructor:function EIP20

add code: emit Transfer(address(0), msg.sender, totalSupply);

mahuaibo commented 6 years ago

function EIP20(uint256 _initialAmount, string _tokenName, uint8 _decimalUnits, string _tokenSymbol ) public { balances[msg.sender] = _initialAmount; // Give the creator all initial tokens emit Transfer(address(0), msg.sender, totalSupply); // add code totalSupply = _initialAmount; // Update total supply name = _tokenName; // Set the name for display purposes decimals = _decimalUnits; // Amount of decimals for display purposes symbol = _tokenSymbol; // Set the symbol for display purposes }