{
    "Function": "recordStakeUpdate",
    "File": "src/contracts/core/Slasher.sol",
    "Parent Contracts": [
        "src/contracts/permissions/Pausable.sol",
        "src/contracts/interfaces/IPausable.sol",
        "src/contracts/interfaces/ISlasher.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": [
        "StructuredLinkedList",
        "StructuredLinkedList",
        "StructuredLinkedList"
    ],
    "Internal Calls": [
        "_recordUpdateAndAddToMiddlewareTimes",
        "require(bool,string)",
        "_updateMiddlewareList",
        "onlyRegisteredForService",
        "require(bool,string)",
        "_addressToUint",
        "_addressToUint",
        "require(bool,string)"
    ],
    "Library Calls": [
        "getHead",
        "sizeOf",
        "remove"
    ],
    "Low-Level Calls": [],
    "Code": "function recordStakeUpdate(address operator, uint32 updateBlock, uint32 serveUntilBlock, uint256 insertAfter) \n        external \n        onlyRegisteredForService(operator) \n    {\n        // sanity check on input\n        require(updateBlock <= block.number, \"Slasher.recordStakeUpdate: cannot provide update for future block\");\n        // update the 'stalest' stakes update time + latest 'serveUntilBlock' of the `operator`\n        _recordUpdateAndAddToMiddlewareTimes(operator, updateBlock, serveUntilBlock);\n\n        /**\n         * Move the middleware to its correct update position, determined by `updateBlock` and indicated via `insertAfter`.\n         * If the the middleware is the only one in the list, then no need to mutate the list\n         */\n        if (_operatorToWhitelistedContractsByUpdate[operator].sizeOf() != 1) {\n            // Remove the caller (middleware) from the list. This will fail if the caller is *not* already in the list.\n            require(_operatorToWhitelistedContractsByUpdate[operator].remove(_addressToUint(msg.sender)) != 0, \n                \"Slasher.recordStakeUpdate: Removing middleware unsuccessful\");\n            // Run routine for updating the `operator`'s linked list of middlewares\n            _updateMiddlewareList(operator, updateBlock, insertAfter);\n        // if there is precisely one middleware in the list, then ensure that the caller is indeed the singular list entrant\n        } else {\n            require(_operatorToWhitelistedContractsByUpdate[operator].getHead() == _addressToUint(msg.sender),\n                \"Slasher.recordStakeUpdate: Caller is not the list entrant\");\n        }\n    }"
}