{
    "Function": "_removeCalldataCheck",
    "File": "src/Timelock.sol",
    "Parent Contracts": [
        "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol",
        "lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol",
        "lib/openzeppelin-contracts/contracts/access/extensions/AccessControlEnumerable.sol",
        "lib/openzeppelin-contracts/contracts/access/AccessControl.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/access/extensions/IAccessControlEnumerable.sol",
        "lib/openzeppelin-contracts/contracts/access/IAccessControl.sol",
        "lib/openzeppelin-contracts/contracts/utils/Context.sol",
        "src/ConfigurablePause.sol"
    ],
    "High-Level Calls": [
        "EnumerableSet",
        "EnumerableSet",
        "EnumerableSet",
        "EnumerableSet",
        "EnumerableSet"
    ],
    "Internal Calls": [
        "assert(bool)",
        "assert(bool)",
        "require(bool,string)",
        "assert(bool)"
    ],
    "Library Calls": [
        "remove",
        "values",
        "add",
        "values",
        "remove"
    ],
    "Low-Level Calls": [],
    "Code": "function _removeCalldataCheck(\n        address contractAddress,\n        bytes4 selector,\n        uint256 index\n    ) private {\n        Index[] storage calldataChecks =\n            _calldataList[contractAddress][selector];\n        /// if no calldata checks are found, this check will fail because\n        /// calldataChecks.length will be 0, and no uint value can be lt 0\n        require(\n            index < calldataChecks.length,\n            \"CalldataList: Calldata index out of bounds\"\n        );\n\n        /// index check to remove by overwriting with ending list element\n        Index storage indexCheck = calldataChecks[index];\n\n        uint16 removedStartIndex = indexCheck.startIndex;\n        uint16 removedEndIndex = indexCheck.endIndex;\n        bytes32[] memory removedDataHashes = indexCheck.dataHashes.values();\n\n        for (uint256 i = 0; i < removedDataHashes.length; i++) {\n            assert(indexCheck.dataHashes.remove(removedDataHashes[i]));\n        }\n\n        /// pop the index without swap if index is same as last index\n        if (calldataChecks.length > 1) {\n            /// index check to overwrite the specified index check with\n            Index storage lastIndexCheck =\n                calldataChecks[calldataChecks.length - 1];\n\n            indexCheck.startIndex = lastIndexCheck.startIndex;\n            indexCheck.endIndex = lastIndexCheck.endIndex;\n            bytes32[] memory dataHashes = lastIndexCheck.dataHashes.values();\n\n            for (uint256 i = 0; i < dataHashes.length; i++) {\n                assert(indexCheck.dataHashes.add(dataHashes[i]));\n                assert(lastIndexCheck.dataHashes.remove(dataHashes[i]));\n            }\n        }\n\n        calldataChecks.pop();\n\n        emit CalldataRemoved(\n            contractAddress,\n            selector,\n            removedStartIndex,\n            removedEndIndex,\n            removedDataHashes\n        );\n    }"
}