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