@boostxyz/sdk 0.0.0-alpha.9 → 1.1.0-alpha.22
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/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.cjs.map +1 -1
- package/dist/Actions/Action.js +7 -7
- package/dist/Actions/ContractAction.d.ts +11 -11
- package/dist/Actions/ContractAction.d.ts.map +1 -1
- package/dist/Actions/ERC721MintAction.d.ts +14 -14
- package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +171 -41
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +15 -392
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.cjs.map +1 -1
- package/dist/AllowLists/AllowList.d.ts +6 -4
- package/dist/AllowLists/AllowList.d.ts.map +1 -1
- package/dist/AllowLists/AllowList.js +45 -23
- package/dist/AllowLists/AllowList.js.map +1 -1
- package/dist/AllowLists/OpenAllowList.d.ts +423 -0
- package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +92 -37
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +55 -71
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs.map +1 -1
- package/dist/AllowLists/SimpleDenyList.d.ts +203 -11
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleDenyList.js +11 -112
- package/dist/AllowLists/SimpleDenyList.js.map +1 -1
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/Boost.cjs +1 -1
- package/dist/Boost.cjs.map +1 -1
- package/dist/Boost.d.ts +20 -21
- package/dist/Boost.d.ts.map +1 -1
- package/dist/Boost.js +43 -57
- package/dist/Boost.js.map +1 -1
- package/dist/BoostCore-BVZExPPu.js +1462 -0
- package/dist/BoostCore-BVZExPPu.js.map +1 -0
- package/dist/BoostCore-D-E-cnGI.cjs +3 -0
- package/dist/BoostCore-D-E-cnGI.cjs.map +1 -0
- package/dist/BoostCore.cjs +1 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +748 -77
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +29 -1150
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.cjs.map +1 -1
- package/dist/BoostRegistry.d.ts +80 -25
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +165 -83
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.cjs.map +1 -1
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +2 -2
- package/dist/Budgets/Budget.js.map +1 -1
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +75 -193
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +80 -298
- package/dist/Budgets/ManagedBudget.js.map +1 -1
- package/dist/Budgets/VestingBudget.d.ts +223 -89
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/Contract.cjs +1 -1
- package/dist/Deployable/Contract.cjs.map +1 -1
- package/dist/Deployable/Contract.d.ts +4 -5
- package/dist/Deployable/Contract.d.ts.map +1 -1
- package/dist/Deployable/Contract.js +5 -7
- package/dist/Deployable/Contract.js.map +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +1 -1
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js +3 -5
- package/dist/Deployable/Deployable.js.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.cjs.map +1 -1
- package/dist/Deployable/DeployableTarget.d.ts +13 -13
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.js +28 -25
- package/dist/Deployable/DeployableTarget.js.map +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
- package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts +179 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js +222 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
- package/dist/EventAction-BZt5cjbe.cjs +2 -0
- package/dist/EventAction-BZt5cjbe.cjs.map +1 -0
- package/dist/EventAction-C_-hJXWm.js +1541 -0
- package/dist/EventAction-C_-hJXWm.js.map +1 -0
- package/dist/Incentive-BhHaK3PZ.cjs +2 -0
- package/dist/Incentive-BhHaK3PZ.cjs.map +1 -0
- package/dist/Incentive-Cqg1w6wD.js +312 -0
- package/dist/Incentive-Cqg1w6wD.js.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.d.ts +38 -16
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +42 -29
- package/dist/Incentives/AllowListIncentive.js.map +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.d.ts +234 -21
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +45 -32
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC1155Incentive.d.ts +224 -37
- package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.d.ts +230 -29
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +56 -43
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +335 -440
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts +231 -29
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.cjs.map +1 -1
- package/dist/Incentives/Incentive.d.ts +4 -4
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +16 -296
- package/dist/Incentives/Incentive.js.map +1 -1
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.d.ts +40 -18
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +37 -24
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-BUR17Tt1.cjs +2 -0
- package/dist/SimpleDenyList-BUR17Tt1.cjs.map +1 -0
- package/dist/SimpleDenyList-CGaWjuld.js +132 -0
- package/dist/SimpleDenyList-CGaWjuld.js.map +1 -0
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.d.ts +16 -16
- package/dist/Validators/SignerValidator.d.ts.map +1 -1
- package/dist/Validators/SignerValidator.js +30 -27
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.cjs.map +1 -1
- package/dist/Validators/Validator.d.ts +1 -1
- package/dist/Validators/Validator.js +2 -2
- package/dist/Validators/Validator.js.map +1 -1
- package/dist/claiming.cjs.map +1 -1
- package/dist/claiming.d.ts +1 -1
- package/dist/claiming.js.map +1 -1
- package/dist/componentInterfaces-BBCFkrZv.js +14 -0
- package/dist/componentInterfaces-BBCFkrZv.js.map +1 -0
- package/dist/componentInterfaces-DRI_dQ-P.cjs +2 -0
- package/dist/componentInterfaces-DRI_dQ-P.cjs.map +1 -0
- package/dist/deployments-DVXioW2i.cjs +2 -0
- package/dist/deployments-DVXioW2i.cjs.map +1 -0
- package/dist/deployments-oykLv3_Z.js +43 -0
- package/dist/deployments-oykLv3_Z.js.map +1 -0
- package/dist/deployments.json +44 -0
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +256 -20
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +183 -26
- package/dist/errors.js.map +1 -1
- package/dist/{generated-57_Kffpz.js → generated-CKt2yCQd.js} +3613 -1869
- package/dist/generated-CKt2yCQd.js.map +1 -0
- package/dist/generated-CyTNlOwM.cjs +3 -0
- package/dist/generated-CyTNlOwM.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +142 -108
- package/dist/index.js.map +1 -1
- package/dist/transfers.cjs.map +1 -1
- package/dist/transfers.d.ts +1 -1
- package/dist/transfers.js.map +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +26 -12
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +38 -23
- package/dist/utils.js.map +1 -1
- package/package.json +20 -10
- package/src/Actions/Action.test.ts +14 -13
- package/src/Actions/ContractAction.test.ts +10 -10
- package/src/Actions/ContractAction.ts +11 -12
- package/src/Actions/ERC721MintAction.test.ts +6 -6
- package/src/Actions/ERC721MintAction.ts +14 -15
- package/src/Actions/EventAction.test.ts +729 -109
- package/src/Actions/EventAction.ts +542 -84
- package/src/AllowLists/AllowList.test.ts +7 -7
- package/src/AllowLists/AllowList.ts +5 -3
- package/src/AllowLists/OpenAllowList.test.ts +40 -0
- package/src/AllowLists/OpenAllowList.ts +45 -0
- package/src/AllowLists/SimpleAllowList.test.ts +4 -4
- package/src/AllowLists/SimpleAllowList.ts +39 -61
- package/src/AllowLists/SimpleDenyList.test.ts +4 -4
- package/src/AllowLists/SimpleDenyList.ts +40 -17
- package/src/Auth/PassthroughAuth.test.ts +1 -1
- package/src/Boost.ts +21 -24
- package/src/BoostCore.test.ts +323 -268
- package/src/BoostCore.ts +396 -219
- package/src/BoostRegistry.test.ts +53 -0
- package/src/BoostRegistry.ts +161 -40
- package/src/Budgets/Budget.test.ts +2 -2
- package/src/Budgets/Budget.ts +1 -2
- package/src/Budgets/ManagedBudget.test.ts +82 -19
- package/src/Budgets/ManagedBudget.ts +48 -310
- package/src/Budgets/VestingBudget.test.ts +7 -7
- package/src/Budgets/VestingBudget.ts +34 -106
- package/src/Deployable/Contract.ts +4 -5
- package/src/Deployable/Deployable.ts +1 -1
- package/src/Deployable/DeployableTarget.ts +30 -19
- package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
- package/src/Incentives/AllowListIncentive.test.ts +5 -5
- package/src/Incentives/AllowListIncentive.ts +29 -15
- package/src/Incentives/CGDAIncentive.test.ts +9 -6
- package/src/Incentives/CGDAIncentive.ts +38 -18
- package/src/Incentives/ERC1155Incentive.test.ts +3 -3
- package/src/Incentives/ERC1155Incentive.ts +28 -29
- package/src/Incentives/ERC20Incentive.test.ts +9 -6
- package/src/Incentives/ERC20Incentive.ts +46 -26
- package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
- package/src/Incentives/ERC20VariableCriteriaIncentive.ts +324 -0
- package/src/Incentives/ERC20VariableIncentive.test.ts +8 -11
- package/src/Incentives/ERC20VariableIncentive.ts +49 -26
- package/src/Incentives/Incentive.test.ts +4 -1
- package/src/Incentives/Incentive.ts +7 -6
- package/src/Incentives/PointsIncentive.test.ts +24 -25
- package/src/Incentives/PointsIncentive.ts +31 -17
- package/src/Validators/SignerValidator.test.ts +6 -6
- package/src/Validators/SignerValidator.ts +19 -17
- package/src/Validators/Validator.test.ts +2 -2
- package/src/Validators/Validator.ts +1 -1
- package/src/claiming.ts +1 -1
- package/src/errors.ts +345 -21
- package/src/index.test.ts +118 -36
- package/src/index.ts +5 -0
- package/src/transfers.ts +1 -1
- package/src/utils.test.ts +2 -2
- package/src/utils.ts +61 -12
- package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
- package/dist/componentInterfaces-CKCBwG16.cjs +0 -2
- package/dist/componentInterfaces-CKCBwG16.cjs.map +0 -1
- package/dist/componentInterfaces-DYkaxBda.js +0 -13
- package/dist/componentInterfaces-DYkaxBda.js.map +0 -1
- package/dist/generated-57_Kffpz.js.map +0 -1
- package/dist/generated-wKBNvm48.cjs +0 -3
- package/dist/generated-wKBNvm48.cjs.map +0 -1
- package/src/Budgets/SimpleBudget.test.ts +0 -152
- package/src/Budgets/SimpleBudget.ts +0 -564
|
@@ -20,7 +20,9 @@ import {
|
|
|
20
20
|
type ContractEventName,
|
|
21
21
|
type Hex,
|
|
22
22
|
encodeAbiParameters,
|
|
23
|
+
zeroHash,
|
|
23
24
|
} from 'viem';
|
|
25
|
+
import { CGDAIncentive as CGDAIncentiveBases } from '../../dist/deployments.json';
|
|
24
26
|
import type {
|
|
25
27
|
DeployableOptions,
|
|
26
28
|
GenericDeployableParams,
|
|
@@ -74,6 +76,12 @@ export interface CGDAIncentivePayload {
|
|
|
74
76
|
* @type {bigint}
|
|
75
77
|
*/
|
|
76
78
|
totalBudget: bigint;
|
|
79
|
+
/**
|
|
80
|
+
* The entity that can `clawback` funds
|
|
81
|
+
*
|
|
82
|
+
* @type {Address}
|
|
83
|
+
*/
|
|
84
|
+
manager: Address;
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
/**
|
|
@@ -144,10 +152,11 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
144
152
|
*
|
|
145
153
|
* @public
|
|
146
154
|
* @static
|
|
147
|
-
* @type {Address}
|
|
155
|
+
* @type {Record<number, Address>}
|
|
148
156
|
*/
|
|
149
|
-
public static override
|
|
150
|
-
|
|
157
|
+
public static override bases: Record<number, Address> = {
|
|
158
|
+
...(CGDAIncentiveBases as Record<number, Address>),
|
|
159
|
+
};
|
|
151
160
|
/**
|
|
152
161
|
* @inheritdoc
|
|
153
162
|
*
|
|
@@ -162,8 +171,8 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
162
171
|
*
|
|
163
172
|
* @public
|
|
164
173
|
* @async
|
|
165
|
-
* @param {?ReadParams
|
|
166
|
-
* @returns {
|
|
174
|
+
* @param {?ReadParams} [params]
|
|
175
|
+
* @returns {Promise<Address>}
|
|
167
176
|
*/
|
|
168
177
|
public async owner(params?: ReadParams<typeof cgdaIncentiveAbi, 'owner'>) {
|
|
169
178
|
return await readCgdaIncentiveOwner(this._config, {
|
|
@@ -179,7 +188,7 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
179
188
|
*
|
|
180
189
|
* @public
|
|
181
190
|
* @async
|
|
182
|
-
* @param {?ReadParams
|
|
191
|
+
* @param {?ReadParams} [params]
|
|
183
192
|
* @returns {Promise<bigint>}
|
|
184
193
|
*/
|
|
185
194
|
public async claims(params?: ReadParams<typeof cgdaIncentiveAbi, 'claims'>) {
|
|
@@ -196,7 +205,7 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
196
205
|
*
|
|
197
206
|
* @public
|
|
198
207
|
* @async
|
|
199
|
-
* @param {?ReadParams
|
|
208
|
+
* @param {?ReadParams} [params]
|
|
200
209
|
* @returns {Promise<bigint>}
|
|
201
210
|
*/
|
|
202
211
|
public async reward(params?: ReadParams<typeof cgdaIncentiveAbi, 'reward'>) {
|
|
@@ -214,7 +223,7 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
214
223
|
* @public
|
|
215
224
|
* @async
|
|
216
225
|
* @param {Address} address
|
|
217
|
-
* @param {?ReadParams
|
|
226
|
+
* @param {?ReadParams} [params]
|
|
218
227
|
* @returns {Promise<boolean>}
|
|
219
228
|
*/
|
|
220
229
|
public async claimed(
|
|
@@ -234,8 +243,8 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
234
243
|
*
|
|
235
244
|
* @public
|
|
236
245
|
* @async
|
|
237
|
-
* @param {?ReadParams
|
|
238
|
-
* @returns {
|
|
246
|
+
* @param {?ReadParams} [params]
|
|
247
|
+
* @returns {Promise<Address>}
|
|
239
248
|
*/
|
|
240
249
|
public async asset(params?: ReadParams<typeof cgdaIncentiveAbi, 'asset'>) {
|
|
241
250
|
return await readCgdaIncentiveAsset(this._config, {
|
|
@@ -250,7 +259,7 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
250
259
|
*
|
|
251
260
|
* @public
|
|
252
261
|
* @async
|
|
253
|
-
* @param {?ReadParams
|
|
262
|
+
* @param {?ReadParams} [params]
|
|
254
263
|
* @returns {Promise<CGDAParameters>}
|
|
255
264
|
*/
|
|
256
265
|
public async cgdaParams(
|
|
@@ -275,7 +284,7 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
275
284
|
*
|
|
276
285
|
* @public
|
|
277
286
|
* @async
|
|
278
|
-
* @param {?ReadParams
|
|
287
|
+
* @param {?ReadParams} [params]
|
|
279
288
|
* @returns {Promise<bigint>}
|
|
280
289
|
*/
|
|
281
290
|
public async totalBudget(
|
|
@@ -294,7 +303,7 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
294
303
|
* @public
|
|
295
304
|
* @async
|
|
296
305
|
* @param {ClaimPayload} payload
|
|
297
|
-
* @param {?WriteParams
|
|
306
|
+
* @param {?WriteParams} [params]
|
|
298
307
|
* @returns {Promise<boolean>} - Returns true if successfully claimed
|
|
299
308
|
*/
|
|
300
309
|
protected async claim(
|
|
@@ -310,7 +319,7 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
310
319
|
* @public
|
|
311
320
|
* @async
|
|
312
321
|
* @param {ClaimPayload} payload
|
|
313
|
-
* @param {?WriteParams
|
|
322
|
+
* @param {?WriteParams} [params]
|
|
314
323
|
* @returns {Promise<boolean>} - Returns true if successfully claimed
|
|
315
324
|
*/
|
|
316
325
|
protected async claimRaw(
|
|
@@ -334,7 +343,7 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
334
343
|
* @public
|
|
335
344
|
* @async
|
|
336
345
|
* @param {ClaimPayload} payload
|
|
337
|
-
* @param {?WriteParams
|
|
346
|
+
* @param {?WriteParams} [params]
|
|
338
347
|
* @returns {Promise<boolean>} - True if the assets were successfully clawbacked
|
|
339
348
|
*/
|
|
340
349
|
public async clawback(
|
|
@@ -350,7 +359,7 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
350
359
|
* @public
|
|
351
360
|
* @async
|
|
352
361
|
* @param {ClaimPayload} payload
|
|
353
|
-
* @param {?WriteParams
|
|
362
|
+
* @param {?WriteParams} [params]
|
|
354
363
|
* @returns {Promise<boolean>} - True if the assets were successfully clawbacked
|
|
355
364
|
*/
|
|
356
365
|
public async clawbackRaw(
|
|
@@ -377,7 +386,7 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
377
386
|
* @public
|
|
378
387
|
* @async
|
|
379
388
|
* @param {ClaimPayload} payload
|
|
380
|
-
* @param {?ReadParams
|
|
389
|
+
* @param {?ReadParams} [params]
|
|
381
390
|
* @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload
|
|
382
391
|
*/
|
|
383
392
|
public async isClaimable(
|
|
@@ -399,7 +408,7 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
399
408
|
*
|
|
400
409
|
* @public
|
|
401
410
|
* @async
|
|
402
|
-
* @param {?ReadParams
|
|
411
|
+
* @param {?ReadParams} [params]
|
|
403
412
|
* @returns {Promise<bigint>} - The current reward
|
|
404
413
|
*/
|
|
405
414
|
public async currentReward(
|
|
@@ -435,6 +444,17 @@ export class CGDAIncentive extends DeployableTarget<
|
|
|
435
444
|
...this.optionallyAttachAccount(options.account),
|
|
436
445
|
};
|
|
437
446
|
}
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Builds the claim data for the CGDAIncentive.
|
|
450
|
+
*
|
|
451
|
+
* @public
|
|
452
|
+
* @returns {Hash} A `zeroHash`, as CGDAIncentive doesn't require specific claim data.
|
|
453
|
+
* @description This function returns `zeroHash` because CGDAIncentive doesn't use any specific claim data.
|
|
454
|
+
*/
|
|
455
|
+
public buildClaimData() {
|
|
456
|
+
return zeroHash;
|
|
457
|
+
}
|
|
438
458
|
}
|
|
439
459
|
|
|
440
460
|
/**
|
|
@@ -2,7 +2,7 @@ import { readMockErc1155BalanceOf } from '@boostxyz/evm';
|
|
|
2
2
|
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
|
|
3
3
|
import { isAddress, pad, parseEther, zeroAddress, zeroHash } from 'viem';
|
|
4
4
|
import { beforeAll, beforeEach, describe, expect, test } from 'vitest';
|
|
5
|
-
import { accounts } from '
|
|
5
|
+
import { accounts } from '@boostxyz/test/accounts';
|
|
6
6
|
import {
|
|
7
7
|
type BudgetFixtures,
|
|
8
8
|
type Fixtures,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
deployFixtures,
|
|
11
11
|
freshBoost,
|
|
12
12
|
fundBudget,
|
|
13
|
-
} from '
|
|
13
|
+
} from '@boostxyz/test/helpers';
|
|
14
14
|
import { ERC1155Incentive, ERC1155StrategyType } from './ERC1155Incentive';
|
|
15
15
|
|
|
16
16
|
const BOOST_CORE_CLAIM_FEE = parseEther('0.000075');
|
|
@@ -19,7 +19,7 @@ let fixtures: Fixtures, budgets: BudgetFixtures;
|
|
|
19
19
|
|
|
20
20
|
describe.skip('ERC1155Incentive', () => {
|
|
21
21
|
beforeAll(async () => {
|
|
22
|
-
fixtures = await loadFixture(deployFixtures);
|
|
22
|
+
fixtures = await loadFixture(deployFixtures(defaultOptions));
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
beforeEach(async () => {
|
|
@@ -127,10 +127,9 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
127
127
|
*
|
|
128
128
|
* @public
|
|
129
129
|
* @static
|
|
130
|
-
* @type {Address}
|
|
130
|
+
* @type {Record<number, Address>}
|
|
131
131
|
*/
|
|
132
|
-
public static override
|
|
133
|
-
.VITE_ERC1155_INCENTIVE_BASE;
|
|
132
|
+
public static override bases: Record<number, Address> = {};
|
|
134
133
|
/**
|
|
135
134
|
* @inheritdoc
|
|
136
135
|
*
|
|
@@ -145,8 +144,8 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
145
144
|
*
|
|
146
145
|
* @public
|
|
147
146
|
* @async
|
|
148
|
-
* @param {?ReadParams
|
|
149
|
-
* @returns {
|
|
147
|
+
* @param {?ReadParams} [params]
|
|
148
|
+
* @returns {Promise<bigint>}
|
|
150
149
|
*/
|
|
151
150
|
public async claims(
|
|
152
151
|
params?: ReadParams<typeof erc1155IncentiveAbi, 'claims'>,
|
|
@@ -164,8 +163,8 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
164
163
|
*
|
|
165
164
|
* @public
|
|
166
165
|
* @async
|
|
167
|
-
* @param {?ReadParams
|
|
168
|
-
* @returns {
|
|
166
|
+
* @param {?ReadParams} [params]
|
|
167
|
+
* @returns {Promise<bigint>}
|
|
169
168
|
*/
|
|
170
169
|
public async reward(
|
|
171
170
|
params?: ReadParams<typeof erc1155IncentiveAbi, 'reward'>,
|
|
@@ -184,8 +183,8 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
184
183
|
* @public
|
|
185
184
|
* @async
|
|
186
185
|
* @param {Address} address
|
|
187
|
-
* @param {?ReadParams
|
|
188
|
-
* @returns {
|
|
186
|
+
* @param {?ReadParams} [params]
|
|
187
|
+
* @returns {Promise<boolean>}
|
|
189
188
|
*/
|
|
190
189
|
public async claimed(
|
|
191
190
|
address: Address,
|
|
@@ -204,8 +203,8 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
204
203
|
*
|
|
205
204
|
* @public
|
|
206
205
|
* @async
|
|
207
|
-
* @param {?ReadParams
|
|
208
|
-
* @returns {
|
|
206
|
+
* @param {?ReadParams} [params]
|
|
207
|
+
* @returns {Promise<Address>}
|
|
209
208
|
*/
|
|
210
209
|
public async asset(params?: ReadParams<typeof erc1155IncentiveAbi, 'asset'>) {
|
|
211
210
|
return await readErc1155IncentiveAsset(this._config, {
|
|
@@ -220,7 +219,7 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
220
219
|
*
|
|
221
220
|
* @public
|
|
222
221
|
* @async
|
|
223
|
-
* @param {?ReadParams
|
|
222
|
+
* @param {?ReadParams} [params]
|
|
224
223
|
* @returns {Promise<StrategyType>}
|
|
225
224
|
*/
|
|
226
225
|
public strategy(
|
|
@@ -238,7 +237,7 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
238
237
|
*
|
|
239
238
|
* @public
|
|
240
239
|
* @async
|
|
241
|
-
* @param {?ReadParams
|
|
240
|
+
* @param {?ReadParams} [params]
|
|
242
241
|
* @returns {unknown}
|
|
243
242
|
*/
|
|
244
243
|
public async limit(params?: ReadParams<typeof erc1155IncentiveAbi, 'limit'>) {
|
|
@@ -254,8 +253,8 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
254
253
|
*
|
|
255
254
|
* @public
|
|
256
255
|
* @async
|
|
257
|
-
* @param {?ReadParams
|
|
258
|
-
* @returns {
|
|
256
|
+
* @param {?ReadParams} [params]
|
|
257
|
+
* @returns {Promise<bigint>}
|
|
259
258
|
*/
|
|
260
259
|
public async tokenId(
|
|
261
260
|
params?: ReadParams<typeof erc1155IncentiveAbi, 'tokenId'>,
|
|
@@ -272,8 +271,8 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
272
271
|
*
|
|
273
272
|
* @public
|
|
274
273
|
* @async
|
|
275
|
-
* @param {?ReadParams
|
|
276
|
-
* @returns {
|
|
274
|
+
* @param {?ReadParams} [params]
|
|
275
|
+
* @returns {Promise<Hex>}
|
|
277
276
|
*/
|
|
278
277
|
public async extraData(
|
|
279
278
|
params?: ReadParams<typeof erc1155IncentiveAbi, 'extraData'>,
|
|
@@ -291,8 +290,8 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
291
290
|
* @public
|
|
292
291
|
* @async
|
|
293
292
|
* @param {ClaimPayload} payload
|
|
294
|
-
* @param {?WriteParams
|
|
295
|
-
* @returns {
|
|
293
|
+
* @param {?WriteParams} [params]
|
|
294
|
+
* @returns {Promise<boolean>}
|
|
296
295
|
*/
|
|
297
296
|
protected async claim(
|
|
298
297
|
payload: ClaimPayload,
|
|
@@ -307,8 +306,8 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
307
306
|
* @public
|
|
308
307
|
* @async
|
|
309
308
|
* @param {ClaimPayload} payload
|
|
310
|
-
* @param {?WriteParams
|
|
311
|
-
* @returns {
|
|
309
|
+
* @param {?WriteParams} [params]
|
|
310
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>}
|
|
312
311
|
*/
|
|
313
312
|
protected async claimRaw(
|
|
314
313
|
payload: ClaimPayload,
|
|
@@ -334,8 +333,8 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
334
333
|
* @public
|
|
335
334
|
* @async
|
|
336
335
|
* @param {ClaimPayload} payload
|
|
337
|
-
* @param {?WriteParams
|
|
338
|
-
* @returns {
|
|
336
|
+
* @param {?WriteParams} [params]
|
|
337
|
+
* @returns {Promise<boolean>}
|
|
339
338
|
*/
|
|
340
339
|
public async clawback(
|
|
341
340
|
payload: ClaimPayload,
|
|
@@ -350,8 +349,8 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
350
349
|
* @public
|
|
351
350
|
* @async
|
|
352
351
|
* @param {ClaimPayload} payload
|
|
353
|
-
* @param {?WriteParams
|
|
354
|
-
* @returns {
|
|
352
|
+
* @param {?WriteParams} [params]
|
|
353
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>}
|
|
355
354
|
*/
|
|
356
355
|
public async clawbackRaw(
|
|
357
356
|
payload: ClaimPayload,
|
|
@@ -377,8 +376,8 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
377
376
|
* @public
|
|
378
377
|
* @async
|
|
379
378
|
* @param {ClaimPayload} payload
|
|
380
|
-
* @param {?ReadParams
|
|
381
|
-
* @returns {
|
|
379
|
+
* @param {?ReadParams} [params]
|
|
380
|
+
* @returns {Promise<boolean>}
|
|
382
381
|
*/
|
|
383
382
|
public async isClaimable(
|
|
384
383
|
payload: ClaimPayload,
|
|
@@ -398,8 +397,8 @@ export class ERC1155Incentive extends DeployableTarget<
|
|
|
398
397
|
* @public
|
|
399
398
|
* @async
|
|
400
399
|
* @param {ERC1155IncentivePayload} data
|
|
401
|
-
* @param {?ReadParams
|
|
402
|
-
* @returns {
|
|
400
|
+
* @param {?ReadParams} [params]
|
|
401
|
+
* @returns {Promise<Hex>}
|
|
403
402
|
*/
|
|
404
403
|
public async preflight(
|
|
405
404
|
data: ERC1155IncentivePayload,
|
|
@@ -2,7 +2,7 @@ import { readMockErc20BalanceOf } from '@boostxyz/evm';
|
|
|
2
2
|
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
|
|
3
3
|
import { isAddress, pad, parseEther, zeroAddress } from 'viem';
|
|
4
4
|
import { beforeAll, beforeEach, describe, expect, test } from 'vitest';
|
|
5
|
-
import { accounts } from '
|
|
5
|
+
import { accounts } from '@boostxyz/test/accounts';
|
|
6
6
|
import {
|
|
7
7
|
type BudgetFixtures,
|
|
8
8
|
type Fixtures,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
deployFixtures,
|
|
11
11
|
freshBoost,
|
|
12
12
|
fundBudget,
|
|
13
|
-
} from '
|
|
13
|
+
} from '@boostxyz/test/helpers';
|
|
14
14
|
import { BOOST_CORE_CLAIM_FEE } from '../BoostCore';
|
|
15
15
|
import { StrategyType } from '../claiming';
|
|
16
16
|
import { ERC20Incentive } from './ERC20Incentive';
|
|
@@ -19,7 +19,7 @@ let fixtures: Fixtures, budgets: BudgetFixtures;
|
|
|
19
19
|
|
|
20
20
|
describe('ERC20Incentive', () => {
|
|
21
21
|
beforeAll(async () => {
|
|
22
|
-
fixtures = await loadFixture(deployFixtures);
|
|
22
|
+
fixtures = await loadFixture(deployFixtures(defaultOptions));
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
beforeEach(async () => {
|
|
@@ -32,6 +32,7 @@ describe('ERC20Incentive', () => {
|
|
|
32
32
|
strategy: StrategyType.POOL,
|
|
33
33
|
reward: 1n,
|
|
34
34
|
limit: 1n,
|
|
35
|
+
manager: zeroAddress,
|
|
35
36
|
});
|
|
36
37
|
await action.deploy();
|
|
37
38
|
expect(isAddress(action.assertValidAddress())).toBe(true);
|
|
@@ -42,11 +43,12 @@ describe('ERC20Incentive', () => {
|
|
|
42
43
|
const referrer = accounts.at(1)!.account!,
|
|
43
44
|
// biome-ignore lint/style/noNonNullAssertion: we know this is defined
|
|
44
45
|
trustedSigner = accounts.at(0)!;
|
|
45
|
-
const erc20Incentive =
|
|
46
|
+
const erc20Incentive = fixtures.core.ERC20Incentive({
|
|
46
47
|
asset: budgets.erc20.assertValidAddress(),
|
|
47
48
|
strategy: StrategyType.POOL,
|
|
48
49
|
reward: 1n,
|
|
49
50
|
limit: 1n,
|
|
51
|
+
manager: budgets.budget.assertValidAddress(),
|
|
50
52
|
});
|
|
51
53
|
const boost = await freshBoost(fixtures, {
|
|
52
54
|
budget: budgets.budget,
|
|
@@ -54,7 +56,7 @@ describe('ERC20Incentive', () => {
|
|
|
54
56
|
});
|
|
55
57
|
|
|
56
58
|
const claimant = trustedSigner.account;
|
|
57
|
-
const incentiveData =
|
|
59
|
+
const incentiveData = erc20Incentive.buildClaimData();
|
|
58
60
|
const incentiveQuantity = 1;
|
|
59
61
|
const claimDataPayload = await boost.validator.encodeClaimData({
|
|
60
62
|
signer: trustedSigner,
|
|
@@ -85,11 +87,12 @@ describe('ERC20Incentive', () => {
|
|
|
85
87
|
const referrer = accounts.at(1)!.account!;
|
|
86
88
|
// biome-ignore lint/style/noNonNullAssertion: we know this is defined
|
|
87
89
|
const trustedSigner = accounts.at(0)!;
|
|
88
|
-
const erc20Incentive =
|
|
90
|
+
const erc20Incentive = fixtures.core.ERC20Incentive({
|
|
89
91
|
asset: budgets.erc20.assertValidAddress(),
|
|
90
92
|
strategy: StrategyType.POOL,
|
|
91
93
|
reward: 1n,
|
|
92
94
|
limit: 1n,
|
|
95
|
+
manager: budgets.budget.assertValidAddress(),
|
|
93
96
|
});
|
|
94
97
|
const boost = await freshBoost(fixtures, {
|
|
95
98
|
budget: budgets.budget,
|
|
@@ -23,7 +23,9 @@ import {
|
|
|
23
23
|
type ContractEventName,
|
|
24
24
|
type Hex,
|
|
25
25
|
encodeAbiParameters,
|
|
26
|
+
zeroHash,
|
|
26
27
|
} from 'viem';
|
|
28
|
+
import { ERC20Incentive as ERC20IncentiveBases } from '../../dist/deployments.json';
|
|
27
29
|
import type {
|
|
28
30
|
DeployableOptions,
|
|
29
31
|
GenericDeployableParams,
|
|
@@ -75,6 +77,12 @@ export interface ERC20IncentivePayload {
|
|
|
75
77
|
* @type {bigint}
|
|
76
78
|
*/
|
|
77
79
|
limit: bigint;
|
|
80
|
+
/**
|
|
81
|
+
* The entity that can `clawback` funds
|
|
82
|
+
*
|
|
83
|
+
* @type {Address}
|
|
84
|
+
*/
|
|
85
|
+
manager: Address;
|
|
78
86
|
}
|
|
79
87
|
|
|
80
88
|
/**
|
|
@@ -110,10 +118,11 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
110
118
|
*
|
|
111
119
|
* @public
|
|
112
120
|
* @static
|
|
113
|
-
* @type {Address}
|
|
121
|
+
* @type {Record<number, Address>}
|
|
114
122
|
*/
|
|
115
|
-
public static override
|
|
116
|
-
|
|
123
|
+
public static override bases: Record<number, Address> = {
|
|
124
|
+
...(ERC20IncentiveBases as Record<number, Address>),
|
|
125
|
+
};
|
|
117
126
|
/**
|
|
118
127
|
* @inheritdoc
|
|
119
128
|
*
|
|
@@ -128,8 +137,8 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
128
137
|
*
|
|
129
138
|
* @public
|
|
130
139
|
* @async
|
|
131
|
-
* @param {?ReadParams
|
|
132
|
-
* @returns {
|
|
140
|
+
* @param {?ReadParams} [params]
|
|
141
|
+
* @returns {Promise<Address>}
|
|
133
142
|
*/
|
|
134
143
|
public async owner(params?: ReadParams<typeof erc20IncentiveAbi, 'owner'>) {
|
|
135
144
|
return await readErc20IncentiveOwner(this._config, {
|
|
@@ -145,7 +154,7 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
145
154
|
*
|
|
146
155
|
* @public
|
|
147
156
|
* @async
|
|
148
|
-
* @param {?ReadParams
|
|
157
|
+
* @param {?ReadParams} [params]
|
|
149
158
|
* @returns {Promise<bigint>} - The current reward
|
|
150
159
|
*/
|
|
151
160
|
public async currentReward(
|
|
@@ -164,7 +173,7 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
164
173
|
*
|
|
165
174
|
* @public
|
|
166
175
|
* @async
|
|
167
|
-
* @param {?ReadParams
|
|
176
|
+
* @param {?ReadParams} [params]
|
|
168
177
|
* @returns {Promise<bigint>}
|
|
169
178
|
*/
|
|
170
179
|
public async claims(params?: ReadParams<typeof erc20IncentiveAbi, 'claims'>) {
|
|
@@ -182,7 +191,7 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
182
191
|
* @public
|
|
183
192
|
* @async
|
|
184
193
|
* @param {Address} address
|
|
185
|
-
* @param {?ReadParams
|
|
194
|
+
* @param {?ReadParams} [params]
|
|
186
195
|
* @returns {Promise<boolean>}
|
|
187
196
|
*/
|
|
188
197
|
public async claimed(
|
|
@@ -202,7 +211,7 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
202
211
|
*
|
|
203
212
|
* @public
|
|
204
213
|
* @async
|
|
205
|
-
* @param {?ReadParams
|
|
214
|
+
* @param {?ReadParams} [params]
|
|
206
215
|
* @returns {Promise<Address>}
|
|
207
216
|
*/
|
|
208
217
|
public async asset(params?: ReadParams<typeof erc20IncentiveAbi, 'asset'>) {
|
|
@@ -218,7 +227,7 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
218
227
|
*
|
|
219
228
|
* @public
|
|
220
229
|
* @async
|
|
221
|
-
* @param {?ReadParams
|
|
230
|
+
* @param {?ReadParams} [params]
|
|
222
231
|
* @returns {Promise<StrategyType>}
|
|
223
232
|
*/
|
|
224
233
|
public strategy(
|
|
@@ -236,7 +245,7 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
236
245
|
*
|
|
237
246
|
* @public
|
|
238
247
|
* @async
|
|
239
|
-
* @param {?ReadParams
|
|
248
|
+
* @param {?ReadParams} [params]
|
|
240
249
|
* @returns {Promise<bigint>}
|
|
241
250
|
*/
|
|
242
251
|
public async reward(params?: ReadParams<typeof erc20IncentiveAbi, 'reward'>) {
|
|
@@ -252,8 +261,8 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
252
261
|
*
|
|
253
262
|
* @public
|
|
254
263
|
* @async
|
|
255
|
-
* @param {?ReadParams
|
|
256
|
-
* @returns {
|
|
264
|
+
* @param {?ReadParams} [params]
|
|
265
|
+
* @returns {Promise<bigint>}
|
|
257
266
|
*/
|
|
258
267
|
public async limit(params?: ReadParams<typeof erc20IncentiveAbi, 'limit'>) {
|
|
259
268
|
return await readErc20IncentiveLimit(this._config, {
|
|
@@ -269,7 +278,7 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
269
278
|
* @public
|
|
270
279
|
* @async
|
|
271
280
|
* @param {bigint} i - Index of address
|
|
272
|
-
* @param {?ReadParams
|
|
281
|
+
* @param {?ReadParams} [params]
|
|
273
282
|
* @returns {Promise<Address>}
|
|
274
283
|
*/
|
|
275
284
|
public async entries(
|
|
@@ -290,7 +299,7 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
290
299
|
* @public
|
|
291
300
|
* @async
|
|
292
301
|
* @param {ClaimPayload} payload
|
|
293
|
-
* @param {?WriteParams
|
|
302
|
+
* @param {?WriteParams} [params]
|
|
294
303
|
* @returns {Promise<boolean>} - Returns true if successfully claimed
|
|
295
304
|
*/
|
|
296
305
|
protected async claim(
|
|
@@ -306,8 +315,8 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
306
315
|
* @public
|
|
307
316
|
* @async
|
|
308
317
|
* @param {ClaimPayload} payload
|
|
309
|
-
* @param {?WriteParams
|
|
310
|
-
* @returns {Promise<boolean>} - Returns true if successfully claimed
|
|
318
|
+
* @param {?WriteParams} [params]
|
|
319
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed
|
|
311
320
|
*/
|
|
312
321
|
protected async claimRaw(
|
|
313
322
|
payload: ClaimPayload,
|
|
@@ -333,7 +342,7 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
333
342
|
* @public
|
|
334
343
|
* @async
|
|
335
344
|
* @param {ClaimPayload} payload
|
|
336
|
-
* @param {?WriteParams
|
|
345
|
+
* @param {?WriteParams} [params]
|
|
337
346
|
* @returns {Promise<boolean>} - True if the assets were successfully clawbacked
|
|
338
347
|
*/
|
|
339
348
|
public async clawback(
|
|
@@ -349,8 +358,8 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
349
358
|
* @public
|
|
350
359
|
* @async
|
|
351
360
|
* @param {ClaimPayload} payload
|
|
352
|
-
* @param {?WriteParams
|
|
353
|
-
* @returns {Promise<boolean>} - True if the assets were successfully clawbacked
|
|
361
|
+
* @param {?WriteParams} [params]
|
|
362
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
|
|
354
363
|
*/
|
|
355
364
|
public async clawbackRaw(
|
|
356
365
|
payload: ClaimPayload,
|
|
@@ -376,8 +385,8 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
376
385
|
* @public
|
|
377
386
|
* @async
|
|
378
387
|
* @param {ClaimPayload} payload
|
|
379
|
-
* @param {?ReadParams
|
|
380
|
-
* @returns {
|
|
388
|
+
* @param {?ReadParams} [params]
|
|
389
|
+
* @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
|
|
381
390
|
*/
|
|
382
391
|
public async isClaimable(
|
|
383
392
|
payload: ClaimPayload,
|
|
@@ -396,7 +405,7 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
396
405
|
*
|
|
397
406
|
* @public
|
|
398
407
|
* @async
|
|
399
|
-
* @param {?WriteParams
|
|
408
|
+
* @param {?WriteParams} [params]
|
|
400
409
|
* @returns {Promise<void>}
|
|
401
410
|
*/
|
|
402
411
|
public async drawRaffle(
|
|
@@ -410,8 +419,8 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
410
419
|
*
|
|
411
420
|
* @public
|
|
412
421
|
* @async
|
|
413
|
-
* @param {?WriteParams
|
|
414
|
-
* @returns {Promise<void>}
|
|
422
|
+
* @param {?WriteParams} [params]
|
|
423
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
415
424
|
*/
|
|
416
425
|
public async drawRaffleRaw(
|
|
417
426
|
params?: WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>,
|
|
@@ -452,6 +461,17 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
452
461
|
...this.optionallyAttachAccount(options.account),
|
|
453
462
|
};
|
|
454
463
|
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Builds the claim data for the ERC20Incentive.
|
|
467
|
+
*
|
|
468
|
+
* @public
|
|
469
|
+
* @returns {Hash} A `zeroHash`, as ERC20Incentive doesn't require specific claim data.
|
|
470
|
+
* @description This function returns `zeroHash` because ERC20Incentive doesn't use any specific claim data.
|
|
471
|
+
*/
|
|
472
|
+
public buildClaimData() {
|
|
473
|
+
return zeroHash;
|
|
474
|
+
}
|
|
455
475
|
}
|
|
456
476
|
|
|
457
477
|
/**
|
|
@@ -462,7 +482,7 @@ export class ERC20Incentive extends DeployableTarget<
|
|
|
462
482
|
* @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`
|
|
463
483
|
* @param {bigint} param0.reward - The amount of the asset to distribute.
|
|
464
484
|
* @param {bigint} param0.limit - How many times can this incentive be claimed.
|
|
465
|
-
* @returns {
|
|
485
|
+
* @returns {Hex}
|
|
466
486
|
*/
|
|
467
487
|
export function prepareERC20IncentivePayload({
|
|
468
488
|
asset,
|