diff --git a/packages/protocols/src/utils.ts b/packages/protocols/src/utils.ts index 89f8394..3b63c83 100644 --- a/packages/protocols/src/utils.ts +++ b/packages/protocols/src/utils.ts @@ -66,7 +66,7 @@ export function generateMerkleProof( ): MerkleProof { const tree = generateMerkleTree(depth, zeroValue, arity, leaves) - const leafIndex = leaves.indexOf(BigInt(leaf)) + const leafIndex = tree.leaves.indexOf(BigInt(leaf)) if (leafIndex === -1) { throw new Error("The leaf does not exists")