{
    "Function": "flashloan",
    "File": "src/DelegateToken.sol",
    "Parent Contracts": [
        "src/interfaces/IDelegateToken.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC2981.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Metadata.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"
    ],
    "High-Level Calls": [
        "DelegateTokenTransferHelpers",
        "DelegateTokenRegistryHelpers",
        "DelegateTokenTransferHelpers",
        "DelegateTokenHelpers",
        "DelegateTokenTransferHelpers",
        "DelegateTokenStorageHelpers",
        "DelegateTokenHelpers",
        "SafeERC20",
        "DelegateTokenRegistryHelpers",
        "DelegateTokenTransferHelpers",
        "DelegateTokenTransferHelpers",
        "IERC1155",
        "DelegateTokenRegistryHelpers",
        "DelegateTokenTransferHelpers",
        "IERC721",
        "DelegateTokenHelpers"
    ],
    "Internal Calls": [
        "nonReentrant"
    ],
    "Library Calls": [
        "pullERC1155AfterCheck",
        "revertOnCallingInvalidFlashloan",
        "revertOnCallingInvalidFlashloan",
        "checkERC20BeforePull",
        "checkERC721BeforePull",
        "revertNotOperator",
        "revertERC721FlashUnavailable",
        "pullERC20AfterCheck",
        "pullERC721AfterCheck",
        "revertOnCallingInvalidFlashloan",
        "checkERC1155BeforePull",
        "revertERC1155FlashAmountUnavailable",
        "revertERC20FlashAmountUnavailable",
        "safeTransfer"
    ],
    "Low-Level Calls": [],
    "Code": "function flashloan(Structs.FlashInfo calldata info) external payable nonReentrant {\n        StorageHelpers.revertNotOperator(accountOperator, info.delegateHolder);\n        if (info.tokenType == IDelegateRegistry.DelegationType.ERC721) {\n            RegistryHelpers.revertERC721FlashUnavailable(delegateRegistry, info);\n            IERC721(info.tokenContract).transferFrom(address(this), info.receiver, info.tokenId);\n            Helpers.revertOnCallingInvalidFlashloan(info);\n            TransferHelpers.checkERC721BeforePull(info.amount, info.tokenContract, info.tokenId);\n            TransferHelpers.pullERC721AfterCheck(info.tokenContract, info.tokenId);\n        } else if (info.tokenType == IDelegateRegistry.DelegationType.ERC20) {\n            RegistryHelpers.revertERC20FlashAmountUnavailable(delegateRegistry, info);\n            SafeERC20.safeTransfer(IERC20(info.tokenContract), info.receiver, info.amount);\n            Helpers.revertOnCallingInvalidFlashloan(info);\n            TransferHelpers.checkERC20BeforePull(info.amount, info.tokenContract, info.tokenId);\n            TransferHelpers.pullERC20AfterCheck(info.tokenContract, info.amount);\n        } else if (info.tokenType == IDelegateRegistry.DelegationType.ERC1155) {\n            RegistryHelpers.revertERC1155FlashAmountUnavailable(delegateRegistry, info);\n            TransferHelpers.checkERC1155BeforePull(erc1155PullAuthorization, info.amount);\n            IERC1155(info.tokenContract).safeTransferFrom(address(this), info.receiver, info.tokenId, info.amount, \"\");\n            Helpers.revertOnCallingInvalidFlashloan(info);\n            TransferHelpers.pullERC1155AfterCheck(erc1155PullAuthorization, info.amount, info.tokenContract, info.tokenId);\n        }\n    }"
}