{
    "Function": "_transferOperatorship",
    "File": "contracts/auth/AxelarAuthWeighted.sol",
    "Parent Contracts": [
        "contracts/interfaces/IAxelarAuthWeighted.sol",
        "contracts/interfaces/IAxelarAuth.sol",
        "contracts/Ownable.sol",
        "contracts/interfaces/IOwnable.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "revert InvalidWeights()",
        "_isSortedAscAndContainsNoDuplicate",
        "revert SameOperators()",
        "abi.decode()",
        "revert InvalidThreshold()",
        "revert InvalidOperators()",
        "keccak256(bytes)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _transferOperatorship(bytes memory params) internal {\n        (address[] memory newOperators, uint256[] memory newWeights, uint256 newThreshold) = abi.decode(\n            params,\n            (address[], uint256[], uint256)\n        );\n        uint256 operatorsLength = newOperators.length;\n        uint256 weightsLength = newWeights.length;\n\n        // operators must be sorted binary or alphabetically in lower case\n        if (operatorsLength == 0 || !_isSortedAscAndContainsNoDuplicate(newOperators)) revert InvalidOperators();\n\n        if (weightsLength != operatorsLength) revert InvalidWeights();\n\n        uint256 totalWeight = 0;\n        for (uint256 i = 0; i < weightsLength; ++i) {\n            totalWeight += newWeights[i];\n        }\n        if (newThreshold == 0 || totalWeight < newThreshold) revert InvalidThreshold();\n\n        bytes32 newOperatorsHash = keccak256(params);\n\n        if (epochForHash[newOperatorsHash] > 0) revert SameOperators();\n\n        uint256 epoch = currentEpoch + 1;\n        currentEpoch = epoch;\n        hashForEpoch[epoch] = newOperatorsHash;\n        epochForHash[newOperatorsHash] = epoch;\n\n        emit OperatorshipTransferred(newOperators, newWeights, newThreshold);\n    }"
}