@tokenops/sdk 1.5.1 → 2.0.0-alpha.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/CHANGELOG.md +198 -2
- package/CONTRIBUTING.md +4 -2
- package/README.md +146 -90
- package/SECURITY.md +7 -1
- package/SUPPORT.md +47 -0
- package/dist/{chunk-YQIBBEFJ.js → chunk-335Z2W67.js} +1 -1
- package/dist/{chunk-2NCLOQ56.cjs → chunk-3QHNYEQD.cjs} +77 -0
- package/dist/chunk-456VDDA3.js +370 -0
- package/dist/{chunk-SG65XWH7.js → chunk-4RAAATVY.js} +1 -3
- package/dist/{chunk-6BMP4ICG.js → chunk-4TSDNZQ3.js} +60 -2
- package/dist/{chunk-PUPKNW3R.cjs → chunk-5576FRT3.cjs} +30 -6
- package/dist/{chunk-AOP6HMPW.js → chunk-6GNR22OV.js} +75 -1
- package/dist/{chunk-NTZY6IB7.js → chunk-6NAVMWZQ.js} +4 -3
- package/dist/{chunk-C7BRZXJA.cjs → chunk-6PXXGACR.cjs} +8 -7
- package/dist/{chunk-IJFQ5L4I.js → chunk-74QFZ5MK.js} +4 -3
- package/dist/chunk-7AFPOE7N.cjs +59 -0
- package/dist/chunk-AXIPOR3C.js +56 -0
- package/dist/chunk-CTED3MTR.cjs +380 -0
- package/dist/{chunk-XGGTQQFH.js → chunk-DZHYSUGY.js} +28 -7
- package/dist/{chunk-OXTLPTO3.js → chunk-EAJ7SYHE.js} +4 -3
- package/dist/{chunk-V2PXZVBF.cjs → chunk-FGEB7RMY.cjs} +4 -4
- package/dist/chunk-GKKDAW44.js +8823 -0
- package/dist/{chunk-2PWNH3UE.js → chunk-H5POPGOZ.js} +63 -5
- package/dist/{chunk-W7IGCOVL.cjs → chunk-JQYC66TO.cjs} +9 -8
- package/dist/{chunk-PFXURMBZ.cjs → chunk-JZLGCTGK.cjs} +68 -8
- package/dist/{chunk-JYOTGRSO.cjs → chunk-KFRDLKMA.cjs} +61 -1
- package/dist/chunk-M4IT6DNJ.cjs +608 -0
- package/dist/{chunk-KLKI352M.cjs → chunk-MVDQMV25.cjs} +0 -3
- package/dist/chunk-NCVX3K2N.cjs +161 -0
- package/dist/chunk-NWFMBLSQ.js +4 -0
- package/dist/chunk-O5676ZWY.js +585 -0
- package/dist/chunk-PUX5VXDB.cjs +8845 -0
- package/dist/{chunk-IXLO7GO5.js → chunk-TWT3STIX.js} +46 -80
- package/dist/chunk-UG5RKLU2.cjs +6 -0
- package/dist/chunk-VP2B4WM2.js +154 -0
- package/dist/{chunk-5X5WL5CU.cjs → chunk-WJLECC22.cjs} +51 -88
- package/dist/{chunk-WENHUPZC.cjs → chunk-XAYGD4E4.cjs} +9 -8
- package/dist/core/addresses.d.ts +15 -3
- package/dist/core/brands.d.ts +8 -2
- package/dist/core/errors.d.ts +71 -10
- package/dist/core/preflight.d.ts +1 -0
- package/dist/fhe/erc7984-abi.d.ts +1 -0
- package/dist/fhe/index.cjs +34 -13
- package/dist/fhe/index.d.cts +1 -0
- package/dist/fhe/index.d.ts +1 -0
- package/dist/fhe/index.js +19 -6
- package/dist/fhe/mock-erc7984.d.ts +4 -4
- package/dist/fhe/operators.d.ts +160 -3
- package/dist/fhe/react/index.cjs +14 -0
- package/dist/fhe/react/index.d.cts +2 -0
- package/dist/fhe/react/index.d.ts +2 -0
- package/dist/fhe/react/index.js +6 -0
- package/dist/fhe/react/useEnsureOperator.d.ts +56 -0
- package/dist/fhe/react/useIsOperator.d.ts +54 -0
- package/dist/fhe/sepolia-encryptor-web.d.ts +18 -3
- package/dist/fhe/types.d.ts +6 -0
- package/dist/fhe-airdrop/abis/{cloneable.d.ts → airdrop-base.d.ts} +254 -396
- package/dist/fhe-airdrop/abis/compliance.d.ts +422 -0
- package/dist/fhe-airdrop/abis/ecdsa.d.ts +1316 -0
- package/dist/fhe-airdrop/abis/factory.d.ts +1319 -190
- package/dist/fhe-airdrop/abis/index.d.ts +5 -2
- package/dist/fhe-airdrop/abis/merkle.d.ts +1238 -0
- package/dist/fhe-airdrop/advanced/index.cjs +10 -12
- package/dist/fhe-airdrop/advanced/index.d.cts +34 -11
- package/dist/fhe-airdrop/advanced/index.d.ts +34 -11
- package/dist/fhe-airdrop/advanced/index.js +2 -8
- package/dist/fhe-airdrop/advanced/react/index.cjs +34 -48
- package/dist/fhe-airdrop/advanced/react/index.d.cts +9 -3
- package/dist/fhe-airdrop/advanced/react/index.d.ts +9 -3
- package/dist/fhe-airdrop/advanced/react/index.js +33 -48
- package/dist/fhe-airdrop/advanced/react/usePredictEcdsaAirdropAddress.d.ts +33 -0
- package/dist/fhe-airdrop/advanced/react/usePredictMerkleAirdropAddress.d.ts +27 -0
- package/dist/fhe-airdrop/airdrop-base.d.ts +600 -0
- package/dist/fhe-airdrop/campaign.d.ts +297 -0
- package/dist/fhe-airdrop/compliance.d.ts +302 -0
- package/dist/fhe-airdrop/constants.d.ts +33 -0
- package/dist/fhe-airdrop/ecdsa.d.ts +263 -0
- package/dist/fhe-airdrop/encryption.d.ts +92 -14
- package/dist/fhe-airdrop/errors.d.ts +245 -15
- package/dist/fhe-airdrop/factory.d.ts +533 -274
- package/dist/fhe-airdrop/guards.d.ts +273 -0
- package/dist/fhe-airdrop/index.cjs +1089 -33
- package/dist/fhe-airdrop/index.d.cts +46 -8
- package/dist/fhe-airdrop/index.d.ts +46 -8
- package/dist/fhe-airdrop/index.js +929 -7
- package/dist/fhe-airdrop/merkle-tree.d.ts +103 -0
- package/dist/fhe-airdrop/merkle.d.ts +180 -0
- package/dist/fhe-airdrop/react/_shared.d.ts +144 -71
- package/dist/fhe-airdrop/react/index.cjs +364 -413
- package/dist/fhe-airdrop/react/index.d.cts +53 -72
- package/dist/fhe-airdrop/react/index.d.ts +53 -72
- package/dist/fhe-airdrop/react/index.js +258 -369
- package/dist/fhe-airdrop/react/useAirdropGasFee.d.ts +10 -5
- package/dist/fhe-airdrop/react/useAirdropHasRole.d.ts +15 -6
- package/dist/fhe-airdrop/react/useAirdropPause.d.ts +30 -0
- package/dist/fhe-airdrop/react/useAirdropPaused.d.ts +17 -0
- package/dist/fhe-airdrop/react/useAirdropToken.d.ts +11 -4
- package/dist/fhe-airdrop/react/useAirdropWindow.d.ts +37 -0
- package/dist/fhe-airdrop/react/useClaimedAmount.d.ts +29 -0
- package/dist/fhe-airdrop/react/useComplianceManager.d.ts +16 -0
- package/dist/fhe-airdrop/react/useCreateEcdsaAirdrop.d.ts +28 -0
- package/dist/fhe-airdrop/react/useCreateMerkleAirdrop.d.ts +25 -0
- package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +23 -0
- package/dist/fhe-airdrop/react/useEffectiveUpgradeable.d.ts +20 -0
- package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +17 -12
- package/dist/fhe-airdrop/react/useFactoryFees.d.ts +28 -0
- package/dist/fhe-airdrop/react/useFactoryRegistry.d.ts +35 -0
- package/dist/fhe-airdrop/react/useFundAirdrop.d.ts +35 -0
- package/dist/fhe-airdrop/react/useGrantInstanceRoles.d.ts +35 -0
- package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +34 -0
- package/dist/fhe-airdrop/react/useMerkleRoot.d.ts +15 -0
- package/dist/fhe-airdrop/react/useSetMerkleRoot.d.ts +22 -0
- package/dist/fhe-airdrop/react/useWithdrawConfidential.d.ts +23 -0
- package/dist/fhe-airdrop/roles.d.ts +147 -0
- package/dist/fhe-airdrop/types.d.ts +68 -55
- package/dist/fhe-disperse/errors.d.ts +55 -0
- package/dist/fhe-disperse/index.cjs +34 -25
- package/dist/fhe-disperse/index.d.cts +1 -1
- package/dist/fhe-disperse/index.d.ts +1 -1
- package/dist/fhe-disperse/index.js +6 -5
- package/dist/fhe-disperse/react/index.cjs +42 -23
- package/dist/fhe-disperse/react/index.d.cts +3 -1
- package/dist/fhe-disperse/react/index.d.ts +3 -1
- package/dist/fhe-disperse/react/index.js +9 -6
- package/dist/fhe-vesting/advanced/index.cjs +8 -7
- package/dist/fhe-vesting/advanced/index.js +6 -5
- package/dist/fhe-vesting/advanced/react/index.cjs +12 -11
- package/dist/fhe-vesting/advanced/react/index.js +9 -8
- package/dist/fhe-vesting/index.cjs +35 -34
- package/dist/fhe-vesting/index.js +7 -6
- package/dist/fhe-vesting/manager.d.ts +19 -0
- package/dist/fhe-vesting/react/index.cjs +160 -140
- package/dist/fhe-vesting/react/index.d.cts +6 -4
- package/dist/fhe-vesting/react/index.d.ts +6 -4
- package/dist/fhe-vesting/react/index.js +24 -16
- package/dist/fhe-vesting/react/useAccessClaimableAmount.d.ts +11 -3
- package/dist/fhe-vesting/react/useAccessSettledAmount.d.ts +11 -3
- package/dist/fhe-vesting/react/useAccessTotalAllocation.d.ts +11 -3
- package/dist/fhe-vesting/react/useAccessVestedAmount.d.ts +11 -3
- package/dist/fhe-vesting/react/useAdminGetClaimableAmount.d.ts +1 -1
- package/dist/fhe-vesting/react/useAdminGetSettledAmount.d.ts +1 -1
- package/dist/fhe-vesting/react/useAdminGetTotalAllocation.d.ts +1 -1
- package/dist/fhe-vesting/react/useAdminGetVestedAmount.d.ts +1 -1
- package/dist/fhe-vesting/react/useAdminPartialClaim.d.ts +8 -0
- package/dist/fhe-vesting/react/useClaim.d.ts +1 -1
- package/dist/fhe-vesting/react/useDiscloseHandleToParty.d.ts +1 -1
- package/dist/fhe-vesting/react/useManagerDiscloseHandleToParty.d.ts +1 -1
- package/dist/fhe-vesting/react/usePartialClaim.d.ts +1 -1
- package/dist/fhe-vesting/react/useVestingInfo.d.ts +1 -1
- package/dist/fhe-vesting/types.d.ts +12 -1
- package/dist/index.cjs +27 -15
- package/dist/index.js +1 -1
- package/dist/testnet-faucet/index.cjs +17 -16
- package/dist/testnet-faucet/index.js +5 -4
- package/dist/testnet-faucet/react/index.cjs +11 -10
- package/dist/testnet-faucet/react/index.js +6 -5
- package/package.json +18 -9
- package/dist/chunk-4WPGQSNT.cjs +0 -44
- package/dist/chunk-6R4KNAPK.js +0 -1630
- package/dist/chunk-DUZIIRPF.js +0 -1655
- package/dist/chunk-MCRBVJGZ.cjs +0 -1637
- package/dist/chunk-ODLTEGHB.js +0 -41
- package/dist/chunk-ORFTDNFZ.js +0 -105
- package/dist/chunk-T46YXSBP.cjs +0 -109
- package/dist/chunk-TIUKIY5V.cjs +0 -1663
- package/dist/fhe-airdrop/advanced/factory-advanced.d.ts +0 -53
- package/dist/fhe-airdrop/advanced/react/usePredictAirdropAddress.d.ts +0 -49
- package/dist/fhe-airdrop/airdrop.d.ts +0 -310
- package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +0 -31
- package/dist/fhe-airdrop/react/useAirdropCanExtendClaimWindow.d.ts +0 -7
- package/dist/fhe-airdrop/react/useAirdropClaim.d.ts +0 -27
- package/dist/fhe-airdrop/react/useAirdropClaimTypehash.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropClaimedSignatures.d.ts +0 -16
- package/dist/fhe-airdrop/react/useAirdropDeploymentBlockNumber.d.ts +0 -6
- package/dist/fhe-airdrop/react/useAirdropDomainSeparator.d.ts +0 -8
- package/dist/fhe-airdrop/react/useAirdropEndTime.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropFactoryCustomFee.d.ts +0 -17
- package/dist/fhe-airdrop/react/useAirdropFactoryDefaultGasFee.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropFactoryDisableCustomFee.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropFactoryFeeCollector.d.ts +0 -11
- package/dist/fhe-airdrop/react/useAirdropFactoryInitCodeHash.d.ts +0 -17
- package/dist/fhe-airdrop/react/useAirdropFactorySetCustomFee.d.ts +0 -17
- package/dist/fhe-airdrop/react/useAirdropFactorySetDefaultGasFee.d.ts +0 -16
- package/dist/fhe-airdrop/react/useAirdropFactorySetFeeCollector.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +0 -16
- package/dist/fhe-airdrop/react/useAirdropHasClaimEnded.d.ts +0 -7
- package/dist/fhe-airdrop/react/useAirdropHasClaimStarted.d.ts +0 -7
- package/dist/fhe-airdrop/react/useAirdropIsClaimWindowActive.d.ts +0 -9
- package/dist/fhe-airdrop/react/useAirdropIsPaused.d.ts +0 -8
- package/dist/fhe-airdrop/react/useAirdropIsSignatureClaimed.d.ts +0 -22
- package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +0 -51
- package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropStartTime.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropWithdrawGasFee.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropWithdrawOtherConfidentialToken.d.ts +0 -14
- package/dist/fhe-airdrop/react/useAirdropWithdrawOtherToken.d.ts +0 -14
- package/dist/fhe-airdrop/react/useClaim.d.ts +0 -31
- package/dist/fhe-airdrop/react/useConfidentialAirdropFactoryImplementation.d.ts +0 -11
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +0 -41
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +0 -48
- package/dist/fhe-airdrop/react/useCreateConfidentialAirdrop.d.ts +0 -29
- package/dist/fhe-airdrop/react/useCreateConfidentialAirdropAndGetAddress.d.ts +0 -31
- package/dist/fhe-airdrop/react/useDisableCustomFee.d.ts +0 -14
- package/dist/fhe-airdrop/react/useFactoryCustomFee.d.ts +0 -17
- package/dist/fhe-airdrop/react/useFactoryDefaultGasFee.d.ts +0 -10
- package/dist/fhe-airdrop/react/useFactoryFeeCollector.d.ts +0 -11
- package/dist/fhe-airdrop/react/useFactoryInitCodeHash.d.ts +0 -17
- package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +0 -33
- package/dist/fhe-airdrop/react/useGetClaimAmount.d.ts +0 -30
- package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +0 -51
- package/dist/fhe-airdrop/react/useSetCustomFee.d.ts +0 -16
- package/dist/fhe-airdrop/react/useSetDefaultGasFee.d.ts +0 -15
- package/dist/fhe-airdrop/react/useSetFeeCollector.d.ts +0 -14
- package/dist/fhe-airdrop/react/useSetPaused.d.ts +0 -14
- package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +0 -31
- package/dist/fhe-airdrop/react/useWithdraw.d.ts +0 -12
- package/dist/fhe-airdrop/react/useWithdrawOtherConfidentialToken.d.ts +0 -13
- package/dist/fhe-airdrop/react/useWithdrawOtherToken.d.ts +0 -13
- package/dist/fhe-vesting/react/useGetClaimableAmount.d.ts +0 -13
- package/dist/fhe-vesting/react/useGetSettledAmount.d.ts +0 -14
- package/dist/fhe-vesting/react/useGetTotalAllocation.d.ts +0 -13
- package/dist/fhe-vesting/react/useGetVestedAmount.d.ts +0 -25
package/dist/chunk-MCRBVJGZ.cjs
DELETED
|
@@ -1,1637 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkFAXIIH5R_cjs = require('./chunk-FAXIIH5R.cjs');
|
|
4
|
-
var chunkKLKI352M_cjs = require('./chunk-KLKI352M.cjs');
|
|
5
|
-
var chunkVJKZWYYJ_cjs = require('./chunk-VJKZWYYJ.cjs');
|
|
6
|
-
var chunk67OV5CX2_cjs = require('./chunk-67OV5CX2.cjs');
|
|
7
|
-
var viem = require('viem');
|
|
8
|
-
|
|
9
|
-
// src/fhe-airdrop/abis/cloneable.ts
|
|
10
|
-
var confidentialAirdropCloneableAbi = [
|
|
11
|
-
{
|
|
12
|
-
inputs: [],
|
|
13
|
-
stateMutability: "nonpayable",
|
|
14
|
-
type: "constructor"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
inputs: [],
|
|
18
|
-
name: "AccessControlBadConfirmation",
|
|
19
|
-
type: "error"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
inputs: [
|
|
23
|
-
{
|
|
24
|
-
internalType: "address",
|
|
25
|
-
name: "account",
|
|
26
|
-
type: "address"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
internalType: "bytes32",
|
|
30
|
-
name: "neededRole",
|
|
31
|
-
type: "bytes32"
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
name: "AccessControlUnauthorizedAccount",
|
|
35
|
-
type: "error"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
inputs: [],
|
|
39
|
-
name: "ClaimNotStarted",
|
|
40
|
-
type: "error"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
inputs: [],
|
|
44
|
-
name: "ClaimWindowFinished",
|
|
45
|
-
type: "error"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
inputs: [],
|
|
49
|
-
name: "ClaimsPaused",
|
|
50
|
-
type: "error"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
inputs: [],
|
|
54
|
-
name: "ECDSAInvalidSignature",
|
|
55
|
-
type: "error"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
inputs: [
|
|
59
|
-
{
|
|
60
|
-
internalType: "uint256",
|
|
61
|
-
name: "length",
|
|
62
|
-
type: "uint256"
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
name: "ECDSAInvalidSignatureLength",
|
|
66
|
-
type: "error"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
inputs: [
|
|
70
|
-
{
|
|
71
|
-
internalType: "bytes32",
|
|
72
|
-
name: "s",
|
|
73
|
-
type: "bytes32"
|
|
74
|
-
}
|
|
75
|
-
],
|
|
76
|
-
name: "ECDSAInvalidSignatureS",
|
|
77
|
-
type: "error"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
inputs: [],
|
|
81
|
-
name: "EndTimeInPast",
|
|
82
|
-
type: "error"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
inputs: [],
|
|
86
|
-
name: "ExtensionNotAllowed",
|
|
87
|
-
type: "error"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
inputs: [],
|
|
91
|
-
name: "InsufficientBalance",
|
|
92
|
-
type: "error"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
inputs: [],
|
|
96
|
-
name: "InsufficientFee",
|
|
97
|
-
type: "error"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
inputs: [],
|
|
101
|
-
name: "InvalidAddress",
|
|
102
|
-
type: "error"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
inputs: [],
|
|
106
|
-
name: "InvalidDuration",
|
|
107
|
-
type: "error"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
inputs: [],
|
|
111
|
-
name: "InvalidInitialization",
|
|
112
|
-
type: "error"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
inputs: [],
|
|
116
|
-
name: "InvalidSignature",
|
|
117
|
-
type: "error"
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
inputs: [],
|
|
121
|
-
name: "InvalidStartTime",
|
|
122
|
-
type: "error"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
inputs: [],
|
|
126
|
-
name: "NotInitializing",
|
|
127
|
-
type: "error"
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
inputs: [
|
|
131
|
-
{
|
|
132
|
-
internalType: "bytes32",
|
|
133
|
-
name: "handle",
|
|
134
|
-
type: "bytes32"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
internalType: "address",
|
|
138
|
-
name: "sender",
|
|
139
|
-
type: "address"
|
|
140
|
-
}
|
|
141
|
-
],
|
|
142
|
-
name: "SenderNotAllowedToUseHandle",
|
|
143
|
-
type: "error"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
inputs: [
|
|
147
|
-
{
|
|
148
|
-
internalType: "address",
|
|
149
|
-
name: "sender",
|
|
150
|
-
type: "address"
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
name: "SenderNotAllowed",
|
|
154
|
-
type: "error"
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
inputs: [],
|
|
158
|
-
name: "SignatureAlreadyClaimed",
|
|
159
|
-
type: "error"
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
inputs: [],
|
|
163
|
-
name: "TransferFailed",
|
|
164
|
-
type: "error"
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
inputs: [],
|
|
168
|
-
name: "ZamaProtocolUnsupported",
|
|
169
|
-
type: "error"
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
inputs: [],
|
|
173
|
-
name: "ZeroBalance",
|
|
174
|
-
type: "error"
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
anonymous: false,
|
|
178
|
-
inputs: [
|
|
179
|
-
{
|
|
180
|
-
indexed: true,
|
|
181
|
-
internalType: "address",
|
|
182
|
-
name: "admin",
|
|
183
|
-
type: "address"
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
indexed: false,
|
|
187
|
-
internalType: "uint32",
|
|
188
|
-
name: "oldEndTime",
|
|
189
|
-
type: "uint32"
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
indexed: false,
|
|
193
|
-
internalType: "uint32",
|
|
194
|
-
name: "newEndTime",
|
|
195
|
-
type: "uint32"
|
|
196
|
-
}
|
|
197
|
-
],
|
|
198
|
-
name: "ClaimWindowExtended",
|
|
199
|
-
type: "event"
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
anonymous: false,
|
|
203
|
-
inputs: [
|
|
204
|
-
{
|
|
205
|
-
indexed: true,
|
|
206
|
-
internalType: "address",
|
|
207
|
-
name: "user",
|
|
208
|
-
type: "address"
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
indexed: false,
|
|
212
|
-
internalType: "bytes32",
|
|
213
|
-
name: "signatureHash",
|
|
214
|
-
type: "bytes32"
|
|
215
|
-
}
|
|
216
|
-
],
|
|
217
|
-
name: "Claimed",
|
|
218
|
-
type: "event"
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
anonymous: false,
|
|
222
|
-
inputs: [],
|
|
223
|
-
name: "EIP712DomainChanged",
|
|
224
|
-
type: "event"
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
anonymous: false,
|
|
228
|
-
inputs: [
|
|
229
|
-
{
|
|
230
|
-
indexed: true,
|
|
231
|
-
internalType: "address",
|
|
232
|
-
name: "recipient",
|
|
233
|
-
type: "address"
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
indexed: false,
|
|
237
|
-
internalType: "uint256",
|
|
238
|
-
name: "amount",
|
|
239
|
-
type: "uint256"
|
|
240
|
-
}
|
|
241
|
-
],
|
|
242
|
-
name: "GasFeeWithdrawn",
|
|
243
|
-
type: "event"
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
anonymous: false,
|
|
247
|
-
inputs: [
|
|
248
|
-
{
|
|
249
|
-
indexed: false,
|
|
250
|
-
internalType: "uint64",
|
|
251
|
-
name: "version",
|
|
252
|
-
type: "uint64"
|
|
253
|
-
}
|
|
254
|
-
],
|
|
255
|
-
name: "Initialized",
|
|
256
|
-
type: "event"
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
anonymous: false,
|
|
260
|
-
inputs: [
|
|
261
|
-
{
|
|
262
|
-
indexed: true,
|
|
263
|
-
internalType: "address",
|
|
264
|
-
name: "admin",
|
|
265
|
-
type: "address"
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
indexed: true,
|
|
269
|
-
internalType: "address",
|
|
270
|
-
name: "feeCollector",
|
|
271
|
-
type: "address"
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
indexed: false,
|
|
275
|
-
internalType: "uint32",
|
|
276
|
-
name: "endTime",
|
|
277
|
-
type: "uint32"
|
|
278
|
-
}
|
|
279
|
-
],
|
|
280
|
-
name: "Initialized",
|
|
281
|
-
type: "event"
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
anonymous: false,
|
|
285
|
-
inputs: [
|
|
286
|
-
{
|
|
287
|
-
indexed: true,
|
|
288
|
-
internalType: "address",
|
|
289
|
-
name: "admin",
|
|
290
|
-
type: "address"
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
indexed: true,
|
|
294
|
-
internalType: "address",
|
|
295
|
-
name: "token",
|
|
296
|
-
type: "address"
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
indexed: true,
|
|
300
|
-
internalType: "address",
|
|
301
|
-
name: "recipient",
|
|
302
|
-
type: "address"
|
|
303
|
-
}
|
|
304
|
-
],
|
|
305
|
-
name: "OtherConfidentialTokenWithdrawn",
|
|
306
|
-
type: "event"
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
anonymous: false,
|
|
310
|
-
inputs: [
|
|
311
|
-
{
|
|
312
|
-
indexed: true,
|
|
313
|
-
internalType: "address",
|
|
314
|
-
name: "admin",
|
|
315
|
-
type: "address"
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
indexed: true,
|
|
319
|
-
internalType: "address",
|
|
320
|
-
name: "token",
|
|
321
|
-
type: "address"
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
indexed: false,
|
|
325
|
-
internalType: "uint256",
|
|
326
|
-
name: "amount",
|
|
327
|
-
type: "uint256"
|
|
328
|
-
}
|
|
329
|
-
],
|
|
330
|
-
name: "OtherTokenWithdrawn",
|
|
331
|
-
type: "event"
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
anonymous: false,
|
|
335
|
-
inputs: [
|
|
336
|
-
{
|
|
337
|
-
indexed: false,
|
|
338
|
-
internalType: "bool",
|
|
339
|
-
name: "isPaused",
|
|
340
|
-
type: "bool"
|
|
341
|
-
}
|
|
342
|
-
],
|
|
343
|
-
name: "PauseToggled",
|
|
344
|
-
type: "event"
|
|
345
|
-
},
|
|
346
|
-
{
|
|
347
|
-
anonymous: false,
|
|
348
|
-
inputs: [
|
|
349
|
-
{
|
|
350
|
-
indexed: true,
|
|
351
|
-
internalType: "bytes32",
|
|
352
|
-
name: "role",
|
|
353
|
-
type: "bytes32"
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
indexed: true,
|
|
357
|
-
internalType: "bytes32",
|
|
358
|
-
name: "previousAdminRole",
|
|
359
|
-
type: "bytes32"
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
indexed: true,
|
|
363
|
-
internalType: "bytes32",
|
|
364
|
-
name: "newAdminRole",
|
|
365
|
-
type: "bytes32"
|
|
366
|
-
}
|
|
367
|
-
],
|
|
368
|
-
name: "RoleAdminChanged",
|
|
369
|
-
type: "event"
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
anonymous: false,
|
|
373
|
-
inputs: [
|
|
374
|
-
{
|
|
375
|
-
indexed: true,
|
|
376
|
-
internalType: "bytes32",
|
|
377
|
-
name: "role",
|
|
378
|
-
type: "bytes32"
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
indexed: true,
|
|
382
|
-
internalType: "address",
|
|
383
|
-
name: "account",
|
|
384
|
-
type: "address"
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
indexed: true,
|
|
388
|
-
internalType: "address",
|
|
389
|
-
name: "sender",
|
|
390
|
-
type: "address"
|
|
391
|
-
}
|
|
392
|
-
],
|
|
393
|
-
name: "RoleGranted",
|
|
394
|
-
type: "event"
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
anonymous: false,
|
|
398
|
-
inputs: [
|
|
399
|
-
{
|
|
400
|
-
indexed: true,
|
|
401
|
-
internalType: "bytes32",
|
|
402
|
-
name: "role",
|
|
403
|
-
type: "bytes32"
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
indexed: true,
|
|
407
|
-
internalType: "address",
|
|
408
|
-
name: "account",
|
|
409
|
-
type: "address"
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
indexed: true,
|
|
413
|
-
internalType: "address",
|
|
414
|
-
name: "sender",
|
|
415
|
-
type: "address"
|
|
416
|
-
}
|
|
417
|
-
],
|
|
418
|
-
name: "RoleRevoked",
|
|
419
|
-
type: "event"
|
|
420
|
-
},
|
|
421
|
-
{
|
|
422
|
-
anonymous: false,
|
|
423
|
-
inputs: [
|
|
424
|
-
{
|
|
425
|
-
indexed: true,
|
|
426
|
-
internalType: "address",
|
|
427
|
-
name: "admin",
|
|
428
|
-
type: "address"
|
|
429
|
-
},
|
|
430
|
-
{
|
|
431
|
-
indexed: true,
|
|
432
|
-
internalType: "address",
|
|
433
|
-
name: "recipient",
|
|
434
|
-
type: "address"
|
|
435
|
-
}
|
|
436
|
-
],
|
|
437
|
-
name: "Withdrawn",
|
|
438
|
-
type: "event"
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
inputs: [],
|
|
442
|
-
name: "CAN_EXTEND_CLAIM_WINDOW",
|
|
443
|
-
outputs: [
|
|
444
|
-
{
|
|
445
|
-
internalType: "bool",
|
|
446
|
-
name: "",
|
|
447
|
-
type: "bool"
|
|
448
|
-
}
|
|
449
|
-
],
|
|
450
|
-
stateMutability: "view",
|
|
451
|
-
type: "function"
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
inputs: [],
|
|
455
|
-
name: "CLAIM_TYPEHASH",
|
|
456
|
-
outputs: [
|
|
457
|
-
{
|
|
458
|
-
internalType: "bytes32",
|
|
459
|
-
name: "",
|
|
460
|
-
type: "bytes32"
|
|
461
|
-
}
|
|
462
|
-
],
|
|
463
|
-
stateMutability: "view",
|
|
464
|
-
type: "function"
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
inputs: [],
|
|
468
|
-
name: "DEFAULT_ADMIN_ROLE",
|
|
469
|
-
outputs: [
|
|
470
|
-
{
|
|
471
|
-
internalType: "bytes32",
|
|
472
|
-
name: "",
|
|
473
|
-
type: "bytes32"
|
|
474
|
-
}
|
|
475
|
-
],
|
|
476
|
-
stateMutability: "view",
|
|
477
|
-
type: "function"
|
|
478
|
-
},
|
|
479
|
-
{
|
|
480
|
-
inputs: [],
|
|
481
|
-
name: "DOMAIN_SEPARATOR",
|
|
482
|
-
outputs: [
|
|
483
|
-
{
|
|
484
|
-
internalType: "bytes32",
|
|
485
|
-
name: "",
|
|
486
|
-
type: "bytes32"
|
|
487
|
-
}
|
|
488
|
-
],
|
|
489
|
-
stateMutability: "view",
|
|
490
|
-
type: "function"
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
inputs: [],
|
|
494
|
-
name: "FEE_COLLECTOR_ROLE",
|
|
495
|
-
outputs: [
|
|
496
|
-
{
|
|
497
|
-
internalType: "bytes32",
|
|
498
|
-
name: "",
|
|
499
|
-
type: "bytes32"
|
|
500
|
-
}
|
|
501
|
-
],
|
|
502
|
-
stateMutability: "view",
|
|
503
|
-
type: "function"
|
|
504
|
-
},
|
|
505
|
-
{
|
|
506
|
-
inputs: [],
|
|
507
|
-
name: "GAS_FEE",
|
|
508
|
-
outputs: [
|
|
509
|
-
{
|
|
510
|
-
internalType: "uint256",
|
|
511
|
-
name: "",
|
|
512
|
-
type: "uint256"
|
|
513
|
-
}
|
|
514
|
-
],
|
|
515
|
-
stateMutability: "view",
|
|
516
|
-
type: "function"
|
|
517
|
-
},
|
|
518
|
-
{
|
|
519
|
-
inputs: [],
|
|
520
|
-
name: "START_TIME",
|
|
521
|
-
outputs: [
|
|
522
|
-
{
|
|
523
|
-
internalType: "uint32",
|
|
524
|
-
name: "",
|
|
525
|
-
type: "uint32"
|
|
526
|
-
}
|
|
527
|
-
],
|
|
528
|
-
stateMutability: "view",
|
|
529
|
-
type: "function"
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
inputs: [],
|
|
533
|
-
name: "TOKEN",
|
|
534
|
-
outputs: [
|
|
535
|
-
{
|
|
536
|
-
internalType: "contract IERC7984",
|
|
537
|
-
name: "",
|
|
538
|
-
type: "address"
|
|
539
|
-
}
|
|
540
|
-
],
|
|
541
|
-
stateMutability: "view",
|
|
542
|
-
type: "function"
|
|
543
|
-
},
|
|
544
|
-
{
|
|
545
|
-
inputs: [
|
|
546
|
-
{
|
|
547
|
-
internalType: "externalEuint64",
|
|
548
|
-
name: "inputAmount",
|
|
549
|
-
type: "bytes32"
|
|
550
|
-
},
|
|
551
|
-
{
|
|
552
|
-
internalType: "bytes",
|
|
553
|
-
name: "inputProof",
|
|
554
|
-
type: "bytes"
|
|
555
|
-
},
|
|
556
|
-
{
|
|
557
|
-
internalType: "bytes",
|
|
558
|
-
name: "signature",
|
|
559
|
-
type: "bytes"
|
|
560
|
-
}
|
|
561
|
-
],
|
|
562
|
-
name: "claim",
|
|
563
|
-
outputs: [],
|
|
564
|
-
stateMutability: "payable",
|
|
565
|
-
type: "function"
|
|
566
|
-
},
|
|
567
|
-
{
|
|
568
|
-
inputs: [
|
|
569
|
-
{
|
|
570
|
-
internalType: "bytes32",
|
|
571
|
-
name: "signatureHash",
|
|
572
|
-
type: "bytes32"
|
|
573
|
-
}
|
|
574
|
-
],
|
|
575
|
-
name: "claimedSignatures",
|
|
576
|
-
outputs: [
|
|
577
|
-
{
|
|
578
|
-
internalType: "bool",
|
|
579
|
-
name: "isClaimed",
|
|
580
|
-
type: "bool"
|
|
581
|
-
}
|
|
582
|
-
],
|
|
583
|
-
stateMutability: "view",
|
|
584
|
-
type: "function"
|
|
585
|
-
},
|
|
586
|
-
{
|
|
587
|
-
inputs: [],
|
|
588
|
-
name: "deploymentBlockNumber",
|
|
589
|
-
outputs: [
|
|
590
|
-
{
|
|
591
|
-
internalType: "uint256",
|
|
592
|
-
name: "",
|
|
593
|
-
type: "uint256"
|
|
594
|
-
}
|
|
595
|
-
],
|
|
596
|
-
stateMutability: "view",
|
|
597
|
-
type: "function"
|
|
598
|
-
},
|
|
599
|
-
{
|
|
600
|
-
inputs: [],
|
|
601
|
-
name: "eip712Domain",
|
|
602
|
-
outputs: [
|
|
603
|
-
{
|
|
604
|
-
internalType: "bytes1",
|
|
605
|
-
name: "fields",
|
|
606
|
-
type: "bytes1"
|
|
607
|
-
},
|
|
608
|
-
{
|
|
609
|
-
internalType: "string",
|
|
610
|
-
name: "name",
|
|
611
|
-
type: "string"
|
|
612
|
-
},
|
|
613
|
-
{
|
|
614
|
-
internalType: "string",
|
|
615
|
-
name: "version",
|
|
616
|
-
type: "string"
|
|
617
|
-
},
|
|
618
|
-
{
|
|
619
|
-
internalType: "uint256",
|
|
620
|
-
name: "chainId",
|
|
621
|
-
type: "uint256"
|
|
622
|
-
},
|
|
623
|
-
{
|
|
624
|
-
internalType: "address",
|
|
625
|
-
name: "verifyingContract",
|
|
626
|
-
type: "address"
|
|
627
|
-
},
|
|
628
|
-
{
|
|
629
|
-
internalType: "bytes32",
|
|
630
|
-
name: "salt",
|
|
631
|
-
type: "bytes32"
|
|
632
|
-
},
|
|
633
|
-
{
|
|
634
|
-
internalType: "uint256[]",
|
|
635
|
-
name: "extensions",
|
|
636
|
-
type: "uint256[]"
|
|
637
|
-
}
|
|
638
|
-
],
|
|
639
|
-
stateMutability: "view",
|
|
640
|
-
type: "function"
|
|
641
|
-
},
|
|
642
|
-
{
|
|
643
|
-
inputs: [],
|
|
644
|
-
name: "endTime",
|
|
645
|
-
outputs: [
|
|
646
|
-
{
|
|
647
|
-
internalType: "uint32",
|
|
648
|
-
name: "",
|
|
649
|
-
type: "uint32"
|
|
650
|
-
}
|
|
651
|
-
],
|
|
652
|
-
stateMutability: "view",
|
|
653
|
-
type: "function"
|
|
654
|
-
},
|
|
655
|
-
{
|
|
656
|
-
inputs: [
|
|
657
|
-
{
|
|
658
|
-
internalType: "uint32",
|
|
659
|
-
name: "newEndTime",
|
|
660
|
-
type: "uint32"
|
|
661
|
-
}
|
|
662
|
-
],
|
|
663
|
-
name: "extendClaimWindow",
|
|
664
|
-
outputs: [],
|
|
665
|
-
stateMutability: "nonpayable",
|
|
666
|
-
type: "function"
|
|
667
|
-
},
|
|
668
|
-
{
|
|
669
|
-
inputs: [
|
|
670
|
-
{
|
|
671
|
-
internalType: "externalEuint64",
|
|
672
|
-
name: "inputAmount",
|
|
673
|
-
type: "bytes32"
|
|
674
|
-
},
|
|
675
|
-
{
|
|
676
|
-
internalType: "bytes",
|
|
677
|
-
name: "inputProof",
|
|
678
|
-
type: "bytes"
|
|
679
|
-
},
|
|
680
|
-
{
|
|
681
|
-
internalType: "bytes",
|
|
682
|
-
name: "signature",
|
|
683
|
-
type: "bytes"
|
|
684
|
-
}
|
|
685
|
-
],
|
|
686
|
-
name: "getClaimAmount",
|
|
687
|
-
outputs: [
|
|
688
|
-
{
|
|
689
|
-
internalType: "euint64",
|
|
690
|
-
name: "encryptedAmount",
|
|
691
|
-
type: "bytes32"
|
|
692
|
-
}
|
|
693
|
-
],
|
|
694
|
-
stateMutability: "nonpayable",
|
|
695
|
-
type: "function"
|
|
696
|
-
},
|
|
697
|
-
{
|
|
698
|
-
inputs: [
|
|
699
|
-
{
|
|
700
|
-
internalType: "bytes32",
|
|
701
|
-
name: "role",
|
|
702
|
-
type: "bytes32"
|
|
703
|
-
}
|
|
704
|
-
],
|
|
705
|
-
name: "getRoleAdmin",
|
|
706
|
-
outputs: [
|
|
707
|
-
{
|
|
708
|
-
internalType: "bytes32",
|
|
709
|
-
name: "",
|
|
710
|
-
type: "bytes32"
|
|
711
|
-
}
|
|
712
|
-
],
|
|
713
|
-
stateMutability: "view",
|
|
714
|
-
type: "function"
|
|
715
|
-
},
|
|
716
|
-
{
|
|
717
|
-
inputs: [
|
|
718
|
-
{
|
|
719
|
-
internalType: "bytes32",
|
|
720
|
-
name: "role",
|
|
721
|
-
type: "bytes32"
|
|
722
|
-
},
|
|
723
|
-
{
|
|
724
|
-
internalType: "address",
|
|
725
|
-
name: "account",
|
|
726
|
-
type: "address"
|
|
727
|
-
}
|
|
728
|
-
],
|
|
729
|
-
name: "grantRole",
|
|
730
|
-
outputs: [],
|
|
731
|
-
stateMutability: "nonpayable",
|
|
732
|
-
type: "function"
|
|
733
|
-
},
|
|
734
|
-
{
|
|
735
|
-
inputs: [],
|
|
736
|
-
name: "hasClaimEnded",
|
|
737
|
-
outputs: [
|
|
738
|
-
{
|
|
739
|
-
internalType: "bool",
|
|
740
|
-
name: "",
|
|
741
|
-
type: "bool"
|
|
742
|
-
}
|
|
743
|
-
],
|
|
744
|
-
stateMutability: "view",
|
|
745
|
-
type: "function"
|
|
746
|
-
},
|
|
747
|
-
{
|
|
748
|
-
inputs: [],
|
|
749
|
-
name: "hasClaimStarted",
|
|
750
|
-
outputs: [
|
|
751
|
-
{
|
|
752
|
-
internalType: "bool",
|
|
753
|
-
name: "",
|
|
754
|
-
type: "bool"
|
|
755
|
-
}
|
|
756
|
-
],
|
|
757
|
-
stateMutability: "view",
|
|
758
|
-
type: "function"
|
|
759
|
-
},
|
|
760
|
-
{
|
|
761
|
-
inputs: [
|
|
762
|
-
{
|
|
763
|
-
internalType: "bytes32",
|
|
764
|
-
name: "role",
|
|
765
|
-
type: "bytes32"
|
|
766
|
-
},
|
|
767
|
-
{
|
|
768
|
-
internalType: "address",
|
|
769
|
-
name: "account",
|
|
770
|
-
type: "address"
|
|
771
|
-
}
|
|
772
|
-
],
|
|
773
|
-
name: "hasRole",
|
|
774
|
-
outputs: [
|
|
775
|
-
{
|
|
776
|
-
internalType: "bool",
|
|
777
|
-
name: "",
|
|
778
|
-
type: "bool"
|
|
779
|
-
}
|
|
780
|
-
],
|
|
781
|
-
stateMutability: "view",
|
|
782
|
-
type: "function"
|
|
783
|
-
},
|
|
784
|
-
{
|
|
785
|
-
inputs: [
|
|
786
|
-
{
|
|
787
|
-
internalType: "address",
|
|
788
|
-
name: "_admin",
|
|
789
|
-
type: "address"
|
|
790
|
-
},
|
|
791
|
-
{
|
|
792
|
-
internalType: "address",
|
|
793
|
-
name: "_feeCollector",
|
|
794
|
-
type: "address"
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
internalType: "uint32",
|
|
798
|
-
name: "_endTime",
|
|
799
|
-
type: "uint32"
|
|
800
|
-
}
|
|
801
|
-
],
|
|
802
|
-
name: "initialize",
|
|
803
|
-
outputs: [],
|
|
804
|
-
stateMutability: "nonpayable",
|
|
805
|
-
type: "function"
|
|
806
|
-
},
|
|
807
|
-
{
|
|
808
|
-
inputs: [],
|
|
809
|
-
name: "isClaimWindowActive",
|
|
810
|
-
outputs: [
|
|
811
|
-
{
|
|
812
|
-
internalType: "bool",
|
|
813
|
-
name: "",
|
|
814
|
-
type: "bool"
|
|
815
|
-
}
|
|
816
|
-
],
|
|
817
|
-
stateMutability: "view",
|
|
818
|
-
type: "function"
|
|
819
|
-
},
|
|
820
|
-
{
|
|
821
|
-
inputs: [],
|
|
822
|
-
name: "isPaused",
|
|
823
|
-
outputs: [
|
|
824
|
-
{
|
|
825
|
-
internalType: "bool",
|
|
826
|
-
name: "",
|
|
827
|
-
type: "bool"
|
|
828
|
-
}
|
|
829
|
-
],
|
|
830
|
-
stateMutability: "view",
|
|
831
|
-
type: "function"
|
|
832
|
-
},
|
|
833
|
-
{
|
|
834
|
-
inputs: [
|
|
835
|
-
{
|
|
836
|
-
internalType: "address",
|
|
837
|
-
name: "user",
|
|
838
|
-
type: "address"
|
|
839
|
-
},
|
|
840
|
-
{
|
|
841
|
-
internalType: "externalEuint64",
|
|
842
|
-
name: "encryptedAmount",
|
|
843
|
-
type: "bytes32"
|
|
844
|
-
}
|
|
845
|
-
],
|
|
846
|
-
name: "isSignatureClaimed",
|
|
847
|
-
outputs: [
|
|
848
|
-
{
|
|
849
|
-
internalType: "bool",
|
|
850
|
-
name: "",
|
|
851
|
-
type: "bool"
|
|
852
|
-
}
|
|
853
|
-
],
|
|
854
|
-
stateMutability: "view",
|
|
855
|
-
type: "function"
|
|
856
|
-
},
|
|
857
|
-
{
|
|
858
|
-
inputs: [
|
|
859
|
-
{
|
|
860
|
-
internalType: "externalEuint64",
|
|
861
|
-
name: "inputAmount",
|
|
862
|
-
type: "bytes32"
|
|
863
|
-
},
|
|
864
|
-
{
|
|
865
|
-
internalType: "bytes",
|
|
866
|
-
name: "signature",
|
|
867
|
-
type: "bytes"
|
|
868
|
-
}
|
|
869
|
-
],
|
|
870
|
-
name: "isSignatureValid",
|
|
871
|
-
outputs: [
|
|
872
|
-
{
|
|
873
|
-
internalType: "bool",
|
|
874
|
-
name: "",
|
|
875
|
-
type: "bool"
|
|
876
|
-
}
|
|
877
|
-
],
|
|
878
|
-
stateMutability: "view",
|
|
879
|
-
type: "function"
|
|
880
|
-
},
|
|
881
|
-
{
|
|
882
|
-
inputs: [
|
|
883
|
-
{
|
|
884
|
-
internalType: "bytes32",
|
|
885
|
-
name: "role",
|
|
886
|
-
type: "bytes32"
|
|
887
|
-
},
|
|
888
|
-
{
|
|
889
|
-
internalType: "address",
|
|
890
|
-
name: "callerConfirmation",
|
|
891
|
-
type: "address"
|
|
892
|
-
}
|
|
893
|
-
],
|
|
894
|
-
name: "renounceRole",
|
|
895
|
-
outputs: [],
|
|
896
|
-
stateMutability: "nonpayable",
|
|
897
|
-
type: "function"
|
|
898
|
-
},
|
|
899
|
-
{
|
|
900
|
-
inputs: [
|
|
901
|
-
{
|
|
902
|
-
internalType: "bytes32",
|
|
903
|
-
name: "role",
|
|
904
|
-
type: "bytes32"
|
|
905
|
-
},
|
|
906
|
-
{
|
|
907
|
-
internalType: "address",
|
|
908
|
-
name: "account",
|
|
909
|
-
type: "address"
|
|
910
|
-
}
|
|
911
|
-
],
|
|
912
|
-
name: "revokeRole",
|
|
913
|
-
outputs: [],
|
|
914
|
-
stateMutability: "nonpayable",
|
|
915
|
-
type: "function"
|
|
916
|
-
},
|
|
917
|
-
{
|
|
918
|
-
inputs: [
|
|
919
|
-
{
|
|
920
|
-
internalType: "bool",
|
|
921
|
-
name: "paused",
|
|
922
|
-
type: "bool"
|
|
923
|
-
}
|
|
924
|
-
],
|
|
925
|
-
name: "setPaused",
|
|
926
|
-
outputs: [],
|
|
927
|
-
stateMutability: "nonpayable",
|
|
928
|
-
type: "function"
|
|
929
|
-
},
|
|
930
|
-
{
|
|
931
|
-
inputs: [
|
|
932
|
-
{
|
|
933
|
-
internalType: "bytes4",
|
|
934
|
-
name: "interfaceId",
|
|
935
|
-
type: "bytes4"
|
|
936
|
-
}
|
|
937
|
-
],
|
|
938
|
-
name: "supportsInterface",
|
|
939
|
-
outputs: [
|
|
940
|
-
{
|
|
941
|
-
internalType: "bool",
|
|
942
|
-
name: "",
|
|
943
|
-
type: "bool"
|
|
944
|
-
}
|
|
945
|
-
],
|
|
946
|
-
stateMutability: "view",
|
|
947
|
-
type: "function"
|
|
948
|
-
},
|
|
949
|
-
{
|
|
950
|
-
inputs: [
|
|
951
|
-
{
|
|
952
|
-
internalType: "address",
|
|
953
|
-
name: "recipient",
|
|
954
|
-
type: "address"
|
|
955
|
-
}
|
|
956
|
-
],
|
|
957
|
-
name: "withdraw",
|
|
958
|
-
outputs: [],
|
|
959
|
-
stateMutability: "nonpayable",
|
|
960
|
-
type: "function"
|
|
961
|
-
},
|
|
962
|
-
{
|
|
963
|
-
inputs: [
|
|
964
|
-
{
|
|
965
|
-
internalType: "address",
|
|
966
|
-
name: "recipient",
|
|
967
|
-
type: "address"
|
|
968
|
-
},
|
|
969
|
-
{
|
|
970
|
-
internalType: "uint256",
|
|
971
|
-
name: "amount",
|
|
972
|
-
type: "uint256"
|
|
973
|
-
}
|
|
974
|
-
],
|
|
975
|
-
name: "withdrawGasFee",
|
|
976
|
-
outputs: [],
|
|
977
|
-
stateMutability: "nonpayable",
|
|
978
|
-
type: "function"
|
|
979
|
-
},
|
|
980
|
-
{
|
|
981
|
-
inputs: [
|
|
982
|
-
{
|
|
983
|
-
internalType: "address",
|
|
984
|
-
name: "tokenAddress",
|
|
985
|
-
type: "address"
|
|
986
|
-
},
|
|
987
|
-
{
|
|
988
|
-
internalType: "address",
|
|
989
|
-
name: "recipient",
|
|
990
|
-
type: "address"
|
|
991
|
-
}
|
|
992
|
-
],
|
|
993
|
-
name: "withdrawOtherConfidentialToken",
|
|
994
|
-
outputs: [],
|
|
995
|
-
stateMutability: "nonpayable",
|
|
996
|
-
type: "function"
|
|
997
|
-
},
|
|
998
|
-
{
|
|
999
|
-
inputs: [
|
|
1000
|
-
{
|
|
1001
|
-
internalType: "address",
|
|
1002
|
-
name: "tokenAddress",
|
|
1003
|
-
type: "address"
|
|
1004
|
-
},
|
|
1005
|
-
{
|
|
1006
|
-
internalType: "address",
|
|
1007
|
-
name: "recipient",
|
|
1008
|
-
type: "address"
|
|
1009
|
-
}
|
|
1010
|
-
],
|
|
1011
|
-
name: "withdrawOtherToken",
|
|
1012
|
-
outputs: [],
|
|
1013
|
-
stateMutability: "nonpayable",
|
|
1014
|
-
type: "function"
|
|
1015
|
-
}
|
|
1016
|
-
];
|
|
1017
|
-
|
|
1018
|
-
// src/fhe-airdrop/errors.ts
|
|
1019
|
-
var AlreadyClaimedError = class extends chunk67OV5CX2_cjs.TokenOpsSdkError {
|
|
1020
|
-
name = "AlreadyClaimedError";
|
|
1021
|
-
constructor(args) {
|
|
1022
|
-
const who = args.caller ? `${args.caller}: ` : "";
|
|
1023
|
-
super(`${args.method}: ${who}this airdrop claim has already been redeemed.`, {
|
|
1024
|
-
code: "TOKENOPS_ALREADY_CLAIMED",
|
|
1025
|
-
cause: args.cause,
|
|
1026
|
-
context: {
|
|
1027
|
-
method: args.method,
|
|
1028
|
-
contractAddress: args.contractAddress,
|
|
1029
|
-
caller: args.caller
|
|
1030
|
-
}
|
|
1031
|
-
});
|
|
1032
|
-
}
|
|
1033
|
-
};
|
|
1034
|
-
var ClaimNotStartedError = class extends chunk67OV5CX2_cjs.TokenOpsSdkError {
|
|
1035
|
-
name = "ClaimNotStartedError";
|
|
1036
|
-
constructor(args) {
|
|
1037
|
-
const detail = args.startsAt !== void 0 ? ` Opens at unix timestamp ${args.startsAt}.` : "";
|
|
1038
|
-
super(`${args.method}: airdrop claim window has not started.${detail}`, {
|
|
1039
|
-
code: "TOKENOPS_CLAIM_NOT_STARTED",
|
|
1040
|
-
cause: args.cause,
|
|
1041
|
-
context: {
|
|
1042
|
-
method: args.method,
|
|
1043
|
-
contractAddress: args.contractAddress,
|
|
1044
|
-
startsAt: args.startsAt
|
|
1045
|
-
}
|
|
1046
|
-
});
|
|
1047
|
-
}
|
|
1048
|
-
};
|
|
1049
|
-
var ClaimWindowClosedError = class extends chunk67OV5CX2_cjs.TokenOpsSdkError {
|
|
1050
|
-
name = "ClaimWindowClosedError";
|
|
1051
|
-
constructor(args) {
|
|
1052
|
-
const detail = args.endedAt !== void 0 ? ` Closed at unix timestamp ${args.endedAt}.` : "";
|
|
1053
|
-
super(`${args.method}: airdrop claim window has closed.${detail}`, {
|
|
1054
|
-
code: "TOKENOPS_CLAIM_WINDOW_CLOSED",
|
|
1055
|
-
cause: args.cause,
|
|
1056
|
-
context: {
|
|
1057
|
-
method: args.method,
|
|
1058
|
-
contractAddress: args.contractAddress,
|
|
1059
|
-
endedAt: args.endedAt
|
|
1060
|
-
}
|
|
1061
|
-
});
|
|
1062
|
-
}
|
|
1063
|
-
};
|
|
1064
|
-
var CONFIDENTIAL_POOL_BALANCE_METHODS = /* @__PURE__ */ new Set([
|
|
1065
|
-
"claim",
|
|
1066
|
-
"withdraw",
|
|
1067
|
-
"withdrawOtherConfidentialToken"
|
|
1068
|
-
]);
|
|
1069
|
-
var airdropProductMapper = (name, _args, ctx) => {
|
|
1070
|
-
switch (name) {
|
|
1071
|
-
case "SignatureAlreadyClaimed":
|
|
1072
|
-
return new AlreadyClaimedError(ctx);
|
|
1073
|
-
case "ClaimNotStarted":
|
|
1074
|
-
return new ClaimNotStartedError(ctx);
|
|
1075
|
-
case "ClaimWindowFinished":
|
|
1076
|
-
return new ClaimWindowClosedError(ctx);
|
|
1077
|
-
// OZ ECDSA reverts surface from `isSignatureValid` when the signature
|
|
1078
|
-
// bytes are structurally malformed (e.g. `s`-value out of range,
|
|
1079
|
-
// 0-length, wrong length). Map to a single typed error so consumers
|
|
1080
|
-
// can branch on `error.code === "TOKENOPS_INVALID_SIGNATURE"`.
|
|
1081
|
-
case "ECDSAInvalidSignature":
|
|
1082
|
-
case "ECDSAInvalidSignatureS":
|
|
1083
|
-
case "ECDSAInvalidSignatureLength":
|
|
1084
|
-
return new chunk67OV5CX2_cjs.InvalidSignatureError(ctx);
|
|
1085
|
-
case "ZeroBalance":
|
|
1086
|
-
case "InsufficientBalance":
|
|
1087
|
-
return CONFIDENTIAL_POOL_BALANCE_METHODS.has(ctx.method) ? new chunk67OV5CX2_cjs.InsufficientBalanceError({ ...ctx, balanceKind: "confidential" }) : void 0;
|
|
1088
|
-
default:
|
|
1089
|
-
return void 0;
|
|
1090
|
-
}
|
|
1091
|
-
};
|
|
1092
|
-
var ConfidentialAirdropClient = class {
|
|
1093
|
-
publicClient;
|
|
1094
|
-
walletClient;
|
|
1095
|
-
address;
|
|
1096
|
-
#aclAddressOverride;
|
|
1097
|
-
#telemetry;
|
|
1098
|
-
#cachedAclAddress;
|
|
1099
|
-
constructor(config) {
|
|
1100
|
-
this.publicClient = config.publicClient;
|
|
1101
|
-
this.walletClient = config.walletClient;
|
|
1102
|
-
this.address = config.address;
|
|
1103
|
-
this.#telemetry = config.telemetry;
|
|
1104
|
-
this.#aclAddressOverride = config.aclAddress;
|
|
1105
|
-
const chainIdForInit = config.publicClient.chain?.id;
|
|
1106
|
-
this.#telemetry?.event("fhe-airdrop.client.init", {
|
|
1107
|
-
surface: "client",
|
|
1108
|
-
chainId: chainIdForInit ?? null,
|
|
1109
|
-
hasWallet: !!this.walletClient,
|
|
1110
|
-
aclResolved: !!config.aclAddress || chainIdForInit !== void 0 && !!chunkFAXIIH5R_cjs.getFhevmAclAddress(chainIdForInit),
|
|
1111
|
-
sdkVersion: chunkKLKI352M_cjs.SDK_VERSION
|
|
1112
|
-
});
|
|
1113
|
-
}
|
|
1114
|
-
/**
|
|
1115
|
-
* The FHEVM ACL contract address used by encrypted-view methods to parse
|
|
1116
|
-
* `ACL.Allowed` events. Resolved lazily on first access; throws
|
|
1117
|
-
* `DeploymentAddressUnavailableError` if no override was passed and the
|
|
1118
|
-
* SDK does not have an ACL deployed for the connected chain.
|
|
1119
|
-
*/
|
|
1120
|
-
get aclAddress() {
|
|
1121
|
-
if (this.#cachedAclAddress) return this.#cachedAclAddress;
|
|
1122
|
-
this.#cachedAclAddress = this.#aclAddressOverride ?? chunkFAXIIH5R_cjs.requireFhevmAclAddress(this.publicClient.chain?.id, "ConfidentialAirdropClient");
|
|
1123
|
-
return this.#cachedAclAddress;
|
|
1124
|
-
}
|
|
1125
|
-
// ============================================================
|
|
1126
|
-
// IMMUTABLE READS
|
|
1127
|
-
// ============================================================
|
|
1128
|
-
/** ERC-7984 confidential token this airdrop was deployed for. Immutable arg. */
|
|
1129
|
-
async token() {
|
|
1130
|
-
return this.#read("TOKEN");
|
|
1131
|
-
}
|
|
1132
|
-
/** Per-claim gas fee in wei. Immutable arg. Attached as `msg.value` by `claim()` automatically. */
|
|
1133
|
-
async gasFee() {
|
|
1134
|
-
return this.#read("GAS_FEE");
|
|
1135
|
-
}
|
|
1136
|
-
/** Unix timestamp when claims become available. Immutable arg. */
|
|
1137
|
-
async startTime() {
|
|
1138
|
-
return this.#read("START_TIME");
|
|
1139
|
-
}
|
|
1140
|
-
/** Whether the admin can extend the claim window past `endTime`. Immutable arg. */
|
|
1141
|
-
async canExtendClaimWindow() {
|
|
1142
|
-
return this.#read("CAN_EXTEND_CLAIM_WINDOW");
|
|
1143
|
-
}
|
|
1144
|
-
// ============================================================
|
|
1145
|
-
// STORAGE READS
|
|
1146
|
-
// ============================================================
|
|
1147
|
-
/** Unix timestamp when claims end. Mutable — can be extended by admin if `canExtendClaimWindow`. */
|
|
1148
|
-
async endTime() {
|
|
1149
|
-
return this.#read("endTime");
|
|
1150
|
-
}
|
|
1151
|
-
/** Whether claims are currently paused by the admin. */
|
|
1152
|
-
async isPaused() {
|
|
1153
|
-
return this.#read("isPaused");
|
|
1154
|
-
}
|
|
1155
|
-
/** Block number at which this clone was deployed. */
|
|
1156
|
-
async deploymentBlockNumber() {
|
|
1157
|
-
return this.#read("deploymentBlockNumber");
|
|
1158
|
-
}
|
|
1159
|
-
/**
|
|
1160
|
-
* Check whether a pre-computed signature hash has been consumed.
|
|
1161
|
-
*
|
|
1162
|
-
* The contract keys claim replay-protection on
|
|
1163
|
-
* `keccak256(abi.encode(CLAIM_TYPEHASH, recipient, bytes32(encryptedAmountHandle)))`.
|
|
1164
|
-
* Use this when you already hold the struct hash (e.g. you computed it server-side
|
|
1165
|
-
* while building the claim payload). For the more common case where you hold the
|
|
1166
|
-
* user address and the encrypted handle, use {@link isSignatureClaimed} instead —
|
|
1167
|
-
* it computes the hash for you.
|
|
1168
|
-
*
|
|
1169
|
-
* @param signatureHash `bytes32` storage key — the EIP-712 struct hash of the Claim.
|
|
1170
|
-
*/
|
|
1171
|
-
async claimedSignatures(signatureHash) {
|
|
1172
|
-
return this.#read("claimedSignatures", [signatureHash]);
|
|
1173
|
-
}
|
|
1174
|
-
// ============================================================
|
|
1175
|
-
// VIEW FUNCTIONS
|
|
1176
|
-
// ============================================================
|
|
1177
|
-
/** `true` if within the claim time window and not paused. Free read — no gas. */
|
|
1178
|
-
async isClaimWindowActive() {
|
|
1179
|
-
return this.#read("isClaimWindowActive");
|
|
1180
|
-
}
|
|
1181
|
-
/** `true` if the current timestamp is past `START_TIME`. */
|
|
1182
|
-
async hasClaimStarted() {
|
|
1183
|
-
return this.#read("hasClaimStarted");
|
|
1184
|
-
}
|
|
1185
|
-
/** `true` if the current timestamp is past `endTime`. */
|
|
1186
|
-
async hasClaimEnded() {
|
|
1187
|
-
return this.#read("hasClaimEnded");
|
|
1188
|
-
}
|
|
1189
|
-
/** EIP-712 domain separator for the clone. Useful for off-chain signing tools. */
|
|
1190
|
-
async domainSeparator() {
|
|
1191
|
-
return this.#read("DOMAIN_SEPARATOR");
|
|
1192
|
-
}
|
|
1193
|
-
/**
|
|
1194
|
-
* EIP-712 type hash for the `Claim(address recipient, bytes32 encryptedAmount)`
|
|
1195
|
-
* struct. Off-chain signers that don't use {@link signClaimAuthorization}
|
|
1196
|
-
* (e.g. custom HSM-backed signers, ledger flows) need this to assemble the
|
|
1197
|
-
* typed-data payload manually.
|
|
1198
|
-
*/
|
|
1199
|
-
async claimTypehash() {
|
|
1200
|
-
return this.#read("CLAIM_TYPEHASH");
|
|
1201
|
-
}
|
|
1202
|
-
/**
|
|
1203
|
-
* Check whether a claim has been consumed, given the user address and encrypted amount handle.
|
|
1204
|
-
*
|
|
1205
|
-
* This is the method most frontend developers want. Pass the same `user` and
|
|
1206
|
-
* `encryptedAmountHandle` that appear in the admin-issued claim payload; the contract
|
|
1207
|
-
* recomputes the struct hash internally and looks it up in storage.
|
|
1208
|
-
*
|
|
1209
|
-
* Prefer this over {@link claimedSignatures} unless you already hold the pre-computed
|
|
1210
|
-
* `bytes32` struct hash (e.g. from a server-side indexer).
|
|
1211
|
-
*
|
|
1212
|
-
* @param user Recipient address from the claim authorization.
|
|
1213
|
-
* @param encryptedAmountHandle The `externalEuint64` handle (as `Hex`) from the claim payload.
|
|
1214
|
-
*/
|
|
1215
|
-
async isSignatureClaimed(user, encryptedAmountHandle) {
|
|
1216
|
-
return this.#read("isSignatureClaimed", [user, encryptedAmountHandle]);
|
|
1217
|
-
}
|
|
1218
|
-
/**
|
|
1219
|
-
* Check whether an admin-issued claim authorization is valid for a specific caller,
|
|
1220
|
-
* without consuming it.
|
|
1221
|
-
*
|
|
1222
|
-
* Returns `false` (not a revert) when the signature is **structurally valid** but
|
|
1223
|
-
* fails one of the on-chain checks: already-claimed, claim window inactive, or the
|
|
1224
|
-
* signer lacks `DEFAULT_ADMIN_ROLE`. The on-chain implementation recomputes the
|
|
1225
|
-
* EIP-712 struct hash over `(msg.sender, encryptedAmount)`, so the result is
|
|
1226
|
-
* caller-specific: a signature issued for recipient A is invalid when checked
|
|
1227
|
-
* against caller B. Pass the address that will actually submit the claim.
|
|
1228
|
-
*
|
|
1229
|
-
* **Throws** {@link InvalidSignatureError} (code `TOKENOPS_INVALID_SIGNATURE`)
|
|
1230
|
-
* when the signature bytes are **structurally malformed** — wrong length, invalid
|
|
1231
|
-
* `s`-value range, or unparseable. The on-chain `ECDSA.recover` reverts before
|
|
1232
|
-
* the boolean logic runs in that case, so consumer code must catch this
|
|
1233
|
-
* separately from the `false` return:
|
|
1234
|
-
*
|
|
1235
|
-
* ```ts
|
|
1236
|
-
* try {
|
|
1237
|
-
* const ok = await airdrop.isSignatureValid({ encryptedAmountHandle, signature, caller });
|
|
1238
|
-
* if (!ok) { /* signed by non-admin, window closed, or already claimed *\/ }
|
|
1239
|
-
* } catch (err) {
|
|
1240
|
-
* if (err instanceof InvalidSignatureError) { /* malformed signature bytes *\/ }
|
|
1241
|
-
* }
|
|
1242
|
-
* ```
|
|
1243
|
-
*
|
|
1244
|
-
* Use this to show a pre-claim validation state in the UI before asking the user to
|
|
1245
|
-
* pay gas.
|
|
1246
|
-
*/
|
|
1247
|
-
async isSignatureValid(args) {
|
|
1248
|
-
try {
|
|
1249
|
-
return await this.publicClient.readContract({
|
|
1250
|
-
address: this.address,
|
|
1251
|
-
abi: confidentialAirdropCloneableAbi,
|
|
1252
|
-
functionName: "isSignatureValid",
|
|
1253
|
-
args: [args.encryptedAmountHandle, args.signature],
|
|
1254
|
-
account: args.caller
|
|
1255
|
-
});
|
|
1256
|
-
} catch (err) {
|
|
1257
|
-
throw chunkKLKI352M_cjs.mapContractRevert(err, {
|
|
1258
|
-
method: "isSignatureValid",
|
|
1259
|
-
contractAddress: this.address,
|
|
1260
|
-
abi: confidentialAirdropCloneableAbi,
|
|
1261
|
-
productMapper: airdropProductMapper,
|
|
1262
|
-
account: args.caller
|
|
1263
|
-
});
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
// ============================================================
|
|
1267
|
-
// PREFLIGHT
|
|
1268
|
-
// ============================================================
|
|
1269
|
-
/**
|
|
1270
|
-
* Read-only preflight for {@link claim}. Runs the deterministic-from-off-chain
|
|
1271
|
-
* checks in parallel and reports any blockers as typed {@link TokenOpsSdkError}s.
|
|
1272
|
-
* Returns `{ ready: true, blockers: [] }` when the claim is safe to submit.
|
|
1273
|
-
*
|
|
1274
|
-
* Preflight is **opt-in**. Consumers who have already validated state can
|
|
1275
|
-
* skip this call and invoke `claim` directly — they'll receive the same
|
|
1276
|
-
* typed errors at write time via the revert mapper.
|
|
1277
|
-
*
|
|
1278
|
-
* Checks performed (all read-only, no gas):
|
|
1279
|
-
* - Claim window started (`block.timestamp ≥ START_TIME`).
|
|
1280
|
-
* - Claim window not closed (`block.timestamp ≤ endTime`).
|
|
1281
|
-
* - Claims not paused.
|
|
1282
|
-
* - Signature not already redeemed by this caller.
|
|
1283
|
-
* - ETH balance covers `GAS_FEE()` (the `msg.value` the claim must attach).
|
|
1284
|
-
*
|
|
1285
|
-
* The EIP-712 admin-signature check is **not** preflight-detectable — the
|
|
1286
|
-
* SDK cannot verify the signer's role without the contract round-trip — and
|
|
1287
|
-
* will still surface as {@link InvalidSignatureError} at write time.
|
|
1288
|
-
*
|
|
1289
|
-
* Pool balance is also **not** preflight-detectable: the clone's confidential
|
|
1290
|
-
* balance is an encrypted `euint64` handle that the SDK cannot read in
|
|
1291
|
-
* plaintext. An unfunded clone will pass preflight and revert on-chain with
|
|
1292
|
-
* {@link FheHandleNotAllowedError} (the FHEVM ACL rejects `FHE.allowTransient`
|
|
1293
|
-
* on an uninitialized handle). Confirm the pool has been funded before
|
|
1294
|
-
* showing `ready: true`.
|
|
1295
|
-
*
|
|
1296
|
-
* @returns `{ ready, blockers }` — same `code` shape the write would throw.
|
|
1297
|
-
*/
|
|
1298
|
-
async preflightClaim(args) {
|
|
1299
|
-
const blockers = [];
|
|
1300
|
-
const [startTime, endTime, isPaused, isClaimed, block, gasFee, callerBalance] = await Promise.all([
|
|
1301
|
-
this.startTime(),
|
|
1302
|
-
this.endTime(),
|
|
1303
|
-
this.isPaused(),
|
|
1304
|
-
this.isSignatureClaimed(args.caller, args.encryptedAmountHandle),
|
|
1305
|
-
this.publicClient.getBlock(),
|
|
1306
|
-
this.gasFee(),
|
|
1307
|
-
this.publicClient.getBalance({ address: args.caller })
|
|
1308
|
-
]);
|
|
1309
|
-
const now = Number(block.timestamp);
|
|
1310
|
-
if (isPaused) {
|
|
1311
|
-
blockers.push(new chunk67OV5CX2_cjs.PausedError({ method: "claim", contractAddress: this.address }));
|
|
1312
|
-
}
|
|
1313
|
-
if (now < startTime) {
|
|
1314
|
-
blockers.push(
|
|
1315
|
-
new ClaimNotStartedError({
|
|
1316
|
-
method: "claim",
|
|
1317
|
-
contractAddress: this.address,
|
|
1318
|
-
startsAt: startTime
|
|
1319
|
-
})
|
|
1320
|
-
);
|
|
1321
|
-
}
|
|
1322
|
-
if (now > endTime) {
|
|
1323
|
-
blockers.push(
|
|
1324
|
-
new ClaimWindowClosedError({
|
|
1325
|
-
method: "claim",
|
|
1326
|
-
contractAddress: this.address,
|
|
1327
|
-
endedAt: endTime
|
|
1328
|
-
})
|
|
1329
|
-
);
|
|
1330
|
-
}
|
|
1331
|
-
if (isClaimed) {
|
|
1332
|
-
blockers.push(
|
|
1333
|
-
new AlreadyClaimedError({
|
|
1334
|
-
method: "claim",
|
|
1335
|
-
contractAddress: this.address,
|
|
1336
|
-
caller: args.caller
|
|
1337
|
-
})
|
|
1338
|
-
);
|
|
1339
|
-
}
|
|
1340
|
-
if (callerBalance < gasFee) {
|
|
1341
|
-
blockers.push(
|
|
1342
|
-
new chunk67OV5CX2_cjs.InsufficientFeeError({
|
|
1343
|
-
method: "claim",
|
|
1344
|
-
contractAddress: this.address,
|
|
1345
|
-
feeKind: "gas",
|
|
1346
|
-
required: gasFee,
|
|
1347
|
-
provided: callerBalance
|
|
1348
|
-
})
|
|
1349
|
-
);
|
|
1350
|
-
}
|
|
1351
|
-
return { ready: blockers.length === 0, blockers };
|
|
1352
|
-
}
|
|
1353
|
-
// ============================================================
|
|
1354
|
-
// CLAIM (USER OP)
|
|
1355
|
-
// ============================================================
|
|
1356
|
-
/**
|
|
1357
|
-
* Claim tokens using an EIP-712 admin signature. Sends `GAS_FEE()` ETH with the tx.
|
|
1358
|
-
*
|
|
1359
|
-
* The `encryptedInput` must be the exact handle the admin signed in
|
|
1360
|
-
* {@link signClaimAuthorization}. The signature commits to that handle, so the SDK
|
|
1361
|
-
* does NOT re-encrypt — submit the admin-issued payload as-is.
|
|
1362
|
-
*
|
|
1363
|
-
* **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
|
|
1364
|
-
*
|
|
1365
|
-
* @returns Transaction hash.
|
|
1366
|
-
* @example
|
|
1367
|
-
* const fee = await airdrop.gasFee();
|
|
1368
|
-
* const hash = await airdrop.claim({ encryptedInput, signature });
|
|
1369
|
-
*/
|
|
1370
|
-
async claim(args) {
|
|
1371
|
-
const wallet = this.#requireWallet("claim");
|
|
1372
|
-
const account = this.#resolveAccount(wallet, args.account, "claim");
|
|
1373
|
-
const fee = args.value ?? await this.gasFee();
|
|
1374
|
-
const writeArgs = [
|
|
1375
|
-
args.encryptedInput.handle,
|
|
1376
|
-
args.encryptedInput.inputProof,
|
|
1377
|
-
args.signature
|
|
1378
|
-
];
|
|
1379
|
-
await this.#preflightWrite("claim", "claim", writeArgs, account, fee);
|
|
1380
|
-
try {
|
|
1381
|
-
return await wallet.writeContract({
|
|
1382
|
-
address: this.address,
|
|
1383
|
-
abi: confidentialAirdropCloneableAbi,
|
|
1384
|
-
functionName: "claim",
|
|
1385
|
-
args: writeArgs,
|
|
1386
|
-
account,
|
|
1387
|
-
chain: wallet.chain,
|
|
1388
|
-
value: fee
|
|
1389
|
-
});
|
|
1390
|
-
} catch (err) {
|
|
1391
|
-
throw this.#mapRevert("claim", err, accountAddress(account));
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
/**
|
|
1395
|
-
* **This is a write transaction, not a free view. It costs gas.**
|
|
1396
|
-
*
|
|
1397
|
-
* Verify the admin-signed claim allocation and grant the caller decrypt access
|
|
1398
|
-
* to the encrypted amount. Budget gas and `await` the receipt before calling
|
|
1399
|
-
* the Zama relayer's `userDecrypt` — the handle is only valid after the tx lands.
|
|
1400
|
-
*
|
|
1401
|
-
* Internally the contract calls `FHE.allow(handle, msg.sender)`, which persists
|
|
1402
|
-
* the ACL grant on-chain. The handle is extracted from the receipt's ACL `Allowed`
|
|
1403
|
-
* event — `simulateContract` would return a divergent handle and break decryption.
|
|
1404
|
-
*
|
|
1405
|
-
* Does **not** consume the claim (the `claimedSignatures` bit is not set). Call
|
|
1406
|
-
* {@link claim} when the user is ready to transfer tokens.
|
|
1407
|
-
*
|
|
1408
|
-
* @returns `{ handle, hash }` — `handle` is a `euint64` granted to the caller;
|
|
1409
|
-
* pass it to the Zama relayer's `userDecrypt` to obtain the plaintext amount.
|
|
1410
|
-
*/
|
|
1411
|
-
async getClaimAmount(args) {
|
|
1412
|
-
const wallet = this.#requireWallet("getClaimAmount");
|
|
1413
|
-
const account = this.#resolveAccount(wallet, args.account, "getClaimAmount");
|
|
1414
|
-
const writeArgs = [
|
|
1415
|
-
args.encryptedInput.handle,
|
|
1416
|
-
args.encryptedInput.inputProof,
|
|
1417
|
-
args.signature
|
|
1418
|
-
];
|
|
1419
|
-
await this.#preflightWrite("getClaimAmount", "getClaimAmount", writeArgs, account);
|
|
1420
|
-
let hash;
|
|
1421
|
-
try {
|
|
1422
|
-
hash = await wallet.writeContract({
|
|
1423
|
-
address: this.address,
|
|
1424
|
-
abi: confidentialAirdropCloneableAbi,
|
|
1425
|
-
functionName: "getClaimAmount",
|
|
1426
|
-
args: writeArgs,
|
|
1427
|
-
account,
|
|
1428
|
-
chain: wallet.chain
|
|
1429
|
-
});
|
|
1430
|
-
} catch (err) {
|
|
1431
|
-
throw this.#mapRevert("getClaimAmount", err, accountAddress(account));
|
|
1432
|
-
}
|
|
1433
|
-
const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
|
|
1434
|
-
const callerAddress = accountAddress(account).toLowerCase();
|
|
1435
|
-
const aclLogs = receipt.logs.filter(
|
|
1436
|
-
(log) => log.address.toLowerCase() === this.aclAddress.toLowerCase()
|
|
1437
|
-
);
|
|
1438
|
-
const events = viem.parseEventLogs({ abi: [chunkFAXIIH5R_cjs.ACL_ALLOWED_EVENT], logs: aclLogs });
|
|
1439
|
-
const granted = events.filter(
|
|
1440
|
-
(ev) => ev.args.account.toLowerCase() === callerAddress && ev.args.caller.toLowerCase() === this.address.toLowerCase()
|
|
1441
|
-
);
|
|
1442
|
-
if (granted.length === 0) {
|
|
1443
|
-
throw new chunk67OV5CX2_cjs.ReceiptEventNotFoundError({
|
|
1444
|
-
method: "getClaimAmount",
|
|
1445
|
-
eventName: "Allowed",
|
|
1446
|
-
contractAddress: this.aclAddress,
|
|
1447
|
-
txHash: hash,
|
|
1448
|
-
hint: `Expected ACL grant from airdrop ${this.address} to caller ${callerAddress}; the contract did not grant decrypt access.`
|
|
1449
|
-
});
|
|
1450
|
-
}
|
|
1451
|
-
if (granted.length > 1) {
|
|
1452
|
-
throw new chunk67OV5CX2_cjs.ReceiptEventAmbiguousError({
|
|
1453
|
-
method: "getClaimAmount",
|
|
1454
|
-
eventName: "Allowed",
|
|
1455
|
-
contractAddress: this.aclAddress,
|
|
1456
|
-
txHash: hash,
|
|
1457
|
-
count: granted.length
|
|
1458
|
-
});
|
|
1459
|
-
}
|
|
1460
|
-
const handle = granted[0].args.handle;
|
|
1461
|
-
return { handle, hash };
|
|
1462
|
-
}
|
|
1463
|
-
// ============================================================
|
|
1464
|
-
// ADMIN WRITES
|
|
1465
|
-
// ============================================================
|
|
1466
|
-
/**
|
|
1467
|
-
* Withdraw all confidential tokens to `recipient`. `DEFAULT_ADMIN_ROLE` only.
|
|
1468
|
-
*
|
|
1469
|
-
* Calling on a clone whose pool was **never funded** throws
|
|
1470
|
-
* {@link FheHandleNotAllowedError} (code `TOKENOPS_FHE_HANDLE_NOT_ALLOWED`).
|
|
1471
|
-
* The contract calls `FHE.allowTransient` on the confidential balance handle;
|
|
1472
|
-
* when the handle is uninitialized, the FHEVM ACL contract reverts with
|
|
1473
|
-
* `SenderNotAllowed(address)`. Confirm the pool has been funded (e.g. via the
|
|
1474
|
-
* factory's `createAndFund...` variant or a follow-up `confidentialTransfer`)
|
|
1475
|
-
* before calling.
|
|
1476
|
-
*/
|
|
1477
|
-
async withdraw(recipient, account) {
|
|
1478
|
-
this.#requireChecksumAddress("withdraw", "recipient", recipient);
|
|
1479
|
-
return this.#simpleWrite("withdraw", [recipient], account);
|
|
1480
|
-
}
|
|
1481
|
-
/** Pause or unpause claims. DEFAULT_ADMIN_ROLE only. */
|
|
1482
|
-
async setPaused(paused, account) {
|
|
1483
|
-
return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-airdrop.client.setPaused", async () => {
|
|
1484
|
-
return this.#simpleWrite("setPaused", [paused], account);
|
|
1485
|
-
});
|
|
1486
|
-
}
|
|
1487
|
-
/**
|
|
1488
|
-
* Extend the claim window end time. DEFAULT_ADMIN_ROLE only.
|
|
1489
|
-
* Requires `CAN_EXTEND_CLAIM_WINDOW == true` or the contract reverts.
|
|
1490
|
-
*/
|
|
1491
|
-
async extendClaimWindow(newEndTime, account) {
|
|
1492
|
-
return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-airdrop.client.extendClaimWindow", async () => {
|
|
1493
|
-
return this.#simpleWrite("extendClaimWindow", [newEndTime], account);
|
|
1494
|
-
});
|
|
1495
|
-
}
|
|
1496
|
-
/** Rescue accidentally sent ERC20 tokens. DEFAULT_ADMIN_ROLE only. */
|
|
1497
|
-
async withdrawOtherToken(tokenAddress, recipient, account) {
|
|
1498
|
-
this.#requireChecksumAddress("withdrawOtherToken", "tokenAddress", tokenAddress);
|
|
1499
|
-
this.#requireChecksumAddress("withdrawOtherToken", "recipient", recipient);
|
|
1500
|
-
return this.#simpleWrite("withdrawOtherToken", [tokenAddress, recipient], account);
|
|
1501
|
-
}
|
|
1502
|
-
/** Rescue accidentally sent ERC7984 confidential tokens. DEFAULT_ADMIN_ROLE only. */
|
|
1503
|
-
async withdrawOtherConfidentialToken(tokenAddress, recipient, account) {
|
|
1504
|
-
this.#requireChecksumAddress("withdrawOtherConfidentialToken", "tokenAddress", tokenAddress);
|
|
1505
|
-
this.#requireChecksumAddress("withdrawOtherConfidentialToken", "recipient", recipient);
|
|
1506
|
-
return this.#simpleWrite("withdrawOtherConfidentialToken", [tokenAddress, recipient], account);
|
|
1507
|
-
}
|
|
1508
|
-
// ============================================================
|
|
1509
|
-
// FEE COLLECTOR WRITES
|
|
1510
|
-
// ============================================================
|
|
1511
|
-
/**
|
|
1512
|
-
* Withdraw collected ETH gas fees. FEE_COLLECTOR_ROLE only.
|
|
1513
|
-
* Pass `amount = 0n` to withdraw the entire balance.
|
|
1514
|
-
*/
|
|
1515
|
-
async withdrawGasFee(recipient, amount, account) {
|
|
1516
|
-
this.#requireChecksumAddress("withdrawGasFee", "recipient", recipient);
|
|
1517
|
-
return this.#simpleWrite("withdrawGasFee", [recipient, amount], account);
|
|
1518
|
-
}
|
|
1519
|
-
// ============================================================
|
|
1520
|
-
// ROLE MANAGEMENT
|
|
1521
|
-
// ============================================================
|
|
1522
|
-
async hasRole(role, account) {
|
|
1523
|
-
return this.#read("hasRole", [role, account]);
|
|
1524
|
-
}
|
|
1525
|
-
async grantRole(role, accountTarget, account) {
|
|
1526
|
-
return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-airdrop.client.grantRole", async () => {
|
|
1527
|
-
return this.#simpleWrite("grantRole", [role, accountTarget], account);
|
|
1528
|
-
});
|
|
1529
|
-
}
|
|
1530
|
-
async revokeRole(role, accountTarget, account) {
|
|
1531
|
-
return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-airdrop.client.revokeRole", async () => {
|
|
1532
|
-
return this.#simpleWrite("revokeRole", [role, accountTarget], account);
|
|
1533
|
-
});
|
|
1534
|
-
}
|
|
1535
|
-
// ============================================================
|
|
1536
|
-
// INTERNALS
|
|
1537
|
-
// ============================================================
|
|
1538
|
-
#requireChecksumAddress(method, argument, value) {
|
|
1539
|
-
if (!viem.isAddress(value, { strict: true })) {
|
|
1540
|
-
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
1541
|
-
method,
|
|
1542
|
-
argument,
|
|
1543
|
-
reason: "must be a valid EIP-55 checksummed address",
|
|
1544
|
-
value
|
|
1545
|
-
});
|
|
1546
|
-
}
|
|
1547
|
-
}
|
|
1548
|
-
#requireWallet(method) {
|
|
1549
|
-
if (!this.walletClient) {
|
|
1550
|
-
throw new chunk67OV5CX2_cjs.MissingWalletClientError(method);
|
|
1551
|
-
}
|
|
1552
|
-
return this.walletClient;
|
|
1553
|
-
}
|
|
1554
|
-
#resolveAccount(wallet, override, method) {
|
|
1555
|
-
const acct = override ?? wallet.account;
|
|
1556
|
-
if (!acct) {
|
|
1557
|
-
throw new chunk67OV5CX2_cjs.MissingAccountError(method);
|
|
1558
|
-
}
|
|
1559
|
-
if (typeof acct === "string") {
|
|
1560
|
-
this.#requireChecksumAddress(method, "account", acct);
|
|
1561
|
-
}
|
|
1562
|
-
return acct;
|
|
1563
|
-
}
|
|
1564
|
-
#mapRevert(method, err, account) {
|
|
1565
|
-
return chunkKLKI352M_cjs.mapContractRevert(err, {
|
|
1566
|
-
method,
|
|
1567
|
-
contractAddress: this.address,
|
|
1568
|
-
abi: confidentialAirdropCloneableAbi,
|
|
1569
|
-
productMapper: airdropProductMapper,
|
|
1570
|
-
account
|
|
1571
|
-
});
|
|
1572
|
-
}
|
|
1573
|
-
async #simpleWrite(functionName, args, account) {
|
|
1574
|
-
const wallet = this.#requireWallet(functionName);
|
|
1575
|
-
const acct = this.#resolveAccount(wallet, account, functionName);
|
|
1576
|
-
await this.#preflightWrite(functionName, functionName, args, acct);
|
|
1577
|
-
try {
|
|
1578
|
-
return await wallet.writeContract({
|
|
1579
|
-
address: this.address,
|
|
1580
|
-
abi: confidentialAirdropCloneableAbi,
|
|
1581
|
-
functionName,
|
|
1582
|
-
args,
|
|
1583
|
-
account: acct,
|
|
1584
|
-
chain: wallet.chain
|
|
1585
|
-
});
|
|
1586
|
-
} catch (err) {
|
|
1587
|
-
throw this.#mapRevert(functionName, err, accountAddress(acct));
|
|
1588
|
-
}
|
|
1589
|
-
}
|
|
1590
|
-
/**
|
|
1591
|
-
* Pre-flight a write via `simulateContract` purely to surface typed reverts.
|
|
1592
|
-
*
|
|
1593
|
-
* The simulate's *return value* is discarded — FHE writes still need
|
|
1594
|
-
* `writeContract` + receipt parsing because simulated FHE op handles diverge
|
|
1595
|
-
* from the executed-tx handles (CLAUDE.md Pitfall #1). The only purpose of
|
|
1596
|
-
* this call is to let viem decode any revert against the ABI and produce a
|
|
1597
|
-
* `ContractFunctionRevertedError` frame the revert-mapper can classify.
|
|
1598
|
-
*/
|
|
1599
|
-
async #preflightWrite(method, functionName, args, account, value) {
|
|
1600
|
-
try {
|
|
1601
|
-
await this.publicClient.simulateContract({
|
|
1602
|
-
address: this.address,
|
|
1603
|
-
abi: confidentialAirdropCloneableAbi,
|
|
1604
|
-
functionName,
|
|
1605
|
-
args,
|
|
1606
|
-
account,
|
|
1607
|
-
...value !== void 0 ? { value } : {}
|
|
1608
|
-
});
|
|
1609
|
-
} catch (err) {
|
|
1610
|
-
if (chunkKLKI352M_cjs.isContractRevert(err)) {
|
|
1611
|
-
throw this.#mapRevert(method, err, accountAddress(account));
|
|
1612
|
-
}
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
async #read(functionName, args = []) {
|
|
1616
|
-
const result = await this.publicClient.readContract({
|
|
1617
|
-
address: this.address,
|
|
1618
|
-
abi: confidentialAirdropCloneableAbi,
|
|
1619
|
-
functionName,
|
|
1620
|
-
args
|
|
1621
|
-
});
|
|
1622
|
-
return result;
|
|
1623
|
-
}
|
|
1624
|
-
};
|
|
1625
|
-
function createConfidentialAirdropClient(config) {
|
|
1626
|
-
return new ConfidentialAirdropClient(config);
|
|
1627
|
-
}
|
|
1628
|
-
function accountAddress(account) {
|
|
1629
|
-
return typeof account === "string" ? account : account.address;
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
exports.AlreadyClaimedError = AlreadyClaimedError;
|
|
1633
|
-
exports.ClaimNotStartedError = ClaimNotStartedError;
|
|
1634
|
-
exports.ClaimWindowClosedError = ClaimWindowClosedError;
|
|
1635
|
-
exports.ConfidentialAirdropClient = ConfidentialAirdropClient;
|
|
1636
|
-
exports.confidentialAirdropCloneableAbi = confidentialAirdropCloneableAbi;
|
|
1637
|
-
exports.createConfidentialAirdropClient = createConfidentialAirdropClient;
|