0

pragma solidity ^0.6.0;

import "./ERC721.sol";

string constant name = "MyToken";

string constant symbol = "MTKN";

contract Mytoken is ERC721(name, symbol) {

}

the error is "Expected pragma, import directive or contract/interface/library/struct/enum definition."

  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Apr 22 '22 at 06:25

1 Answers1

0

When you declare a variables in Solidity, you must to do into a contract. Change your smart contract with this:

pragma solidity ^0.6.0;

import "./ERC721.sol";

contract Mytoken is ERC721 {
    string constant name = "MyToken";
    string constant symbol = "MTKN";

    constructor() ERC721(name, symbol) {
        
    }

}
Antonio Carito
  • 1,287
  • 1
  • 5
  • 10