{
    "Function": "_delegationReceivedHook",
    "File": "src/contracts/core/DelegationManager.sol",
    "Parent Contracts": [
        "src/contracts/core/DelegationManagerStorage.sol",
        "src/contracts/interfaces/IDelegationManager.sol",
        "src/contracts/permissions/Pausable.sol",
        "src/contracts/interfaces/IPausable.sol",
        "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol",
        "lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol",
        "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "mload(uint256)",
        "abi.encodeWithSelector()",
        "call(uint256,uint256,uint256,uint256,uint256,uint256,uint256)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _delegationReceivedHook(\n        IDelegationTerms dt,\n        address staker,\n        IStrategy[] memory strategies,\n        uint256[] memory shares\n    )\n        internal\n    {\n        /**\n         * We use low-level call functionality here to ensure that an operator cannot maliciously make this function fail in order to prevent undelegation.\n         * In particular, in-line assembly is also used to prevent the copying of uncapped return data which is also a potential DoS vector.\n         */\n        // format calldata\n        bytes memory lowLevelCalldata = abi.encodeWithSelector(IDelegationTerms.onDelegationReceived.selector, staker, strategies, shares);\n        // Prepare memory for low-level call return data. We accept a max return data length of 32 bytes\n        bool success;\n        bytes32[1] memory returnData;\n        // actually make the call\n        assembly {\n            success := call(\n                // gas provided to this context\n                LOW_LEVEL_GAS_BUDGET,\n                // address to call\n                dt,\n                // value in wei for call\n                0,\n                // memory location to copy for calldata\n                add(lowLevelCalldata, 32),\n                // length of memory to copy for calldata\n                mload(lowLevelCalldata),\n                // memory location to copy return data\n                returnData,\n                // byte size of return data to copy to memory\n                32\n            )\n        }\n        // if the call fails, we emit a special event rather than reverting\n        if (!success) {\n            emit OnDelegationReceivedCallFailure(dt, returnData[0]);\n        }\n    }"
}