{
    "Function": "isEligible",
    "File": "contracts/MerkleEligibility.sol",
    "Parent Contracts": [
        "interfaces/IEligibility.sol"
    ],
    "High-Level Calls": [
        "MerkleLib"
    ],
    "Internal Calls": [
        "abi.encode()",
        "keccak256(bytes)"
    ],
    "Library Calls": [
        "verifyProof"
    ],
    "Low-Level Calls": [],
    "Code": "function isEligible(uint index, address recipient, bytes32[] memory proof) public override view returns (bool eligible) {\n        Gate memory gate = gates[index];\n        // We need to pack the 20 bytes address to the 32 bytes value, so we call abi.encode\n        bytes32 leaf = keccak256(abi.encode(recipient));\n        // Check the per-address count first\n        bool countValid = timesWithdrawn[index][recipient] < gate.maxWithdrawalsAddress;\n        // Then check global count and merkle proof\n        return countValid && gate.totalWithdrawals < gate.maxWithdrawalsTotal && gate.root.verifyProof(leaf, proof);\n    }"
}