@@ -3,42 +3,26 @@ import { task, types } from "hardhat/config"
3
3
import { deploy , saveDeployedContracts } from "../scripts/utils"
4
4
5
5
task ( "deploy" , "Deploy a Semaphore contract" )
6
- . addOptionalParam < string > ( "verifierKeyPts" , "Verifier key points library address" , undefined , types . string )
7
6
. addOptionalParam < string > ( "verifier" , "Verifier contract address" , undefined , types . string )
8
7
. addOptionalParam < string > ( "poseidon" , "Poseidon library address" , undefined , types . string )
9
8
. addOptionalParam < boolean > ( "logs" , "Print the logs" , true , types . boolean )
10
9
. setAction (
11
10
async (
12
- {
13
- logs,
14
- verifierKeyPts : verifierKeyPtsAddress ,
15
- verifier : semaphoreVerifierAddress ,
16
- poseidon : poseidonT3Address
17
- } ,
11
+ { logs, verifier : semaphoreVerifierAddress , poseidon : poseidonT3Address } ,
18
12
{ ethers, hardhatArguments }
19
13
) : Promise < any > => {
20
14
const startBlock = await ethers . provider . getBlockNumber ( )
21
15
22
- if ( ! verifierKeyPtsAddress ) {
23
- verifierKeyPtsAddress = await deploy ( ethers , "SemaphoreVerifierKeyPts" , hardhatArguments . network )
24
- if ( logs ) {
25
- console . info ( `SemaphoreVerifierKeyPts library has been deployed to: ${ verifierKeyPtsAddress } ` )
26
- }
27
- }
28
-
29
16
if ( ! semaphoreVerifierAddress ) {
30
- semaphoreVerifierAddress = await deploy ( ethers , "SemaphoreVerifier" , hardhatArguments . network , [ ] , {
31
- libraries : {
32
- SemaphoreVerifierKeyPts : verifierKeyPtsAddress
33
- }
34
- } )
17
+ semaphoreVerifierAddress = await deploy ( ethers , "SemaphoreVerifier" , hardhatArguments . network )
35
18
if ( logs ) {
36
19
console . info ( `SemaphoreVerifier contract has been deployed to: ${ semaphoreVerifierAddress } ` )
37
20
}
38
21
}
39
22
40
23
if ( ! poseidonT3Address ) {
41
24
poseidonT3Address = await deploy ( ethers , "PoseidonT3" , hardhatArguments . network )
25
+
42
26
if ( logs ) {
43
27
console . info ( `PoseidonT3 library has been deployed to: ${ poseidonT3Address } ` )
44
28
}
@@ -55,17 +39,13 @@ task("deploy", "Deploy a Semaphore contract")
55
39
}
56
40
}
57
41
)
42
+
58
43
if ( logs ) {
59
44
console . info ( `Semaphore contract has been deployed to: ${ semaphoreAddress } ` )
60
45
}
61
46
62
47
saveDeployedContracts (
63
48
[
64
- {
65
- name : "SemaphoreVerifierKeyPts" ,
66
- address : verifierKeyPtsAddress ,
67
- startBlock
68
- } ,
69
49
{
70
50
name : "SemaphoreVerifier" ,
71
51
address : semaphoreVerifierAddress ,
@@ -88,7 +68,6 @@ task("deploy", "Deploy a Semaphore contract")
88
68
return {
89
69
semaphore : await ethers . getContractAt ( "Semaphore" , semaphoreAddress ) ,
90
70
verifierAddress : semaphoreVerifierAddress ,
91
- verifierKeyPtsAddress,
92
71
poseidonAddress : poseidonT3Address
93
72
}
94
73
}
0 commit comments