{
    "Function": "mint",
    "File": "contracts/NestedAsset.sol",
    "Parent Contracts": [
        "contracts/abstracts/OwnableFactoryHandler.sol",
        "node_modules/@openzeppelin/contracts/access/Ownable.sol",
        "node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol",
        "node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol",
        "node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol",
        "node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol",
        "node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol",
        "node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol",
        "node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol"
    ],
    "High-Level Calls": [
        "Counters",
        "Counters"
    ],
    "Internal Calls": [
        "_exists",
        "require(bool,string)",
        "onlyFactory",
        "_safeMint"
    ],
    "Library Calls": [
        "increment",
        "current"
    ],
    "Low-Level Calls": [],
    "Code": "function mint(address _owner, uint256 _replicatedTokenId) public onlyFactory returns (uint256) {\n        _tokenIds.increment();\n\n        uint256 tokenId = _tokenIds.current();\n        _safeMint(_owner, tokenId);\n\n        // Stores the first asset of the replication chain as the original\n        if (_replicatedTokenId == 0) {\n            return tokenId;\n        }\n\n        require(_exists(_replicatedTokenId) && tokenId != _replicatedTokenId, \"NA: INVALID_REPLICATED_TOKEN_ID\");\n\n        uint256 originalTokenId = originalAsset[_replicatedTokenId];\n        originalAsset[tokenId] = originalTokenId != 0 ? originalTokenId : _replicatedTokenId;\n\n        return tokenId;\n    }"
}