-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
133 lines (91 loc) · 8.72 KB
/
justfile
File metadata and controls
133 lines (91 loc) · 8.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
RPC_URL := "https://starknet-sepolia.public.blastapi.io/rpc/v0_7"
CIRCUIT_ROOT := "circuits"
CONTRACTS_ROOT := "contracts"
UI_ROOT := "ui"
API_ROOT := "api"
# ui
ui-run:
(cd {{UI_ROOT}} && npm run dev)
# api
api-run:
(cd {{API_ROOT}} && docker-compose up)
# circuits transfer
circuits-test circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo test --show-output)
circuits-check circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo check)
circuits-build circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo build)
circuits-fmt circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo fmt)
circuits-witness circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo execute witness && bb write_vk --scheme ultra_honk --oracle_hash keccak -b ./target/{{circuit}}.json -o ./target/)
circuits-proof circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo execute witness && bb prove_ultra_keccak_honk -b target/{{circuit}}.json -w target/witness.gz -o target/proof.bin && garaga calldata --system ultra_keccak_honk --vk target/vk.bin --proof target/proof.bin --format array > calldata.txt)
circuits-build-nargo circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo compile && nargo execute witness && bb write_vk --scheme ultra_honk -b --oracle_hash keccak ./target/{{circuit}}.json -o ./target/)
circuits-proof-nargo circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}} && mkdir -p target/proof && bb prove --scheme ultra_honk --bytecode_path target/{{circuit}}.json --witness_path target/witness.gz --output_path target/proof --oracle_hash keccak --output_format bytes && garaga calldata --system ultra_keccak_honk --vk target/vk --proof target/proof/proof --format array > target/proof/calldata.txt)
# (cd {{CIRCUIT_ROOT}}/{{circuit}} && bb write_vk --scheme ultra_honk --oracle_hash keccak -b ./target/zk_vote.json -o ./target/ && bb prove_ultra_keccak_honk -b target/{{circuit}}.json -w target/witness.gz -o target/proof.bin )
# (cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo execute witness && bb prove_ultra_keccak_honk -b target/{{circuit}}.json -w target/witness.gz -o target/proof.bin)
circuits-verify circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}} && bb verify --scheme ultra_honk --proof_path target/proof/proof --vk_path target/vk --oracle_hash keccak)
# (cd {{CIRCUIT_ROOT}}/{{circuit}} && bb write_vk --scheme ultra_honk --oracle_hash keccak -b ./target/zk_vote.json -o ./target/ && bb prove_ultra_keccak_honk -b target/{{circuit}}.json -w target/witness.gz -o target/proof.bin )
# (cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo execute witness && bb prove_ultra_keccak_honk -b target/{{circuit}}.json -w target/witness.gz -o target/proof.bin)
circuits-generate-verifier circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo build)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && bb write_vk --scheme ultra_honk --oracle_hash keccak -b ./target/{{circuit}}.json -o ./target/ && cp ./target/vk ./target/vk.bin)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && bb write_solidity_verifier -k ./target/vk -o ./target/Verifier.sol)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && garaga calldata --system ultra_keccak_honk --vk target/vk.bin --proof target/vk.bin --format array > calldata.txt)
circuits-generate circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo build)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && bb write_vk --scheme ultra_honk --oracle_hash keccak -b ./target/{{circuit}}.json -o ./target/ && cp ./target/vk ./target/vk.bin)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && bb write_solidity_verifier -k ./target/vk -o ./target/Verifier.sol)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo execute witness)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && mkdir -p target/proof && bb prove --scheme ultra_honk --bytecode_path ./target/{{circuit}}.json --witness_path target/witness.gz --output_path target/proof --oracle_hash keccak --output_format bytes && garaga calldata --system ultra_keccak_honk --vk target/vk --proof target/proof/proof --format array > target/proof/calldata.txt)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && garaga calldata --system ultra_keccak_honk --vk ./target/vk.bin --proof ./target/proof/proof --format array > calldata.txt)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && garaga gen --system ultra_keccak_honk --vk ./target/vk.bin --project-name contracts)
circuits-generate-solidity circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo build)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && bb write_vk --scheme ultra_honk --oracle_hash keccak -b ./target/{{circuit}}.json -o ./target/ && cp ./target/vk ./target/vk.bin)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && bb write_solidity_verifier -k ./target/vk -o ./target/Verifier.sol)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo execute witness)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && mkdir -p target/proof && bb prove --scheme ultra_honk --bytecode_path target/{{circuit}}.json --witness_path target/witness.gz --output_path target/proof --oracle_hash keccak --output_format bytes && garaga calldata --system ultra_keccak_honk --vk target/vk --proof target/proof/proof --format array > target/proof/calldata.txt)
# (cd {{CIRCUIT_ROOT}}/{{circuit}} && bb prove_ultra_keccak_honk -b ./target/{{circuit}}.json -w ./target/witness.gz -o target/proof.bin)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && garaga calldata --system ultra_keccak_honk --vk target/vk.bin --proof ./target/proof/proof --format array > calldata.txt)
# (cd {{CIRCUIT_ROOT}}/{{circuit}} && garaga calldata --system ultra_keccak_honk --vk target/vk.bin --proof target/proof.bin --format array > calldata.txt)
circuits-generate-cairo circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo build)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && bb write_vk --scheme ultra_honk --oracle_hash keccak -b ./target/{{circuit}}.json -o ./target/ && cp ./target/vk ./target/vk.bin)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && bb write_solidity_verifier -k ./target/vk -o ./target/Verifier.sol)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo execute witness)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && mkdir -p target/proof && bb prove --scheme ultra_honk --bytecode_path ./target/{{circuit}}.json --witness_path target/witness.gz --output_path target/proof --oracle_hash keccak --output_format bytes && garaga calldata --system ultra_keccak_honk --vk target/vk --proof target/proof/proof --format array > target/proof/calldata.txt)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && garaga calldata --system ultra_keccak_honk --vk ./target/vk.bin --proof ./target/proof/proof --format array > calldata.txt)
(cd {{CIRCUIT_ROOT}}/{{circuit}} && garaga gen --system ultra_keccak_honk --vk ./target/vk.bin --project-name contracts)
# circuits-generate-cairo circuit:
# (cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo build)
# (cd {{CIRCUIT_ROOT}}/{{circuit}} && nargo execute witness)
# (cd {{CIRCUIT_ROOT}}/{{circuit}} && bb write_vk --scheme ultra_honk --oracle_hash keccak -b ./target/{{circuit}}.json -o ./target/ && cp ./target/vk ./target/vk.bin)
# (cd {{CIRCUIT_ROOT}}/{{circuit}} && mkdir -p target/proof && bb prove --scheme ultra_honk --bytecode_path target/{{circuit}}.json --output_path target/proof/proof --oracle_hash keccak --output_format bytes)
# # (cd {{CIRCUIT_ROOT}}/{{circuit}} && mkdir -p target/proof && bb prove --scheme ultra_honk --bytecode_path target/{{circuit}}.json --witness_path -w target/witness.gz --output_path target/proof --oracle_hash keccak --output_format bytes)
# (cd {{CIRCUIT_ROOT}}/{{circuit}} && garaga calldata --system ultra_keccak_honk --vk target/vk --proof target/proof/proof --format array > target/proof/calldata.txt)
# # (cd {{CIRCUIT_ROOT}}/{{circuit}} && garaga calldata --system ultra_keccak_honk --vk target/vk.bin --proof target/proof.bin --format array > calldata.txt)
circuits-declare-verifier circuit:
(cd {{CIRCUIT_ROOT}}/{{circuit}}/contracts && sncast --account deployer declare --url {{RPC_URL}} --contract-name UltraKeccakHonkVerifier --fee-token ETH)
circuits-deploy-verifier circuit class_hash:
(cd {{CIRCUIT_ROOT}}/{{circuit}}/contracts && sncast --account deployer deploy --url {{RPC_URL}} --class-hash {{class_hash}} --fee-token ETH)
devnet:
starknet-devnet --accounts=2 --seed=0 --initial-balance=100000000000000000000000
# contracts
contracts-test:
(cd {{CONTRACTS_ROOT}} && snforge test)
contracts-fmt:
(cd {{CONTRACTS_ROOT}} && scarb fmt)
contracts-declare:
(cd {{CONTRACTS_ROOT}} && sncast --account deployer declare --url {{RPC_URL}} --contract-name Privado --fee-token ETH)
contracts-deploy class_hash:
(cd {{CONTRACTS_ROOT}} && sncast --account deployer deploy --url {{RPC_URL}} --class-hash {{class_hash}} --fee-token ETH)
contracts-deployer-account-create:
(cd {{CONTRACTS_ROOT}} && sncast account create -n deployer --url {{RPC_URL}})
contracts-deployer-account-deploy:
(cd {{CONTRACTS_ROOT}} && sncast account deploy --name deployer --url {{RPC_URL}} --fee-token ETH)