{
    "Function": "verifyValidatorBalance",
    "File": "src/contracts/libraries/BeaconChainProofs.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "Merkle"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "require(bool,string)"
    ],
    "Library Calls": [
        "verifyInclusionSha256"
    ],
    "Low-Level Calls": [],
    "Code": "function verifyValidatorBalance(\n        uint40 validatorIndex,\n        bytes32 beaconStateRoot,\n        bytes calldata proof,\n        bytes32 balanceRoot\n    ) internal view {\n        require(proof.length == 32 * ((BALANCE_TREE_HEIGHT + 1) + BEACON_STATE_FIELD_TREE_HEIGHT), \"BeaconChainProofs.verifyValidatorBalance: Proof has incorrect length\");\n\n        /**\n        * the beacon state's balance list is a list of uint64 values, and these are grouped together in 4s when merkleized.  \n        * Therefore, the index of the balance of a validator is validatorIndex/4\n        */\n        uint256 balanceIndex = uint256(validatorIndex/4);\n        balanceIndex = (BALANCE_INDEX << (BALANCE_TREE_HEIGHT + 1)) | balanceIndex;\n\n        require(Merkle.verifyInclusionSha256(proof, beaconStateRoot, balanceRoot, balanceIndex), \"BeaconChainProofs.verifyValidatorBalance: Invalid merkle proof\");\n    }"
}