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."

1

There are 1 best solutions below

0
On

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) {
        
    }

}