Do not use hidden path to fix windows

circom-desktop
ioedeveloper 4 weeks ago
parent cff213fb8f
commit 1789f79700
  1. 8
      apps/circuit-compiler/src/app/actions/index.ts
  2. 6
      apps/circuit-compiler/src/app/services/circomPluginClient.ts
  3. 18
      apps/remix-ide-e2e/src/tests/circom.test.ts
  4. 6
      apps/remixdesktop/src/plugins/circomElectronBasePlugin.ts
  5. 2
      libs/remix-ws-templates/src/templates/hashchecker/scripts/groth16/groth16_trusted_setup.ts
  6. 4
      libs/remix-ws-templates/src/templates/hashchecker/scripts/groth16/groth16_zkproof.ts
  7. 2
      libs/remix-ws-templates/src/templates/hashchecker/scripts/plonk/plonk_trusted_setup.ts
  8. 2
      libs/remix-ws-templates/src/templates/hashchecker/scripts/plonk/plonk_zkproof.ts
  9. 2
      libs/remix-ws-templates/src/templates/rln/scripts/groth16/groth16_trusted_setup.ts
  10. 4
      libs/remix-ws-templates/src/templates/rln/scripts/groth16/groth16_zkproof.ts
  11. 2
      libs/remix-ws-templates/src/templates/rln/scripts/plonk/plonk_trusted_setup.ts
  12. 4
      libs/remix-ws-templates/src/templates/rln/scripts/plonk/plonk_zkproof.ts
  13. 2
      libs/remix-ws-templates/src/templates/semaphore/scripts/groth16/groth16_trusted_setup.ts
  14. 4
      libs/remix-ws-templates/src/templates/semaphore/scripts/groth16/groth16_zkproof.ts
  15. 2
      libs/remix-ws-templates/src/templates/semaphore/scripts/plonk/plonk_trusted_setup.ts
  16. 4
      libs/remix-ws-templates/src/templates/semaphore/scripts/plonk/plonk_zkproof.ts
  17. 2
      libs/remix-ws-templates/src/templates/semaphore/scripts/run_setup.ts
  18. 4
      libs/remix-ws-templates/src/templates/semaphore/scripts/run_verification.ts

