0

This question already has an answer here:

Why do i ask this? I've been trying to solve this for hours.

Problem version 1:

Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.function TokenERC20(

 */
function TokenERC20( 
    uint256 initialSupply,
    string tokenName,
    string tokenSymbol

Version 2

browser/Test.sol:187:6: Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.

/* Initializes contract with initial supply tokens to the creator of the contract */
 function MyAdvancedToken(
    uint256 initialSupply,
    string tokenName,
    string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}

marked as duplicate by mirg, Achala Dissanayake, flygoing, user19510, Crissi Mariam Robert May 9 '18 at 14:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Listen to your warning!

constructor(
    ...
    ...

Its a new solidity thing...the argument that has the same name as the Contract no longer works, you have to use 'constructor'

  • I've been doing that for hours now, no kidding, but I just keep getting this constructor TokenERC20( error lines as this one constructor MyAdvancedToken( : browser/Test.sol:187:21: ParserError: Expected token LParen got 'Identifier' constructor MyAdvancedToken( – Crypto Offical May 9 '18 at 1:46
0

These both codes, does seem to be annoying. I've been doing exactly that, but it just won't work. It seems alike that there's something that i Should now here.

*/ function TokenERC20( uint256 initialSupply, string tokenName, string tokenSymbol

function MyAdvancedToken( uint256 initialSupply, string tokenName, string tokenSymbol

enter image description here

browser/Test.sol:45:28: ParserError: Expected token Semicolon got 'LParen' Constructors TokenERC20(

enter image description here

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.