{
    "Function": "initializeDiamondCut",
    "File": "src/Libraries/LibDiamond.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [
        "revert(string)",
        "revert(string)",
        "require(bool,string)",
        "require(bool,string)",
        "enforceHasContractCode"
    ],
    "Library Calls": [],
    "Low-Level Calls": [
        "delegatecall"
    ],
    "Code": "function initializeDiamondCut(address _init, bytes memory _calldata) internal {\n        if (_init == address(0)) {\n            require(_calldata.length == 0, \"LibDiamondCut: _init is address(0) but_calldata is not empty\");\n        } else {\n            require(_calldata.length > 0, \"LibDiamondCut: _calldata is empty but _init is not address(0)\");\n            if (_init != address(this)) {\n                enforceHasContractCode(_init, \"LibDiamondCut: _init address has no code\");\n            }\n            // solhint-disable-next-line avoid-low-level-calls\n            (bool success, bytes memory error) = _init.delegatecall(_calldata);\n            if (!success) {\n                if (error.length > 0) {\n                    // bubble up the error\n                    revert(string(error));\n                } else {\n                    revert(\"LibDiamondCut: _init function reverted\");\n                }\n            }\n        }\n    }"
}