@tokenops/sdk 2.0.0-alpha.1 → 2.0.0-alpha.2
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 +29 -0
- package/README.md +5 -5
- package/dist/{chunk-JZLGCTGK.cjs → chunk-3YHBO2DL.cjs} +2 -2
- package/dist/{chunk-H5POPGOZ.js → chunk-44YJPMQC.js} +1 -1
- package/dist/{chunk-DZHYSUGY.js → chunk-A4DCEE33.js} +11 -5
- package/dist/{chunk-M4IT6DNJ.cjs → chunk-AREQJHKA.cjs} +108 -3
- package/dist/chunk-EBLBPUPI.cjs +255 -0
- package/dist/chunk-EYDA6Q6C.js +245 -0
- package/dist/{chunk-XAYGD4E4.cjs → chunk-FEDX7B6T.cjs} +3 -3
- package/dist/{chunk-JQYC66TO.cjs → chunk-FHWSBGWE.cjs} +5 -5
- package/dist/{chunk-5576FRT3.cjs → chunk-FT5H2Q7Y.cjs} +11 -5
- package/dist/{chunk-456VDDA3.js → chunk-GADGBQJO.js} +78 -25
- package/dist/{chunk-6NAVMWZQ.js → chunk-IGO5XSPS.js} +2 -2
- package/dist/{chunk-CTED3MTR.cjs → chunk-IUKKNJ2R.cjs} +82 -29
- package/dist/{chunk-FGEB7RMY.cjs → chunk-MM5BV5CS.cjs} +4 -4
- package/dist/{chunk-335Z2W67.js → chunk-PYYSB5ZN.js} +1 -1
- package/dist/{chunk-PUX5VXDB.cjs → chunk-PZZK3O3S.cjs} +1040 -42
- package/dist/{chunk-74QFZ5MK.js → chunk-SPLNGUFF.js} +1 -1
- package/dist/{chunk-6PXXGACR.cjs → chunk-UHHMVBLU.cjs} +2 -2
- package/dist/{chunk-O5676ZWY.js → chunk-VW356KR3.js} +108 -5
- package/dist/{chunk-EAJ7SYHE.js → chunk-WJMEBBU7.js} +1 -1
- package/dist/{chunk-GKKDAW44.js → chunk-X7WBPCEU.js} +1026 -32
- package/dist/core/addresses.d.ts +4 -4
- package/dist/core/errors.d.ts +1 -1
- package/dist/fhe/types.d.ts +2 -2
- package/dist/fhe-airdrop/abis/merkle.d.ts +24 -12
- package/dist/fhe-airdrop/advanced/index.cjs +4 -4
- package/dist/fhe-airdrop/advanced/index.js +1 -1
- package/dist/fhe-airdrop/advanced/react/index.cjs +590 -9
- package/dist/fhe-airdrop/advanced/react/index.d.cts +34 -0
- package/dist/fhe-airdrop/advanced/react/index.d.ts +34 -0
- package/dist/fhe-airdrop/advanced/react/index.js +561 -7
- package/dist/fhe-airdrop/advanced/react/useClearCompliancePolicy.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useClearUpgradeabilityPolicy.d.ts +26 -0
- package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +25 -0
- package/dist/fhe-airdrop/advanced/react/useEcdsaInitCodeHash.d.ts +30 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryComplianceDelegate.d.ts +25 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryCompliancePolicy.d.ts +38 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryCustomFee.d.ts +24 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryGrantRole.d.ts +32 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryHasRole.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryImplementations.d.ts +33 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRenounceRole.d.ts +36 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRevokeRole.d.ts +35 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRoleConstants.d.ts +46 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRoleMembers.d.ts +47 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryUpgradeabilityPolicy.d.ts +39 -0
- package/dist/fhe-airdrop/advanced/react/useMerkleInitCodeHash.d.ts +24 -0
- package/dist/fhe-airdrop/advanced/react/useSetComplianceDelegate.d.ts +33 -0
- package/dist/fhe-airdrop/advanced/react/useSetComplianceManagerImpl.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetCompliancePolicy.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultDelegateToCompliance.d.ts +31 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultUpgradeable.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetEcdsaImplementation.d.ts +34 -0
- package/dist/fhe-airdrop/advanced/react/useSetFeeCollector.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetMerkleImplementation.d.ts +30 -0
- package/dist/fhe-airdrop/advanced/react/useSetUpgradeabilityPolicy.d.ts +31 -0
- package/dist/fhe-airdrop/airdrop-base.d.ts +8 -0
- package/dist/fhe-airdrop/campaign.d.ts +61 -20
- package/dist/fhe-airdrop/constants.d.ts +1 -1
- package/dist/fhe-airdrop/errors.d.ts +28 -0
- package/dist/fhe-airdrop/guards.d.ts +46 -2
- package/dist/fhe-airdrop/index.cjs +74 -971
- package/dist/fhe-airdrop/index.d.cts +2 -2
- package/dist/fhe-airdrop/index.d.ts +2 -2
- package/dist/fhe-airdrop/index.js +8 -927
- package/dist/fhe-airdrop/merkle-tree.d.ts +32 -38
- package/dist/fhe-airdrop/merkle.d.ts +52 -31
- package/dist/fhe-airdrop/react/_shared.d.ts +13 -0
- package/dist/fhe-airdrop/react/index.cjs +934 -84
- package/dist/fhe-airdrop/react/index.d.cts +49 -3
- package/dist/fhe-airdrop/react/index.d.ts +49 -3
- package/dist/fhe-airdrop/react/index.js +825 -22
- package/dist/fhe-airdrop/react/keys.d.ts +90 -0
- package/dist/fhe-airdrop/react/useAccessEcdsaClaimAmount.d.ts +26 -0
- package/dist/fhe-airdrop/react/useAccessMerkleClaimAmount.d.ts +27 -0
- package/dist/fhe-airdrop/react/useAddComplianceDelegate.d.ts +37 -0
- package/dist/fhe-airdrop/react/useAdminBatchDiscloseBalanceToParties.d.ts +36 -0
- package/dist/fhe-airdrop/react/useAdminDiscloseBalanceToParty.d.ts +31 -0
- package/dist/fhe-airdrop/react/useAdminGetCurrentBalance.d.ts +27 -0
- package/dist/fhe-airdrop/react/useAirdropConfig.d.ts +49 -0
- package/dist/fhe-airdrop/react/useAirdropDeploymentMode.d.ts +28 -0
- package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +35 -0
- package/dist/fhe-airdrop/react/useAirdropRenounceRole.d.ts +36 -0
- package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +33 -0
- package/dist/fhe-airdrop/react/useAirdropRoleAdmin.d.ts +28 -0
- package/dist/fhe-airdrop/react/useAirdropRoleConstants.d.ts +67 -0
- package/dist/fhe-airdrop/react/useAirdropRoleMembers.d.ts +49 -0
- package/dist/fhe-airdrop/react/useAirdropUpgradeToAndCall.d.ts +45 -0
- package/dist/fhe-airdrop/react/useBatchDiscloseHandlesToParty.d.ts +32 -0
- package/dist/fhe-airdrop/react/useBuildMerkleCampaign.d.ts +68 -0
- package/dist/fhe-airdrop/react/useComplianceGrantRole.d.ts +32 -0
- package/dist/fhe-airdrop/react/useComplianceHasRole.d.ts +37 -0
- package/dist/fhe-airdrop/react/useComplianceInfo.d.ts +50 -0
- package/dist/fhe-airdrop/react/useComplianceManagerOf.d.ts +32 -0
- package/dist/fhe-airdrop/react/useComplianceRenounceRole.d.ts +38 -0
- package/dist/fhe-airdrop/react/useComplianceRevokeRole.d.ts +36 -0
- package/dist/fhe-airdrop/react/useComplianceRoleConstants.d.ts +41 -0
- package/dist/fhe-airdrop/react/useComplianceRoleMembers.d.ts +45 -0
- package/dist/fhe-airdrop/react/useCreateAndFundEcdsaAirdrop.d.ts +55 -0
- package/dist/fhe-airdrop/react/useCreateAndFundMerkleAirdrop.d.ts +52 -0
- package/dist/fhe-airdrop/react/useDiscloseHandleToParty.d.ts +35 -0
- package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +4 -3
- package/dist/fhe-airdrop/react/useEcdsaClaimAndUnwrap.d.ts +27 -0
- package/dist/fhe-airdrop/react/useEcdsaDomain.d.ts +41 -0
- package/dist/fhe-airdrop/react/useEffectiveDelegateToCompliance.d.ts +26 -0
- package/dist/fhe-airdrop/react/useEncryptCampaignAmounts.d.ts +59 -0
- package/dist/fhe-airdrop/react/useIsActiveDelegate.d.ts +29 -0
- package/dist/fhe-airdrop/react/useIsMerkleRootMutable.d.ts +21 -0
- package/dist/fhe-airdrop/react/useIsSignatureValid.d.ts +46 -0
- package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +7 -19
- package/dist/fhe-airdrop/react/useMerkleClaimAndUnwrap.d.ts +29 -0
- package/dist/fhe-airdrop/react/usePlanMerkleCampaign.d.ts +53 -0
- package/dist/fhe-airdrop/react/usePreflightClaim.d.ts +46 -0
- package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +67 -0
- package/dist/fhe-airdrop/react/useRescueERC20.d.ts +30 -0
- package/dist/fhe-airdrop/react/useRescueOtherConfidentialToken.d.ts +34 -0
- package/dist/fhe-airdrop/react/useRevokeComplianceDelegate.d.ts +37 -0
- package/dist/fhe-airdrop/react/useRotateMerkleRoot.d.ts +52 -0
- package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +42 -0
- package/dist/fhe-airdrop/react/useWithdrawGasFee.d.ts +37 -0
- package/dist/fhe-airdrop/types.d.ts +14 -1
- package/dist/fhe-disperse/index.cjs +21 -21
- package/dist/fhe-disperse/index.js +2 -2
- package/dist/fhe-disperse/react/index.cjs +22 -22
- package/dist/fhe-disperse/react/index.js +3 -3
- package/dist/fhe-vesting/advanced/index.cjs +5 -5
- package/dist/fhe-vesting/advanced/index.js +3 -3
- package/dist/fhe-vesting/advanced/react/index.cjs +7 -7
- package/dist/fhe-vesting/advanced/react/index.js +4 -4
- package/dist/fhe-vesting/index.cjs +8 -8
- package/dist/fhe-vesting/index.js +2 -2
- package/dist/fhe-vesting/react/index.cjs +114 -114
- package/dist/fhe-vesting/react/index.js +3 -3
- package/dist/index.cjs +18 -18
- package/dist/index.js +1 -1
- package/dist/testnet-faucet/index.cjs +14 -14
- package/dist/testnet-faucet/index.js +2 -2
- package/dist/testnet-faucet/react/index.cjs +8 -8
- package/dist/testnet-faucet/react/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-NCVX3K2N.cjs +0 -161
- package/dist/chunk-VP2B4WM2.js +0 -154
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkPZZK3O3S_cjs = require('./chunk-PZZK3O3S.cjs');
|
|
4
|
+
var chunkAREQJHKA_cjs = require('./chunk-AREQJHKA.cjs');
|
|
5
5
|
var chunkJK4XMMKM_cjs = require('./chunk-JK4XMMKM.cjs');
|
|
6
6
|
var chunk67OV5CX2_cjs = require('./chunk-67OV5CX2.cjs');
|
|
7
7
|
var merkleTree = require('@openzeppelin/merkle-tree');
|
|
@@ -11,7 +11,7 @@ function leafOf(args) {
|
|
|
11
11
|
const inner = viem.keccak256(
|
|
12
12
|
viem.encodeAbiParameters(
|
|
13
13
|
[{ type: "address" }, { type: "address" }, { type: "bytes32" }],
|
|
14
|
-
[args.instance, args.
|
|
14
|
+
[args.instance, args.account, args.handle]
|
|
15
15
|
)
|
|
16
16
|
);
|
|
17
17
|
return viem.keccak256(inner);
|
|
@@ -42,19 +42,19 @@ function assertLeaves(instance, leaves, method) {
|
|
|
42
42
|
}
|
|
43
43
|
const seen = /* @__PURE__ */ new Map();
|
|
44
44
|
leaves.forEach((leaf, index) => {
|
|
45
|
-
if (!viem.isAddress(leaf.
|
|
45
|
+
if (!viem.isAddress(leaf.account, { strict: false })) {
|
|
46
46
|
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
47
47
|
method,
|
|
48
|
-
argument: `leaves[${index}].
|
|
48
|
+
argument: `leaves[${index}].account`,
|
|
49
49
|
reason: "is not a 20-byte hex address",
|
|
50
|
-
value: leaf.
|
|
50
|
+
value: leaf.account
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
if (viem.isAddressEqual(leaf.
|
|
53
|
+
if (viem.isAddressEqual(leaf.account, viem.zeroAddress)) {
|
|
54
54
|
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
55
55
|
method,
|
|
56
|
-
argument: `leaves[${index}].
|
|
57
|
-
reason: "is the zero address
|
|
56
|
+
argument: `leaves[${index}].account`,
|
|
57
|
+
reason: "is the zero address; the contract rejects it with ZeroAccount"
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
if (!HANDLE_PATTERN.test(leaf.handle)) {
|
|
@@ -65,13 +65,13 @@ function assertLeaves(instance, leaves, method) {
|
|
|
65
65
|
value: leaf.handle
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
const key = leaf.
|
|
68
|
+
const key = leaf.account.toLowerCase();
|
|
69
69
|
const first = seen.get(key);
|
|
70
70
|
if (first !== void 0) {
|
|
71
71
|
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
72
72
|
method,
|
|
73
|
-
argument: `leaves[${index}].
|
|
74
|
-
reason: `appears twice (also at index ${first}); one root pays max, not sum, of
|
|
73
|
+
argument: `leaves[${index}].account`,
|
|
74
|
+
reason: `appears twice (also at index ${first}); one root pays max, not sum, of an account's leaves \u2014 merge them into a single cumulative total`
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
seen.set(key, index);
|
|
@@ -83,22 +83,23 @@ function buildMerkleTree(args) {
|
|
|
83
83
|
function buildMerkleTreeInternal({ instance, leaves }, method) {
|
|
84
84
|
assertLeaves(instance, leaves, method);
|
|
85
85
|
const airdrop = chunkJK4XMMKM_cjs.normaliseAddress(instance);
|
|
86
|
-
const accounts = leaves.map((leaf) => chunkJK4XMMKM_cjs.normaliseAddress(leaf.
|
|
86
|
+
const accounts = leaves.map((leaf) => chunkJK4XMMKM_cjs.normaliseAddress(leaf.account));
|
|
87
87
|
const rows = accounts.map((account, i) => [airdrop, account, leaves[i].handle]);
|
|
88
88
|
const tree = merkleTree.StandardMerkleTree.of(rows, ["address", "address", "bytes32"]);
|
|
89
89
|
return {
|
|
90
90
|
root: tree.root,
|
|
91
|
-
// `getProof(i)` indexes the INPUT array, not the tree: `StandardMerkleTree`
|
|
92
|
-
//
|
|
93
|
-
//
|
|
91
|
+
// `getProof(i)` indexes the INPUT array, not the tree: `StandardMerkleTree` sorts
|
|
92
|
+
// leaves internally but keeps `values` in insertion order, so entry `i` always belongs
|
|
93
|
+
// to `leaves[i]`.
|
|
94
94
|
entries: leaves.map((leaf, i) => ({
|
|
95
95
|
...leaf,
|
|
96
|
-
|
|
96
|
+
account: accounts[i],
|
|
97
97
|
merkleProof: tree.getProof(i)
|
|
98
98
|
}))
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
var MAX_UINT64 = (1n << 64n) - 1n;
|
|
102
|
+
var MERKLE_BATCH_LIMIT = 2048 / 64;
|
|
102
103
|
function validateCampaignRecipients(recipients) {
|
|
103
104
|
validateCampaignRecipientsInternal(recipients, "validateCampaignRecipients");
|
|
104
105
|
}
|
|
@@ -147,7 +148,7 @@ function validateCampaignRecipientsInternal(recipients, method) {
|
|
|
147
148
|
seen.set(key, index);
|
|
148
149
|
});
|
|
149
150
|
}
|
|
150
|
-
async function encryptRoster({ instance, recipients, encryptor }, method) {
|
|
151
|
+
async function encryptRoster({ instance, recipients, encryptor, submitter }, method) {
|
|
151
152
|
validateCampaignRecipientsInternal(recipients, method);
|
|
152
153
|
if (!viem.isAddress(instance, { strict: false })) {
|
|
153
154
|
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
@@ -164,17 +165,60 @@ async function encryptRoster({ instance, recipients, encryptor }, method) {
|
|
|
164
165
|
reason: "is the zero address; inputs must be bound to the airdrop instance"
|
|
165
166
|
});
|
|
166
167
|
}
|
|
167
|
-
const enc =
|
|
168
|
+
const enc = chunkPZZK3O3S_cjs.resolveEncryptor(encryptor);
|
|
168
169
|
if (!enc) {
|
|
169
170
|
throw new chunk67OV5CX2_cjs.MissingEncryptorError(method, {
|
|
170
171
|
hint: "Pass an encryptor instance, or a lazy factory that returns one."
|
|
171
172
|
});
|
|
172
173
|
}
|
|
174
|
+
if (submitter !== void 0) {
|
|
175
|
+
if (!viem.isAddress(submitter, { strict: false })) {
|
|
176
|
+
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
177
|
+
method,
|
|
178
|
+
argument: "submitter",
|
|
179
|
+
reason: "is not a 20-byte hex address",
|
|
180
|
+
value: submitter
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
if (viem.isAddressEqual(submitter, viem.zeroAddress)) {
|
|
184
|
+
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
185
|
+
method,
|
|
186
|
+
argument: "submitter",
|
|
187
|
+
reason: "is the zero address; no proof can be bound to it, so no leaf would be claimable"
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
173
191
|
const airdrop = chunkJK4XMMKM_cjs.normaliseAddress(instance);
|
|
174
192
|
const accounts = recipients.map((r) => chunkJK4XMMKM_cjs.normaliseAddress(r.recipient));
|
|
193
|
+
if (submitter !== void 0) {
|
|
194
|
+
const boundTo = chunkJK4XMMKM_cjs.normaliseAddress(submitter);
|
|
195
|
+
const chunks = [];
|
|
196
|
+
for (let i = 0; i < recipients.length; i += MERKLE_BATCH_LIMIT) {
|
|
197
|
+
chunks.push(recipients.slice(i, i + MERKLE_BATCH_LIMIT));
|
|
198
|
+
}
|
|
199
|
+
const encryptedChunks = await Promise.all(
|
|
200
|
+
chunks.map(
|
|
201
|
+
(chunk) => chunkPZZK3O3S_cjs.encryptUint64Batch({
|
|
202
|
+
encryptor: enc,
|
|
203
|
+
contractAddress: airdrop,
|
|
204
|
+
userAddress: boundTo,
|
|
205
|
+
values: chunk.map((r) => r.cumulativeTotal)
|
|
206
|
+
})
|
|
207
|
+
)
|
|
208
|
+
);
|
|
209
|
+
return accounts.map((account, i) => {
|
|
210
|
+
const chunk = encryptedChunks[Math.floor(i / MERKLE_BATCH_LIMIT)];
|
|
211
|
+
return {
|
|
212
|
+
account,
|
|
213
|
+
boundTo,
|
|
214
|
+
handle: chunk.handles[i % MERKLE_BATCH_LIMIT],
|
|
215
|
+
inputProof: chunk.inputProof
|
|
216
|
+
};
|
|
217
|
+
});
|
|
218
|
+
}
|
|
175
219
|
const encrypted = await Promise.all(
|
|
176
220
|
recipients.map(
|
|
177
|
-
(r, i) =>
|
|
221
|
+
(r, i) => chunkPZZK3O3S_cjs.encryptUint64({
|
|
178
222
|
encryptor: enc,
|
|
179
223
|
contractAddress: airdrop,
|
|
180
224
|
userAddress: accounts[i],
|
|
@@ -182,8 +226,9 @@ async function encryptRoster({ instance, recipients, encryptor }, method) {
|
|
|
182
226
|
})
|
|
183
227
|
)
|
|
184
228
|
);
|
|
185
|
-
return accounts.map((
|
|
186
|
-
|
|
229
|
+
return accounts.map((account, i) => ({
|
|
230
|
+
account,
|
|
231
|
+
boundTo: account,
|
|
187
232
|
handle: encrypted[i].handle,
|
|
188
233
|
inputProof: encrypted[i].inputProof
|
|
189
234
|
}));
|
|
@@ -194,9 +239,13 @@ async function encryptCampaignAmounts(args) {
|
|
|
194
239
|
async function buildMerkleCampaign({
|
|
195
240
|
instance,
|
|
196
241
|
recipients,
|
|
197
|
-
encryptor
|
|
242
|
+
encryptor,
|
|
243
|
+
submitter
|
|
198
244
|
}) {
|
|
199
|
-
const leaves = await encryptRoster(
|
|
245
|
+
const leaves = await encryptRoster(
|
|
246
|
+
{ instance, recipients, encryptor, submitter },
|
|
247
|
+
"buildMerkleCampaign"
|
|
248
|
+
);
|
|
200
249
|
return buildMerkleTreeInternal({ instance, leaves }, "buildMerkleCampaign");
|
|
201
250
|
}
|
|
202
251
|
async function planMerkleCampaign({
|
|
@@ -206,7 +255,8 @@ async function planMerkleCampaign({
|
|
|
206
255
|
creator,
|
|
207
256
|
userSalt,
|
|
208
257
|
recipients,
|
|
209
|
-
encryptor
|
|
258
|
+
encryptor,
|
|
259
|
+
submitter
|
|
210
260
|
}) {
|
|
211
261
|
validateCampaignRecipientsInternal(recipients, "planMerkleCampaign");
|
|
212
262
|
const initCodeHashBefore = await factory.getMerkleInitCodeHash({ params, mode });
|
|
@@ -219,10 +269,11 @@ async function planMerkleCampaign({
|
|
|
219
269
|
const campaign = await buildMerkleCampaign({
|
|
220
270
|
instance: predictedAddress,
|
|
221
271
|
recipients,
|
|
222
|
-
encryptor
|
|
272
|
+
encryptor,
|
|
273
|
+
submitter
|
|
223
274
|
});
|
|
224
275
|
const initCodeHashAfter = await factory.getMerkleInitCodeHash({ params, mode });
|
|
225
|
-
|
|
276
|
+
chunkAREQJHKA_cjs.assertPredictionFresh({
|
|
226
277
|
variant: "merkle",
|
|
227
278
|
initCodeHashBefore,
|
|
228
279
|
initCodeHashAfter,
|
|
@@ -235,12 +286,14 @@ async function rotateMerkleRoot({
|
|
|
235
286
|
airdrop,
|
|
236
287
|
recipients,
|
|
237
288
|
encryptor,
|
|
289
|
+
submitter,
|
|
238
290
|
account
|
|
239
291
|
}) {
|
|
240
292
|
const campaign = await buildMerkleCampaign({
|
|
241
293
|
instance: airdrop.address,
|
|
242
294
|
recipients,
|
|
243
|
-
encryptor
|
|
295
|
+
encryptor,
|
|
296
|
+
submitter
|
|
244
297
|
});
|
|
245
298
|
const hash = await airdrop.setMerkleRoot({ newRoot: campaign.root, account });
|
|
246
299
|
return { ...campaign, hash };
|
|
@@ -258,7 +311,7 @@ var ASSIGNABLE_ROLES = [
|
|
|
258
311
|
function planInstanceRoleSplit(args) {
|
|
259
312
|
const { assignment, caller, airdropType } = args;
|
|
260
313
|
if (assignment.feeCollector !== void 0) {
|
|
261
|
-
throw new
|
|
314
|
+
throw new chunkAREQJHKA_cjs.FeeCollectorSelfAdministeredError({ requestedGrantee: assignment.feeCollector });
|
|
262
315
|
}
|
|
263
316
|
const steps = [];
|
|
264
317
|
for (const { key, role, variant } of ASSIGNABLE_ROLES) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkUHHMVBLU_cjs = require('./chunk-UHHMVBLU.cjs');
|
|
4
4
|
|
|
5
5
|
// src/fhe-vesting/advanced/factory-advanced.ts
|
|
6
|
-
var ConfidentialVestingFactoryAdvancedClient = class extends
|
|
6
|
+
var ConfidentialVestingFactoryAdvancedClient = class extends chunkUHHMVBLU_cjs.ConfidentialVestingFactoryClient {
|
|
7
7
|
/**
|
|
8
8
|
* Compute the deterministic CREATE2 clone address as the factory would have
|
|
9
9
|
* computed it at `args.blockNumber`.
|
|
@@ -20,7 +20,7 @@ var ConfidentialVestingFactoryAdvancedClient = class extends chunk6PXXGACR_cjs.C
|
|
|
20
20
|
if (hasOptions) {
|
|
21
21
|
return this.publicClient.readContract({
|
|
22
22
|
address: this.address,
|
|
23
|
-
abi:
|
|
23
|
+
abi: chunkUHHMVBLU_cjs.confidentialVestingFactoryAbi,
|
|
24
24
|
functionName: "predictManagerAddressWithOptions",
|
|
25
25
|
args: [
|
|
26
26
|
args.token,
|
|
@@ -34,7 +34,7 @@ var ConfidentialVestingFactoryAdvancedClient = class extends chunk6PXXGACR_cjs.C
|
|
|
34
34
|
}
|
|
35
35
|
return this.publicClient.readContract({
|
|
36
36
|
address: this.address,
|
|
37
|
-
abi:
|
|
37
|
+
abi: chunkUHHMVBLU_cjs.confidentialVestingFactoryAbi,
|
|
38
38
|
functionName: "predictManagerAddress",
|
|
39
39
|
args: [args.token, args.userSalt, args.deployer],
|
|
40
40
|
blockNumber: args.blockNumber
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfidentialVestingFactoryClient, confidentialVestingFactoryAbi } from './chunk-
|
|
1
|
+
import { ConfidentialVestingFactoryClient, confidentialVestingFactoryAbi } from './chunk-WJMEBBU7.js';
|
|
2
2
|
|
|
3
3
|
// src/fhe-vesting/advanced/factory-advanced.ts
|
|
4
4
|
var ConfidentialVestingFactoryAdvancedClient = class extends ConfidentialVestingFactoryClient {
|