Skip to content

Commit

Permalink
Merge pull request #101 from Rate-Limiting-Nullifier/fix/withdraw-pro…
Browse files Browse the repository at this point in the history
…of-to-contract-verifier

Inputs to verifier contracts are wrong ordered
  • Loading branch information
mhchia authored Sep 16, 2023
2 parents 7a4a5af + 775b217 commit 579fbb5
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 579fbb5

Please sign in to comment.