@permissionless-technologies/upp-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +194 -0
  3. package/dist/asp-TXSAFFD3.cjs +53 -0
  4. package/dist/asp-TXSAFFD3.cjs.map +1 -0
  5. package/dist/asp-ZA3RGN7G.js +4 -0
  6. package/dist/asp-ZA3RGN7G.js.map +1 -0
  7. package/dist/babyjubjub-2MGQVCKB.js +5 -0
  8. package/dist/babyjubjub-2MGQVCKB.js.map +1 -0
  9. package/dist/babyjubjub-MWZLJOVZ.cjs +66 -0
  10. package/dist/babyjubjub-MWZLJOVZ.cjs.map +1 -0
  11. package/dist/chunk-2JQISXBD.js +150 -0
  12. package/dist/chunk-2JQISXBD.js.map +1 -0
  13. package/dist/chunk-3HQ7A6ZM.cjs +61 -0
  14. package/dist/chunk-3HQ7A6ZM.cjs.map +1 -0
  15. package/dist/chunk-5AKBSMEQ.cjs +1008 -0
  16. package/dist/chunk-5AKBSMEQ.cjs.map +1 -0
  17. package/dist/chunk-5V5HSN6Y.js +81 -0
  18. package/dist/chunk-5V5HSN6Y.js.map +1 -0
  19. package/dist/chunk-BH24DZ5S.cjs +91 -0
  20. package/dist/chunk-BH24DZ5S.cjs.map +1 -0
  21. package/dist/chunk-C7QQOJ7T.cjs +67 -0
  22. package/dist/chunk-C7QQOJ7T.cjs.map +1 -0
  23. package/dist/chunk-ERQE57IA.cjs +404 -0
  24. package/dist/chunk-ERQE57IA.cjs.map +1 -0
  25. package/dist/chunk-EUP7MBAH.cjs +165 -0
  26. package/dist/chunk-EUP7MBAH.cjs.map +1 -0
  27. package/dist/chunk-G7VZBCD6.cjs +35 -0
  28. package/dist/chunk-G7VZBCD6.cjs.map +1 -0
  29. package/dist/chunk-GQV47S3N.cjs +10 -0
  30. package/dist/chunk-GQV47S3N.cjs.map +1 -0
  31. package/dist/chunk-GXZ3MTCQ.cjs +527 -0
  32. package/dist/chunk-GXZ3MTCQ.cjs.map +1 -0
  33. package/dist/chunk-JWNXBALH.cjs +57 -0
  34. package/dist/chunk-JWNXBALH.cjs.map +1 -0
  35. package/dist/chunk-KIKBPJXJ.cjs +348 -0
  36. package/dist/chunk-KIKBPJXJ.cjs.map +1 -0
  37. package/dist/chunk-NCW4AE7L.js +8 -0
  38. package/dist/chunk-NCW4AE7L.js.map +1 -0
  39. package/dist/chunk-NDM5EJEV.cjs +70 -0
  40. package/dist/chunk-NDM5EJEV.cjs.map +1 -0
  41. package/dist/chunk-NUIQHTSA.js +489 -0
  42. package/dist/chunk-NUIQHTSA.js.map +1 -0
  43. package/dist/chunk-OQDSHMXU.js +1002 -0
  44. package/dist/chunk-OQDSHMXU.js.map +1 -0
  45. package/dist/chunk-P37MRZ73.js +58 -0
  46. package/dist/chunk-P37MRZ73.js.map +1 -0
  47. package/dist/chunk-PWHOUQOZ.js +335 -0
  48. package/dist/chunk-PWHOUQOZ.js.map +1 -0
  49. package/dist/chunk-S4B7GYLN.js +112 -0
  50. package/dist/chunk-S4B7GYLN.js.map +1 -0
  51. package/dist/chunk-SGZZL5AC.js +59 -0
  52. package/dist/chunk-SGZZL5AC.js.map +1 -0
  53. package/dist/chunk-SQKBT2SH.cjs +122 -0
  54. package/dist/chunk-SQKBT2SH.cjs.map +1 -0
  55. package/dist/chunk-TSF6HEVS.cjs +201 -0
  56. package/dist/chunk-TSF6HEVS.cjs.map +1 -0
  57. package/dist/chunk-V23OSL25.js +48 -0
  58. package/dist/chunk-V23OSL25.js.map +1 -0
  59. package/dist/chunk-W77GRBO4.js +53 -0
  60. package/dist/chunk-W77GRBO4.js.map +1 -0
  61. package/dist/chunk-XV72HNHN.js +399 -0
  62. package/dist/chunk-XV72HNHN.js.map +1 -0
  63. package/dist/chunk-YOWDERVC.js +186 -0
  64. package/dist/chunk-YOWDERVC.js.map +1 -0
  65. package/dist/chunk-Z6ZWNWWR.js +30 -0
  66. package/dist/chunk-Z6ZWNWWR.js.map +1 -0
  67. package/dist/chunk-ZKZV6OI3.cjs +165 -0
  68. package/dist/chunk-ZKZV6OI3.cjs.map +1 -0
  69. package/dist/chunk-ZU6J7KMY.js +159 -0
  70. package/dist/chunk-ZU6J7KMY.js.map +1 -0
  71. package/dist/core/index.cjs +300 -0
  72. package/dist/core/index.cjs.map +1 -0
  73. package/dist/core/index.d.cts +9 -0
  74. package/dist/core/index.d.ts +9 -0
  75. package/dist/core/index.js +11 -0
  76. package/dist/core/index.js.map +1 -0
  77. package/dist/index-BBzvvrhG.d.ts +757 -0
  78. package/dist/index-BGvapsJy.d.cts +2811 -0
  79. package/dist/index-C-jSNw6j.d.cts +757 -0
  80. package/dist/index-ChGaGPzP.d.ts +2811 -0
  81. package/dist/index.cjs +3652 -0
  82. package/dist/index.cjs.map +1 -0
  83. package/dist/index.d.cts +12 -0
  84. package/dist/index.d.ts +12 -0
  85. package/dist/index.js +3112 -0
  86. package/dist/index.js.map +1 -0
  87. package/dist/indexer/index.cjs +58 -0
  88. package/dist/indexer/index.cjs.map +1 -0
  89. package/dist/indexer/index.d.cts +206 -0
  90. package/dist/indexer/index.d.ts +206 -0
  91. package/dist/indexer/index.js +5 -0
  92. package/dist/indexer/index.js.map +1 -0
  93. package/dist/keccak-m31-B_AqBbRF.d.cts +70 -0
  94. package/dist/keccak-m31-B_AqBbRF.d.ts +70 -0
  95. package/dist/keys/index.cjs +68 -0
  96. package/dist/keys/index.cjs.map +1 -0
  97. package/dist/keys/index.d.cts +158 -0
  98. package/dist/keys/index.d.ts +158 -0
  99. package/dist/keys/index.js +7 -0
  100. package/dist/keys/index.js.map +1 -0
  101. package/dist/merkle-7KS2EHRF.js +5 -0
  102. package/dist/merkle-7KS2EHRF.js.map +1 -0
  103. package/dist/merkle-HGDC6OB4.cjs +30 -0
  104. package/dist/merkle-HGDC6OB4.cjs.map +1 -0
  105. package/dist/merkle-mteVOlDf.d.cts +188 -0
  106. package/dist/merkle-mteVOlDf.d.ts +188 -0
  107. package/dist/poseidon-UHTJLWQM.js +7 -0
  108. package/dist/poseidon-UHTJLWQM.js.map +1 -0
  109. package/dist/poseidon-WHJSZSNP.cjs +45 -0
  110. package/dist/poseidon-WHJSZSNP.cjs.map +1 -0
  111. package/dist/proof-5OECB3RQ.cjs +45 -0
  112. package/dist/proof-5OECB3RQ.cjs.map +1 -0
  113. package/dist/proof-C4YBP6RY.js +4 -0
  114. package/dist/proof-C4YBP6RY.js.map +1 -0
  115. package/dist/react/index.cjs +2641 -0
  116. package/dist/react/index.cjs.map +1 -0
  117. package/dist/react/index.d.cts +757 -0
  118. package/dist/react/index.d.ts +757 -0
  119. package/dist/react/index.js +2598 -0
  120. package/dist/react/index.js.map +1 -0
  121. package/dist/transfer-2UDHDS7Q.cjs +37 -0
  122. package/dist/transfer-2UDHDS7Q.cjs.map +1 -0
  123. package/dist/transfer-BlmbO-Rd.d.ts +1270 -0
  124. package/dist/transfer-DKZuJnRM.d.cts +1270 -0
  125. package/dist/transfer-KTCXKHS4.js +8 -0
  126. package/dist/transfer-KTCXKHS4.js.map +1 -0
  127. package/dist/types-CJSbxv4q.d.cts +143 -0
  128. package/dist/types-mLybMxNR.d.ts +143 -0
  129. package/dist/utils/index.cjs +178 -0
  130. package/dist/utils/index.cjs.map +1 -0
  131. package/dist/utils/index.d.cts +88 -0
  132. package/dist/utils/index.d.ts +88 -0
  133. package/dist/utils/index.js +9 -0
  134. package/dist/utils/index.js.map +1 -0
  135. package/package.json +119 -0
  136. package/src/contracts/interfaces/IASPRegistry.sol +36 -0
  137. package/src/contracts/interfaces/IUniversalPrivatePool.sol +260 -0
  138. package/src/contracts/interfaces/IVerifiers.sol +68 -0
  139. package/src/deployments/11155111.json +19 -0
  140. package/src/deployments/31337.json +19 -0
