Skip to content

Commit

Permalink
inputs to verifier contracts are wrong ordered
Browse files Browse the repository at this point in the history
  • Loading branch information
mhchia committed Sep 16, 2023
1 parent 7a4a5af commit 775b217
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/contract-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ function proofToArray(proof: Proof) {
// [proof[6], proof[7]],
// [identityCommitment, uint256(uint160(receiver))]
// );
// Ref: https://github.com/iden3/snarkjs/blob/33c753b1c513747e3b1f2d6cab2ca2e0c830eb77/smart_contract_tests/test/smart_contracts.test.js#L85-L87
return [
BigInt(proof.pi_a[0]),
BigInt(proof.pi_a[1]),
BigInt(proof.pi_b[0][0]),
BigInt(proof.pi_b[0][1]),
BigInt(proof.pi_b[1][0]),
BigInt(proof.pi_b[1][1]),
BigInt(proof.pi_c[0]),
BigInt(proof.pi_c[1]),
proof.pi_a[0].toString(),
proof.pi_a[1].toString(),
proof.pi_b[0][1].toString(),
proof.pi_b[0][0].toString(),
proof.pi_b[1][1].toString(),
proof.pi_b[1][0].toString(),
proof.pi_c[0].toString(),
proof.pi_c[1].toString(),
]
}

Expand Down

0 comments on commit 775b217

Please sign in to comment.