{
    "Function": "withdraw",
    "File": "contracts/MerkleIdentity.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "IPriceGate",
        "IEligibility",
        "IVoterID"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "verifyMetadata",
        "require(bool,string)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function withdraw(uint merkleIndex, uint tokenId, string memory uri, bytes32[] memory addressProof, bytes32[] memory metadataProof) external payable {\n        MerkleTree storage tree = merkleTrees[merkleIndex];\n        IVoterID id = IVoterID(tree.nftAddress);\n\n        // mint an identity first, this keeps the token-collision gas cost down\n        id.createIdentityFor(msg.sender, tokenId, uri);\n\n        // check that the merkle index is real\n        require(merkleIndex <= numTrees, 'merkleIndex out of range');\n\n        // verify that the metadata is real\n        require(verifyMetadata(tree.metadataMerkleRoot, tokenId, uri, metadataProof), \"The metadata proof could not be verified\");\n\n        // check eligibility of address\n        IEligibility(tree.eligibilityAddress).passThruGate(tree.eligibilityIndex, msg.sender, addressProof);\n\n        // check that the price is right\n        IPriceGate(tree.priceGateAddress).passThruGate{value: msg.value}(tree.priceIndex, msg.sender);\n\n    }"
}