{
    "Function": "weightOfOperator",
    "File": "src/contracts/middleware/VoteWeigherBase.sol",
    "Parent Contracts": [
        "src/contracts/middleware/VoteWeigherBaseStorage.sol",
        "src/contracts/interfaces/IVoteWeigher.sol",
        "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"
    ],
    "High-Level Calls": [
        "IDelegationManager",
        "IStrategy"
    ],
    "Internal Calls": [
        "strategiesConsideredAndMultipliersLength"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function weightOfOperator(address operator, uint256 quorumNumber) public virtual returns (uint96) {\n        uint96 weight;\n\n        if (quorumNumber < NUMBER_OF_QUORUMS) {\n            uint256 stratsLength = strategiesConsideredAndMultipliersLength(quorumNumber);\n\n            StrategyAndWeightingMultiplier memory strategyAndMultiplier;\n\n            for (uint256 i = 0; i < stratsLength;) {\n                // accessing i^th StrategyAndWeightingMultiplier struct for the quorumNumber\n                strategyAndMultiplier = strategiesConsideredAndMultipliers[quorumNumber][i];\n\n                // shares of the operator in the strategy\n                uint256 sharesAmount = delegation.operatorShares(operator, strategyAndMultiplier.strategy);\n\n                // add the weight from the shares for this strategy to the total weight\n                if (sharesAmount > 0) {\n                    weight += uint96(\n                        (\n                            (strategyAndMultiplier.strategy).sharesToUnderlying(sharesAmount)\n                                * strategyAndMultiplier.multiplier\n                        ) / WEIGHTING_DIVISOR\n                    );\n                }\n\n                unchecked {\n                    ++i;\n                }\n            }\n        }\n\n        return weight;\n    }"
}