{
    "Function": "_createNewFighter",
    "File": "src/FighterFarm.sol",
    "Parent Contracts": [
        "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Enumerable.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Enumerable.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Metadata.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/Context.sol"
    ],
    "High-Level Calls": [
        "FighterOps",
        "AiArenaHelper"
    ],
    "Internal Calls": [
        "balanceOf",
        "_createFighterBase",
        "require(bool)",
        "_safeMint"
    ],
    "Library Calls": [
        "fighterCreatedEmitter"
    ],
    "Low-Level Calls": [],
    "Code": "function _createNewFighter(\n        address to, \n        uint256 dna, \n        string memory modelHash,\n        string memory modelType, \n        uint8 fighterType,\n        uint8 iconsType,\n        uint256[2] memory customAttributes\n    ) \n        private \n    {  \n        require(balanceOf(to) < MAX_FIGHTERS_ALLOWED);\n        uint256 element; \n        uint256 weight;\n        uint256 newDna;\n        if (customAttributes[0] == 100) {\n            (element, weight, newDna) = _createFighterBase(dna, fighterType);\n        }\n        else {\n            element = customAttributes[0];\n            weight = customAttributes[1];\n            newDna = dna;\n        }\n        uint256 newId = fighters.length;\n\n        bool dendroidBool = fighterType == 1;\n        FighterOps.FighterPhysicalAttributes memory attrs = _aiArenaHelperInstance.createPhysicalAttributes(\n            newDna,\n            generation[fighterType],\n            iconsType,\n            dendroidBool\n        );\n        fighters.push(\n            FighterOps.Fighter(\n                weight,\n                element,\n                attrs,\n                newId,\n                modelHash,\n                modelType,\n                generation[fighterType],\n                iconsType,\n                dendroidBool\n            )\n        );\n        _safeMint(to, newId);\n        FighterOps.fighterCreatedEmitter(newId, weight, element, generation[fighterType]);\n    }"
}