@ -29,7 +29,7 @@ export const computeWitness = async (plugin: CircomPluginClient, appState: AppSt
const wtns = await snarkjs.wtns.exportJson(witness) const wtns = await snarkjs.wtns.exportJson(witness)
const wtnsJson = wtns.map(wtn => wtn.toString()) const wtnsJson = wtns.map(wtn => wtn.toString())
const fileName = extractNameFromKey(appState.filePath) const fileName = extractNameFromKey(appState.filePath)
const writePath = extractParentFromKey(appState.filePath) + `/.bin/${fileName.replace('.circom', '.wtn.json')}` const writePath = extractParentFromKey(appState.filePath) + `/bin/${fileName.replace('.circom', '.wtn.json')}`
await plugin.call('fileManager', 'writeFile', writePath, JSON.stringify(wtnsJson, null, 2)) await plugin.call('fileManager', 'writeFile', writePath, JSON.stringify(wtnsJson, null, 2))
plugin._paq.push(['trackEvent', 'circuit-compiler', 'computeWitness', 'wtns.exportJson', writePath]) plugin._paq.push(['trackEvent', 'circuit-compiler', 'computeWitness', 'wtns.exportJson', writePath])
@ -53,7 +53,7 @@ export const runSetupAndExport = async (plugin: CircomPluginClient, appState: Ap
await plugin.generateR1cs(appState.filePath, { version: appState.version, prime: appState.primeValue }) await plugin.generateR1cs(appState.filePath, { version: appState.version, prime: appState.primeValue })
const fileName = extractNameFromKey(appState.filePath) const fileName = extractNameFromKey(appState.filePath)
const readPath = extractParentFromKey(appState.filePath) + `/.bin/${fileName.replace('.circom', '.r1cs')}` const readPath = extractParentFromKey(appState.filePath) + `/bin/${fileName.replace('.circom', '.r1cs')}`
// @ts-ignore // @ts-ignore
const r1csBuffer = await plugin.call('fileManager', 'readFile', readPath, { encoding: null }) const r1csBuffer = await plugin.call('fileManager', 'readFile', readPath, { encoding: null })
// @ts-ignore // @ts-ignore
@ -112,12 +112,12 @@ export const generateProof = async (plugin: CircomPluginClient, appState: AppSta
dispatch({ type: 'SET_PROOF_FEEDBACK', payload: null }) dispatch({ type: 'SET_PROOF_FEEDBACK', payload: null })
plugin.emit('statusChanged', { key: 'none' }) plugin.emit('statusChanged', { key: 'none' })
const fileName = extractNameFromKey(appState.filePath) const fileName = extractNameFromKey(appState.filePath)
const r1csPath = extractParentFromKey(appState.filePath) + `/.bin/${fileName.replace('.circom', '.r1cs')}` const r1csPath = extractParentFromKey(appState.filePath) + `/bin/${fileName.replace('.circom', '.r1cs')}`
// @ts-ignore // @ts-ignore
const r1csBuffer = await plugin.call('fileManager', 'readFile', r1csPath, { encoding: null }) const r1csBuffer = await plugin.call('fileManager', 'readFile', r1csPath, { encoding: null })
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer) const r1cs = new Uint8Array(r1csBuffer)
const wtnsPath = isElectron() ? extractParentFromKey(appState.filePath) + "/.bin/" + fileName.replace('.circom', '_js') + "/" + fileName.replace('.circom', '.wtn') : r1csPath.replace('.r1cs', '.wtn') const wtnsPath = isElectron() ? extractParentFromKey(appState.filePath) + "/bin/" + fileName.replace('.circom', '_js') + "/" + fileName.replace('.circom', '.wtn') : r1csPath.replace('.r1cs', '.wtn')
// @ts-ignore // @ts-ignore
const wtnsBuffer = await plugin.call('fileManager', 'readFile', wtnsPath, { encoding: null }) const wtnsBuffer = await plugin.call('fileManager', 'readFile', wtnsPath, { encoding: null })
// @ts-ignore // @ts-ignore

@ -158,7 +158,7 @@ export class CircomPluginClient extends PluginClient {
const { stdout, stderr } = await this.call('circom', 'run', path, versionToInstall, { prime: prime, wasm: "", inputs: "" }) const { stdout, stderr } = await this.call('circom', 'run', path, versionToInstall, { prime: prime, wasm: "", inputs: "" })
const fileName = extractNameFromKey(path) const fileName = extractNameFromKey(path)
this.lastCompiledCircuitPath = pathModule.normalize(extractParentFromKey(path) + "/.bin/" + fileName.replace('.circom', '_js') + "/" + fileName.replace('circom', 'wasm')) this.lastCompiledCircuitPath = pathModule.normalize(extractParentFromKey(path) + "/bin/" + fileName.replace('.circom', '_js') + "/" + fileName.replace('circom', 'wasm'))
if (stderr) this.call('terminal', 'log', { type: 'error', value: stderr }) if (stderr) this.call('terminal', 'log', { type: 'error', value: stderr })
if (stdout) this.call('terminal', 'log', { type: 'log', value: stdout }) if (stdout) this.call('terminal', 'log', { type: 'log', value: stdout })
} catch (error) { } catch (error) {
@ -212,7 +212,7 @@ export class CircomPluginClient extends PluginClient {
this.lastCompiledFile = path this.lastCompiledFile = path
const fileName = extractNameFromKey(path) const fileName = extractNameFromKey(path)
this.lastCompiledCircuitPath = extractParentFromKey(path) + "/.bin/" + fileName.replace('circom', 'wasm') this.lastCompiledCircuitPath = extractParentFromKey(path) + "/bin/" + fileName.replace('circom', 'wasm')
// @ts-ignore // @ts-ignore
await this.call('fileManager', 'writeFile', this.lastCompiledCircuitPath, circuitProgram, { encoding: null }) await this.call('fileManager', 'writeFile', this.lastCompiledCircuitPath, circuitProgram, { encoding: null })
const fileContent = this.lastParsedFiles[path] const fileContent = this.lastParsedFiles[path]
@ -279,7 +279,7 @@ export class CircomPluginClient extends PluginClient {
throw new Error(r1csErrors) throw new Error(r1csErrors)
} else { } else {
const fileName = extractNameFromKey(path) const fileName = extractNameFromKey(path)
const writePath = extractParentFromKey(path) + "/.bin/" + fileName.replace('circom', 'r1cs') const writePath = extractParentFromKey(path) + "/bin/" + fileName.replace('circom', 'r1cs')
// @ts-ignore // @ts-ignore
await this.call('fileManager', 'writeFile', writePath, r1csProgram, true) await this.call('fileManager', 'writeFile', writePath, r1csProgram, true)

@ -38,8 +38,8 @@ module.exports = {
.waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]') .waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]')
.waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]') .waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]')
.click('[data-id="play-editor"]') .click('[data-id="play-editor"]')
.waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/.bin/simple.wasm"]') .waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/bin/simple.wasm"]')
.waitForElementVisible('[data-id="treeViewLitreeViewItemcircuits/.bin/simple.wasm"]') .waitForElementVisible('[data-id="treeViewLitreeViewItemcircuits/bin/simple.wasm"]')
}, },
'Should compute a witness for a simple circuit #group1': function (browser: NightwatchBrowser) { 'Should compute a witness for a simple circuit #group1': function (browser: NightwatchBrowser) {
browser browser
@ -55,8 +55,8 @@ module.exports = {
.click('[data-id="compute_witness_btn"]') .click('[data-id="compute_witness_btn"]')
.frameParent() .frameParent()
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/.bin/simple.wtn"]') .waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/bin/simple.wtn"]')
.waitForElementVisible('[data-id="treeViewLitreeViewItemcircuits/.bin/simple.wtn"]') .waitForElementVisible('[data-id="treeViewLitreeViewItemcircuits/bin/simple.wtn"]')
}, },
'Should compile a simple circuit using compile button in circom plugin #group2': function (browser: NightwatchBrowser) { 'Should compile a simple circuit using compile button in circom plugin #group2': function (browser: NightwatchBrowser) {
browser browser
@ -70,8 +70,8 @@ module.exports = {
.click('button[data-id="compile_circuit_btn"]') .click('button[data-id="compile_circuit_btn"]')
.frameParent() .frameParent()
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/.bin/simple.wasm"]') .waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/bin/simple.wasm"]')
.waitForElementVisible('[data-id="treeViewLitreeViewItemcircuits/.bin/simple.wasm"]') .waitForElementVisible('[data-id="treeViewLitreeViewItemcircuits/bin/simple.wasm"]')
}, },
'Should run Groth16 setup and export for a simple circuit using the GUI #group2': function (browser: NightwatchBrowser) { 'Should run Groth16 setup and export for a simple circuit using the GUI #group2': function (browser: NightwatchBrowser) {
browser browser
@ -116,8 +116,8 @@ module.exports = {
return actions.keyDown(this.Keys.CONTROL).sendKeys('s') return actions.keyDown(this.Keys.CONTROL).sendKeys('s')
}) })
.waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/.bin/simple.wasm"]') .waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/bin/simple.wasm"]')
.waitForElementVisible('[data-id="treeViewLitreeViewItemcircuits/.bin/simple.wasm"]') .waitForElementVisible('[data-id="treeViewLitreeViewItemcircuits/bin/simple.wasm"]')
}, },
'Should display warnings for compiled circuit without pragma version #group4': function (browser: NightwatchBrowser) { 'Should display warnings for compiled circuit without pragma version #group4': function (browser: NightwatchBrowser) {
browser browser
@ -164,7 +164,7 @@ module.exports = {
.waitForElementNotPresent('[data-id="circuit_feedback"]') .waitForElementNotPresent('[data-id="circuit_feedback"]')
.frameParent() .frameParent()
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/.bin/simple.wasm"]') .waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/bin/simple.wasm"]')
}, },
'Should create a new workspace using hash checker template #group5 #group6': function (browser: NightwatchBrowser) { 'Should create a new workspace using hash checker template #group5 #group6': function (browser: NightwatchBrowser) {
browser browser

@ -49,12 +49,12 @@ class CircomElectronPluginClient extends ElectronBasePluginClient {
// @ts-ignore // @ts-ignore
const wd = await this.call('fs', 'getWorkingDir') const wd = await this.call('fs', 'getWorkingDir')
// @ts-ignore // @ts-ignore
const outputDirExists = await this.call('fs', 'exists', path.normalize(extractParentFromKey(filePath) + '/.bin')) const outputDirExists = await this.call('fs', 'exists', path.normalize(extractParentFromKey(filePath) + '/bin'))
// @ts-ignore // @ts-ignore
if (!outputDirExists) await this.call('fs', 'mkdir', path.normalize(extractParentFromKey(filePath) + '/.bin')) if (!outputDirExists) await this.call('fs', 'mkdir', path.normalize(extractParentFromKey(filePath) + '/bin'))
filePath = path.join(wd, filePath) filePath = path.join(wd, filePath)
const depPath = path.normalize(path.join(wd, '.deps/https/raw.githubusercontent.com/iden3/')) const depPath = path.normalize(path.join(wd, '.deps/https/raw.githubusercontent.com/iden3/'))
const outputDir = path.normalize(extractParentFromKey(filePath) + '/.bin') const outputDir = path.normalize(extractParentFromKey(filePath) + '/bin')
this.call('terminal' as any, 'logHtml', `Compiling ${filePath} with circom compiler (${version})`) this.call('terminal' as any, 'logHtml', `Compiling ${filePath} with circom compiler (${version})`)
return await circomCli.run(`${filePath} -l ${depPath} -o ${outputDir}`, version, options) return await circomCli.run(`${filePath} -l ${depPath} -o ${outputDir}`, version, options)

@ -13,7 +13,7 @@ const logger = {
const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmTiT4eiYz5KF7gQrDsgfCSTRv3wBPYJ4bRN1MmTRshpnW"; const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmTiT4eiYz5KF7gQrDsgfCSTRv3wBPYJ4bRN1MmTRshpnW";
// @ts-ignore // @ts-ignore
const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/calculate_hash.r1cs', { encoding: null }); const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/calculate_hash.r1cs', { encoding: null });
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer); const r1cs = new Uint8Array(r1csBuffer);
const zkey_0 = { type: "mem" }; const zkey_0 = { type: "mem" };

@ -12,13 +12,13 @@ const logger = {
(async () => { (async () => {
try { try {
// @ts-ignore // @ts-ignore
const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/calculate_hash.r1cs', { encoding: null }); const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/calculate_hash.r1cs', { encoding: null });
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer); const r1cs = new Uint8Array(r1csBuffer);
// @ts-ignore // @ts-ignore
await remix.call('circuit-compiler', 'compile', 'circuits/calculate_hash.circom'); await remix.call('circuit-compiler', 'compile', 'circuits/calculate_hash.circom');
// @ts-ignore // @ts-ignore
const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/calculate_hash.wasm', { encoding: null }); const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/calculate_hash.wasm', { encoding: null });
// @ts-ignore // @ts-ignore
const wasm = new Uint8Array(wasmBuffer); const wasm = new Uint8Array(wasmBuffer);

@ -8,7 +8,7 @@ const snarkjs = require('snarkjs');
const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmTiT4eiYz5KF7gQrDsgfCSTRv3wBPYJ4bRN1MmTRshpnW"; const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmTiT4eiYz5KF7gQrDsgfCSTRv3wBPYJ4bRN1MmTRshpnW";
// @ts-ignore // @ts-ignore
const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/calculate_hash.r1cs', { encoding: null }); const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/calculate_hash.r1cs', { encoding: null });
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer); const r1cs = new Uint8Array(r1csBuffer);
const zkey_final = { type: "mem" }; const zkey_final = { type: "mem" };

@ -15,7 +15,7 @@ const logger = {
// @ts-ignore // @ts-ignore
await remix.call('circuit-compiler', 'compile', 'circuits/calculate_hash.circom'); await remix.call('circuit-compiler', 'compile', 'circuits/calculate_hash.circom');
// @ts-ignore // @ts-ignore
const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/calculate_hash.wasm', { encoding: null }); const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/calculate_hash.wasm', { encoding: null });
// @ts-ignore // @ts-ignore
const wasm = new Uint8Array(wasmBuffer); const wasm = new Uint8Array(wasmBuffer);
const zkey_final = { const zkey_final = {

@ -13,7 +13,7 @@ const logger = {
const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmTiT4eiYz5KF7gQrDsgfCSTRv3wBPYJ4bRN1MmTRshpnW"; const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmTiT4eiYz5KF7gQrDsgfCSTRv3wBPYJ4bRN1MmTRshpnW";
// @ts-ignore // @ts-ignore
const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/rln.r1cs', { encoding: null }); const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/rln.r1cs', { encoding: null });
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer); const r1cs = new Uint8Array(r1csBuffer);
const zkey_0 = { type: "mem" }; const zkey_0 = { type: "mem" };

@ -73,13 +73,13 @@ async function prove (signals, wasm, wtns, r1cs, zkey_final, vKey) {
(async () => { (async () => {
try { try {
// @ts-ignore // @ts-ignore
const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/rln.r1cs', { encoding: null }); const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/rln.r1cs', { encoding: null });
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer); const r1cs = new Uint8Array(r1csBuffer);
// @ts-ignore // @ts-ignore
await remix.call('circuit-compiler', 'compile', 'circuits/rln.circom'); await remix.call('circuit-compiler', 'compile', 'circuits/rln.circom');
// @ts-ignore // @ts-ignore
const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/rln.wasm', { encoding: null }); const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/rln.wasm', { encoding: null });
// @ts-ignore // @ts-ignore
const wasm = new Uint8Array(wasmBuffer); const wasm = new Uint8Array(wasmBuffer);

@ -8,7 +8,7 @@ const snarkjs = require('snarkjs');
const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmciCq5JcZQyTLvC9GRanrLBi82ZmSriq1Fr5zANkGHebf"; const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmciCq5JcZQyTLvC9GRanrLBi82ZmSriq1Fr5zANkGHebf";
// @ts-ignore // @ts-ignore
const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/rln.r1cs', { encoding: null }); const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/rln.r1cs', { encoding: null });
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer); const r1cs = new Uint8Array(r1csBuffer);
const zkey_final = { type: "mem" }; const zkey_final = { type: "mem" };

@ -96,13 +96,13 @@ async function prove (signals, wasm, wtns, r1cs, zkey_final, vKey) {
(async () => { (async () => {
try { try {
// @ts-ignore // @ts-ignore
const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/rln.r1cs', { encoding: null }); const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/rln.r1cs', { encoding: null });
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer); const r1cs = new Uint8Array(r1csBuffer);
// @ts-ignore // @ts-ignore
await remix.call('circuit-compiler', 'compile', 'circuits/rln.circom'); await remix.call('circuit-compiler', 'compile', 'circuits/rln.circom');
// @ts-ignore // @ts-ignore
const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/rln.wasm', { encoding: null }); const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/rln.wasm', { encoding: null });
// @ts-ignore // @ts-ignore
const wasm = new Uint8Array(wasmBuffer); const wasm = new Uint8Array(wasmBuffer);

@ -13,7 +13,7 @@ const logger = {
const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmTiT4eiYz5KF7gQrDsgfCSTRv3wBPYJ4bRN1MmTRshpnW"; const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmTiT4eiYz5KF7gQrDsgfCSTRv3wBPYJ4bRN1MmTRshpnW";
// @ts-ignore // @ts-ignore
const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/semaphore.r1cs', { encoding: null }); const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/semaphore.r1cs', { encoding: null });
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer); const r1cs = new Uint8Array(r1csBuffer);
const zkey_0 = { type: "mem" }; const zkey_0 = { type: "mem" };

@ -25,13 +25,13 @@ function hash(message: any): bigint {
(async () => { (async () => {
try { try {
// @ts-ignore // @ts-ignore
const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/semaphore.r1cs', true); const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/semaphore.r1cs', true);
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer); const r1cs = new Uint8Array(r1csBuffer);
// @ts-ignore // @ts-ignore
await remix.call('circuit-compiler', 'compile', 'circuits/semaphore.circom'); await remix.call('circuit-compiler', 'compile', 'circuits/semaphore.circom');
// @ts-ignore // @ts-ignore
const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/semaphore.wasm', true); const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/semaphore.wasm', true);
// @ts-ignore // @ts-ignore
const wasm = new Uint8Array(wasmBuffer); const wasm = new Uint8Array(wasmBuffer);

@ -13,7 +13,7 @@ const logger = {
const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmciCq5JcZQyTLvC9GRanrLBi82ZmSriq1Fr5zANkGHebf"; const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmciCq5JcZQyTLvC9GRanrLBi82ZmSriq1Fr5zANkGHebf";
// @ts-ignore // @ts-ignore
const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/semaphore.r1cs', { encoding: null }); const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/semaphore.r1cs', { encoding: null });
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer); const r1cs = new Uint8Array(r1csBuffer);
const zkey_final = { type: "mem" }; const zkey_final = { type: "mem" };

@ -25,13 +25,13 @@ function hash(message: any): bigint {
(async () => { (async () => {
try { try {
// @ts-ignore // @ts-ignore
const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/semaphore.r1cs', true); const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/semaphore.r1cs', true);
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer); const r1cs = new Uint8Array(r1csBuffer);
// @ts-ignore // @ts-ignore
await remix.call('circuit-compiler', 'compile', 'circuits/semaphore.circom'); await remix.call('circuit-compiler', 'compile', 'circuits/semaphore.circom');
// @ts-ignore // @ts-ignore
const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/semaphore.wasm', true); const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/semaphore.wasm', true);
// @ts-ignore // @ts-ignore
const wasm = new Uint8Array(wasmBuffer); const wasm = new Uint8Array(wasmBuffer);

@ -26,7 +26,7 @@ function hash(message: any): bigint {
const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmTiT4eiYz5KF7gQrDsgfCSTRv3wBPYJ4bRN1MmTRshpnW"; const ptau_final = "https://ipfs-cluster.ethdevops.io/ipfs/QmTiT4eiYz5KF7gQrDsgfCSTRv3wBPYJ4bRN1MmTRshpnW";
// @ts-ignore // @ts-ignore
const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/semaphore.r1cs', true); const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/semaphore.r1cs', true);
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer); const r1cs = new Uint8Array(r1csBuffer);
const zkey_0 = { type: "mem" }; const zkey_0 = { type: "mem" };

@ -25,11 +25,11 @@ function hash(message: any): bigint {
(async () => { (async () => {
try { try {
// @ts-ignore // @ts-ignore
const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/semaphore.r1cs', true); const r1csBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/semaphore.r1cs', true);
// @ts-ignore // @ts-ignore
const r1cs = new Uint8Array(r1csBuffer); const r1cs = new Uint8Array(r1csBuffer);
// @ts-ignore // @ts-ignore
const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/.bin/semaphore.wasm', true); const wasmBuffer = await remix.call('fileManager', 'readFile', 'circuits/bin/semaphore.wasm', true);
// @ts-ignore // @ts-ignore
const wasm = new Uint8Array(wasmBuffer); const wasm = new Uint8Array(wasmBuffer);

Loading…
Cancel
Save