package/package.json ADDED
@@ -0,0 +1,119 @@
1
+ {
2
+ "name": "@permissionless-technologies/upp-sdk",
3
+ "version": "0.1.0",
4
+ "description": "Universal Private Pool SDK - Privacy-preserving token operations for any ERC20",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ },
15
+ "./core": {
16
+ "types": "./dist/core/index.d.ts",
17
+ "import": "./dist/core/index.js",
18
+ "require": "./dist/core/index.cjs"
19
+ },
20
+ "./utils": {
21
+ "types": "./dist/utils/index.d.ts",
22
+ "import": "./dist/utils/index.js",
23
+ "require": "./dist/utils/index.cjs"
24
+ },
25
+ "./keys": {
26
+ "types": "./dist/keys/index.d.ts",
27
+ "import": "./dist/keys/index.js",
28
+ "require": "./dist/keys/index.cjs"
29
+ },
30
+ "./react": {
31
+ "types": "./dist/react/index.d.ts",
32
+ "import": "./dist/react/index.js",
33
+ "require": "./dist/react/index.cjs"
34
+ },
35
+ "./indexer": {
36
+ "types": "./dist/indexer/index.d.ts",
37
+ "import": "./dist/indexer/index.js",
38
+ "require": "./dist/indexer/index.cjs"
39
+ },
40
+ "./stwo-prover": {
41
+ "types": "./stwo-prover/pkg/upp_stwo_prover.d.ts",
42
+ "import": "./stwo-prover/pkg/upp_stwo_prover.js"
43
+ }
44
+ },
45
+ "files": [
46
+ "dist",
47
+ "src/deployments/*.json",
48
+ "src/contracts/interfaces/*.sol"
49
+ ],
50
+ "scripts": {
51
+ "build": "tsup",
52
+ "dev": "tsup --watch",
53
+ "test": "vitest",
54
+ "test:run": "vitest run",
55
+ "lint": "eslint src --ext .ts",
56
+ "typecheck": "tsc --noEmit",
57
+ "prepublishOnly": "npm run build",
58
+ "circuits:compile": "node scripts/compile-circuits.js",
59
+ "circuits:setup": "node scripts/setup-circuits.js",
60
+ "circuits:verifiers": "node scripts/generate-verifiers.js",
61
+ "deploy:local": "forge script src/contracts/script/DeployUPP.s.sol:DeployUPPLocal --rpc-url http://localhost:8545 --broadcast --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 && node scripts/extract-deployment.js 31337",
62
+ "deploy:sepolia": "source .env && forge script src/contracts/script/DeployUPP.s.sol:DeployUPPSepolia --rpc-url ${RPC_ENDPOINT_TESTNET} --broadcast --private-key ${PRIVATE_KEY_TESTNET} && node scripts/extract-deployment.js 11155111",
63
+ "extract:deployment": "node scripts/extract-deployment.js",
64
+ "generate:abis": "node scripts/generate-abis.js"
65
+ },
66
+ "keywords": [
67
+ "ethereum",
68
+ "privacy",
69
+ "zk",
70
+ "zero-knowledge",
71
+ "stealth-address",
72
+ "erc20",
73
+ "viem"
74
+ ],
75
+ "author": "",
76
+ "license": "AGPL-3.0-or-later",
77
+ "peerDependencies": {
78
+ "react": "^18.0.0 || ^19.0.0",
79
+ "viem": "^2.0.0",
80
+ "wagmi": "^2.0.0"
81
+ },
82
+ "peerDependenciesMeta": {
83
+ "react": {
84
+ "optional": true
85
+ },
86
+ "wagmi": {
87
+ "optional": true
88
+ }
89
+ },
90
+ "dependencies": {
91
+ "@noble/curves": "^1.4.0",
92
+ "@permissionless-technologies/upc-sdk": "^0.1.0",
93
+ "@zk-kit/lean-imt.sol": "^2.0.1",
94
+ "@zk-kit/poseidon-cipher": "^0.3.0",
95
+ "bech32": "^2.0.0",
96
+ "circomlib": "^2.0.5",
97
+ "circomlibjs": "^0.1.7",
98
+ "poseidon-solidity": "^0.0.5",
99
+ "snarkjs": "^0.7.4"
100
+ },
101
+ "devDependencies": {
102
+ "@rainbow-me/rainbowkit": "^2.0.0",
103
+ "@tanstack/react-query": "^5.0.0",
104
+ "@types/node": "^20.0.0",
105
+ "@types/react": "^18.0.0 || ^19.0.0",
106
+ "@types/react-dom": "^19.2.3",
107
+ "@types/snarkjs": "^0.7.8",
108
+ "eslint": "^8.0.0",
109
+ "react": "^19.0.0",
110
+ "tsup": "^8.0.0",
111
+ "typescript": "^5.0.0",
112
+ "viem": "^2.0.0",
113
+ "vitest": "^1.0.0",
114
+ "wagmi": "^2.0.0"
115
+ },
116
+ "engines": {
117
+ "node": ">=18.0.0"
118
+ }
119
+ }
@@ -0,0 +1,36 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^0.8.20;
3
+
4
+ /// @notice ASP Registry Hub interface
5
+ /// @dev Manages multiple ASP (Association Set Provider) whitelists
6
+ interface IASPRegistryHub {
7
+ /// @notice Check if an ASP root is valid for a given ASP ID
8
+ /// @param aspId The ASP identifier
9
+ /// @param root The claimed ASP Merkle root
10
+ /// @return True if the root is currently valid for that ASP
11
+ function isValidASPRoot(uint256 aspId, uint256 root) external view returns (bool);
12
+
13
+ /// @notice Get current ASP root for an ASP ID
14
+ /// @param aspId The ASP identifier
15
+ /// @return The current root of that ASP's whitelist tree
16
+ function getCurrentRoot(uint256 aspId) external view returns (uint256);
17
+
18
+ /// @notice Register a new ASP
19
+ /// @param name Human-readable name for the ASP
20
+ /// @return aspId The assigned ASP identifier
21
+ function registerASP(string calldata name) external returns (uint256 aspId);
22
+
23
+ /// @notice Update an ASP's root (only ASP operator)
24
+ /// @param aspId The ASP identifier
25
+ /// @param newRoot The new whitelist root
26
+ function updateRoot(uint256 aspId, uint256 newRoot) external;
27
+ }
28
+
29
+ /// @notice Individual ASP information
30
+ struct ASPInfo {
31
+ uint256 id;
32
+ address operator;
33
+ string name;
34
+ uint256 currentRoot;
35
+ uint256 lastUpdated;
36
+ }
@@ -0,0 +1,260 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^0.8.20;
3
+
4
+ /// @notice Interface for the Universal Private Pool
5
+ interface IUniversalPrivatePool {
6
+ // ============ Events ============
7
+
8
+ event CommitmentInserted(
9
+ bytes32 indexed commitment,
10
+ uint256 leafIndex,
11
+ uint256 timestamp
12
+ );
13
+
14
+ event StarkCommitmentInserted(
15
+ uint128 indexed commitment,
16
+ uint256 leafIndex,
17
+ uint256 timestamp
18
+ );
19
+
20
+ event Shielded(
21
+ address indexed token,
22
+ address indexed depositor,
23
+ bytes32 indexed commitment,
24
+ uint256 leafIndex,
25
+ bytes encryptedNote
26
+ );
27
+
28
+ event Transferred(
29
+ bytes32 indexed nullifier,
30
+ bytes32 indexed outputCommitment1,
31
+ bytes32 indexed outputCommitment2,
32
+ bytes encryptedNote1,
33
+ bytes encryptedNote2
34
+ );
35
+
36
+ event Merged(
37
+ bytes32 indexed outputCommitment,
38
+ bytes32 indexed nullifier1,
39
+ bytes32 indexed nullifier2,
40
+ address merger,
41
+ address token
42
+ );
43
+
44
+ event Withdrawn(
45
+ address indexed token,
46
+ address indexed recipient,
47
+ bytes32 indexed nullifier,
48
+ uint256 amount,
49
+ bool isRagequit
50
+ );
51
+
52
+ event JoinSplit(
53
+ bytes32[4] nullifiers,
54
+ bytes32 indexed outputCommitment1,
55
+ bytes32 indexed outputCommitment2,
56
+ bytes encryptedNote1,
57
+ bytes encryptedNote2
58
+ );
59
+
60
+ event MergeTransfer(
61
+ bytes32 indexed nullifier1,
62
+ bytes32 indexed nullifier2,
63
+ bytes32 nullifier3,
64
+ bytes32 nullifier4,
65
+ bytes32 outputCommitment1,
66
+ bytes32 outputCommitment2,
67
+ address merger,
68
+ address token
69
+ );
70
+
71
+ event SwapOrderPlaced(
72
+ bytes32 indexed orderId,
73
+ address indexed sellToken,
74
+ address indexed buyToken,
75
+ uint256 sellAmount,
76
+ uint256 rate,
77
+ uint256 makerAspId,
78
+ uint256 requiredFillerAspId,
79
+ uint256 expiry
80
+ );
81
+
82
+ event SwapOrderFilled(
83
+ bytes32 indexed orderId,
84
+ bytes32 indexed fillerNullifier,
85
+ uint256 takeAmount,
86
+ uint256 giveAmount,
87
+ uint256 fillerAspId
88
+ );
89
+
90
+ event SwapOrderClaimed(
91
+ bytes32 indexed orderId,
92
+ uint256 accumulatedBuyAmount,
93
+ uint256 refundedSellAmount
94
+ );
95
+
96
+ event SwapOrderCancelled(
97
+ bytes32 indexed orderId,
98
+ uint256 refundedSellAmount
99
+ );
100
+
101
+ // ============ Shield ============
102
+
103
+ function shield(
104
+ address token,
105
+ uint256 amount,
106
+ bytes32 commitment,
107
+ bytes calldata encryptedNote
108
+ ) external;
109
+
110
+ function shieldWithPermit(
111
+ address token,
112
+ uint256 amount,
113
+ bytes32 commitment,
114
+ bytes calldata encryptedNote,
115
+ uint256 deadline,
116
+ uint8 v,
117
+ bytes32 r,
118
+ bytes32 s
119
+ ) external;
120
+
121
+ function shieldFor(
122
+ address depositor,
123
+ address token,
124
+ uint256 amount,
125
+ bytes32 commitment,
126
+ bytes calldata encryptedNote
127
+ ) external;
128
+
129
+ // ============ Transfer ============
130
+
131
+ function transfer(
132
+ uint256[8] calldata proof,
133
+ bytes32 nullifier,
134
+ uint256 stateRoot,
135
+ uint256 aspRoot,
136
+ address token,
137
+ bytes32 outputCommitment1,
138
+ bytes32 outputCommitment2,
139
+ bytes calldata encryptedNote1,
140
+ bytes calldata encryptedNote2
141
+ ) external;
142
+
143
+ // ============ Merge ============
144
+
145
+ function merge(
146
+ uint256[8] calldata proof,
147
+ bytes32 nullifier1,
148
+ bytes32 nullifier2,
149
+ uint256 stateRoot,
150
+ address token,
151
+ bytes32 outputCommitment,
152
+ bytes calldata encryptedNote
153
+ ) external;
154
+
155
+ // ============ Withdraw ============
156
+
157
+ function withdraw(
158
+ uint256[8] calldata proof,
159
+ bytes32 nullifier,
160
+ uint256 stateRoot,
161
+ uint256 aspRoot,
162
+ uint256 aspId,
163
+ address token,
164
+ uint256 amount,
165
+ address recipient,
166
+ bool isRagequit
167
+ ) external;
168
+
169
+ // ============ JoinSplit ============
170
+
171
+ function joinSplit(
172
+ uint256[8] calldata proof,
173
+ bytes32[4] calldata nullifiers,
174
+ uint256 stateRoot,
175
+ uint256 aspRoot,
176
+ uint256 aspId,
177
+ address token,
178
+ bytes32 outputCommitment1,
179
+ bytes32 outputCommitment2,
180
+ bytes calldata encryptedNote1,
181
+ bytes calldata encryptedNote2
182
+ ) external;
183
+
184
+ // ============ MergeTransfer ============
185
+
186
+ function mergeTransfer2x2(
187
+ uint256[8] calldata proof,
188
+ bytes32 nullifier1,
189
+ bytes32 nullifier2,
190
+ uint256 stateRoot,
191
+ address token,
192
+ bytes32 outputCommitment1,
193
+ bytes32 outputCommitment2,
194
+ bytes calldata encryptedNote1,
195
+ bytes calldata encryptedNote2
196
+ ) external;
197
+
198
+ function mergeTransfer4x2(
199
+ uint256[8] calldata proof,
200
+ bytes32[4] calldata nullifiers,
201
+ uint256 stateRoot,
202
+ address token,
203
+ bytes32 outputCommitment1,
204
+ bytes32 outputCommitment2,
205
+ bytes calldata encryptedNote1,
206
+ bytes calldata encryptedNote2
207
+ ) external;
208
+
209
+ // ============ Swap ============
210
+
211
+ function swapOrder(
212
+ uint256[8] calldata proof,
213
+ bytes32 nullifier,
214
+ uint256 stateRoot,
215
+ uint256 aspRoot,
216
+ uint256 aspId,
217
+ address sellToken,
218
+ uint256 sellAmount,
219
+ address buyToken,
220
+ uint256 rate,
221
+ uint256 requiredFillerAspId,
222
+ bytes32 cancelKeyHash,
223
+ uint256 expiry
224
+ ) external;
225
+
226
+ function swapFill(
227
+ bytes32 orderId,
228
+ uint256[8] calldata proof,
229
+ bytes32 nullifier,
230
+ uint256 stateRoot,
231
+ uint256 aspRoot,
232
+ uint256 aspId,
233
+ uint256 takeAmount,
234
+ bytes32 fillerOutputCommitment,
235
+ bytes calldata encryptedFillerNote
236
+ ) external;
237
+
238
+ function swapClaim(
239
+ bytes32 orderId,
240
+ bytes32 cancelSecret,
241
+ bytes32 buyOutputCommitment,
242
+ bytes calldata encryptedBuyNote,
243
+ bytes32 refundCommitment,
244
+ bytes calldata encryptedRefundNote
245
+ ) external;
246
+
247
+ function swapCancel(
248
+ bytes32 orderId,
249
+ bytes32 cancelSecret,
250
+ bytes32 refundCommitment,
251
+ bytes calldata encryptedRefundNote
252
+ ) external;
253
+
254
+ // ============ View Functions ============
255
+
256
+ function isKnownRoot(uint256 root) external view returns (bool);
257
+ function nullifierUsed(bytes32 nullifier) external view returns (bool);
258
+ function getMerkleRoot() external view returns (uint256);
259
+ function getMerkleSize() external view returns (uint256);
260
+ }
@@ -0,0 +1,68 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^0.8.20;
3
+
4
+ /// @notice Verifier interface for shield proofs
5
+ interface IShieldVerifier {
6
+ function verifyProof(
7
+ uint256[8] calldata proof,
8
+ uint256[4] calldata pubSignals // [commitment, amount, origin, token]
9
+ ) external view returns (bool);
10
+ }
11
+
12
+ /// @notice Verifier interface for transfer proofs
13
+ interface ITransferVerifier {
14
+ function verifyProof(
15
+ uint256[8] calldata proof,
16
+ uint256[6] calldata pubSignals // [stateRoot, aspRoot, nullifier, outCommitment1, outCommitment2, token]
17
+ ) external view returns (bool);
18
+ }
19
+
20
+ /// @notice Verifier interface for merge proofs (2-in-1-out)
21
+ interface IMergeVerifier {
22
+ function verifyProof(
23
+ uint256[8] calldata proof,
24
+ uint256[6] calldata pubSignals // [stateRoot, nullifier1, nullifier2, outCommitment, merger, token]
25
+ ) external view returns (bool);
26
+ }
27
+
28
+ /// @notice Verifier interface for withdrawal proofs
29
+ interface IWithdrawVerifier {
30
+ function verifyProof(
31
+ uint256[8] calldata proof,
32
+ uint256[7] calldata pubSignals // [stateRoot, aspRoot, nullifier, amount, recipient, token, isRagequit]
33
+ ) external view returns (bool);
34
+ }
35
+
36
+ /// @notice Verifier interface for JoinSplit proofs (4-in-2-out, same origin)
37
+ interface IJoinSplitVerifier {
38
+ function verifyProof(
39
+ uint256[8] calldata proof,
40
+ uint256[9] calldata pubSignals // [stateRoot, aspRoot, nullifier1-4, outCommitment1-2, token]
41
+ ) external view returns (bool);
42
+ }
43
+
44
+ /// @notice Verifier interface for MergeTransfer 2x2 proofs (2-in-2-out, origin changes)
45
+ interface IMergeTransfer2x2Verifier {
46
+ function verifyProof(
47
+ uint256[8] calldata proof,
48
+ uint256[7] calldata pubSignals // [stateRoot, nullifier1-2, outCommitment1-2, merger, token]
49
+ ) external view returns (bool);
50
+ }
51
+
52
+ /// @notice Verifier interface for MergeTransfer 4x2 proofs (4-in-2-out, origin changes)
53
+ interface IMergeTransfer4x2Verifier {
54
+ function verifyProof(
55
+ uint256[8] calldata proof,
56
+ uint256[9] calldata pubSignals // [stateRoot, nullifier1-4, outCommitment1-2, merger, token]
57
+ ) external view returns (bool);
58
+ }
59
+
60
+ /// @notice Verifier interface for Circle STARK withdrawal proofs (post-quantum)
61
+ interface ICircleStarkWithdrawVerifier {
62
+ function verify(bytes calldata proof, bytes32 publicInputsSeed) external view returns (bool);
63
+ }
64
+
65
+ /// @notice Verifier interface for Circle STARK transfer proofs (post-quantum, 1-in-2-out)
66
+ interface ICircleStarkTransferVerifier {
67
+ function verify(bytes calldata proof, bytes32 publicInputsSeed) external view returns (bool);
68
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "UniversalPrivatePool": "0xb111a861cba83b16b9cab613b31b1f0ca03e1996",
3
+ "ASPRegistryHub": "0xfd11c56a23314aa88dfbcc36254f33e5e8b010df",
4
+ "TestToken": "0x93d4baee17a99734d88717ead15f98ef803c4e38",
5
+ "TestToken2": "0xc9169f12033d020a74c89ae8ab25d580846e0910",
6
+ "verifiers": {
7
+ "TransferVerifier": "0xa34bde414650a7cd6dbd2d5a08a09df7b4a5951d",
8
+ "MergeVerifier": "0xd016825bc5aa7dd3b1cad100c1ac291581a1e2c5",
9
+ "WithdrawVerifier": "0x50c624fc273d8e584e46ba9dce2660f5b8c3d3ac",
10
+ "JoinSplitVerifier": "0x6799d8a5d4d8cf82a842270916ba71dbf2d1810f",
11
+ "MergeTransfer2x2Verifier": "0x0cb522e58d10b8c86c10a8cc7f208ed625444579",
12
+ "MergeTransfer4x2Verifier": "0xc22364ff54c102e54c1f44a43284c932983603b6"
13
+ },
14
+ "starkVerifiers": {
15
+ "CircleStarkVerifier": "0xeb2a0cb5a1c4265dd2acbd46060328b87dc8dcce"
16
+ },
17
+ "deployBlock": 10477882,
18
+ "deployTimestamp": 1773936927201
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "UniversalPrivatePool": "0x2279b7a0a67db372996a5fab50d91eaa73d2ebe6",
3
+ "ASPRegistryHub": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512",
4
+ "TestToken": "0x610178da211fef7d417bc0e6fed39f05609ad788",
5
+ "TestToken2": "0xb7f8bc63bbcad18155201308c8f3540b07f84f5e",
6
+ "verifiers": {
7
+ "TransferVerifier": "0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0",
8
+ "MergeVerifier": "0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9",
9
+ "WithdrawVerifier": "0xdc64a140aa3e981100a9beca4e685f962f0cf6c9",
10
+ "JoinSplitVerifier": "0x5fc8d32690cc91d4c39d9d3abcbd16989f875707",
11
+ "MergeTransfer2x2Verifier": "0x0165878a594ca255338adfa4d48449f69242eb8f",
12
+ "MergeTransfer4x2Verifier": "0xa513e6e4b8f2a923d98304ec87f64353c4d5c853"
13
+ },
14
+ "starkVerifiers": {
15
+ "CircleStarkVerifier": "0x0dcd1bf9a1b36ce34237eeafef220932846bcd82"
16
+ },
17
+ "deployBlock": 1,
18
+ "deployTimestamp": 1774604726045
19
+ }