Skip to content

Commit

Permalink
Updating name of constructor function
Browse files Browse the repository at this point in the history
Defining constructors as functions with the same name as the contract is deprecated.
  • Loading branch information
Chris Dannen committed Oct 9, 2018
1 parent 20aca4f commit f9f9ee5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mytoken.sol
Expand Up @@ -12,7 +12,7 @@ contract MyToken {
event Transfer(address indexed from, address indexed to, uint256 value);

/* Initializes contract with initial supply tokens to the creator of the contract */
function MyToken(uint256 _supply, string _name, string _symbol, uint8 _decimals) public {
constructor(uint256 _supply, string _name, string _symbol, uint8 _decimals) public {
/* if supply not given then generate 1 million of the smallest unit of the token */
if (_supply == 0) _supply = 1000000;

Expand Down

0 comments on commit f9f9ee5

Please sign in to comment.