contract MetaVisa is ERC721Enumerable {
    using Counters for Counters.Counter;
    
    Counters.Counter private _tokenIdTracker;
    
    event Mint(address indexed from, address indexed to, uint256 indexed tokenId);
    
    mapping(address => bool) public isBuy; 

    /**
     * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_ROLE` to the
     * account that deploys the contract.
     *
     * Token URIs will be autogenerated based on `baseURI` and their token IDs.
     * See {ERC721-tokenURI}.
     */
    constructor(
        string memory name,
        string memory symbol
    ) ERC721(name, symbol) {
    }

    
    /**
     * @dev Creates a new token for `to`. Its token ID will be automatically
     * assigned (and available on the emitted {IERC721-Transfer} event), and the token
     * URI autogenerated based on the base URI passed at construction.
     *
     * See {ERC721-_mint}.
     *
     * Requirements:
     *
     * - the caller must have the `MINTER_ROLE`.
     */
    function mint(string memory tokenURI) public virtual  {
        // We cannot just use balanceOf to create the new tokenId because tokens
        // can be burned (destroyed), so we need a separate counter.
        //getFeeAddress().transfer(msg.value);
        require(!isBuy[msg.sender], "mint:You can only buy it once ");
        uint256 tokenId = _tokenIdTracker.current();
        _mint(msg.sender, _tokenIdTracker.current());
        _setTokenURI(_tokenIdTracker.current(),tokenURI);
        _tokenIdTracker.increment();
        isBuy[msg.sender]=true;
        emit Mint(address(0), msg.sender, tokenId);
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual override( ERC721Enumerable) {
        super._beforeTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override( ERC721Enumerable)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }
    
}
/**
 * @dev {ERC721} token, including:
 *
 *  - ability for holders to burn (destroy) their tokens
 *  - a minter role that allows for token minting (creation)
 *  - a pauser role that allows to stop all token transfers
 *  - token ID and URI autogeneration
 *
 * This contract uses {AccessControl} to lock permissioned functions using the
 * different roles - head to its documentation for details.
 *
 * The account that deploys the contract will be granted the minter and pauser
 * roles, as well as the default admin role, which will let it grant both minter
 * and pauser roles to other accounts.
 */
function mint(string memory tokenURI) public virtual  {
        // We cannot just use balanceOf to create the new tokenId because tokens
        // can be burned (destroyed), so we need a separate counter.
        //getFeeAddress().transfer(msg.value);
        require(!isBuy[msg.sender], "mint:You can only buy it once ");
        uint256 tokenId = _tokenIdTracker.current();
        _mint(msg.sender, _tokenIdTracker.current());
        _setTokenURI(_tokenIdTracker.current(),tokenURI);
        _tokenIdTracker.increment();
        isBuy[msg.sender]=true;
        emit Mint(address(0), msg.sender, tokenId);
    }
/**
 * @dev Creates a new token for `to`. Its token ID will be automatically
 * assigned (and available on the emitted {IERC721-Transfer} event), and the token
 * URI autogenerated based on the base URI passed at construction.
 *
 * See {ERC721-_mint}.
 *
 * Requirements:
 *
 * - the caller must have the `MINTER_ROLE`.
 */