Skip to content

Commit

Permalink
fix: submit proof to contract
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisht13 committed Oct 16, 2024
1 parent 8cccce2 commit 4416d99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion frontend/pages/api/submitProofToContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { config } from "dotenv";
import { encodeAbiParameters, parseAbiParameters } from "viem";

import { abi as contractABI } from "../../public/JwtVerifier.json";
const contractAddress = "0x9Ff07b3f525736Ac92F00f522aDbe2439EAB2e20";
const contractAddress = "0x04Dd7D48dbe268A957A7aED7FA6206D833c6A3bF";

config();
const privateKey = process.env.PRIVATE_KEY;
Expand Down Expand Up @@ -70,12 +70,15 @@ export default async function handler(
};
console.log("JWT proof:", jwtProof);

const gas = 8000000n;

const { request } = await publicClient.simulateContract({
account,
address: contractAddress,
abi: contractABI,
functionName: "verifyEmailProof",
args: [jwtProof],
gas,
});
console.log("Contract request:", request);
const hash = await walletClient.writeContract(request);
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3430,7 +3430,7 @@ __metadata:

"@zk-jwt/helpers@file:../packages/helpers::locator=frontend%40workspace%3Afrontend":
version: 0.0.1
resolution: "@zk-jwt/helpers@file:../packages/helpers#../packages/helpers::hash=760f02&locator=frontend%40workspace%3Afrontend"
resolution: "@zk-jwt/helpers@file:../packages/helpers#../packages/helpers::hash=9c1bd4&locator=frontend%40workspace%3Afrontend"
dependencies:
"@zk-email/helpers": ^6.1.5
addressparser: ^1.0.1
Expand All @@ -3446,7 +3446,7 @@ __metadata:
pako: ^2.1.0
psl: ^1.9.0
snarkjs: ^0.7.4
checksum: c16e302e229937615d5ed62d124935b1f4d4654ae97b770b23523fa1f8007a3b42aed14f9caf94a9dc43fe527722bae9d3e16a38c61f59274a2cf047fcd35f6c
checksum: 64ba81f8cb3ce5e77c53b686a9479f9dd5a81568de67a6926efbd18f2d0024ce799ced428c3c7626f9f5112dcef54665565d8483e2de3da279d2d974c664f256
languageName: node
linkType: hard

Expand Down

0 comments on commit 4416d99

Please sign in to comment.