contract MacroverseRealEstate is ERC721, Ownable {

    
    /**
     * Deploy the backend, taking mint, burn, and set-user commands from the deployer.
     * Use the given domain as the domain for token URIs.
     */
    constructor(string memory domain) public ERC721("Macroverse Real Estate", "MRE") {
        _setTokenMetadataDomain(domain);
    }
    
    /**
     * Allow this contract to change the ERC721 metadata URI domain.
     */
    function _setTokenMetadataDomain(string memory domain) internal {
        // Set up new OpenZeppelin 3.0 automatic token URI system.
        // Good thing we match their format or we'd have to fork OZ.
        uint chainId = 0;
        assembly {
            chainId := chainid()
        }
        _setBaseURI(string(abi.encodePacked("https://", domain, "/vre/v1/chain/", Strings.toString(chainId), "/token/")));
    }
    
    /**
     * Allow this the owner to change the ERC721 metadata URI domain.
     */
    function setTokenMetadataDomain(string memory domain) external onlyOwner {
        _setTokenMetadataDomain(domain);
    }

    /**
     * Mint tokens at the direction of the owning contract.
     */
    function mint(address to, uint256 tokenId) external onlyOwner {
        _mint(to, tokenId);
    }

    /**
     * Burn tokens at the direction of the owning contract.
     */
    function burn(uint256 tokenId) external onlyOwner {
        _burn(tokenId);
    }

    /**
     * Publically expose a token existence test. Returns true if the given
     * token is owned by someone, and false otherwise. Note that tokens sent to
     * 0x0 but not burned may still exist.
     */
    function exists(uint256 tokenId) external view returns (bool) {
        return _exists(tokenId);
    }
}
/**
 * The MacroverseRealEstate contract keeps track of who currently owns virtual
 * real estate in the Macroverse world, at all scales. It supersedes the
 * MacroverseStarRegistry. Registration and Macroverse-specific manipulation of
 * tokens is accomplished through the MacroverseUniversalRegistry, which owns
 * this contract.
 *
 * The split between this contract and the MacroverseUniversalRegistry exists
 * to keep contract size under the limit.
 */
function setTokenMetadataDomain(string memory domain) external onlyOwner {
    _setTokenMetadataDomain(domain);
}

/**
 * Allow this the owner to change the ERC721 metadata URI domain.
 */