{
    "Function": "_validateSignatures",
    "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": [
        "ECDSA"
    ],
    "Internal Calls": [
        "revert MalformedSigners()",
        "revert MalformedSigners()"
    ],
    "Library Calls": [
        "recover"
    ],
    "Low-Level Calls": [],
    "Code": "function _validateSignatures(\n        bytes32 messageHash,\n        address[] memory operators,\n        uint256[] memory weights,\n        uint256 threshold,\n        bytes[] memory signatures\n    ) internal pure {\n        uint256 operatorsLength = operators.length;\n        uint256 operatorIndex = 0;\n        uint256 weight = 0;\n        // looking for signers within operators\n        // assuming that both operators and signatures are sorted\n        for (uint256 i = 0; i < signatures.length; ++i) {\n            address signer = ECDSA.recover(messageHash, signatures[i]);\n            // looping through remaining operators to find a match\n            for (; operatorIndex < operatorsLength && signer != operators[operatorIndex]; ++operatorIndex) {}\n            // checking if we are out of operators\n            if (operatorIndex == operatorsLength) revert MalformedSigners();\n            // return if weight sum above threshold\n            weight += weights[operatorIndex];\n            // weight needs to reach or surpass threshold\n            if (weight >= threshold) return;\n            // increasing operators index if match was found\n            ++operatorIndex;\n        }\n        // if weight sum below threshold\n        revert MalformedSigners();\n    }"
}