@tokenops/sdk 1.0.0 → 1.1.1
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.
- package/README.md +102 -18
- package/dist/{chunk-HTOMTEA3.cjs → chunk-23F7JIK5.cjs} +2 -2
- package/dist/{chunk-ECT3NL2L.js → chunk-3PQ2RFPC.js} +3 -3
- package/dist/{chunk-OLDGMKW2.cjs → chunk-3ZRHDTEX.cjs} +33 -0
- package/dist/chunk-5KHIQG7Y.cjs +2180 -0
- package/dist/{chunk-T5LVV3KY.cjs → chunk-FPQBFIUW.cjs} +3 -3
- package/dist/{chunk-QIHZVLIK.js → chunk-FXCW7LVB.js} +1 -1
- package/dist/{chunk-K6MFFDBJ.cjs → chunk-G7G75C46.cjs} +6 -6
- package/dist/{chunk-72YGZEQE.js → chunk-IR5AK5U5.js} +6 -8
- package/dist/{chunk-CMRETRZO.js → chunk-ITQBDRWX.js} +1 -1
- package/dist/{chunk-ZHFLRKFY.js → chunk-JJ4R5QXF.js} +1 -1
- package/dist/{chunk-COPFW5Z4.js → chunk-M7V2EDPB.js} +30 -1
- package/dist/{chunk-UOG4PJL5.js → chunk-OQZAZIAS.js} +8 -10
- package/dist/{chunk-SUOG3BQS.cjs → chunk-OYLZEEHF.cjs} +1 -2
- package/dist/chunk-QE7ZONJ2.js +2171 -0
- package/dist/{chunk-62DF53UQ.cjs → chunk-SAGJIEQK.cjs} +7 -9
- package/dist/{chunk-JFR5J4FL.cjs → chunk-SEKC7H5Y.cjs} +8 -8
- package/dist/{chunk-6ECAHP5O.cjs → chunk-SYHXDHWX.cjs} +9 -11
- package/dist/{chunk-QCA7O2Q5.cjs → chunk-W7JHOK7G.cjs} +4 -4
- package/dist/{chunk-52TC6BF7.js → chunk-X56UVEXS.js} +1 -2
- package/dist/{chunk-HGXNRR25.js → chunk-XWDVPV42.js} +2 -2
- package/dist/core/addresses.d.ts +22 -0
- package/dist/core/errors.d.ts +1 -1
- package/dist/core/telemetry.d.ts +0 -3
- package/dist/fhe/operators.d.ts +1 -1
- package/dist/fhe-airdrop/advanced/factory-advanced.d.ts +3 -3
- package/dist/fhe-airdrop/advanced/index.cjs +5 -5
- package/dist/fhe-airdrop/advanced/index.d.cts +2 -2
- package/dist/fhe-airdrop/advanced/index.d.ts +2 -2
- package/dist/fhe-airdrop/advanced/index.js +3 -3
- package/dist/fhe-airdrop/advanced/react/index.cjs +8 -8
- package/dist/fhe-airdrop/advanced/react/index.d.cts +1 -1
- package/dist/fhe-airdrop/advanced/react/index.d.ts +1 -1
- package/dist/fhe-airdrop/advanced/react/index.js +4 -4
- package/dist/fhe-airdrop/factory.d.ts +8 -10
- package/dist/fhe-airdrop/index.cjs +9 -9
- package/dist/fhe-airdrop/index.js +2 -2
- package/dist/fhe-airdrop/react/index.cjs +69 -69
- package/dist/fhe-airdrop/react/index.js +4 -4
- package/dist/fhe-disperse/index.cjs +19 -19
- package/dist/fhe-disperse/index.js +2 -2
- package/dist/fhe-disperse/react/index.cjs +20 -20
- package/dist/fhe-disperse/react/index.js +3 -3
- package/dist/fhe-disperse/react/useSingletonWithdrawTokenFee.d.ts +2 -2
- package/dist/fhe-vesting/advanced/factory-advanced.d.ts +2 -2
- package/dist/fhe-vesting/advanced/index.cjs +5 -5
- package/dist/fhe-vesting/advanced/index.d.cts +2 -2
- package/dist/fhe-vesting/advanced/index.d.ts +2 -2
- package/dist/fhe-vesting/advanced/index.js +3 -3
- package/dist/fhe-vesting/advanced/react/index.cjs +8 -8
- package/dist/fhe-vesting/advanced/react/index.d.cts +1 -1
- package/dist/fhe-vesting/advanced/react/index.d.ts +1 -1
- package/dist/fhe-vesting/advanced/react/index.js +5 -5
- package/dist/fhe-vesting/factory.d.ts +6 -8
- package/dist/fhe-vesting/index.cjs +25 -25
- package/dist/fhe-vesting/index.js +3 -3
- package/dist/fhe-vesting/manager.d.ts +1 -2
- package/dist/fhe-vesting/react/index.cjs +126 -126
- package/dist/fhe-vesting/react/index.js +4 -4
- package/dist/fhe-vesting/react/useManagerWithdrawTokenFee.d.ts +1 -1
- package/dist/fhe-vesting/types.d.ts +0 -2
- package/dist/index.cjs +27 -11
- package/dist/index.js +1 -1
- package/dist/testnet-faucet/abis/confidential-test-token.d.ts +1039 -0
- package/dist/testnet-faucet/abis/index.d.ts +2 -0
- package/dist/testnet-faucet/abis/test-token.d.ts +253 -0
- package/dist/testnet-faucet/errors.d.ts +21 -0
- package/dist/testnet-faucet/faucet.d.ts +173 -0
- package/dist/testnet-faucet/index.cjs +208 -0
- package/dist/testnet-faucet/index.d.cts +8 -0
- package/dist/testnet-faucet/index.d.ts +8 -0
- package/dist/testnet-faucet/index.js +7 -0
- package/dist/testnet-faucet/react/_shared.d.ts +61 -0
- package/dist/testnet-faucet/react/index.cjs +379 -0
- package/dist/testnet-faucet/react/index.d.cts +38 -0
- package/dist/testnet-faucet/react/index.d.ts +38 -0
- package/dist/testnet-faucet/react/index.js +219 -0
- package/dist/testnet-faucet/react/useConfidentialBalance.d.ts +24 -0
- package/dist/testnet-faucet/react/useFaucetDecimals.d.ts +9 -0
- package/dist/testnet-faucet/react/useFaucetMetadata.d.ts +14 -0
- package/dist/testnet-faucet/react/useFaucetRate.d.ts +11 -0
- package/dist/testnet-faucet/react/useInferredTotalSupply.d.ts +11 -0
- package/dist/testnet-faucet/react/useMaxTotalSupply.d.ts +10 -0
- package/dist/testnet-faucet/react/useMintConfidential.d.ts +35 -0
- package/dist/testnet-faucet/react/useMintUnderlying.d.ts +31 -0
- package/dist/testnet-faucet/react/useUnderlyingBalance.d.ts +19 -0
- package/dist/testnet-faucet/react/useUnderlyingDecimals.d.ts +9 -0
- package/dist/testnet-faucet/react/useUnderlyingTokenAddress.d.ts +12 -0
- package/dist/testnet-faucet/types.d.ts +92 -0
- package/dist/testnet-faucet/validate.d.ts +44 -0
- package/package.json +77 -29
|
@@ -0,0 +1,2180 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkVDXVNZCO_cjs = require('./chunk-VDXVNZCO.cjs');
|
|
4
|
+
var chunk3ZRHDTEX_cjs = require('./chunk-3ZRHDTEX.cjs');
|
|
5
|
+
var chunkCQIPRNS7_cjs = require('./chunk-CQIPRNS7.cjs');
|
|
6
|
+
var chunkVJKZWYYJ_cjs = require('./chunk-VJKZWYYJ.cjs');
|
|
7
|
+
var chunk66IHPTOK_cjs = require('./chunk-66IHPTOK.cjs');
|
|
8
|
+
var chunk56UI7LUR_cjs = require('./chunk-56UI7LUR.cjs');
|
|
9
|
+
var chains = require('viem/chains');
|
|
10
|
+
var viem = require('viem');
|
|
11
|
+
|
|
12
|
+
// src/testnet-faucet/abis/confidential-test-token.ts
|
|
13
|
+
var confidentialTokenopsTestTokenAbi = [
|
|
14
|
+
{
|
|
15
|
+
inputs: [],
|
|
16
|
+
stateMutability: "nonpayable",
|
|
17
|
+
type: "constructor"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
inputs: [
|
|
21
|
+
{
|
|
22
|
+
internalType: "address",
|
|
23
|
+
name: "target",
|
|
24
|
+
type: "address"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
name: "AddressEmptyCode",
|
|
28
|
+
type: "error"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
inputs: [
|
|
32
|
+
{
|
|
33
|
+
internalType: "address",
|
|
34
|
+
name: "implementation",
|
|
35
|
+
type: "address"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
name: "ERC1967InvalidImplementation",
|
|
39
|
+
type: "error"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
inputs: [],
|
|
43
|
+
name: "ERC1967NonPayable",
|
|
44
|
+
type: "error"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
inputs: [
|
|
48
|
+
{
|
|
49
|
+
internalType: "address",
|
|
50
|
+
name: "receiver",
|
|
51
|
+
type: "address"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
name: "ERC7984InvalidReceiver",
|
|
55
|
+
type: "error"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
inputs: [
|
|
59
|
+
{
|
|
60
|
+
internalType: "address",
|
|
61
|
+
name: "receiver",
|
|
62
|
+
type: "address"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
name: "ERC7984InvalidReceiver",
|
|
66
|
+
type: "error"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
inputs: [
|
|
70
|
+
{
|
|
71
|
+
internalType: "address",
|
|
72
|
+
name: "sender",
|
|
73
|
+
type: "address"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
name: "ERC7984InvalidSender",
|
|
77
|
+
type: "error"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
inputs: [],
|
|
81
|
+
name: "ERC7984TotalSupplyOverflow",
|
|
82
|
+
type: "error"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
inputs: [
|
|
86
|
+
{
|
|
87
|
+
internalType: "address",
|
|
88
|
+
name: "caller",
|
|
89
|
+
type: "address"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
name: "ERC7984UnauthorizedCaller",
|
|
93
|
+
type: "error"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
inputs: [
|
|
97
|
+
{
|
|
98
|
+
internalType: "address",
|
|
99
|
+
name: "holder",
|
|
100
|
+
type: "address"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
internalType: "address",
|
|
104
|
+
name: "spender",
|
|
105
|
+
type: "address"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
name: "ERC7984UnauthorizedSpender",
|
|
109
|
+
type: "error"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
inputs: [
|
|
113
|
+
{
|
|
114
|
+
internalType: "euint64",
|
|
115
|
+
name: "amount",
|
|
116
|
+
type: "bytes32"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
internalType: "address",
|
|
120
|
+
name: "user",
|
|
121
|
+
type: "address"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
name: "ERC7984UnauthorizedUseOfEncryptedAmount",
|
|
125
|
+
type: "error"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
inputs: [
|
|
129
|
+
{
|
|
130
|
+
internalType: "address",
|
|
131
|
+
name: "holder",
|
|
132
|
+
type: "address"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
name: "ERC7984ZeroBalance",
|
|
136
|
+
type: "error"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
inputs: [],
|
|
140
|
+
name: "FailedCall",
|
|
141
|
+
type: "error"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
inputs: [],
|
|
145
|
+
name: "InvalidInitialization",
|
|
146
|
+
type: "error"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
inputs: [],
|
|
150
|
+
name: "InvalidKMSSignatures",
|
|
151
|
+
type: "error"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
inputs: [
|
|
155
|
+
{
|
|
156
|
+
internalType: "bytes32",
|
|
157
|
+
name: "unwrapRequestId",
|
|
158
|
+
type: "bytes32"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
name: "InvalidUnwrapRequest",
|
|
162
|
+
type: "error"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
inputs: [],
|
|
166
|
+
name: "NotInitializing",
|
|
167
|
+
type: "error"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
inputs: [
|
|
171
|
+
{
|
|
172
|
+
internalType: "address",
|
|
173
|
+
name: "owner",
|
|
174
|
+
type: "address"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
name: "OwnableInvalidOwner",
|
|
178
|
+
type: "error"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
inputs: [
|
|
182
|
+
{
|
|
183
|
+
internalType: "address",
|
|
184
|
+
name: "account",
|
|
185
|
+
type: "address"
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
name: "OwnableUnauthorizedAccount",
|
|
189
|
+
type: "error"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
inputs: [
|
|
193
|
+
{
|
|
194
|
+
internalType: "uint8",
|
|
195
|
+
name: "bits",
|
|
196
|
+
type: "uint8"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
internalType: "uint256",
|
|
200
|
+
name: "value",
|
|
201
|
+
type: "uint256"
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
name: "SafeCastOverflowedUintDowncast",
|
|
205
|
+
type: "error"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
inputs: [
|
|
209
|
+
{
|
|
210
|
+
internalType: "address",
|
|
211
|
+
name: "token",
|
|
212
|
+
type: "address"
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
name: "SafeERC20FailedOperation",
|
|
216
|
+
type: "error"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
inputs: [
|
|
220
|
+
{
|
|
221
|
+
internalType: "bytes32",
|
|
222
|
+
name: "handle",
|
|
223
|
+
type: "bytes32"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
internalType: "address",
|
|
227
|
+
name: "sender",
|
|
228
|
+
type: "address"
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
name: "SenderNotAllowedToUseHandle",
|
|
232
|
+
type: "error"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
inputs: [],
|
|
236
|
+
name: "UUPSUnauthorizedCallContext",
|
|
237
|
+
type: "error"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
inputs: [
|
|
241
|
+
{
|
|
242
|
+
internalType: "bytes32",
|
|
243
|
+
name: "slot",
|
|
244
|
+
type: "bytes32"
|
|
245
|
+
}
|
|
246
|
+
],
|
|
247
|
+
name: "UUPSUnsupportedProxiableUUID",
|
|
248
|
+
type: "error"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
inputs: [],
|
|
252
|
+
name: "ZamaProtocolUnsupported",
|
|
253
|
+
type: "error"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
anonymous: false,
|
|
257
|
+
inputs: [
|
|
258
|
+
{
|
|
259
|
+
indexed: true,
|
|
260
|
+
internalType: "euint64",
|
|
261
|
+
name: "encryptedAmount",
|
|
262
|
+
type: "bytes32"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
indexed: true,
|
|
266
|
+
internalType: "address",
|
|
267
|
+
name: "requester",
|
|
268
|
+
type: "address"
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
name: "AmountDiscloseRequested",
|
|
272
|
+
type: "event"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
anonymous: false,
|
|
276
|
+
inputs: [
|
|
277
|
+
{
|
|
278
|
+
indexed: true,
|
|
279
|
+
internalType: "euint64",
|
|
280
|
+
name: "encryptedAmount",
|
|
281
|
+
type: "bytes32"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
indexed: false,
|
|
285
|
+
internalType: "uint64",
|
|
286
|
+
name: "amount",
|
|
287
|
+
type: "uint64"
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
name: "AmountDisclosed",
|
|
291
|
+
type: "event"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
anonymous: false,
|
|
295
|
+
inputs: [
|
|
296
|
+
{
|
|
297
|
+
indexed: true,
|
|
298
|
+
internalType: "address",
|
|
299
|
+
name: "to",
|
|
300
|
+
type: "address"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
indexed: false,
|
|
304
|
+
internalType: "uint256",
|
|
305
|
+
name: "underlyingMinted",
|
|
306
|
+
type: "uint256"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
indexed: false,
|
|
310
|
+
internalType: "euint64",
|
|
311
|
+
name: "encryptedAmount",
|
|
312
|
+
type: "bytes32"
|
|
313
|
+
}
|
|
314
|
+
],
|
|
315
|
+
name: "ConfidentialMint",
|
|
316
|
+
type: "event"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
anonymous: false,
|
|
320
|
+
inputs: [
|
|
321
|
+
{
|
|
322
|
+
indexed: true,
|
|
323
|
+
internalType: "address",
|
|
324
|
+
name: "from",
|
|
325
|
+
type: "address"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
indexed: true,
|
|
329
|
+
internalType: "address",
|
|
330
|
+
name: "to",
|
|
331
|
+
type: "address"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
indexed: true,
|
|
335
|
+
internalType: "euint64",
|
|
336
|
+
name: "amount",
|
|
337
|
+
type: "bytes32"
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
name: "ConfidentialTransfer",
|
|
341
|
+
type: "event"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
anonymous: false,
|
|
345
|
+
inputs: [
|
|
346
|
+
{
|
|
347
|
+
indexed: false,
|
|
348
|
+
internalType: "uint64",
|
|
349
|
+
name: "version",
|
|
350
|
+
type: "uint64"
|
|
351
|
+
}
|
|
352
|
+
],
|
|
353
|
+
name: "Initialized",
|
|
354
|
+
type: "event"
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
anonymous: false,
|
|
358
|
+
inputs: [
|
|
359
|
+
{
|
|
360
|
+
indexed: true,
|
|
361
|
+
internalType: "address",
|
|
362
|
+
name: "holder",
|
|
363
|
+
type: "address"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
indexed: true,
|
|
367
|
+
internalType: "address",
|
|
368
|
+
name: "operator",
|
|
369
|
+
type: "address"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
indexed: false,
|
|
373
|
+
internalType: "uint48",
|
|
374
|
+
name: "until",
|
|
375
|
+
type: "uint48"
|
|
376
|
+
}
|
|
377
|
+
],
|
|
378
|
+
name: "OperatorSet",
|
|
379
|
+
type: "event"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
anonymous: false,
|
|
383
|
+
inputs: [
|
|
384
|
+
{
|
|
385
|
+
indexed: true,
|
|
386
|
+
internalType: "address",
|
|
387
|
+
name: "previousOwner",
|
|
388
|
+
type: "address"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
indexed: true,
|
|
392
|
+
internalType: "address",
|
|
393
|
+
name: "newOwner",
|
|
394
|
+
type: "address"
|
|
395
|
+
}
|
|
396
|
+
],
|
|
397
|
+
name: "OwnershipTransferStarted",
|
|
398
|
+
type: "event"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
anonymous: false,
|
|
402
|
+
inputs: [
|
|
403
|
+
{
|
|
404
|
+
indexed: true,
|
|
405
|
+
internalType: "address",
|
|
406
|
+
name: "previousOwner",
|
|
407
|
+
type: "address"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
indexed: true,
|
|
411
|
+
internalType: "address",
|
|
412
|
+
name: "newOwner",
|
|
413
|
+
type: "address"
|
|
414
|
+
}
|
|
415
|
+
],
|
|
416
|
+
name: "OwnershipTransferred",
|
|
417
|
+
type: "event"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
anonymous: false,
|
|
421
|
+
inputs: [
|
|
422
|
+
{
|
|
423
|
+
indexed: false,
|
|
424
|
+
internalType: "bytes32[]",
|
|
425
|
+
name: "handlesList",
|
|
426
|
+
type: "bytes32[]"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
indexed: false,
|
|
430
|
+
internalType: "bytes",
|
|
431
|
+
name: "abiEncodedCleartexts",
|
|
432
|
+
type: "bytes"
|
|
433
|
+
}
|
|
434
|
+
],
|
|
435
|
+
name: "PublicDecryptionVerified",
|
|
436
|
+
type: "event"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
anonymous: false,
|
|
440
|
+
inputs: [
|
|
441
|
+
{
|
|
442
|
+
indexed: true,
|
|
443
|
+
internalType: "address",
|
|
444
|
+
name: "receiver",
|
|
445
|
+
type: "address"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
indexed: true,
|
|
449
|
+
internalType: "bytes32",
|
|
450
|
+
name: "unwrapRequestId",
|
|
451
|
+
type: "bytes32"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
indexed: false,
|
|
455
|
+
internalType: "euint64",
|
|
456
|
+
name: "encryptedAmount",
|
|
457
|
+
type: "bytes32"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
indexed: false,
|
|
461
|
+
internalType: "uint64",
|
|
462
|
+
name: "cleartextAmount",
|
|
463
|
+
type: "uint64"
|
|
464
|
+
}
|
|
465
|
+
],
|
|
466
|
+
name: "UnwrapFinalized",
|
|
467
|
+
type: "event"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
anonymous: false,
|
|
471
|
+
inputs: [
|
|
472
|
+
{
|
|
473
|
+
indexed: true,
|
|
474
|
+
internalType: "address",
|
|
475
|
+
name: "receiver",
|
|
476
|
+
type: "address"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
indexed: true,
|
|
480
|
+
internalType: "bytes32",
|
|
481
|
+
name: "unwrapRequestId",
|
|
482
|
+
type: "bytes32"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
indexed: false,
|
|
486
|
+
internalType: "euint64",
|
|
487
|
+
name: "amount",
|
|
488
|
+
type: "bytes32"
|
|
489
|
+
}
|
|
490
|
+
],
|
|
491
|
+
name: "UnwrapRequested",
|
|
492
|
+
type: "event"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
anonymous: false,
|
|
496
|
+
inputs: [
|
|
497
|
+
{
|
|
498
|
+
indexed: true,
|
|
499
|
+
internalType: "address",
|
|
500
|
+
name: "implementation",
|
|
501
|
+
type: "address"
|
|
502
|
+
}
|
|
503
|
+
],
|
|
504
|
+
name: "Upgraded",
|
|
505
|
+
type: "event"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
anonymous: false,
|
|
509
|
+
inputs: [
|
|
510
|
+
{
|
|
511
|
+
indexed: true,
|
|
512
|
+
internalType: "address",
|
|
513
|
+
name: "to",
|
|
514
|
+
type: "address"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
indexed: false,
|
|
518
|
+
internalType: "uint256",
|
|
519
|
+
name: "roundedAmount",
|
|
520
|
+
type: "uint256"
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
indexed: false,
|
|
524
|
+
internalType: "euint64",
|
|
525
|
+
name: "encryptedWrappedAmount",
|
|
526
|
+
type: "bytes32"
|
|
527
|
+
}
|
|
528
|
+
],
|
|
529
|
+
name: "Wrap",
|
|
530
|
+
type: "event"
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
inputs: [],
|
|
534
|
+
name: "UPGRADE_INTERFACE_VERSION",
|
|
535
|
+
outputs: [
|
|
536
|
+
{
|
|
537
|
+
internalType: "string",
|
|
538
|
+
name: "",
|
|
539
|
+
type: "string"
|
|
540
|
+
}
|
|
541
|
+
],
|
|
542
|
+
stateMutability: "view",
|
|
543
|
+
type: "function"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
inputs: [],
|
|
547
|
+
name: "acceptOwnership",
|
|
548
|
+
outputs: [],
|
|
549
|
+
stateMutability: "nonpayable",
|
|
550
|
+
type: "function"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
inputs: [
|
|
554
|
+
{
|
|
555
|
+
internalType: "address",
|
|
556
|
+
name: "account",
|
|
557
|
+
type: "address"
|
|
558
|
+
}
|
|
559
|
+
],
|
|
560
|
+
name: "confidentialBalanceOf",
|
|
561
|
+
outputs: [
|
|
562
|
+
{
|
|
563
|
+
internalType: "euint64",
|
|
564
|
+
name: "",
|
|
565
|
+
type: "bytes32"
|
|
566
|
+
}
|
|
567
|
+
],
|
|
568
|
+
stateMutability: "view",
|
|
569
|
+
type: "function"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
inputs: [],
|
|
573
|
+
name: "confidentialProtocolId",
|
|
574
|
+
outputs: [
|
|
575
|
+
{
|
|
576
|
+
internalType: "uint256",
|
|
577
|
+
name: "",
|
|
578
|
+
type: "uint256"
|
|
579
|
+
}
|
|
580
|
+
],
|
|
581
|
+
stateMutability: "view",
|
|
582
|
+
type: "function"
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
inputs: [],
|
|
586
|
+
name: "confidentialTotalSupply",
|
|
587
|
+
outputs: [
|
|
588
|
+
{
|
|
589
|
+
internalType: "euint64",
|
|
590
|
+
name: "",
|
|
591
|
+
type: "bytes32"
|
|
592
|
+
}
|
|
593
|
+
],
|
|
594
|
+
stateMutability: "view",
|
|
595
|
+
type: "function"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
inputs: [
|
|
599
|
+
{
|
|
600
|
+
internalType: "address",
|
|
601
|
+
name: "to",
|
|
602
|
+
type: "address"
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
internalType: "externalEuint64",
|
|
606
|
+
name: "encryptedAmount",
|
|
607
|
+
type: "bytes32"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
internalType: "bytes",
|
|
611
|
+
name: "inputProof",
|
|
612
|
+
type: "bytes"
|
|
613
|
+
}
|
|
614
|
+
],
|
|
615
|
+
name: "confidentialTransfer",
|
|
616
|
+
outputs: [
|
|
617
|
+
{
|
|
618
|
+
internalType: "euint64",
|
|
619
|
+
name: "",
|
|
620
|
+
type: "bytes32"
|
|
621
|
+
}
|
|
622
|
+
],
|
|
623
|
+
stateMutability: "nonpayable",
|
|
624
|
+
type: "function"
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
inputs: [
|
|
628
|
+
{
|
|
629
|
+
internalType: "address",
|
|
630
|
+
name: "to",
|
|
631
|
+
type: "address"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
internalType: "euint64",
|
|
635
|
+
name: "amount",
|
|
636
|
+
type: "bytes32"
|
|
637
|
+
}
|
|
638
|
+
],
|
|
639
|
+
name: "confidentialTransfer",
|
|
640
|
+
outputs: [
|
|
641
|
+
{
|
|
642
|
+
internalType: "euint64",
|
|
643
|
+
name: "",
|
|
644
|
+
type: "bytes32"
|
|
645
|
+
}
|
|
646
|
+
],
|
|
647
|
+
stateMutability: "nonpayable",
|
|
648
|
+
type: "function"
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
inputs: [
|
|
652
|
+
{
|
|
653
|
+
internalType: "address",
|
|
654
|
+
name: "to",
|
|
655
|
+
type: "address"
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
internalType: "euint64",
|
|
659
|
+
name: "amount",
|
|
660
|
+
type: "bytes32"
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
internalType: "bytes",
|
|
664
|
+
name: "data",
|
|
665
|
+
type: "bytes"
|
|
666
|
+
}
|
|
667
|
+
],
|
|
668
|
+
name: "confidentialTransferAndCall",
|
|
669
|
+
outputs: [
|
|
670
|
+
{
|
|
671
|
+
internalType: "euint64",
|
|
672
|
+
name: "transferred",
|
|
673
|
+
type: "bytes32"
|
|
674
|
+
}
|
|
675
|
+
],
|
|
676
|
+
stateMutability: "nonpayable",
|
|
677
|
+
type: "function"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
inputs: [
|
|
681
|
+
{
|
|
682
|
+
internalType: "address",
|
|
683
|
+
name: "to",
|
|
684
|
+
type: "address"
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
internalType: "externalEuint64",
|
|
688
|
+
name: "encryptedAmount",
|
|
689
|
+
type: "bytes32"
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
internalType: "bytes",
|
|
693
|
+
name: "inputProof",
|
|
694
|
+
type: "bytes"
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
internalType: "bytes",
|
|
698
|
+
name: "data",
|
|
699
|
+
type: "bytes"
|
|
700
|
+
}
|
|
701
|
+
],
|
|
702
|
+
name: "confidentialTransferAndCall",
|
|
703
|
+
outputs: [
|
|
704
|
+
{
|
|
705
|
+
internalType: "euint64",
|
|
706
|
+
name: "transferred",
|
|
707
|
+
type: "bytes32"
|
|
708
|
+
}
|
|
709
|
+
],
|
|
710
|
+
stateMutability: "nonpayable",
|
|
711
|
+
type: "function"
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
inputs: [
|
|
715
|
+
{
|
|
716
|
+
internalType: "address",
|
|
717
|
+
name: "from",
|
|
718
|
+
type: "address"
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
internalType: "address",
|
|
722
|
+
name: "to",
|
|
723
|
+
type: "address"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
internalType: "externalEuint64",
|
|
727
|
+
name: "encryptedAmount",
|
|
728
|
+
type: "bytes32"
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
internalType: "bytes",
|
|
732
|
+
name: "inputProof",
|
|
733
|
+
type: "bytes"
|
|
734
|
+
}
|
|
735
|
+
],
|
|
736
|
+
name: "confidentialTransferFrom",
|
|
737
|
+
outputs: [
|
|
738
|
+
{
|
|
739
|
+
internalType: "euint64",
|
|
740
|
+
name: "transferred",
|
|
741
|
+
type: "bytes32"
|
|
742
|
+
}
|
|
743
|
+
],
|
|
744
|
+
stateMutability: "nonpayable",
|
|
745
|
+
type: "function"
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
inputs: [
|
|
749
|
+
{
|
|
750
|
+
internalType: "address",
|
|
751
|
+
name: "from",
|
|
752
|
+
type: "address"
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
internalType: "address",
|
|
756
|
+
name: "to",
|
|
757
|
+
type: "address"
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
internalType: "euint64",
|
|
761
|
+
name: "amount",
|
|
762
|
+
type: "bytes32"
|
|
763
|
+
}
|
|
764
|
+
],
|
|
765
|
+
name: "confidentialTransferFrom",
|
|
766
|
+
outputs: [
|
|
767
|
+
{
|
|
768
|
+
internalType: "euint64",
|
|
769
|
+
name: "transferred",
|
|
770
|
+
type: "bytes32"
|
|
771
|
+
}
|
|
772
|
+
],
|
|
773
|
+
stateMutability: "nonpayable",
|
|
774
|
+
type: "function"
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
inputs: [
|
|
778
|
+
{
|
|
779
|
+
internalType: "address",
|
|
780
|
+
name: "from",
|
|
781
|
+
type: "address"
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
internalType: "address",
|
|
785
|
+
name: "to",
|
|
786
|
+
type: "address"
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
internalType: "externalEuint64",
|
|
790
|
+
name: "encryptedAmount",
|
|
791
|
+
type: "bytes32"
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
internalType: "bytes",
|
|
795
|
+
name: "inputProof",
|
|
796
|
+
type: "bytes"
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
internalType: "bytes",
|
|
800
|
+
name: "data",
|
|
801
|
+
type: "bytes"
|
|
802
|
+
}
|
|
803
|
+
],
|
|
804
|
+
name: "confidentialTransferFromAndCall",
|
|
805
|
+
outputs: [
|
|
806
|
+
{
|
|
807
|
+
internalType: "euint64",
|
|
808
|
+
name: "transferred",
|
|
809
|
+
type: "bytes32"
|
|
810
|
+
}
|
|
811
|
+
],
|
|
812
|
+
stateMutability: "nonpayable",
|
|
813
|
+
type: "function"
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
inputs: [
|
|
817
|
+
{
|
|
818
|
+
internalType: "address",
|
|
819
|
+
name: "from",
|
|
820
|
+
type: "address"
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
internalType: "address",
|
|
824
|
+
name: "to",
|
|
825
|
+
type: "address"
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
internalType: "euint64",
|
|
829
|
+
name: "amount",
|
|
830
|
+
type: "bytes32"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
internalType: "bytes",
|
|
834
|
+
name: "data",
|
|
835
|
+
type: "bytes"
|
|
836
|
+
}
|
|
837
|
+
],
|
|
838
|
+
name: "confidentialTransferFromAndCall",
|
|
839
|
+
outputs: [
|
|
840
|
+
{
|
|
841
|
+
internalType: "euint64",
|
|
842
|
+
name: "transferred",
|
|
843
|
+
type: "bytes32"
|
|
844
|
+
}
|
|
845
|
+
],
|
|
846
|
+
stateMutability: "nonpayable",
|
|
847
|
+
type: "function"
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
inputs: [],
|
|
851
|
+
name: "contractURI",
|
|
852
|
+
outputs: [
|
|
853
|
+
{
|
|
854
|
+
internalType: "string",
|
|
855
|
+
name: "",
|
|
856
|
+
type: "string"
|
|
857
|
+
}
|
|
858
|
+
],
|
|
859
|
+
stateMutability: "view",
|
|
860
|
+
type: "function"
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
inputs: [],
|
|
864
|
+
name: "decimals",
|
|
865
|
+
outputs: [
|
|
866
|
+
{
|
|
867
|
+
internalType: "uint8",
|
|
868
|
+
name: "",
|
|
869
|
+
type: "uint8"
|
|
870
|
+
}
|
|
871
|
+
],
|
|
872
|
+
stateMutability: "view",
|
|
873
|
+
type: "function"
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
inputs: [
|
|
877
|
+
{
|
|
878
|
+
internalType: "euint64",
|
|
879
|
+
name: "encryptedAmount",
|
|
880
|
+
type: "bytes32"
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
internalType: "uint64",
|
|
884
|
+
name: "cleartextAmount",
|
|
885
|
+
type: "uint64"
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
internalType: "bytes",
|
|
889
|
+
name: "decryptionProof",
|
|
890
|
+
type: "bytes"
|
|
891
|
+
}
|
|
892
|
+
],
|
|
893
|
+
name: "discloseEncryptedAmount",
|
|
894
|
+
outputs: [],
|
|
895
|
+
stateMutability: "nonpayable",
|
|
896
|
+
type: "function"
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
inputs: [
|
|
900
|
+
{
|
|
901
|
+
internalType: "bytes32",
|
|
902
|
+
name: "unwrapRequestId",
|
|
903
|
+
type: "bytes32"
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
internalType: "uint64",
|
|
907
|
+
name: "unwrapAmountCleartext",
|
|
908
|
+
type: "uint64"
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
internalType: "bytes",
|
|
912
|
+
name: "decryptionProof",
|
|
913
|
+
type: "bytes"
|
|
914
|
+
}
|
|
915
|
+
],
|
|
916
|
+
name: "finalizeUnwrap",
|
|
917
|
+
outputs: [],
|
|
918
|
+
stateMutability: "nonpayable",
|
|
919
|
+
type: "function"
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
inputs: [],
|
|
923
|
+
name: "inferredTotalSupply",
|
|
924
|
+
outputs: [
|
|
925
|
+
{
|
|
926
|
+
internalType: "uint256",
|
|
927
|
+
name: "",
|
|
928
|
+
type: "uint256"
|
|
929
|
+
}
|
|
930
|
+
],
|
|
931
|
+
stateMutability: "view",
|
|
932
|
+
type: "function"
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
inputs: [
|
|
936
|
+
{
|
|
937
|
+
internalType: "string",
|
|
938
|
+
name: "name_",
|
|
939
|
+
type: "string"
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
internalType: "string",
|
|
943
|
+
name: "symbol_",
|
|
944
|
+
type: "string"
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
internalType: "string",
|
|
948
|
+
name: "contractURI_",
|
|
949
|
+
type: "string"
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
internalType: "contract IERC20",
|
|
953
|
+
name: "underlying_",
|
|
954
|
+
type: "address"
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
internalType: "address",
|
|
958
|
+
name: "owner_",
|
|
959
|
+
type: "address"
|
|
960
|
+
}
|
|
961
|
+
],
|
|
962
|
+
name: "initialize",
|
|
963
|
+
outputs: [],
|
|
964
|
+
stateMutability: "nonpayable",
|
|
965
|
+
type: "function"
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
inputs: [
|
|
969
|
+
{
|
|
970
|
+
internalType: "address",
|
|
971
|
+
name: "holder",
|
|
972
|
+
type: "address"
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
internalType: "address",
|
|
976
|
+
name: "spender",
|
|
977
|
+
type: "address"
|
|
978
|
+
}
|
|
979
|
+
],
|
|
980
|
+
name: "isOperator",
|
|
981
|
+
outputs: [
|
|
982
|
+
{
|
|
983
|
+
internalType: "bool",
|
|
984
|
+
name: "",
|
|
985
|
+
type: "bool"
|
|
986
|
+
}
|
|
987
|
+
],
|
|
988
|
+
stateMutability: "view",
|
|
989
|
+
type: "function"
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
inputs: [],
|
|
993
|
+
name: "maxTotalSupply",
|
|
994
|
+
outputs: [
|
|
995
|
+
{
|
|
996
|
+
internalType: "uint256",
|
|
997
|
+
name: "",
|
|
998
|
+
type: "uint256"
|
|
999
|
+
}
|
|
1000
|
+
],
|
|
1001
|
+
stateMutability: "view",
|
|
1002
|
+
type: "function"
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
inputs: [
|
|
1006
|
+
{
|
|
1007
|
+
internalType: "address",
|
|
1008
|
+
name: "to",
|
|
1009
|
+
type: "address"
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
internalType: "uint64",
|
|
1013
|
+
name: "amount",
|
|
1014
|
+
type: "uint64"
|
|
1015
|
+
}
|
|
1016
|
+
],
|
|
1017
|
+
name: "mint",
|
|
1018
|
+
outputs: [
|
|
1019
|
+
{
|
|
1020
|
+
internalType: "euint64",
|
|
1021
|
+
name: "minted",
|
|
1022
|
+
type: "bytes32"
|
|
1023
|
+
}
|
|
1024
|
+
],
|
|
1025
|
+
stateMutability: "nonpayable",
|
|
1026
|
+
type: "function"
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
inputs: [],
|
|
1030
|
+
name: "name",
|
|
1031
|
+
outputs: [
|
|
1032
|
+
{
|
|
1033
|
+
internalType: "string",
|
|
1034
|
+
name: "",
|
|
1035
|
+
type: "string"
|
|
1036
|
+
}
|
|
1037
|
+
],
|
|
1038
|
+
stateMutability: "view",
|
|
1039
|
+
type: "function"
|
|
1040
|
+
},
|
|
1041
|
+
{
|
|
1042
|
+
inputs: [
|
|
1043
|
+
{
|
|
1044
|
+
internalType: "address",
|
|
1045
|
+
name: "",
|
|
1046
|
+
type: "address"
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
internalType: "address",
|
|
1050
|
+
name: "from",
|
|
1051
|
+
type: "address"
|
|
1052
|
+
},
|
|
1053
|
+
{
|
|
1054
|
+
internalType: "uint256",
|
|
1055
|
+
name: "amount",
|
|
1056
|
+
type: "uint256"
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
internalType: "bytes",
|
|
1060
|
+
name: "data",
|
|
1061
|
+
type: "bytes"
|
|
1062
|
+
}
|
|
1063
|
+
],
|
|
1064
|
+
name: "onTransferReceived",
|
|
1065
|
+
outputs: [
|
|
1066
|
+
{
|
|
1067
|
+
internalType: "bytes4",
|
|
1068
|
+
name: "",
|
|
1069
|
+
type: "bytes4"
|
|
1070
|
+
}
|
|
1071
|
+
],
|
|
1072
|
+
stateMutability: "nonpayable",
|
|
1073
|
+
type: "function"
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
inputs: [],
|
|
1077
|
+
name: "owner",
|
|
1078
|
+
outputs: [
|
|
1079
|
+
{
|
|
1080
|
+
internalType: "address",
|
|
1081
|
+
name: "",
|
|
1082
|
+
type: "address"
|
|
1083
|
+
}
|
|
1084
|
+
],
|
|
1085
|
+
stateMutability: "view",
|
|
1086
|
+
type: "function"
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
inputs: [],
|
|
1090
|
+
name: "pendingOwner",
|
|
1091
|
+
outputs: [
|
|
1092
|
+
{
|
|
1093
|
+
internalType: "address",
|
|
1094
|
+
name: "",
|
|
1095
|
+
type: "address"
|
|
1096
|
+
}
|
|
1097
|
+
],
|
|
1098
|
+
stateMutability: "view",
|
|
1099
|
+
type: "function"
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
inputs: [],
|
|
1103
|
+
name: "proxiableUUID",
|
|
1104
|
+
outputs: [
|
|
1105
|
+
{
|
|
1106
|
+
internalType: "bytes32",
|
|
1107
|
+
name: "",
|
|
1108
|
+
type: "bytes32"
|
|
1109
|
+
}
|
|
1110
|
+
],
|
|
1111
|
+
stateMutability: "view",
|
|
1112
|
+
type: "function"
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
inputs: [],
|
|
1116
|
+
name: "rate",
|
|
1117
|
+
outputs: [
|
|
1118
|
+
{
|
|
1119
|
+
internalType: "uint256",
|
|
1120
|
+
name: "",
|
|
1121
|
+
type: "uint256"
|
|
1122
|
+
}
|
|
1123
|
+
],
|
|
1124
|
+
stateMutability: "view",
|
|
1125
|
+
type: "function"
|
|
1126
|
+
},
|
|
1127
|
+
{
|
|
1128
|
+
inputs: [],
|
|
1129
|
+
name: "renounceOwnership",
|
|
1130
|
+
outputs: [],
|
|
1131
|
+
stateMutability: "nonpayable",
|
|
1132
|
+
type: "function"
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
inputs: [
|
|
1136
|
+
{
|
|
1137
|
+
internalType: "euint64",
|
|
1138
|
+
name: "encryptedAmount",
|
|
1139
|
+
type: "bytes32"
|
|
1140
|
+
}
|
|
1141
|
+
],
|
|
1142
|
+
name: "requestDiscloseEncryptedAmount",
|
|
1143
|
+
outputs: [],
|
|
1144
|
+
stateMutability: "nonpayable",
|
|
1145
|
+
type: "function"
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
inputs: [
|
|
1149
|
+
{
|
|
1150
|
+
internalType: "address",
|
|
1151
|
+
name: "operator",
|
|
1152
|
+
type: "address"
|
|
1153
|
+
},
|
|
1154
|
+
{
|
|
1155
|
+
internalType: "uint48",
|
|
1156
|
+
name: "until",
|
|
1157
|
+
type: "uint48"
|
|
1158
|
+
}
|
|
1159
|
+
],
|
|
1160
|
+
name: "setOperator",
|
|
1161
|
+
outputs: [],
|
|
1162
|
+
stateMutability: "nonpayable",
|
|
1163
|
+
type: "function"
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
inputs: [
|
|
1167
|
+
{
|
|
1168
|
+
internalType: "bytes4",
|
|
1169
|
+
name: "interfaceId",
|
|
1170
|
+
type: "bytes4"
|
|
1171
|
+
}
|
|
1172
|
+
],
|
|
1173
|
+
name: "supportsInterface",
|
|
1174
|
+
outputs: [
|
|
1175
|
+
{
|
|
1176
|
+
internalType: "bool",
|
|
1177
|
+
name: "",
|
|
1178
|
+
type: "bool"
|
|
1179
|
+
}
|
|
1180
|
+
],
|
|
1181
|
+
stateMutability: "view",
|
|
1182
|
+
type: "function"
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
inputs: [],
|
|
1186
|
+
name: "symbol",
|
|
1187
|
+
outputs: [
|
|
1188
|
+
{
|
|
1189
|
+
internalType: "string",
|
|
1190
|
+
name: "",
|
|
1191
|
+
type: "string"
|
|
1192
|
+
}
|
|
1193
|
+
],
|
|
1194
|
+
stateMutability: "view",
|
|
1195
|
+
type: "function"
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
inputs: [
|
|
1199
|
+
{
|
|
1200
|
+
internalType: "address",
|
|
1201
|
+
name: "newOwner",
|
|
1202
|
+
type: "address"
|
|
1203
|
+
}
|
|
1204
|
+
],
|
|
1205
|
+
name: "transferOwnership",
|
|
1206
|
+
outputs: [],
|
|
1207
|
+
stateMutability: "nonpayable",
|
|
1208
|
+
type: "function"
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
inputs: [],
|
|
1212
|
+
name: "underlying",
|
|
1213
|
+
outputs: [
|
|
1214
|
+
{
|
|
1215
|
+
internalType: "address",
|
|
1216
|
+
name: "",
|
|
1217
|
+
type: "address"
|
|
1218
|
+
}
|
|
1219
|
+
],
|
|
1220
|
+
stateMutability: "view",
|
|
1221
|
+
type: "function"
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
inputs: [
|
|
1225
|
+
{
|
|
1226
|
+
internalType: "address",
|
|
1227
|
+
name: "from",
|
|
1228
|
+
type: "address"
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
internalType: "address",
|
|
1232
|
+
name: "to",
|
|
1233
|
+
type: "address"
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
internalType: "externalEuint64",
|
|
1237
|
+
name: "encryptedAmount",
|
|
1238
|
+
type: "bytes32"
|
|
1239
|
+
},
|
|
1240
|
+
{
|
|
1241
|
+
internalType: "bytes",
|
|
1242
|
+
name: "inputProof",
|
|
1243
|
+
type: "bytes"
|
|
1244
|
+
}
|
|
1245
|
+
],
|
|
1246
|
+
name: "unwrap",
|
|
1247
|
+
outputs: [
|
|
1248
|
+
{
|
|
1249
|
+
internalType: "bytes32",
|
|
1250
|
+
name: "",
|
|
1251
|
+
type: "bytes32"
|
|
1252
|
+
}
|
|
1253
|
+
],
|
|
1254
|
+
stateMutability: "nonpayable",
|
|
1255
|
+
type: "function"
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
inputs: [
|
|
1259
|
+
{
|
|
1260
|
+
internalType: "address",
|
|
1261
|
+
name: "from",
|
|
1262
|
+
type: "address"
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
internalType: "address",
|
|
1266
|
+
name: "to",
|
|
1267
|
+
type: "address"
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
internalType: "euint64",
|
|
1271
|
+
name: "amount",
|
|
1272
|
+
type: "bytes32"
|
|
1273
|
+
}
|
|
1274
|
+
],
|
|
1275
|
+
name: "unwrap",
|
|
1276
|
+
outputs: [
|
|
1277
|
+
{
|
|
1278
|
+
internalType: "bytes32",
|
|
1279
|
+
name: "",
|
|
1280
|
+
type: "bytes32"
|
|
1281
|
+
}
|
|
1282
|
+
],
|
|
1283
|
+
stateMutability: "nonpayable",
|
|
1284
|
+
type: "function"
|
|
1285
|
+
},
|
|
1286
|
+
{
|
|
1287
|
+
inputs: [
|
|
1288
|
+
{
|
|
1289
|
+
internalType: "bytes32",
|
|
1290
|
+
name: "unwrapRequestId",
|
|
1291
|
+
type: "bytes32"
|
|
1292
|
+
}
|
|
1293
|
+
],
|
|
1294
|
+
name: "unwrapAmount",
|
|
1295
|
+
outputs: [
|
|
1296
|
+
{
|
|
1297
|
+
internalType: "euint64",
|
|
1298
|
+
name: "",
|
|
1299
|
+
type: "bytes32"
|
|
1300
|
+
}
|
|
1301
|
+
],
|
|
1302
|
+
stateMutability: "view",
|
|
1303
|
+
type: "function"
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
inputs: [
|
|
1307
|
+
{
|
|
1308
|
+
internalType: "bytes32",
|
|
1309
|
+
name: "unwrapRequestId",
|
|
1310
|
+
type: "bytes32"
|
|
1311
|
+
}
|
|
1312
|
+
],
|
|
1313
|
+
name: "unwrapRequester",
|
|
1314
|
+
outputs: [
|
|
1315
|
+
{
|
|
1316
|
+
internalType: "address",
|
|
1317
|
+
name: "",
|
|
1318
|
+
type: "address"
|
|
1319
|
+
}
|
|
1320
|
+
],
|
|
1321
|
+
stateMutability: "view",
|
|
1322
|
+
type: "function"
|
|
1323
|
+
},
|
|
1324
|
+
{
|
|
1325
|
+
inputs: [
|
|
1326
|
+
{
|
|
1327
|
+
internalType: "address",
|
|
1328
|
+
name: "newImplementation",
|
|
1329
|
+
type: "address"
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
internalType: "bytes",
|
|
1333
|
+
name: "data",
|
|
1334
|
+
type: "bytes"
|
|
1335
|
+
}
|
|
1336
|
+
],
|
|
1337
|
+
name: "upgradeToAndCall",
|
|
1338
|
+
outputs: [],
|
|
1339
|
+
stateMutability: "payable",
|
|
1340
|
+
type: "function"
|
|
1341
|
+
},
|
|
1342
|
+
{
|
|
1343
|
+
inputs: [
|
|
1344
|
+
{
|
|
1345
|
+
internalType: "address",
|
|
1346
|
+
name: "to",
|
|
1347
|
+
type: "address"
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
internalType: "uint256",
|
|
1351
|
+
name: "amount",
|
|
1352
|
+
type: "uint256"
|
|
1353
|
+
}
|
|
1354
|
+
],
|
|
1355
|
+
name: "wrap",
|
|
1356
|
+
outputs: [
|
|
1357
|
+
{
|
|
1358
|
+
internalType: "euint64",
|
|
1359
|
+
name: "",
|
|
1360
|
+
type: "bytes32"
|
|
1361
|
+
}
|
|
1362
|
+
],
|
|
1363
|
+
stateMutability: "nonpayable",
|
|
1364
|
+
type: "function"
|
|
1365
|
+
}
|
|
1366
|
+
];
|
|
1367
|
+
|
|
1368
|
+
// src/testnet-faucet/abis/test-token.ts
|
|
1369
|
+
var tokenopsTestTokenAbi = [
|
|
1370
|
+
{
|
|
1371
|
+
inputs: [],
|
|
1372
|
+
stateMutability: "nonpayable",
|
|
1373
|
+
type: "constructor"
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
inputs: [
|
|
1377
|
+
{
|
|
1378
|
+
internalType: "address",
|
|
1379
|
+
name: "spender",
|
|
1380
|
+
type: "address"
|
|
1381
|
+
},
|
|
1382
|
+
{
|
|
1383
|
+
internalType: "uint256",
|
|
1384
|
+
name: "allowance",
|
|
1385
|
+
type: "uint256"
|
|
1386
|
+
},
|
|
1387
|
+
{
|
|
1388
|
+
internalType: "uint256",
|
|
1389
|
+
name: "needed",
|
|
1390
|
+
type: "uint256"
|
|
1391
|
+
}
|
|
1392
|
+
],
|
|
1393
|
+
name: "ERC20InsufficientAllowance",
|
|
1394
|
+
type: "error"
|
|
1395
|
+
},
|
|
1396
|
+
{
|
|
1397
|
+
inputs: [
|
|
1398
|
+
{
|
|
1399
|
+
internalType: "address",
|
|
1400
|
+
name: "sender",
|
|
1401
|
+
type: "address"
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
internalType: "uint256",
|
|
1405
|
+
name: "balance",
|
|
1406
|
+
type: "uint256"
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
internalType: "uint256",
|
|
1410
|
+
name: "needed",
|
|
1411
|
+
type: "uint256"
|
|
1412
|
+
}
|
|
1413
|
+
],
|
|
1414
|
+
name: "ERC20InsufficientBalance",
|
|
1415
|
+
type: "error"
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
inputs: [
|
|
1419
|
+
{
|
|
1420
|
+
internalType: "address",
|
|
1421
|
+
name: "approver",
|
|
1422
|
+
type: "address"
|
|
1423
|
+
}
|
|
1424
|
+
],
|
|
1425
|
+
name: "ERC20InvalidApprover",
|
|
1426
|
+
type: "error"
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
inputs: [
|
|
1430
|
+
{
|
|
1431
|
+
internalType: "address",
|
|
1432
|
+
name: "receiver",
|
|
1433
|
+
type: "address"
|
|
1434
|
+
}
|
|
1435
|
+
],
|
|
1436
|
+
name: "ERC20InvalidReceiver",
|
|
1437
|
+
type: "error"
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
inputs: [
|
|
1441
|
+
{
|
|
1442
|
+
internalType: "address",
|
|
1443
|
+
name: "sender",
|
|
1444
|
+
type: "address"
|
|
1445
|
+
}
|
|
1446
|
+
],
|
|
1447
|
+
name: "ERC20InvalidSender",
|
|
1448
|
+
type: "error"
|
|
1449
|
+
},
|
|
1450
|
+
{
|
|
1451
|
+
inputs: [
|
|
1452
|
+
{
|
|
1453
|
+
internalType: "address",
|
|
1454
|
+
name: "spender",
|
|
1455
|
+
type: "address"
|
|
1456
|
+
}
|
|
1457
|
+
],
|
|
1458
|
+
name: "ERC20InvalidSpender",
|
|
1459
|
+
type: "error"
|
|
1460
|
+
},
|
|
1461
|
+
{
|
|
1462
|
+
anonymous: false,
|
|
1463
|
+
inputs: [
|
|
1464
|
+
{
|
|
1465
|
+
indexed: true,
|
|
1466
|
+
internalType: "address",
|
|
1467
|
+
name: "owner",
|
|
1468
|
+
type: "address"
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
indexed: true,
|
|
1472
|
+
internalType: "address",
|
|
1473
|
+
name: "spender",
|
|
1474
|
+
type: "address"
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
indexed: false,
|
|
1478
|
+
internalType: "uint256",
|
|
1479
|
+
name: "value",
|
|
1480
|
+
type: "uint256"
|
|
1481
|
+
}
|
|
1482
|
+
],
|
|
1483
|
+
name: "Approval",
|
|
1484
|
+
type: "event"
|
|
1485
|
+
},
|
|
1486
|
+
{
|
|
1487
|
+
anonymous: false,
|
|
1488
|
+
inputs: [
|
|
1489
|
+
{
|
|
1490
|
+
indexed: true,
|
|
1491
|
+
internalType: "address",
|
|
1492
|
+
name: "from",
|
|
1493
|
+
type: "address"
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
indexed: true,
|
|
1497
|
+
internalType: "address",
|
|
1498
|
+
name: "to",
|
|
1499
|
+
type: "address"
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
indexed: false,
|
|
1503
|
+
internalType: "uint256",
|
|
1504
|
+
name: "value",
|
|
1505
|
+
type: "uint256"
|
|
1506
|
+
}
|
|
1507
|
+
],
|
|
1508
|
+
name: "Transfer",
|
|
1509
|
+
type: "event"
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
inputs: [
|
|
1513
|
+
{
|
|
1514
|
+
internalType: "address",
|
|
1515
|
+
name: "owner",
|
|
1516
|
+
type: "address"
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
internalType: "address",
|
|
1520
|
+
name: "spender",
|
|
1521
|
+
type: "address"
|
|
1522
|
+
}
|
|
1523
|
+
],
|
|
1524
|
+
name: "allowance",
|
|
1525
|
+
outputs: [
|
|
1526
|
+
{
|
|
1527
|
+
internalType: "uint256",
|
|
1528
|
+
name: "",
|
|
1529
|
+
type: "uint256"
|
|
1530
|
+
}
|
|
1531
|
+
],
|
|
1532
|
+
stateMutability: "view",
|
|
1533
|
+
type: "function"
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
inputs: [
|
|
1537
|
+
{
|
|
1538
|
+
internalType: "address",
|
|
1539
|
+
name: "spender",
|
|
1540
|
+
type: "address"
|
|
1541
|
+
},
|
|
1542
|
+
{
|
|
1543
|
+
internalType: "uint256",
|
|
1544
|
+
name: "value",
|
|
1545
|
+
type: "uint256"
|
|
1546
|
+
}
|
|
1547
|
+
],
|
|
1548
|
+
name: "approve",
|
|
1549
|
+
outputs: [
|
|
1550
|
+
{
|
|
1551
|
+
internalType: "bool",
|
|
1552
|
+
name: "",
|
|
1553
|
+
type: "bool"
|
|
1554
|
+
}
|
|
1555
|
+
],
|
|
1556
|
+
stateMutability: "nonpayable",
|
|
1557
|
+
type: "function"
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
inputs: [
|
|
1561
|
+
{
|
|
1562
|
+
internalType: "address",
|
|
1563
|
+
name: "account",
|
|
1564
|
+
type: "address"
|
|
1565
|
+
}
|
|
1566
|
+
],
|
|
1567
|
+
name: "balanceOf",
|
|
1568
|
+
outputs: [
|
|
1569
|
+
{
|
|
1570
|
+
internalType: "uint256",
|
|
1571
|
+
name: "",
|
|
1572
|
+
type: "uint256"
|
|
1573
|
+
}
|
|
1574
|
+
],
|
|
1575
|
+
stateMutability: "view",
|
|
1576
|
+
type: "function"
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
inputs: [],
|
|
1580
|
+
name: "decimals",
|
|
1581
|
+
outputs: [
|
|
1582
|
+
{
|
|
1583
|
+
internalType: "uint8",
|
|
1584
|
+
name: "",
|
|
1585
|
+
type: "uint8"
|
|
1586
|
+
}
|
|
1587
|
+
],
|
|
1588
|
+
stateMutability: "view",
|
|
1589
|
+
type: "function"
|
|
1590
|
+
},
|
|
1591
|
+
{
|
|
1592
|
+
inputs: [
|
|
1593
|
+
{
|
|
1594
|
+
internalType: "address",
|
|
1595
|
+
name: "to",
|
|
1596
|
+
type: "address"
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
internalType: "uint256",
|
|
1600
|
+
name: "amount",
|
|
1601
|
+
type: "uint256"
|
|
1602
|
+
}
|
|
1603
|
+
],
|
|
1604
|
+
name: "mint",
|
|
1605
|
+
outputs: [],
|
|
1606
|
+
stateMutability: "nonpayable",
|
|
1607
|
+
type: "function"
|
|
1608
|
+
},
|
|
1609
|
+
{
|
|
1610
|
+
inputs: [],
|
|
1611
|
+
name: "name",
|
|
1612
|
+
outputs: [
|
|
1613
|
+
{
|
|
1614
|
+
internalType: "string",
|
|
1615
|
+
name: "",
|
|
1616
|
+
type: "string"
|
|
1617
|
+
}
|
|
1618
|
+
],
|
|
1619
|
+
stateMutability: "view",
|
|
1620
|
+
type: "function"
|
|
1621
|
+
},
|
|
1622
|
+
{
|
|
1623
|
+
inputs: [],
|
|
1624
|
+
name: "symbol",
|
|
1625
|
+
outputs: [
|
|
1626
|
+
{
|
|
1627
|
+
internalType: "string",
|
|
1628
|
+
name: "",
|
|
1629
|
+
type: "string"
|
|
1630
|
+
}
|
|
1631
|
+
],
|
|
1632
|
+
stateMutability: "view",
|
|
1633
|
+
type: "function"
|
|
1634
|
+
},
|
|
1635
|
+
{
|
|
1636
|
+
inputs: [],
|
|
1637
|
+
name: "totalSupply",
|
|
1638
|
+
outputs: [
|
|
1639
|
+
{
|
|
1640
|
+
internalType: "uint256",
|
|
1641
|
+
name: "",
|
|
1642
|
+
type: "uint256"
|
|
1643
|
+
}
|
|
1644
|
+
],
|
|
1645
|
+
stateMutability: "view",
|
|
1646
|
+
type: "function"
|
|
1647
|
+
},
|
|
1648
|
+
{
|
|
1649
|
+
inputs: [
|
|
1650
|
+
{
|
|
1651
|
+
internalType: "address",
|
|
1652
|
+
name: "to",
|
|
1653
|
+
type: "address"
|
|
1654
|
+
},
|
|
1655
|
+
{
|
|
1656
|
+
internalType: "uint256",
|
|
1657
|
+
name: "value",
|
|
1658
|
+
type: "uint256"
|
|
1659
|
+
}
|
|
1660
|
+
],
|
|
1661
|
+
name: "transfer",
|
|
1662
|
+
outputs: [
|
|
1663
|
+
{
|
|
1664
|
+
internalType: "bool",
|
|
1665
|
+
name: "",
|
|
1666
|
+
type: "bool"
|
|
1667
|
+
}
|
|
1668
|
+
],
|
|
1669
|
+
stateMutability: "nonpayable",
|
|
1670
|
+
type: "function"
|
|
1671
|
+
},
|
|
1672
|
+
{
|
|
1673
|
+
inputs: [
|
|
1674
|
+
{
|
|
1675
|
+
internalType: "address",
|
|
1676
|
+
name: "from",
|
|
1677
|
+
type: "address"
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
internalType: "address",
|
|
1681
|
+
name: "to",
|
|
1682
|
+
type: "address"
|
|
1683
|
+
},
|
|
1684
|
+
{
|
|
1685
|
+
internalType: "uint256",
|
|
1686
|
+
name: "value",
|
|
1687
|
+
type: "uint256"
|
|
1688
|
+
}
|
|
1689
|
+
],
|
|
1690
|
+
name: "transferFrom",
|
|
1691
|
+
outputs: [
|
|
1692
|
+
{
|
|
1693
|
+
internalType: "bool",
|
|
1694
|
+
name: "",
|
|
1695
|
+
type: "bool"
|
|
1696
|
+
}
|
|
1697
|
+
],
|
|
1698
|
+
stateMutability: "nonpayable",
|
|
1699
|
+
type: "function"
|
|
1700
|
+
}
|
|
1701
|
+
];
|
|
1702
|
+
|
|
1703
|
+
// src/testnet-faucet/errors.ts
|
|
1704
|
+
var FaucetSupplyExhaustedError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
|
|
1705
|
+
name = "FaucetSupplyExhaustedError";
|
|
1706
|
+
constructor(args) {
|
|
1707
|
+
super(
|
|
1708
|
+
`${args.method}: the confidential faucet's backing is saturated (max total supply reached). Unwrap existing CTTT to free capacity, or mint a smaller amount.`,
|
|
1709
|
+
{
|
|
1710
|
+
code: "TOKENOPS_FAUCET_SUPPLY_EXHAUSTED",
|
|
1711
|
+
cause: args.cause,
|
|
1712
|
+
context: { method: args.method, contractAddress: args.contractAddress }
|
|
1713
|
+
}
|
|
1714
|
+
);
|
|
1715
|
+
}
|
|
1716
|
+
};
|
|
1717
|
+
var TESTNET_FAUCET_SUPPORTED_CHAIN_IDS = [chains.sepolia.id, 31337];
|
|
1718
|
+
function isTestnetFaucetChainId(chainId) {
|
|
1719
|
+
return TESTNET_FAUCET_SUPPORTED_CHAIN_IDS.includes(chainId);
|
|
1720
|
+
}
|
|
1721
|
+
function assertTestnetFaucetChain(chainId) {
|
|
1722
|
+
if (chainId === void 0) return;
|
|
1723
|
+
if (!isTestnetFaucetChainId(chainId)) {
|
|
1724
|
+
throw new chunk56UI7LUR_cjs.UnsupportedChainError(chainId);
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
var UINT64_MAX = (1n << 64n) - 1n;
|
|
1728
|
+
var UINT256_MAX = (1n << 256n) - 1n;
|
|
1729
|
+
function assertUint64Amount(value, argument, method) {
|
|
1730
|
+
if (typeof value !== "bigint") {
|
|
1731
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1732
|
+
method,
|
|
1733
|
+
argument,
|
|
1734
|
+
reason: "amount must be a bigint",
|
|
1735
|
+
value: String(value)
|
|
1736
|
+
});
|
|
1737
|
+
}
|
|
1738
|
+
if (value <= 0n) {
|
|
1739
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1740
|
+
method,
|
|
1741
|
+
argument,
|
|
1742
|
+
reason: "amount must be greater than zero",
|
|
1743
|
+
value: value.toString()
|
|
1744
|
+
});
|
|
1745
|
+
}
|
|
1746
|
+
if (value > UINT64_MAX) {
|
|
1747
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1748
|
+
method,
|
|
1749
|
+
argument,
|
|
1750
|
+
reason: `amount exceeds uint64 max (${UINT64_MAX.toString()})`,
|
|
1751
|
+
value: value.toString()
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
function assertUint256Amount(value, argument, method) {
|
|
1756
|
+
if (typeof value !== "bigint") {
|
|
1757
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1758
|
+
method,
|
|
1759
|
+
argument,
|
|
1760
|
+
reason: "amount must be a bigint",
|
|
1761
|
+
value: String(value)
|
|
1762
|
+
});
|
|
1763
|
+
}
|
|
1764
|
+
if (value <= 0n) {
|
|
1765
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1766
|
+
method,
|
|
1767
|
+
argument,
|
|
1768
|
+
reason: "amount must be greater than zero",
|
|
1769
|
+
value: value.toString()
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1772
|
+
if (value > UINT256_MAX) {
|
|
1773
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1774
|
+
method,
|
|
1775
|
+
argument,
|
|
1776
|
+
reason: "amount exceeds uint256 max",
|
|
1777
|
+
value: value.toString()
|
|
1778
|
+
});
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
function assertNonZeroRecipient(input, argument, method) {
|
|
1782
|
+
const normalised = chunkCQIPRNS7_cjs.normaliseAddress(input);
|
|
1783
|
+
if (/^0x0{40}$/i.test(normalised)) {
|
|
1784
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1785
|
+
method,
|
|
1786
|
+
argument,
|
|
1787
|
+
reason: "recipient must not be the zero address",
|
|
1788
|
+
value: normalised
|
|
1789
|
+
});
|
|
1790
|
+
}
|
|
1791
|
+
return normalised;
|
|
1792
|
+
}
|
|
1793
|
+
var faucetProductMapper = (name, _args, ctx) => {
|
|
1794
|
+
switch (name) {
|
|
1795
|
+
case "ERC7984TotalSupplyOverflow":
|
|
1796
|
+
return new FaucetSupplyExhaustedError({
|
|
1797
|
+
method: ctx.method,
|
|
1798
|
+
contractAddress: ctx.contractAddress
|
|
1799
|
+
});
|
|
1800
|
+
case "ERC7984InvalidReceiver":
|
|
1801
|
+
case "ERC20InvalidReceiver":
|
|
1802
|
+
return new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1803
|
+
method: ctx.method,
|
|
1804
|
+
argument: "to",
|
|
1805
|
+
reason: "recipient must not be the zero address"
|
|
1806
|
+
});
|
|
1807
|
+
default:
|
|
1808
|
+
return void 0;
|
|
1809
|
+
}
|
|
1810
|
+
};
|
|
1811
|
+
var TestnetFaucetClient = class {
|
|
1812
|
+
publicClient;
|
|
1813
|
+
walletClient;
|
|
1814
|
+
/** The `ConfidentialTokenopsTestToken` (CTTT) proxy address this client targets. */
|
|
1815
|
+
address;
|
|
1816
|
+
#chainId;
|
|
1817
|
+
#cttAddressIsOverride = false;
|
|
1818
|
+
#telemetry;
|
|
1819
|
+
#cachedUnderlying;
|
|
1820
|
+
constructor(config) {
|
|
1821
|
+
this.publicClient = config.publicClient;
|
|
1822
|
+
this.walletClient = config.walletClient;
|
|
1823
|
+
this.#telemetry = config.telemetry;
|
|
1824
|
+
const chainId = config.chainId ?? config.publicClient.chain?.id;
|
|
1825
|
+
this.#chainId = chainId;
|
|
1826
|
+
assertTestnetFaucetChain(chainId);
|
|
1827
|
+
const addressOverride = config.address ? chunkCQIPRNS7_cjs.normaliseAddress(config.address) : void 0;
|
|
1828
|
+
const resolved = addressOverride ?? (chainId === void 0 ? void 0 : chunk3ZRHDTEX_cjs.getConfidentialTestTokenAddress(chainId));
|
|
1829
|
+
if (!resolved) {
|
|
1830
|
+
throw new chunk56UI7LUR_cjs.DeploymentAddressUnavailableError({
|
|
1831
|
+
reason: chainId === void 0 ? "chain-id-missing" : "registry-not-deployed",
|
|
1832
|
+
product: "testnetFaucet",
|
|
1833
|
+
contract: "confidentialTestToken",
|
|
1834
|
+
chainId,
|
|
1835
|
+
clientLabel: "TestnetFaucetClient"
|
|
1836
|
+
});
|
|
1837
|
+
}
|
|
1838
|
+
this.address = resolved;
|
|
1839
|
+
this.#cttAddressIsOverride = !!addressOverride;
|
|
1840
|
+
this.#telemetry?.event("testnet-faucet.client.init", {
|
|
1841
|
+
chainId: chainId ?? null,
|
|
1842
|
+
hasWallet: !!this.walletClient,
|
|
1843
|
+
sdkVersion: chunkVDXVNZCO_cjs.SDK_VERSION
|
|
1844
|
+
});
|
|
1845
|
+
}
|
|
1846
|
+
// ============================================================
|
|
1847
|
+
// READ METHODS
|
|
1848
|
+
// ============================================================
|
|
1849
|
+
/**
|
|
1850
|
+
* Resolve the underlying `TokenopsTestToken` (TTT) address.
|
|
1851
|
+
*
|
|
1852
|
+
* Resolution order: registry entry for the chain → the wrapper's own
|
|
1853
|
+
* `underlying()` getter (read once, cached). The wrapper is the authoritative
|
|
1854
|
+
* source, so this works even on a local deployment where only the CTTT
|
|
1855
|
+
* address was supplied.
|
|
1856
|
+
*
|
|
1857
|
+
* The registry shortcut is only taken for the canonical (registry) CTTT. If
|
|
1858
|
+
* the CTTT `address` was overridden, the registry is skipped and the custom
|
|
1859
|
+
* wrapper's own authoritative `underlying()` is read — otherwise a custom
|
|
1860
|
+
* CTTT on a registry chain would silently pair with the canonical TTT. The
|
|
1861
|
+
* backing token is never consumer-supplied: a faucet client always pairs the
|
|
1862
|
+
* CTTT with the TTT that the CTTT itself reports.
|
|
1863
|
+
*/
|
|
1864
|
+
async underlyingToken() {
|
|
1865
|
+
if (this.#cachedUnderlying) return this.#cachedUnderlying;
|
|
1866
|
+
const fromRegistry = this.#cttAddressIsOverride || this.#chainId === void 0 ? void 0 : chunk3ZRHDTEX_cjs.getTestTokenAddress(this.#chainId);
|
|
1867
|
+
const resolved = fromRegistry ?? await this.#readCtt("underlying");
|
|
1868
|
+
this.#cachedUnderlying = chunkCQIPRNS7_cjs.normaliseAddress(resolved);
|
|
1869
|
+
return this.#cachedUnderlying;
|
|
1870
|
+
}
|
|
1871
|
+
/**
|
|
1872
|
+
* Read the encrypted confidential balance handle for `account` (defaults to
|
|
1873
|
+
* the wallet's account).
|
|
1874
|
+
*
|
|
1875
|
+
* Returns the `euint64` ciphertext handle. The account holds persistent ACL
|
|
1876
|
+
* on its own balance, so pass this handle — together with the CTTT contract
|
|
1877
|
+
* address ({@link address}) and the account's signer — to the Zama relayer's
|
|
1878
|
+
* `userDecrypt` to obtain the plaintext. The SDK is the producer side only;
|
|
1879
|
+
* it does not call `userDecrypt`.
|
|
1880
|
+
*
|
|
1881
|
+
* @returns the `bytes32` balance handle (an {@link EncryptedHandle}). A
|
|
1882
|
+
* never-credited account reads back the zero handle.
|
|
1883
|
+
*/
|
|
1884
|
+
async confidentialBalanceOf(account) {
|
|
1885
|
+
const who = this.#resolveReadAddress(account, "confidentialBalanceOf");
|
|
1886
|
+
const handle = await this.#readCtt("confidentialBalanceOf", [who]);
|
|
1887
|
+
return chunk66IHPTOK_cjs.asEncryptedHandle(handle);
|
|
1888
|
+
}
|
|
1889
|
+
/**
|
|
1890
|
+
* Read the plaintext underlying `TokenopsTestToken` (TTT) balance for
|
|
1891
|
+
* `account` (defaults to the wallet's account), in TTT 18-decimal base units.
|
|
1892
|
+
*/
|
|
1893
|
+
async underlyingBalanceOf(account) {
|
|
1894
|
+
const who = this.#resolveReadAddress(account, "underlyingBalanceOf");
|
|
1895
|
+
return this.#readTtt("balanceOf", [who]);
|
|
1896
|
+
}
|
|
1897
|
+
/**
|
|
1898
|
+
* Decimal-conversion rate between underlying and confidential units:
|
|
1899
|
+
* `1` CTTT 6-decimal unit is backed by `rate` TTT 18-decimal base units
|
|
1900
|
+
* (`10^(18-6) = 10^12`).
|
|
1901
|
+
*/
|
|
1902
|
+
async rate() {
|
|
1903
|
+
return this.#readCtt("rate");
|
|
1904
|
+
}
|
|
1905
|
+
/** Decimals of the confidential token (CTTT) — `6`. */
|
|
1906
|
+
async decimals() {
|
|
1907
|
+
return this.#readCtt("decimals");
|
|
1908
|
+
}
|
|
1909
|
+
/** Decimals of the underlying token (TTT) — `18`. */
|
|
1910
|
+
async underlyingDecimals() {
|
|
1911
|
+
return this.#readTtt("decimals");
|
|
1912
|
+
}
|
|
1913
|
+
/**
|
|
1914
|
+
* The wrapper's inferred total supply: underlying held in custody divided by
|
|
1915
|
+
* `rate`, an upper bound on the confidential total supply. In CTTT 6-decimal
|
|
1916
|
+
* units.
|
|
1917
|
+
*/
|
|
1918
|
+
async inferredTotalSupply() {
|
|
1919
|
+
return this.#readCtt("inferredTotalSupply");
|
|
1920
|
+
}
|
|
1921
|
+
/** Max confidential total supply the wrapper supports (`type(uint64).max`). */
|
|
1922
|
+
async maxTotalSupply() {
|
|
1923
|
+
return this.#readCtt("maxTotalSupply");
|
|
1924
|
+
}
|
|
1925
|
+
/**
|
|
1926
|
+
* Consolidated faucet metadata — both tokens' name/symbol/decimals/address,
|
|
1927
|
+
* the conversion `rate`, and the `maxTotalSupply` ceiling — in a single
|
|
1928
|
+
* parallel read. Handy for rendering a faucet panel.
|
|
1929
|
+
*/
|
|
1930
|
+
async getMetadata() {
|
|
1931
|
+
const underlyingAddress = await this.underlyingToken();
|
|
1932
|
+
const [cName, cSymbol, cDecimals, rate, maxTotalSupply, uName, uSymbol, uDecimals] = await Promise.all([
|
|
1933
|
+
this.#readCtt("name"),
|
|
1934
|
+
this.#readCtt("symbol"),
|
|
1935
|
+
this.#readCtt("decimals"),
|
|
1936
|
+
this.#readCtt("rate"),
|
|
1937
|
+
this.#readCtt("maxTotalSupply"),
|
|
1938
|
+
this.#readTtt("name"),
|
|
1939
|
+
this.#readTtt("symbol"),
|
|
1940
|
+
this.#readTtt("decimals")
|
|
1941
|
+
]);
|
|
1942
|
+
return {
|
|
1943
|
+
confidential: { address: this.address, name: cName, symbol: cSymbol, decimals: cDecimals },
|
|
1944
|
+
underlying: {
|
|
1945
|
+
address: underlyingAddress,
|
|
1946
|
+
name: uName,
|
|
1947
|
+
symbol: uSymbol,
|
|
1948
|
+
decimals: uDecimals
|
|
1949
|
+
},
|
|
1950
|
+
rate,
|
|
1951
|
+
maxTotalSupply
|
|
1952
|
+
};
|
|
1953
|
+
}
|
|
1954
|
+
// ============================================================
|
|
1955
|
+
// WRITE METHODS
|
|
1956
|
+
// ============================================================
|
|
1957
|
+
/**
|
|
1958
|
+
* Mint confidential test tokens (CTTT) to `to`, fully backed by freshly
|
|
1959
|
+
* minted underlying TTT held in custody.
|
|
1960
|
+
*
|
|
1961
|
+
* **This is the confidential faucet.** Open and permissionless — anyone can
|
|
1962
|
+
* mint any `uint64` amount. The amount is PUBLIC (plaintext calldata +
|
|
1963
|
+
* `ConfidentialMint` event); only the recipient's aggregated balance and
|
|
1964
|
+
* later confidential transfers are private.
|
|
1965
|
+
*
|
|
1966
|
+
* @returns `{ hash, to, amount, underlyingMinted, handle }` decoded from the
|
|
1967
|
+
* `ConfidentialMint` event. To read the recipient's plaintext balance,
|
|
1968
|
+
* call {@link confidentialBalanceOf} and user-decrypt it.
|
|
1969
|
+
* @throws {InvalidArgumentError} for a zero recipient or out-of-range amount.
|
|
1970
|
+
* @throws {FaucetSupplyExhaustedError} if the wrapper's backing ceiling is reached.
|
|
1971
|
+
* @throws {ReceiptEventNotFoundError} if no `ConfidentialMint` event is found.
|
|
1972
|
+
*/
|
|
1973
|
+
async mintConfidential(args) {
|
|
1974
|
+
return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "testnet-faucet.mintConfidential", async () => {
|
|
1975
|
+
const wallet = this.#requireWallet("mintConfidential");
|
|
1976
|
+
const account = this.#resolveAccount(wallet, args.account, "mintConfidential");
|
|
1977
|
+
const to = assertNonZeroRecipient(
|
|
1978
|
+
args.to ?? accountAddress(account),
|
|
1979
|
+
"to",
|
|
1980
|
+
"mintConfidential"
|
|
1981
|
+
);
|
|
1982
|
+
assertUint64Amount(args.amount, "amount", "mintConfidential");
|
|
1983
|
+
const target = this.#cttTarget();
|
|
1984
|
+
await this.#preflightWrite(target, "mintConfidential", "mint", [to, args.amount], account);
|
|
1985
|
+
let hash;
|
|
1986
|
+
try {
|
|
1987
|
+
hash = await wallet.writeContract({
|
|
1988
|
+
address: target.address,
|
|
1989
|
+
abi: target.abi,
|
|
1990
|
+
functionName: "mint",
|
|
1991
|
+
args: [to, args.amount],
|
|
1992
|
+
account,
|
|
1993
|
+
chain: wallet.chain
|
|
1994
|
+
});
|
|
1995
|
+
} catch (err) {
|
|
1996
|
+
throw this.#mapRevert(target, "mintConfidential", err, void 0, accountAddress(account));
|
|
1997
|
+
}
|
|
1998
|
+
const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
|
|
1999
|
+
if (receipt.status !== "success") {
|
|
2000
|
+
throw new chunk56UI7LUR_cjs.TokenOpsContractError(`mintConfidential: transaction ${hash} reverted`, {
|
|
2001
|
+
contract: "ConfidentialTokenopsTestToken",
|
|
2002
|
+
call: "mint",
|
|
2003
|
+
tx: hash
|
|
2004
|
+
});
|
|
2005
|
+
}
|
|
2006
|
+
const events = viem.parseEventLogs({
|
|
2007
|
+
abi: confidentialTokenopsTestTokenAbi,
|
|
2008
|
+
eventName: "ConfidentialMint",
|
|
2009
|
+
logs: receipt.logs
|
|
2010
|
+
});
|
|
2011
|
+
const ours = events.filter((ev2) => ev2.address.toLowerCase() === this.address.toLowerCase());
|
|
2012
|
+
if (ours.length === 0) {
|
|
2013
|
+
throw new chunk56UI7LUR_cjs.ReceiptEventNotFoundError({
|
|
2014
|
+
method: "mintConfidential",
|
|
2015
|
+
eventName: "ConfidentialMint",
|
|
2016
|
+
contractAddress: this.address,
|
|
2017
|
+
txHash: hash
|
|
2018
|
+
});
|
|
2019
|
+
}
|
|
2020
|
+
if (ours.length > 1) {
|
|
2021
|
+
throw new chunk56UI7LUR_cjs.ReceiptEventAmbiguousError({
|
|
2022
|
+
method: "mintConfidential",
|
|
2023
|
+
eventName: "ConfidentialMint",
|
|
2024
|
+
contractAddress: this.address,
|
|
2025
|
+
txHash: hash,
|
|
2026
|
+
count: ours.length
|
|
2027
|
+
});
|
|
2028
|
+
}
|
|
2029
|
+
const ev = ours[0];
|
|
2030
|
+
return {
|
|
2031
|
+
hash: chunk66IHPTOK_cjs.asTxHash(hash),
|
|
2032
|
+
to: ev.args.to,
|
|
2033
|
+
amount: args.amount,
|
|
2034
|
+
underlyingMinted: ev.args.underlyingMinted,
|
|
2035
|
+
handle: chunk66IHPTOK_cjs.asEncryptedHandle(ev.args.encryptedAmount)
|
|
2036
|
+
};
|
|
2037
|
+
});
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* Mint standard (non-confidential) ERC-20 test tokens (TTT) to `to`.
|
|
2041
|
+
*
|
|
2042
|
+
* Open and permissionless. Use this when you want plain TTT — e.g. to then
|
|
2043
|
+
* `approve` + `wrap` it into CTTT through the standard ERC-7984 flow.
|
|
2044
|
+
*
|
|
2045
|
+
* @returns `{ hash, to, amount }`.
|
|
2046
|
+
* @throws {InvalidArgumentError} for a zero recipient or out-of-range amount.
|
|
2047
|
+
*/
|
|
2048
|
+
async mintUnderlying(args) {
|
|
2049
|
+
return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "testnet-faucet.mintUnderlying", async () => {
|
|
2050
|
+
const wallet = this.#requireWallet("mintUnderlying");
|
|
2051
|
+
const account = this.#resolveAccount(wallet, args.account, "mintUnderlying");
|
|
2052
|
+
const to = assertNonZeroRecipient(args.to ?? accountAddress(account), "to", "mintUnderlying");
|
|
2053
|
+
assertUint256Amount(args.amount, "amount", "mintUnderlying");
|
|
2054
|
+
const target = {
|
|
2055
|
+
address: await this.underlyingToken(),
|
|
2056
|
+
abi: tokenopsTestTokenAbi
|
|
2057
|
+
};
|
|
2058
|
+
await this.#preflightWrite(target, "mintUnderlying", "mint", [to, args.amount], account);
|
|
2059
|
+
let hash;
|
|
2060
|
+
try {
|
|
2061
|
+
hash = await wallet.writeContract({
|
|
2062
|
+
address: target.address,
|
|
2063
|
+
abi: target.abi,
|
|
2064
|
+
functionName: "mint",
|
|
2065
|
+
args: [to, args.amount],
|
|
2066
|
+
account,
|
|
2067
|
+
chain: wallet.chain
|
|
2068
|
+
});
|
|
2069
|
+
} catch (err) {
|
|
2070
|
+
throw this.#mapRevert(target, "mintUnderlying", err, void 0, accountAddress(account));
|
|
2071
|
+
}
|
|
2072
|
+
const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
|
|
2073
|
+
if (receipt.status !== "success") {
|
|
2074
|
+
throw new chunk56UI7LUR_cjs.TokenOpsContractError(`mintUnderlying: transaction ${hash} reverted`, {
|
|
2075
|
+
contract: "TokenopsTestToken",
|
|
2076
|
+
call: "mint",
|
|
2077
|
+
tx: hash
|
|
2078
|
+
});
|
|
2079
|
+
}
|
|
2080
|
+
return { hash: chunk66IHPTOK_cjs.asTxHash(hash), to, amount: args.amount };
|
|
2081
|
+
});
|
|
2082
|
+
}
|
|
2083
|
+
// ============================================================
|
|
2084
|
+
// INTERNAL HELPERS
|
|
2085
|
+
// ============================================================
|
|
2086
|
+
#cttTarget() {
|
|
2087
|
+
return { address: this.address, abi: confidentialTokenopsTestTokenAbi };
|
|
2088
|
+
}
|
|
2089
|
+
#requireWallet(method) {
|
|
2090
|
+
if (!this.walletClient) {
|
|
2091
|
+
throw new chunk56UI7LUR_cjs.MissingWalletClientError(method);
|
|
2092
|
+
}
|
|
2093
|
+
return this.walletClient;
|
|
2094
|
+
}
|
|
2095
|
+
#resolveAccount(wallet, override, method) {
|
|
2096
|
+
const acct = override ?? wallet.account;
|
|
2097
|
+
if (!acct) {
|
|
2098
|
+
throw new chunk56UI7LUR_cjs.MissingAccountError(method);
|
|
2099
|
+
}
|
|
2100
|
+
return acct;
|
|
2101
|
+
}
|
|
2102
|
+
/**
|
|
2103
|
+
* Resolve the address a read targets. Uses the explicit `override` if given,
|
|
2104
|
+
* else the wallet's account address. Throws {@link MissingAccountError} when
|
|
2105
|
+
* neither is available (a read-only client must be told whose balance to read).
|
|
2106
|
+
*/
|
|
2107
|
+
#resolveReadAddress(override, method) {
|
|
2108
|
+
if (override) return chunkCQIPRNS7_cjs.normaliseAddress(override);
|
|
2109
|
+
const acct = this.walletClient?.account?.address;
|
|
2110
|
+
if (!acct) {
|
|
2111
|
+
throw new chunk56UI7LUR_cjs.MissingAccountError(method);
|
|
2112
|
+
}
|
|
2113
|
+
return acct;
|
|
2114
|
+
}
|
|
2115
|
+
async #readCtt(functionName, args = []) {
|
|
2116
|
+
const result = await this.publicClient.readContract({
|
|
2117
|
+
address: this.address,
|
|
2118
|
+
abi: confidentialTokenopsTestTokenAbi,
|
|
2119
|
+
functionName,
|
|
2120
|
+
args
|
|
2121
|
+
});
|
|
2122
|
+
return result;
|
|
2123
|
+
}
|
|
2124
|
+
async #readTtt(functionName, args = []) {
|
|
2125
|
+
const address = await this.underlyingToken();
|
|
2126
|
+
const result = await this.publicClient.readContract({
|
|
2127
|
+
address,
|
|
2128
|
+
abi: tokenopsTestTokenAbi,
|
|
2129
|
+
functionName,
|
|
2130
|
+
args
|
|
2131
|
+
});
|
|
2132
|
+
return result;
|
|
2133
|
+
}
|
|
2134
|
+
/**
|
|
2135
|
+
* Pre-flight a write via `simulateContract` purely to surface typed reverts.
|
|
2136
|
+
* The simulate's return value is discarded; only its revert-decoding side
|
|
2137
|
+
* effect matters (so role/state/overflow reverts classify into typed SDK
|
|
2138
|
+
* errors instead of `UnknownWriteFailureError` on wallet transports).
|
|
2139
|
+
*/
|
|
2140
|
+
async #preflightWrite(target, method, functionName, args, account) {
|
|
2141
|
+
try {
|
|
2142
|
+
await this.publicClient.simulateContract({
|
|
2143
|
+
address: target.address,
|
|
2144
|
+
abi: target.abi,
|
|
2145
|
+
functionName,
|
|
2146
|
+
args,
|
|
2147
|
+
account
|
|
2148
|
+
});
|
|
2149
|
+
} catch (err) {
|
|
2150
|
+
if (chunkVDXVNZCO_cjs.isContractRevert(err)) {
|
|
2151
|
+
throw this.#mapRevert(target, method, err, void 0, accountAddress(account));
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
#mapRevert(target, method, err, productContext, account) {
|
|
2156
|
+
return chunkVDXVNZCO_cjs.mapContractRevert(err, {
|
|
2157
|
+
method,
|
|
2158
|
+
contractAddress: target.address,
|
|
2159
|
+
abi: target.abi,
|
|
2160
|
+
productMapper: faucetProductMapper,
|
|
2161
|
+
productContext,
|
|
2162
|
+
account
|
|
2163
|
+
});
|
|
2164
|
+
}
|
|
2165
|
+
};
|
|
2166
|
+
function createTestnetFaucetClient(config) {
|
|
2167
|
+
return new TestnetFaucetClient(config);
|
|
2168
|
+
}
|
|
2169
|
+
function accountAddress(account) {
|
|
2170
|
+
return typeof account === "string" ? account : account.address;
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
exports.FaucetSupplyExhaustedError = FaucetSupplyExhaustedError;
|
|
2174
|
+
exports.TESTNET_FAUCET_SUPPORTED_CHAIN_IDS = TESTNET_FAUCET_SUPPORTED_CHAIN_IDS;
|
|
2175
|
+
exports.TestnetFaucetClient = TestnetFaucetClient;
|
|
2176
|
+
exports.assertTestnetFaucetChain = assertTestnetFaucetChain;
|
|
2177
|
+
exports.confidentialTokenopsTestTokenAbi = confidentialTokenopsTestTokenAbi;
|
|
2178
|
+
exports.createTestnetFaucetClient = createTestnetFaucetClient;
|
|
2179
|
+
exports.isTestnetFaucetChainId = isTestnetFaucetChainId;
|
|
2180
|
+
exports.tokenopsTestTokenAbi = tokenopsTestTokenAbi;
|