{
    "Function": "setProtocolPremiums",
    "File": "contracts/managers/SherlockProtocolManager.sol",
    "Parent Contracts": [
        "contracts/managers/Manager.sol",
        "node_modules/@openzeppelin/contracts/security/Pausable.sol",
        "node_modules/@openzeppelin/contracts/access/Ownable.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol",
        "contracts/interfaces/managers/ISherlockProtocolManager.sol",
        "contracts/interfaces/managers/IManager.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "_settleTotalDebt",
        "_calcGlobalPremiumPerSecForStakers",
        "_verifyProtocolExists",
        "onlyOwner",
        "revert UnequalArrayLength()",
        "_setSingleProtocolPremium",
        "revert InvalidArgument()"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function setProtocolPremiums(bytes32[] calldata _protocol, uint256[] calldata _premium)\n    external\n    override\n    onlyOwner\n  {\n    // Checks to make sure there are an equal amount of entries in each array\n    if (_protocol.length != _premium.length) revert UnequalArrayLength();\n    if (_protocol.length == 0) revert InvalidArgument();\n\n    // Updates the global claimable amount for stakers\n    _settleTotalDebt();\n\n    uint256 allPremiumsPerSecToStakers_ = allPremiumsPerSecToStakers;\n\n    // Loops through the array of protocols and checks to make sure each has a protocol agent assigned\n    for (uint256 i; i < _protocol.length; i++) {\n      _verifyProtocolExists(_protocol[i]);\n\n      // Sets the protocol premium for that specific protocol\n      // Function returns the old premium and nonStakerPercentage for that specific protocol\n      (uint256 oldPremiumPerSecond, uint256 nonStakerPercentage) = _setSingleProtocolPremium(\n        _protocol[i],\n        _premium[i]\n      );\n\n      // Calculates the new global premium which adds up all premiums paid by all protocols\n      allPremiumsPerSecToStakers_ = _calcGlobalPremiumPerSecForStakers(\n        oldPremiumPerSecond,\n        _premium[i],\n        nonStakerPercentage,\n        nonStakerPercentage,\n        allPremiumsPerSecToStakers_\n      );\n    }\n\n    // After the loop has finished, sets allPremiumsPerSecToStakers to the final temp value\n    allPremiumsPerSecToStakers = allPremiumsPerSecToStakers_;\n  }"
}