parent
41a4ebba14
commit
bbe69aaf29
@ -1,110 +1,110 @@ |
||||
export default async () => { |
||||
return { |
||||
// @ts-ignore
|
||||
'.prettierrc': (await import('raw-loader!./.prettierrc')).default, |
||||
// @ts-ignore
|
||||
'README.md': (await import('raw-loader!./README.md')).default, |
||||
// @ts-ignore
|
||||
'contracts/CCIP-BnM.sol': (await import('raw-loader!./contracts/CCIP-BnM.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/IHackerGroup.sol': (await import('raw-loader!./contracts/IHackerGroup.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/Link.sol': (await import('raw-loader!./contracts/Link.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/Router.sol': (await import('raw-loader!./contracts/Router.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/demo ccip contracts/Receiver.sol': (await import('raw-loader!./contracts/demo ccip contracts/Receiver.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/demo ccip contracts/Sender.sol': (await import('raw-loader!./contracts/demo ccip contracts/Sender.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/demo ccip contracts/transferToken.sol': (await import('raw-loader!./contracts/demo ccip contracts/transferToken.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/hackerClient.sol': (await import('raw-loader!./contracts/hackerClient.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/hackergroup.sol': (await import('raw-loader!./contracts/hackergroup.sol')).default, |
||||
// @ts-ignore
|
||||
'data/group_id.json': (await import('./data/group_id.json.raw!=!raw-loader!./data/group_id.json')).default, |
||||
// @ts-ignore
|
||||
'data/proof_approve.json': (await import('./data/proof_approve.json.raw!=!raw-loader!./data/proof_approve.json')).default, |
||||
// @ts-ignore
|
||||
'data/proof_submit.json': (await import('./data/proof_submit.json.raw!=!raw-loader!./data/proof_submit.json')).default, |
||||
// @ts-ignore
|
||||
'data/semaphore_deployment.json': (await import('./data/semaphore_deployment.json.raw!=!raw-loader!./data/semaphore_deployment.json')).default, |
||||
// @ts-ignore
|
||||
'index.ts': (await import('raw-loader!./index.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/0_compile_1.ts': (await import('raw-loader!./scripts/0_compile_1.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/0_compile_2.ts': (await import('raw-loader!./scripts/0_compile_2.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/0_compile_3.ts': (await import('raw-loader!./scripts/0_compile_3.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/0_compile_4.ts': (await import('raw-loader!./scripts/0_compile_4.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/1_deploy_semaphore.ts': (await import('raw-loader!./scripts/1_deploy_semaphore.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/2.1_addmembers.ts': (await import('raw-loader!./scripts/2.1_addmembers.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/2_create_groups.ts': (await import('raw-loader!./scripts/2_create_groups.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/3_store_groups.ts': (await import('raw-loader!./scripts/3_store_groups.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/helpers/convertsignal.ts': (await import('raw-loader!./scripts/helpers/convertsignal.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/helpers/createProofForIdendity.ts': (await import('raw-loader!./scripts/helpers/createProofForIdendity.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/helpers/deploy.ts': (await import('raw-loader!./scripts/helpers/deploy.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/helpers/packProof.ts': (await import('raw-loader!./scripts/helpers/packProof.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/helpers/unpackProof.ts': (await import('raw-loader!./scripts/helpers/unpackProof.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/4.1_generate_proof_approve.ts': (await import('raw-loader!./scripts/manual operations/4.1_generate_proof_approve.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/4.5_generate_proof_with_trusted_setup.ts': (await import('raw-loader!./scripts/manual operations/4.5_generate_proof_with_trusted_setup.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/4_generate_proof_submit.ts': (await import('raw-loader!./scripts/manual operations/4_generate_proof_submit.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/5_verify_proof_on_chain.ts': (await import('raw-loader!./scripts/manual operations/5_verify_proof_on_chain.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/6_get_verified_proofs.ts': (await import('raw-loader!./scripts/manual operations/6_get_verified_proofs.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/7_generate_cids.ts': (await import('raw-loader!./scripts/manual operations/7_generate_cids.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/7_hackergroup_events.ts': (await import('raw-loader!./scripts/manual operations/7_hackergroup_events.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/tests/hackerClient.test.ts': (await import('raw-loader!./scripts/tests/hackerClient.test.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/tests/hackergroup.test.ts': (await import('raw-loader!./scripts/tests/hackergroup.test.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/types/types.ts': (await import('raw-loader!./scripts/types/types.ts')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/README.md': (await import('raw-loader!./semaphore/contracts/README.md')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/Semaphore.sol': (await import('raw-loader!./semaphore/contracts/Semaphore.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/artifacts/Semaphore.json': (await import('./semaphore/contracts/artifacts/Semaphore.json.raw!=!raw-loader!./semaphore/contracts/artifacts/Semaphore.json')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/artifacts/Semaphore_metadata.json': (await import('./semaphore/contracts/artifacts/Semaphore_metadata.json.raw!=!raw-loader!./semaphore/contracts/artifacts/Semaphore_metadata.json')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/base/Pairing.sol': (await import('raw-loader!./semaphore/contracts/base/Pairing.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/base/SemaphoreGroups.sol': (await import('raw-loader!./semaphore/contracts/base/SemaphoreGroups.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/base/SemaphoreVerifier.sol': (await import('raw-loader!./semaphore/contracts/base/SemaphoreVerifier.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/extensions/SemaphoreVoting.sol': (await import('raw-loader!./semaphore/contracts/extensions/SemaphoreVoting.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/extensions/SemaphoreWhistleblowing.sol': (await import('raw-loader!./semaphore/contracts/extensions/SemaphoreWhistleblowing.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/interfaces/ISemaphore.sol': (await import('raw-loader!./semaphore/contracts/interfaces/ISemaphore.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/interfaces/ISemaphoreGroups.sol': (await import('raw-loader!./semaphore/contracts/interfaces/ISemaphoreGroups.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/interfaces/ISemaphoreVerifier.sol': (await import('raw-loader!./semaphore/contracts/interfaces/ISemaphoreVerifier.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/interfaces/ISemaphoreVoting.sol': (await import('raw-loader!./semaphore/contracts/interfaces/ISemaphoreVoting.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/interfaces/ISemaphoreWhistleblowing.sol': (await import('raw-loader!./semaphore/contracts/interfaces/ISemaphoreWhistleblowing.sol')).default |
||||
// @ts-ignore
|
||||
'.prettierrc': (await import('raw-loader!./.prettierrc')).default, |
||||
// @ts-ignore
|
||||
'README.md': (await import('raw-loader!./README.md')).default, |
||||
// @ts-ignore
|
||||
'contracts/CCIP-BnM.sol': (await import('raw-loader!./contracts/CCIP-BnM.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/IHackerGroup.sol': (await import('raw-loader!./contracts/IHackerGroup.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/Link.sol': (await import('raw-loader!./contracts/Link.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/Router.sol': (await import('raw-loader!./contracts/Router.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/demo ccip contracts/Receiver.sol': (await import('raw-loader!./contracts/demo ccip contracts/Receiver.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/demo ccip contracts/Sender.sol': (await import('raw-loader!./contracts/demo ccip contracts/Sender.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/demo ccip contracts/transferToken.sol': (await import('raw-loader!./contracts/demo ccip contracts/transferToken.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/hackerClient.sol': (await import('raw-loader!./contracts/hackerClient.sol')).default, |
||||
// @ts-ignore
|
||||
'contracts/hackergroup.sol': (await import('raw-loader!./contracts/hackergroup.sol')).default, |
||||
// @ts-ignore
|
||||
'data/group_id.json': (await import('./data/group_id.json.raw!=!raw-loader!./data/group_id.json')).default, |
||||
// @ts-ignore
|
||||
'data/proof_approve.json': (await import('./data/proof_approve.json.raw!=!raw-loader!./data/proof_approve.json')).default, |
||||
// @ts-ignore
|
||||
'data/proof_submit.json': (await import('./data/proof_submit.json.raw!=!raw-loader!./data/proof_submit.json')).default, |
||||
// @ts-ignore
|
||||
'data/semaphore_deployment.json': (await import('./data/semaphore_deployment.json.raw!=!raw-loader!./data/semaphore_deployment.json')).default, |
||||
// @ts-ignore
|
||||
'index.ts': (await import('raw-loader!./index.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/0_compile_1.ts': (await import('raw-loader!./scripts/0_compile_1.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/0_compile_2.ts': (await import('raw-loader!./scripts/0_compile_2.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/0_compile_3.ts': (await import('raw-loader!./scripts/0_compile_3.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/0_compile_4.ts': (await import('raw-loader!./scripts/0_compile_4.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/1_deploy_semaphore.ts': (await import('raw-loader!./scripts/1_deploy_semaphore.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/2.1_addmembers.ts': (await import('raw-loader!./scripts/2.1_addmembers.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/2_create_groups.ts': (await import('raw-loader!./scripts/2_create_groups.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/3_store_groups.ts': (await import('raw-loader!./scripts/3_store_groups.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/helpers/convertsignal.ts': (await import('raw-loader!./scripts/helpers/convertsignal.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/helpers/createProofForIdendity.ts': (await import('raw-loader!./scripts/helpers/createProofForIdendity.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/helpers/deploy.ts': (await import('raw-loader!./scripts/helpers/deploy.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/helpers/packProof.ts': (await import('raw-loader!./scripts/helpers/packProof.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/helpers/unpackProof.ts': (await import('raw-loader!./scripts/helpers/unpackProof.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/4.1_generate_proof_approve.ts': (await import('raw-loader!./scripts/manual operations/4.1_generate_proof_approve.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/4.5_generate_proof_with_trusted_setup.ts': (await import('raw-loader!./scripts/manual operations/4.5_generate_proof_with_trusted_setup.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/4_generate_proof_submit.ts': (await import('raw-loader!./scripts/manual operations/4_generate_proof_submit.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/5_verify_proof_on_chain.ts': (await import('raw-loader!./scripts/manual operations/5_verify_proof_on_chain.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/6_get_verified_proofs.ts': (await import('raw-loader!./scripts/manual operations/6_get_verified_proofs.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/7_generate_cids.ts': (await import('raw-loader!./scripts/manual operations/7_generate_cids.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/manual operations/7_hackergroup_events.ts': (await import('raw-loader!./scripts/manual operations/7_hackergroup_events.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/tests/hackerClient.test.ts': (await import('raw-loader!./scripts/tests/hackerClient.test.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/tests/hackergroup.test.ts': (await import('raw-loader!./scripts/tests/hackergroup.test.ts')).default, |
||||
// @ts-ignore
|
||||
'scripts/types/types.ts': (await import('raw-loader!./scripts/types/types.ts')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/README.md': (await import('raw-loader!./semaphore/contracts/README.md')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/Semaphore.sol': (await import('raw-loader!./semaphore/contracts/Semaphore.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/artifacts/Semaphore.json': (await import('./semaphore/contracts/artifacts/Semaphore.json.raw!=!raw-loader!./semaphore/contracts/artifacts/Semaphore.json')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/artifacts/Semaphore_metadata.json': (await import('./semaphore/contracts/artifacts/Semaphore_metadata.json.raw!=!raw-loader!./semaphore/contracts/artifacts/Semaphore_metadata.json')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/base/Pairing.sol': (await import('raw-loader!./semaphore/contracts/base/Pairing.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/base/SemaphoreGroups.sol': (await import('raw-loader!./semaphore/contracts/base/SemaphoreGroups.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/base/SemaphoreVerifier.sol': (await import('raw-loader!./semaphore/contracts/base/SemaphoreVerifier.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/extensions/SemaphoreVoting.sol': (await import('raw-loader!./semaphore/contracts/extensions/SemaphoreVoting.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/extensions/SemaphoreWhistleblowing.sol': (await import('raw-loader!./semaphore/contracts/extensions/SemaphoreWhistleblowing.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/interfaces/ISemaphore.sol': (await import('raw-loader!./semaphore/contracts/interfaces/ISemaphore.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/interfaces/ISemaphoreGroups.sol': (await import('raw-loader!./semaphore/contracts/interfaces/ISemaphoreGroups.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/interfaces/ISemaphoreVerifier.sol': (await import('raw-loader!./semaphore/contracts/interfaces/ISemaphoreVerifier.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/interfaces/ISemaphoreVoting.sol': (await import('raw-loader!./semaphore/contracts/interfaces/ISemaphoreVoting.sol')).default, |
||||
// @ts-ignore
|
||||
'semaphore/contracts/interfaces/ISemaphoreWhistleblowing.sol': (await import('raw-loader!./semaphore/contracts/interfaces/ISemaphoreWhistleblowing.sol')).default |
||||
} |
||||
} |
@ -1,15 +1,15 @@ |
||||
;(async () => { |
||||
try { |
||||
remix.off('solidity', 'compilationFinished') |
||||
const params = { |
||||
optimize: true, |
||||
runs: 200, |
||||
language: 'Solidity', |
||||
version: '0.8.4+commit.c7e474f2', |
||||
} |
||||
await remix.call('solidity', 'setCompilerConfig', params as any) |
||||
await remix.call('solidity', 'compile' as any, 'semaphore/contracts/Semaphore.sol') |
||||
}catch(e){ |
||||
console.log(e.message) |
||||
try { |
||||
remix.off('solidity', 'compilationFinished') |
||||
const params = { |
||||
optimize: true, |
||||
runs: 200, |
||||
language: 'Solidity', |
||||
version: '0.8.4+commit.c7e474f2', |
||||
} |
||||
await remix.call('solidity', 'setCompilerConfig', params as any) |
||||
await remix.call('solidity', 'compile' as any, 'semaphore/contracts/Semaphore.sol') |
||||
}catch(e){ |
||||
console.log(e.message) |
||||
} |
||||
})() |
||||
|
@ -1,15 +1,15 @@ |
||||
;(async () => { |
||||
try { |
||||
remix.off('solidity', 'compilationFinished') |
||||
const params = { |
||||
optimize: true, |
||||
runs: 200, |
||||
language: 'Solidity', |
||||
version: '0.8.4+commit.c7e474f2', |
||||
} |
||||
await remix.call('solidity', 'setCompilerConfig', params as any) |
||||
await remix.call('solidity', 'compile' as any, 'semaphore/contracts/base/SemaphoreVerifier.sol') |
||||
}catch(e){ |
||||
console.log(e.message) |
||||
try { |
||||
remix.off('solidity', 'compilationFinished') |
||||
const params = { |
||||
optimize: true, |
||||
runs: 200, |
||||
language: 'Solidity', |
||||
version: '0.8.4+commit.c7e474f2', |
||||
} |
||||
await remix.call('solidity', 'setCompilerConfig', params as any) |
||||
await remix.call('solidity', 'compile' as any, 'semaphore/contracts/base/SemaphoreVerifier.sol') |
||||
}catch(e){ |
||||
console.log(e.message) |
||||
} |
||||
})() |
||||
|
@ -1,15 +1,15 @@ |
||||
;(async () => { |
||||
try { |
||||
remix.off('solidity', 'compilationFinished') |
||||
const params = { |
||||
optimize: true, |
||||
runs: 200, |
||||
language: 'Solidity', |
||||
version: '0.8.4+commit.c7e474f2', |
||||
} |
||||
await remix.call('solidity', 'setCompilerConfig', params as any) |
||||
await remix.call('solidity', 'compile' as any, 'contracts/hackerClient.sol') |
||||
}catch(e){ |
||||
console.log(e.message) |
||||
try { |
||||
remix.off('solidity', 'compilationFinished') |
||||
const params = { |
||||
optimize: true, |
||||
runs: 200, |
||||
language: 'Solidity', |
||||
version: '0.8.4+commit.c7e474f2', |
||||
} |
||||
await remix.call('solidity', 'setCompilerConfig', params as any) |
||||
await remix.call('solidity', 'compile' as any, 'contracts/hackerClient.sol') |
||||
}catch(e){ |
||||
console.log(e.message) |
||||
} |
||||
})() |
||||
|
@ -1,15 +1,15 @@ |
||||
;(async () => { |
||||
try { |
||||
remix.off('solidity', 'compilationFinished') |
||||
const params = { |
||||
optimize: true, |
||||
runs: 200, |
||||
language: 'Solidity', |
||||
version: '0.8.4+commit.c7e474f2', |
||||
} |
||||
await remix.call('solidity', 'setCompilerConfig', params as any) |
||||
await remix.call('solidity', 'compile' as any, 'contracts/hackergroup.sol') |
||||
}catch(e){ |
||||
console.log(e.message) |
||||
try { |
||||
remix.off('solidity', 'compilationFinished') |
||||
const params = { |
||||
optimize: true, |
||||
runs: 200, |
||||
language: 'Solidity', |
||||
version: '0.8.4+commit.c7e474f2', |
||||
} |
||||
await remix.call('solidity', 'setCompilerConfig', params as any) |
||||
await remix.call('solidity', 'compile' as any, 'contracts/hackergroup.sol') |
||||
}catch(e){ |
||||
console.log(e.message) |
||||
} |
||||
})() |
@ -1,47 +1,47 @@ |
||||
import { deploy } from './helpers/deploy' |
||||
;(async () => { |
||||
try { |
||||
const pairing = await deploy('Pairing', []) |
||||
|
||||
console.log(pairing.address) |
||||
|
||||
const verifier = await deploy('SemaphoreVerifier', [], { |
||||
Pairing: pairing.address, |
||||
}) |
||||
|
||||
const verifierAddress = verifier.address |
||||
|
||||
const poseidonT3 = await deploy('PoseidonT3', []) |
||||
console.log('PoseidonT3 at', poseidonT3.address) |
||||
|
||||
const incrementalBinaryTree = await deploy('IncrementalBinaryTree', [], { |
||||
'poseidon-solidity/PoseidonT3.sol:PoseidonT3': poseidonT3.address, |
||||
}) |
||||
console.log('IncrementalBinaryTree at', incrementalBinaryTree.address) |
||||
|
||||
if (!verifierAddress) throw new Error("verifier address shouldn't be null, the semaphore needs it...") |
||||
const semaphore = await deploy('Semaphore', [verifierAddress], { |
||||
IncrementalBinaryTree: incrementalBinaryTree.address, |
||||
}) |
||||
console.log('Semaphore addres: ', semaphore.address) |
||||
|
||||
await remix.call( |
||||
'fileManager', |
||||
'setFile', |
||||
'./data/semaphore_deployment.json', |
||||
JSON.stringify( |
||||
{ |
||||
semaphoreAddress: semaphore.address, |
||||
verifierAddress, |
||||
}, |
||||
null, |
||||
'\t', |
||||
), |
||||
) |
||||
|
||||
await remix.call('solidity', 'compile' as any, 'contracts/hackergroup.sol') |
||||
await remix.call('solidity', 'compile' as any, 'contracts/hackerClient.sol') |
||||
} catch (e) { |
||||
console.error(e.message) |
||||
} |
||||
try { |
||||
const pairing = await deploy('Pairing', []) |
||||
|
||||
console.log(pairing.address) |
||||
|
||||
const verifier = await deploy('SemaphoreVerifier', [], { |
||||
Pairing: pairing.address, |
||||
}) |
||||
|
||||
const verifierAddress = verifier.address |
||||
|
||||
const poseidonT3 = await deploy('PoseidonT3', []) |
||||
console.log('PoseidonT3 at', poseidonT3.address) |
||||
|
||||
const incrementalBinaryTree = await deploy('IncrementalBinaryTree', [], { |
||||
'poseidon-solidity/PoseidonT3.sol:PoseidonT3': poseidonT3.address, |
||||
}) |
||||
console.log('IncrementalBinaryTree at', incrementalBinaryTree.address) |
||||
|
||||
if (!verifierAddress) throw new Error("verifier address shouldn't be null, the semaphore needs it...") |
||||
const semaphore = await deploy('Semaphore', [verifierAddress], { |
||||
IncrementalBinaryTree: incrementalBinaryTree.address, |
||||
}) |
||||
console.log('Semaphore addres: ', semaphore.address) |
||||
|
||||
await remix.call( |
||||
'fileManager', |
||||
'setFile', |
||||
'./data/semaphore_deployment.json', |
||||
JSON.stringify( |
||||
{ |
||||
semaphoreAddress: semaphore.address, |
||||
verifierAddress, |
||||
}, |
||||
null, |
||||
'\t', |
||||
), |
||||
) |
||||
|
||||
await remix.call('solidity', 'compile' as any, 'contracts/hackergroup.sol') |
||||
await remix.call('solidity', 'compile' as any, 'contracts/hackerClient.sol') |
||||
} catch (e) { |
||||
console.error(e.message) |
||||
} |
||||
})() |
||||
|
@ -1,58 +1,58 @@ |
||||
import { ethers, BigNumber } from 'ethers' |
||||
import { ISemaphoreDeploymentData, IGroup, IGroupMember } from './types/types' |
||||
;(async () => { |
||||
const signer = new ethers.providers.Web3Provider(web3Provider).getSigner() |
||||
console.log(await signer.getAddress()) |
||||
const signerAddress = await signer.getAddress() |
||||
const signer = new ethers.providers.Web3Provider(web3Provider).getSigner() |
||||
console.log(await signer.getAddress()) |
||||
const signerAddress = await signer.getAddress() |
||||
|
||||
const semaphore_deployment = await remix.call('fileManager', 'readFile', 'data/semaphore_deployment.json') |
||||
const semaphore_deployment_data: ISemaphoreDeploymentData = JSON.parse(semaphore_deployment) |
||||
const semaphore_deployment = await remix.call('fileManager', 'readFile', 'data/semaphore_deployment.json') |
||||
const semaphore_deployment_data: ISemaphoreDeploymentData = JSON.parse(semaphore_deployment) |
||||
|
||||
const contract = await ethers.getContractAt('Semaphore', semaphore_deployment_data.semaphoreAddress, signer) |
||||
const contract = await ethers.getContractAt('Semaphore', semaphore_deployment_data.semaphoreAddress, signer) |
||||
|
||||
//console.log(contract.filters)
|
||||
//console.log(contract.filters)
|
||||
|
||||
let eventFilter = contract.filters.GroupCreated() |
||||
let groupsCreated = await contract.queryFilter(eventFilter) |
||||
let eventFilter = contract.filters.GroupCreated() |
||||
const groupsCreated = await contract.queryFilter(eventFilter) |
||||
|
||||
const groupIds: any = [] |
||||
const groupIds: any = [] |
||||
|
||||
for (let groupCreated of groupsCreated) { |
||||
console.log(groupCreated) |
||||
const group = await contract.groups(groupCreated.args[0]) |
||||
for (const groupCreated of groupsCreated) { |
||||
console.log(groupCreated) |
||||
const group = await contract.groups(groupCreated.args[0]) |
||||
|
||||
if (group[0] == signerAddress) { |
||||
console.log('found group belonging to ' + signerAddress + 'group id ' + groupCreated.args[0]) |
||||
groupIds.push(groupCreated.args[0]) |
||||
} |
||||
if (group[0] == signerAddress) { |
||||
console.log('found group belonging to ' + signerAddress + 'group id ' + groupCreated.args[0]) |
||||
groupIds.push(groupCreated.args[0]) |
||||
} |
||||
} |
||||
|
||||
eventFilter = contract.filters.MemberAdded() |
||||
let membersAdded = await contract.queryFilter(eventFilter) |
||||
eventFilter = contract.filters.MemberAdded() |
||||
const membersAdded = await contract.queryFilter(eventFilter) |
||||
|
||||
const groups: IGroup[] = [] |
||||
const groups: IGroup[] = [] |
||||
|
||||
for (let groupId of groupIds) { |
||||
console.log('checking group members of group ' + groupId) |
||||
for (const groupId of groupIds) { |
||||
console.log('checking group members of group ' + groupId) |
||||
|
||||
const group: IGroup = { |
||||
group_id: groupId.toString(), |
||||
members: [], |
||||
} |
||||
|
||||
for (let member of membersAdded) { |
||||
if (member.args[0].toHexString() == BigNumber.from(groupId).toHexString()) { |
||||
console.log('found member ') |
||||
console.log(member.args[2].toString()) |
||||
group.members.push(member.args[2].toString()) |
||||
} |
||||
} |
||||
const group: IGroup = { |
||||
group_id: groupId.toString(), |
||||
members: [], |
||||
} |
||||
|
||||
groups.push(group) |
||||
for (const member of membersAdded) { |
||||
if (member.args[0].toHexString() == BigNumber.from(groupId).toHexString()) { |
||||
console.log('found member ') |
||||
console.log(member.args[2].toString()) |
||||
group.members.push(member.args[2].toString()) |
||||
} |
||||
} |
||||
|
||||
console.log('groups:') |
||||
console.log(groups) |
||||
groups.push(group) |
||||
} |
||||
|
||||
console.log('groups:') |
||||
console.log(groups) |
||||
|
||||
await remix.call('fileManager', 'setFile', './build/groups.json', JSON.stringify(groups, null, '\t')) |
||||
await remix.call('fileManager', 'setFile', './build/groups.json', JSON.stringify(groups, null, '\t')) |
||||
})() |
||||
|
@ -1,22 +1,22 @@ |
||||
import { ethers, BigNumber } from 'ethers' |
||||
import { ISemaphoreDeploymentData, IGroup, IGroupMember } from './types' |
||||
;(async () => { |
||||
const signer = new ethers.providers.Web3Provider(web3Provider).getSigner() |
||||
console.log(await signer.getAddress()) |
||||
const signerAddress = await signer.getAddress() |
||||
const signer = new ethers.providers.Web3Provider(web3Provider).getSigner() |
||||
console.log(await signer.getAddress()) |
||||
const signerAddress = await signer.getAddress() |
||||
|
||||
const semaphore_deployment = await remix.call('fileManager', 'readFile', 'data/semaphore_deployment.json') |
||||
const semaphore_deployment_data: ISemaphoreDeploymentData = JSON.parse(semaphore_deployment) |
||||
const semaphore_deployment = await remix.call('fileManager', 'readFile', 'data/semaphore_deployment.json') |
||||
const semaphore_deployment_data: ISemaphoreDeploymentData = JSON.parse(semaphore_deployment) |
||||
|
||||
const contract = await ethers.getContractAt('Semaphore', semaphore_deployment_data.semaphoreAddress, signer) |
||||
const contract = await ethers.getContractAt('Semaphore', semaphore_deployment_data.semaphoreAddress, signer) |
||||
|
||||
//console.log(contract.filters)
|
||||
//console.log(contract.filters)
|
||||
|
||||
let eventFilter = contract.filters.ProofVerified() |
||||
let proofs_verified = await contract.queryFilter(eventFilter) |
||||
const eventFilter = contract.filters.ProofVerified() |
||||
const proofs_verified = await contract.queryFilter(eventFilter) |
||||
|
||||
console.log(JSON.stringify(proofs_verified, null, '\t')) |
||||
console.log(JSON.stringify(proofs_verified, null, '\t')) |
||||
|
||||
// write it to the filesystem
|
||||
await remix.call('fileManager', 'setFile', './build/proofs_verified.json', JSON.stringify(proofs_verified, null, '\t')) |
||||
// write it to the filesystem
|
||||
await remix.call('fileManager', 'setFile', './build/proofs_verified.json', JSON.stringify(proofs_verified, null, '\t')) |
||||
})() |
||||
|
@ -1,19 +1,19 @@ |
||||
import { ethers, BigNumber, utils } from 'ethers' |
||||
import { BigNumberToSignal } from './helpers/convertsignal' |
||||
;(async () => { |
||||
const verified_proofs = JSON.parse(await remix.call('fileManager', 'readFile', './build/proofs_verified.json')) |
||||
const verified_proofs = JSON.parse(await remix.call('fileManager', 'readFile', './build/proofs_verified.json')) |
||||
|
||||
const cids = [] |
||||
const cids = [] |
||||
|
||||
for (let proof of verified_proofs) { |
||||
const cid = BigNumberToSignal(proof.args[3].hex) |
||||
const signal = proof.args[4].hex |
||||
cids.push({ |
||||
date: Date.now(), |
||||
cid: cid, |
||||
signal |
||||
}) |
||||
} |
||||
for (const proof of verified_proofs) { |
||||
const cid = BigNumberToSignal(proof.args[3].hex) |
||||
const signal = proof.args[4].hex |
||||
cids.push({ |
||||
date: Date.now(), |
||||
cid: cid, |
||||
signal |
||||
}) |
||||
} |
||||
|
||||
await remix.call('fileManager', 'setFile', './build/cids.json', JSON.stringify(cids, null, '\t')) |
||||
await remix.call('fileManager', 'setFile', './build/cids.json', JSON.stringify(cids, null, '\t')) |
||||
})() |
||||
|
Loading…
Reference in new issue