How to use the snarkjs.generateCall function in snarkjs

To help you get started, weโ€™ve selected a few snarkjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LimeChain / etherlime / packages / etherlime / cli-commands / zk-proof / generate-call.js View on Github external
const run = async (signals, proof) => {
	const publicSignals = require(`${process.cwd()}/${generatedProofPath}/${signals}`);
	const generatedProof = zkSnark.unstringifyBigInts((require(`${process.cwd()}/${generatedProofPath}/${proof}`)));

	createGenerateCallFolder(generatedCallPath);

	const generatedCall = await zkSnark.generateCall(publicSignals, generatedProof);
	
	
	fs.writeFileSync(`${generatedCallPath}/generatedCall.json`, zkSnark.stringifyBigInts(generatedCall));
	console.log('===== Generated Call Complete! =====');
	console.log('===== Generated Call: =====')
	console.log(generatedCall)
};