@boostxyz/sdk 0.0.0-alpha.8 → 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 +57 -14
- package/dist/Actions/ContractAction.d.ts.map +1 -1
- package/dist/Actions/ERC721MintAction.d.ts +50 -23
- 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 +420 -45
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +15 -225
- 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 +123 -39
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +75 -76
- 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 +234 -13
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleDenyList.js +11 -200
- package/dist/AllowLists/SimpleDenyList.js.map +1 -1
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.cjs.map +1 -1
- package/dist/Auth/PassthroughAuth.js +4 -4
- package/dist/Auth/PassthroughAuth.js.map +1 -1
- package/dist/Boost.cjs +1 -1
- package/dist/Boost.cjs.map +1 -1
- package/dist/Boost.d.ts +105 -14
- package/dist/Boost.d.ts.map +1 -1
- package/dist/Boost.js +137 -5
- 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 +759 -82
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +29 -1148
- 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 +83 -28
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +170 -93
- 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 +112 -192
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +89 -290
- package/dist/Budgets/ManagedBudget.js.map +1 -1
- package/dist/Budgets/VestingBudget.d.ts +277 -91
- 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 +6 -8
- 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 +30 -27
- 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 +73 -21
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +61 -36
- 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 +323 -26
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +73 -39
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC1155Incentive.d.ts +291 -43
- 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 +278 -33
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +79 -47
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +346 -420
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts +271 -32
- 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 -280
- 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 +89 -23
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +66 -36
- 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 +310 -17
- package/dist/Validators/SignerValidator.d.ts.map +1 -1
- package/dist/Validators/SignerValidator.js +164 -36
- 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 +2 -0
- package/dist/claiming.cjs.map +1 -0
- package/dist/claiming.d.ts +43 -0
- package/dist/claiming.d.ts.map +1 -0
- package/dist/claiming.js +17 -0
- package/dist/claiming.js.map +1 -0
- 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 +257 -21
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +183 -26
- package/dist/errors.js.map +1 -1
- package/dist/{generated-Cbv8zFkf.js → generated-CKt2yCQd.js} +3615 -1868
- 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 +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +143 -126
- package/dist/index.js.map +1 -1
- package/dist/transfers.cjs +2 -0
- package/dist/transfers.cjs.map +1 -0
- package/dist/transfers.d.ts +198 -0
- package/dist/transfers.d.ts.map +1 -0
- package/dist/transfers.js +84 -0
- package/dist/transfers.js.map +1 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +25 -1380
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +36 -648
- package/dist/utils.js.map +1 -1
- package/package.json +34 -10
- package/src/Actions/Action.test.ts +19 -17
- package/src/Actions/ContractAction.test.ts +14 -16
- package/src/Actions/ContractAction.ts +84 -22
- package/src/Actions/ERC721MintAction.test.ts +8 -8
- package/src/Actions/ERC721MintAction.ts +83 -30
- package/src/Actions/EventAction.test.ts +759 -113
- package/src/Actions/EventAction.ts +991 -116
- 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 +86 -65
- package/src/AllowLists/SimpleDenyList.test.ts +4 -4
- package/src/AllowLists/SimpleDenyList.ts +87 -126
- package/src/Auth/PassthroughAuth.test.ts +1 -1
- package/src/Auth/PassthroughAuth.ts +1 -1
- package/src/Boost.ts +147 -15
- package/src/BoostCore.test.ts +326 -278
- package/src/BoostCore.ts +425 -242
- package/src/BoostRegistry.test.ts +53 -0
- package/src/BoostRegistry.ts +168 -50
- 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 +106 -315
- package/src/Budgets/VestingBudget.test.ts +7 -7
- package/src/Budgets/VestingBudget.ts +110 -112
- package/src/Deployable/Contract.ts +5 -6
- package/src/Deployable/Deployable.ts +1 -1
- package/src/Deployable/DeployableTarget.ts +32 -21
- package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
- package/src/Incentives/AllowListIncentive.test.ts +7 -10
- package/src/Incentives/AllowListIncentive.ts +88 -30
- package/src/Incentives/CGDAIncentive.test.ts +11 -12
- package/src/Incentives/CGDAIncentive.ts +161 -37
- package/src/Incentives/ERC1155Incentive.test.ts +5 -16
- package/src/Incentives/ERC1155Incentive.ts +132 -51
- package/src/Incentives/ERC20Incentive.test.ts +15 -23
- package/src/Incentives/ERC20Incentive.ts +131 -46
- package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
- package/src/Incentives/ERC20VariableCriteriaIncentive.ts +324 -0
- package/src/Incentives/ERC20VariableIncentive.test.ts +12 -35
- package/src/Incentives/ERC20VariableIncentive.ts +118 -43
- package/src/Incentives/Incentive.test.ts +5 -2
- package/src/Incentives/Incentive.ts +7 -6
- package/src/Incentives/PointsIncentive.test.ts +26 -30
- package/src/Incentives/PointsIncentive.ts +110 -34
- package/src/Validators/SignerValidator.test.ts +9 -13
- package/src/Validators/SignerValidator.ts +437 -26
- package/src/Validators/Validator.test.ts +2 -2
- package/src/Validators/Validator.ts +1 -1
- package/src/claiming.ts +56 -0
- package/src/errors.ts +346 -22
- package/src/index.test.ts +118 -36
- package/src/index.ts +15 -7
- package/src/transfers.ts +284 -0
- package/src/utils.test.ts +2 -2
- package/src/utils.ts +61 -2061
- 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-BzszviNp.cjs +0 -3
- package/dist/generated-BzszviNp.cjs.map +0 -1
- package/dist/generated-Cbv8zFkf.js.map +0 -1
- package/src/Budgets/SimpleBudget.test.ts +0 -152
- package/src/Budgets/SimpleBudget.ts +0 -521
package/src/BoostCore.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
boostCoreAbi,
|
|
3
3
|
type iAuthAbi,
|
|
4
|
-
readBoostCoreClaimFee,
|
|
5
4
|
readBoostCoreCreateBoostAuth,
|
|
6
5
|
readBoostCoreGetBoost,
|
|
7
6
|
readBoostCoreGetBoostCount,
|
|
@@ -10,29 +9,37 @@ import {
|
|
|
10
9
|
readIAuthIsAuthorized,
|
|
11
10
|
simulateBoostCoreClaimIncentive,
|
|
12
11
|
simulateBoostCoreClaimIncentiveFor,
|
|
13
|
-
|
|
12
|
+
simulateBoostCoreCreateBoost,
|
|
14
13
|
simulateBoostCoreSetCreateBoostAuth,
|
|
15
14
|
simulateBoostCoreSetProtocolFeeReceiver,
|
|
16
15
|
writeBoostCoreClaimIncentive,
|
|
17
16
|
writeBoostCoreClaimIncentiveFor,
|
|
18
|
-
writeBoostCoreSetClaimFee,
|
|
19
17
|
writeBoostCoreSetCreateBoostAuth,
|
|
20
18
|
writeBoostCoreSetProtocolFeeReceiver,
|
|
21
19
|
} from '@boostxyz/evm';
|
|
22
20
|
import { bytecode } from '@boostxyz/evm/artifacts/contracts/BoostCore.sol/BoostCore.json';
|
|
23
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
type GetTransactionReceiptParameters,
|
|
23
|
+
getAccount,
|
|
24
|
+
getTransactionReceipt,
|
|
25
|
+
waitForTransactionReceipt,
|
|
26
|
+
} from '@wagmi/core';
|
|
27
|
+
import type { SimulateContractReturnType } from '@wagmi/core/actions';
|
|
24
28
|
import { createWriteContract } from '@wagmi/core/codegen';
|
|
25
29
|
import {
|
|
26
30
|
type Address,
|
|
27
31
|
type ContractEventName,
|
|
28
32
|
type Hex,
|
|
33
|
+
parseEther,
|
|
29
34
|
parseEventLogs,
|
|
30
35
|
zeroAddress,
|
|
31
36
|
zeroHash,
|
|
32
37
|
} from 'viem';
|
|
38
|
+
import { BoostCore as BoostCoreBases } from '../dist/deployments.json';
|
|
33
39
|
import { type Action, actionFromAddress } from './Actions/Action';
|
|
34
|
-
import { EventAction } from './Actions/EventAction';
|
|
40
|
+
import { EventAction, type EventActionPayload } from './Actions/EventAction';
|
|
35
41
|
import { type AllowList, allowListFromAddress } from './AllowLists/AllowList';
|
|
42
|
+
import { OpenAllowList } from './AllowLists/OpenAllowList';
|
|
36
43
|
import {
|
|
37
44
|
SimpleAllowList,
|
|
38
45
|
type SimpleAllowListPayload,
|
|
@@ -42,7 +49,13 @@ import {
|
|
|
42
49
|
type SimpleDenyListPayload,
|
|
43
50
|
} from './AllowLists/SimpleDenyList';
|
|
44
51
|
import { type Auth, PassthroughAuth } from './Auth/Auth';
|
|
45
|
-
import {
|
|
52
|
+
import {
|
|
53
|
+
Boost,
|
|
54
|
+
type BoostPayload,
|
|
55
|
+
type RawBoost,
|
|
56
|
+
type Target,
|
|
57
|
+
prepareBoostPayload,
|
|
58
|
+
} from './Boost';
|
|
46
59
|
import { type Budget, budgetFromAddress } from './Budgets/Budget';
|
|
47
60
|
import {
|
|
48
61
|
ManagedBudget,
|
|
@@ -66,6 +79,11 @@ import {
|
|
|
66
79
|
ERC20Incentive,
|
|
67
80
|
type ERC20IncentivePayload,
|
|
68
81
|
} from './Incentives/ERC20Incentive';
|
|
82
|
+
import {
|
|
83
|
+
ERC20VariableCriteriaIncentive,
|
|
84
|
+
type ERC20VariableCriteriaIncentivePayload,
|
|
85
|
+
} from './Incentives/ERC20VariableCriteriaIncentive';
|
|
86
|
+
import type { ERC20VariableIncentivePayload } from './Incentives/ERC20VariableIncentive';
|
|
69
87
|
import {
|
|
70
88
|
ERC20VariableIncentive,
|
|
71
89
|
type Incentive,
|
|
@@ -82,33 +100,52 @@ import {
|
|
|
82
100
|
import { type Validator, validatorFromAddress } from './Validators/Validator';
|
|
83
101
|
import {
|
|
84
102
|
BoostCoreNoIdentifierEmitted,
|
|
103
|
+
BoostNotFoundError,
|
|
85
104
|
BudgetMustAuthorizeBoostCore,
|
|
86
105
|
DeployableUnknownOwnerProvidedError,
|
|
87
106
|
IncentiveNotCloneableError,
|
|
88
107
|
MustInitializeBudgetError,
|
|
89
|
-
NoContractAddressUponReceiptError,
|
|
90
108
|
} from './errors';
|
|
91
109
|
import {
|
|
92
|
-
type ERC20VariableIncentivePayload,
|
|
93
|
-
type EventActionPayload,
|
|
94
110
|
type GenericLog,
|
|
95
|
-
type BoostPayload as OnChainBoostPayload,
|
|
96
111
|
type ReadParams,
|
|
97
|
-
type Target,
|
|
98
112
|
type WriteParams,
|
|
99
|
-
|
|
113
|
+
assertValidAddressByChainId,
|
|
100
114
|
} from './utils';
|
|
101
115
|
|
|
116
|
+
/**
|
|
117
|
+
* The ABI of the BoostCore contract, if needed for low level operations
|
|
118
|
+
*
|
|
119
|
+
* @type {typeof boostCoreAbi}
|
|
120
|
+
*/
|
|
102
121
|
export { boostCoreAbi };
|
|
103
122
|
|
|
104
123
|
/**
|
|
105
|
-
* The
|
|
106
|
-
*
|
|
124
|
+
* The fee (in wei) required to claim each incentive, must be provided for the `claimIncentive` transaction
|
|
125
|
+
*
|
|
126
|
+
* @type {bigint}
|
|
127
|
+
*/
|
|
128
|
+
export const BOOST_CORE_CLAIM_FEE = parseEther('0.000075');
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The address of the deployed BoostCore instance. In prerelease mode, this will be its sepolia address
|
|
107
132
|
*
|
|
108
133
|
* @type {Address}
|
|
109
134
|
*/
|
|
110
|
-
export const BOOST_CORE_ADDRESS
|
|
111
|
-
|
|
135
|
+
export const BOOST_CORE_ADDRESS =
|
|
136
|
+
(BoostCoreBases as Record<string, Address>)[__DEFAULT_CHAIN_ID__] ||
|
|
137
|
+
zeroAddress;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The fixed addresses for the deployed Boost Core.
|
|
141
|
+
* By default, `new BoostCore` will use the address deployed to the currently connected chain, or `BOOST_CORE_ADDRESS` if not provided.
|
|
142
|
+
*
|
|
143
|
+
* @type {Record<number, Address>}
|
|
144
|
+
*/
|
|
145
|
+
export const BOOST_CORE_ADDRESSES: Record<number, Address> = {
|
|
146
|
+
...(BoostCoreBases as Record<number, Address>),
|
|
147
|
+
31337: import.meta.env.VITE_BOOST_CORE_ADDRESS,
|
|
148
|
+
};
|
|
112
149
|
|
|
113
150
|
/**
|
|
114
151
|
* A generic `viem.Log` event with support for `BoostCore` event types.
|
|
@@ -206,11 +243,10 @@ export type BoostCoreConfig =
|
|
|
206
243
|
export type CreateBoostPayload = {
|
|
207
244
|
budget: Budget;
|
|
208
245
|
action: Action;
|
|
209
|
-
validator
|
|
246
|
+
validator?: Validator;
|
|
210
247
|
allowList: AllowList;
|
|
211
248
|
incentives: Array<Incentive>;
|
|
212
249
|
protocolFee?: bigint;
|
|
213
|
-
referralFee?: bigint;
|
|
214
250
|
maxParticipants?: bigint;
|
|
215
251
|
owner?: Address;
|
|
216
252
|
};
|
|
@@ -227,6 +263,26 @@ export class BoostCore extends Deployable<
|
|
|
227
263
|
[Address, Address],
|
|
228
264
|
typeof boostCoreAbi
|
|
229
265
|
> {
|
|
266
|
+
/**
|
|
267
|
+
* A static property representing a map of stringified chain ID's to the address of the deployed implementation on chain
|
|
268
|
+
*
|
|
269
|
+
* @static
|
|
270
|
+
* @readonly
|
|
271
|
+
* @type {Record<string, Address>}
|
|
272
|
+
*/
|
|
273
|
+
static readonly addresses: Record<number, Address> = BOOST_CORE_ADDRESSES;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* A getter that will return Boost core's static addresses by numerical chain ID
|
|
277
|
+
*
|
|
278
|
+
* @public
|
|
279
|
+
* @readonly
|
|
280
|
+
* @type {Record<number, Address>}
|
|
281
|
+
*/
|
|
282
|
+
public get addresses(): Record<number, Address> {
|
|
283
|
+
return (this.constructor as typeof BoostCore).addresses;
|
|
284
|
+
}
|
|
285
|
+
|
|
230
286
|
/**
|
|
231
287
|
* Creates an instance of BoostCore.
|
|
232
288
|
*
|
|
@@ -245,63 +301,155 @@ export class BoostCore extends Deployable<
|
|
|
245
301
|
options.protocolFeeReceiver,
|
|
246
302
|
]);
|
|
247
303
|
} else {
|
|
248
|
-
|
|
304
|
+
const { address } = assertValidAddressByChainId(
|
|
305
|
+
config,
|
|
306
|
+
BOOST_CORE_ADDRESSES,
|
|
307
|
+
);
|
|
308
|
+
super({ account, config }, address);
|
|
249
309
|
}
|
|
250
310
|
//@ts-expect-error I can't set this property on the class because for some reason it takes super out of constructor scope?
|
|
251
311
|
this.abi = boostCoreAbi;
|
|
252
312
|
}
|
|
313
|
+
|
|
253
314
|
/**
|
|
254
315
|
* Create a new Boost.
|
|
255
316
|
*
|
|
256
317
|
* @public
|
|
257
318
|
* @async
|
|
258
319
|
* @param {CreateBoostPayload} _boostPayload
|
|
259
|
-
* @param {?DeployableOptions} [
|
|
260
|
-
* @returns {Boost}
|
|
320
|
+
* @param {?DeployableOptions} [_params]
|
|
321
|
+
* @returns {Promise<Boost>}
|
|
261
322
|
*/
|
|
262
323
|
public async createBoost(
|
|
263
324
|
_boostPayload: CreateBoostPayload,
|
|
264
|
-
|
|
325
|
+
_params?: DeployableOptions &
|
|
326
|
+
WriteParams<typeof boostCoreAbi, 'createBoost'>,
|
|
265
327
|
) {
|
|
266
|
-
const coreAddress = this.assertValidAddress();
|
|
267
328
|
const [payload, options] =
|
|
268
|
-
this.validateDeploymentConfig<CreateBoostPayload>(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
action,
|
|
276
|
-
validator,
|
|
277
|
-
allowList,
|
|
278
|
-
incentives,
|
|
279
|
-
protocolFee = 0n,
|
|
280
|
-
referralFee = 0n,
|
|
281
|
-
maxParticipants = 0n,
|
|
282
|
-
owner,
|
|
283
|
-
} = payload;
|
|
329
|
+
this.validateDeploymentConfig<CreateBoostPayload>(_boostPayload, _params);
|
|
330
|
+
const desiredChainId = _params?.chain?.id || _params?.chainId;
|
|
331
|
+
const { chainId, address: coreAddress } = assertValidAddressByChainId(
|
|
332
|
+
options.config,
|
|
333
|
+
this.addresses,
|
|
334
|
+
desiredChainId,
|
|
335
|
+
);
|
|
284
336
|
|
|
285
337
|
const boostFactory = createWriteContract({
|
|
286
338
|
abi: boostCoreAbi,
|
|
287
339
|
functionName: 'createBoost',
|
|
288
|
-
address:
|
|
340
|
+
address: coreAddress,
|
|
289
341
|
});
|
|
290
342
|
|
|
291
|
-
|
|
292
|
-
|
|
343
|
+
const onChainPayload = await this.prepareCreateBoostPayload(
|
|
344
|
+
coreAddress,
|
|
345
|
+
chainId,
|
|
346
|
+
payload,
|
|
347
|
+
options,
|
|
348
|
+
);
|
|
349
|
+
|
|
350
|
+
const boostHash = await boostFactory(options.config, {
|
|
351
|
+
...this.optionallyAttachAccount(options.account),
|
|
352
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
353
|
+
...(_params as any),
|
|
354
|
+
chainId,
|
|
355
|
+
args: [prepareBoostPayload(onChainPayload)],
|
|
356
|
+
});
|
|
357
|
+
const receipt = await waitForTransactionReceipt(options.config, {
|
|
358
|
+
hash: boostHash,
|
|
359
|
+
});
|
|
360
|
+
const boostCreatedLog = parseEventLogs({
|
|
361
|
+
abi: boostCoreAbi,
|
|
362
|
+
eventName: 'BoostCreated',
|
|
363
|
+
logs: receipt.logs,
|
|
364
|
+
}).at(0);
|
|
365
|
+
let boostId = 0n;
|
|
366
|
+
if (!boostCreatedLog) throw new BoostCoreNoIdentifierEmitted();
|
|
367
|
+
boostId = boostCreatedLog?.args.boostId;
|
|
368
|
+
const boost = await this.readBoost(boostId);
|
|
369
|
+
return new Boost({
|
|
370
|
+
id: boostId,
|
|
371
|
+
budget: payload.budget.at(boost.budget),
|
|
372
|
+
action: payload.action.at(boost.action),
|
|
373
|
+
validator: payload.validator!.at(boost.validator),
|
|
374
|
+
allowList: payload.allowList.at(boost.allowList),
|
|
375
|
+
incentives: payload.incentives.map((incentive, i) =>
|
|
376
|
+
// biome-ignore lint/style/noNonNullAssertion: this will never be undefined
|
|
377
|
+
incentive.at(boost.incentives.at(i)!),
|
|
378
|
+
),
|
|
379
|
+
protocolFee: boost.protocolFee,
|
|
380
|
+
maxParticipants: boost.maxParticipants,
|
|
381
|
+
owner: boost.owner,
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Returns a simulated Boost creation.
|
|
387
|
+
*
|
|
388
|
+
* @public
|
|
389
|
+
* @async
|
|
390
|
+
* @param {CreateBoostPayload} _boostPayload
|
|
391
|
+
* @param {?DeployableOptions} [_params]
|
|
392
|
+
* @returns {Promise<SimulateContractReturnType>}
|
|
393
|
+
*/
|
|
394
|
+
public async simulateCreateBoost(
|
|
395
|
+
_boostPayload: CreateBoostPayload,
|
|
396
|
+
_params?: DeployableOptions &
|
|
397
|
+
WriteParams<typeof boostCoreAbi, 'createBoost'>,
|
|
398
|
+
) {
|
|
399
|
+
const [payload, options] =
|
|
400
|
+
this.validateDeploymentConfig<CreateBoostPayload>(_boostPayload, _params);
|
|
401
|
+
const desiredChainId = _params?.chain?.id || _params?.chainId;
|
|
402
|
+
const { chainId, address: coreAddress } = assertValidAddressByChainId(
|
|
403
|
+
options.config,
|
|
404
|
+
this.addresses,
|
|
405
|
+
desiredChainId,
|
|
406
|
+
);
|
|
407
|
+
|
|
408
|
+
const onChainPayload = await this.prepareCreateBoostPayload(
|
|
409
|
+
coreAddress,
|
|
410
|
+
chainId,
|
|
411
|
+
payload,
|
|
412
|
+
options,
|
|
413
|
+
);
|
|
414
|
+
|
|
415
|
+
return await simulateBoostCoreCreateBoost(this._config, {
|
|
416
|
+
...this.optionallyAttachAccount(),
|
|
417
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
418
|
+
...(_params as any),
|
|
419
|
+
address: coreAddress,
|
|
420
|
+
chainId,
|
|
421
|
+
args: [prepareBoostPayload(onChainPayload)],
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// This function mutates payload, which isn't awesome but it's fine
|
|
426
|
+
private async prepareCreateBoostPayload(
|
|
427
|
+
coreAddress: Address,
|
|
428
|
+
chainId: number,
|
|
429
|
+
payload: CreateBoostPayload,
|
|
430
|
+
options: DeployableOptions,
|
|
431
|
+
): Promise<BoostPayload> {
|
|
432
|
+
if (!payload.owner) {
|
|
433
|
+
payload.owner =
|
|
293
434
|
this._account?.address ||
|
|
294
435
|
getAccount(options.config).address ||
|
|
295
436
|
zeroAddress;
|
|
296
|
-
if (owner === zeroAddress) {
|
|
437
|
+
if (payload.owner === zeroAddress) {
|
|
297
438
|
throw new DeployableUnknownOwnerProvidedError();
|
|
298
439
|
}
|
|
299
440
|
}
|
|
300
441
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
442
|
+
if (!payload.validator) {
|
|
443
|
+
payload.validator = this.SignerValidator({
|
|
444
|
+
signers: [payload.owner],
|
|
445
|
+
validatorCaller: coreAddress,
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
let budgetPayload: BoostPayload['budget'] = zeroAddress;
|
|
450
|
+
if (payload.budget.address) {
|
|
451
|
+
budgetPayload = payload.budget.address;
|
|
452
|
+
if (!(await payload.budget.isAuthorized(coreAddress))) {
|
|
305
453
|
throw new BudgetMustAuthorizeBoostCore(coreAddress);
|
|
306
454
|
}
|
|
307
455
|
} else {
|
|
@@ -310,92 +458,93 @@ export class BoostCore extends Deployable<
|
|
|
310
458
|
|
|
311
459
|
// if we're supplying an address, it could be a pre-initialized target
|
|
312
460
|
// if base is explicitly set to false, then it will not be initialized, and it will be referenced as is if it implements interface correctly
|
|
313
|
-
let actionPayload:
|
|
461
|
+
let actionPayload: BoostPayload['action'] = {
|
|
314
462
|
instance: zeroAddress,
|
|
315
463
|
isBase: true,
|
|
316
464
|
parameters: zeroHash,
|
|
317
465
|
};
|
|
318
|
-
if (action.address) {
|
|
319
|
-
const isBase =
|
|
466
|
+
if (payload.action.address) {
|
|
467
|
+
const isBase = payload.action.isBase;
|
|
320
468
|
actionPayload = {
|
|
321
469
|
isBase: isBase,
|
|
322
|
-
instance: action.address,
|
|
470
|
+
instance: payload.action.address,
|
|
323
471
|
parameters: isBase
|
|
324
|
-
? action.buildParameters(undefined, options).args.at(0) ||
|
|
472
|
+
? payload.action.buildParameters(undefined, options).args.at(0) ||
|
|
473
|
+
zeroHash
|
|
325
474
|
: zeroHash,
|
|
326
475
|
};
|
|
327
476
|
} else {
|
|
328
477
|
actionPayload.parameters =
|
|
329
|
-
action.buildParameters(undefined, options).args.at(0) ||
|
|
330
|
-
|
|
478
|
+
payload.action.buildParameters(undefined, options).args.at(0) ||
|
|
479
|
+
zeroHash;
|
|
480
|
+
actionPayload.instance = assertValidAddressByChainId(
|
|
481
|
+
options.config,
|
|
482
|
+
payload.action.bases,
|
|
483
|
+
chainId,
|
|
484
|
+
).address;
|
|
331
485
|
}
|
|
332
486
|
|
|
333
|
-
let validatorPayload:
|
|
487
|
+
let validatorPayload: BoostPayload['validator'] = {
|
|
334
488
|
instance: zeroAddress,
|
|
335
489
|
isBase: true,
|
|
336
490
|
parameters: zeroHash,
|
|
337
491
|
};
|
|
338
|
-
if (validator.address) {
|
|
339
|
-
const isBase =
|
|
492
|
+
if (payload.validator.address) {
|
|
493
|
+
const isBase = payload.validator.isBase;
|
|
340
494
|
validatorPayload = {
|
|
341
495
|
isBase: isBase,
|
|
342
|
-
instance: validator.address,
|
|
496
|
+
instance: payload.validator.address,
|
|
343
497
|
parameters: isBase
|
|
344
|
-
? validator
|
|
345
|
-
|
|
346
|
-
{
|
|
347
|
-
signers: [owner],
|
|
348
|
-
validatorCaller: coreAddress,
|
|
349
|
-
},
|
|
350
|
-
options,
|
|
351
|
-
)
|
|
352
|
-
.args.at(0) || zeroHash
|
|
498
|
+
? payload.validator.buildParameters(undefined, options).args.at(0) ||
|
|
499
|
+
zeroHash
|
|
353
500
|
: zeroHash,
|
|
354
501
|
};
|
|
355
502
|
} else {
|
|
356
503
|
validatorPayload.parameters =
|
|
357
|
-
validator
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
)
|
|
365
|
-
.args.at(0) || zeroHash;
|
|
366
|
-
validatorPayload.instance = validator.base;
|
|
504
|
+
payload.validator.buildParameters(undefined, options).args.at(0) ||
|
|
505
|
+
zeroHash;
|
|
506
|
+
validatorPayload.instance = assertValidAddressByChainId(
|
|
507
|
+
options.config,
|
|
508
|
+
payload.validator.bases,
|
|
509
|
+
chainId,
|
|
510
|
+
).address;
|
|
367
511
|
}
|
|
368
512
|
|
|
369
|
-
let allowListPayload:
|
|
513
|
+
let allowListPayload: BoostPayload['allowList'] = {
|
|
370
514
|
instance: zeroAddress,
|
|
371
515
|
isBase: true,
|
|
372
516
|
parameters: zeroHash,
|
|
373
517
|
};
|
|
374
|
-
if (allowList.address) {
|
|
375
|
-
const isBase =
|
|
518
|
+
if (payload.allowList.address) {
|
|
519
|
+
const isBase = payload.allowList.isBase;
|
|
376
520
|
allowListPayload = {
|
|
377
521
|
isBase: isBase,
|
|
378
|
-
instance: allowList.address,
|
|
522
|
+
instance: payload.allowList.address,
|
|
379
523
|
parameters: isBase
|
|
380
524
|
? zeroHash // allowList.buildParameters(undefined, options).args.at(0) || zeroHash
|
|
381
525
|
: zeroHash,
|
|
382
526
|
};
|
|
383
527
|
} else {
|
|
384
528
|
allowListPayload.parameters =
|
|
385
|
-
allowList.buildParameters(undefined, options).args.at(0) ||
|
|
386
|
-
|
|
529
|
+
payload.allowList.buildParameters(undefined, options).args.at(0) ||
|
|
530
|
+
zeroHash;
|
|
531
|
+
allowListPayload.instance = assertValidAddressByChainId(
|
|
532
|
+
options.config,
|
|
533
|
+
payload.allowList.bases,
|
|
534
|
+
chainId,
|
|
535
|
+
).address;
|
|
387
536
|
}
|
|
388
537
|
|
|
389
|
-
|
|
538
|
+
const incentivesPayloads: Array<Target> = payload.incentives.map(() => ({
|
|
390
539
|
instance: zeroAddress,
|
|
391
540
|
isBase: true,
|
|
392
541
|
parameters: zeroHash,
|
|
393
542
|
}));
|
|
394
|
-
for (let i = 0; i < incentives.length; i++) {
|
|
543
|
+
for (let i = 0; i < payload.incentives.length; i++) {
|
|
395
544
|
// biome-ignore lint/style/noNonNullAssertion: this will never be undefined
|
|
396
|
-
const incentive = incentives.at(i)!;
|
|
545
|
+
const incentive = payload.incentives.at(i)!;
|
|
397
546
|
if (incentive.address) {
|
|
398
|
-
const isBase = incentive.
|
|
547
|
+
const isBase = incentive.isBase;
|
|
399
548
|
if (!isBase) throw new IncentiveNotCloneableError(incentive);
|
|
400
549
|
incentivesPayloads[i] = {
|
|
401
550
|
isBase: isBase,
|
|
@@ -406,9 +555,15 @@ export class BoostCore extends Deployable<
|
|
|
406
555
|
: zeroHash,
|
|
407
556
|
};
|
|
408
557
|
} else {
|
|
558
|
+
// biome-ignore lint/style/noNonNullAssertion: this will never be undefined
|
|
409
559
|
incentivesPayloads[i]!.parameters =
|
|
410
560
|
incentive.buildParameters(undefined, options).args.at(0) || zeroHash;
|
|
411
|
-
|
|
561
|
+
// biome-ignore lint/style/noNonNullAssertion: this will never be undefined
|
|
562
|
+
incentivesPayloads[i]!.instance = assertValidAddressByChainId(
|
|
563
|
+
options.config,
|
|
564
|
+
incentive.bases,
|
|
565
|
+
chainId,
|
|
566
|
+
).address;
|
|
412
567
|
}
|
|
413
568
|
}
|
|
414
569
|
|
|
@@ -418,42 +573,12 @@ export class BoostCore extends Deployable<
|
|
|
418
573
|
validator: validatorPayload,
|
|
419
574
|
allowList: allowListPayload,
|
|
420
575
|
incentives: incentivesPayloads,
|
|
421
|
-
protocolFee,
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
owner,
|
|
576
|
+
protocolFee: payload.protocolFee || 0n,
|
|
577
|
+
maxParticipants: payload.maxParticipants || 0n,
|
|
578
|
+
owner: payload.owner,
|
|
425
579
|
};
|
|
426
580
|
|
|
427
|
-
|
|
428
|
-
args: [prepareBoostPayload(onChainPayload)],
|
|
429
|
-
...this.optionallyAttachAccount(options.account),
|
|
430
|
-
});
|
|
431
|
-
const receipt = await waitForTransactionReceipt(options.config, {
|
|
432
|
-
hash: boostHash,
|
|
433
|
-
});
|
|
434
|
-
const boostCreatedLog = parseEventLogs({
|
|
435
|
-
abi: boostCoreAbi,
|
|
436
|
-
eventName: 'BoostCreated',
|
|
437
|
-
logs: receipt.logs,
|
|
438
|
-
}).at(0);
|
|
439
|
-
let boostId = 0n;
|
|
440
|
-
if (!boostCreatedLog) throw new BoostCoreNoIdentifierEmitted();
|
|
441
|
-
boostId = boostCreatedLog?.args.boostIndex;
|
|
442
|
-
const boost = await this.readBoost(boostId);
|
|
443
|
-
return new Boost({
|
|
444
|
-
id: boostId,
|
|
445
|
-
budget: budget.at(boost.budget),
|
|
446
|
-
action: action.at(boost.action),
|
|
447
|
-
validator: validator.at(boost.validator),
|
|
448
|
-
allowList: allowList.at(boost.allowList),
|
|
449
|
-
incentives: incentives.map((incentive, i) =>
|
|
450
|
-
incentive.at(boost.incentives.at(i)!),
|
|
451
|
-
),
|
|
452
|
-
protocolFee: boost.protocolFee,
|
|
453
|
-
referralFee: boost.referralFee,
|
|
454
|
-
maxParticipants: boost.maxParticipants,
|
|
455
|
-
owner: boost.owner,
|
|
456
|
-
});
|
|
581
|
+
return onChainPayload;
|
|
457
582
|
}
|
|
458
583
|
|
|
459
584
|
/**
|
|
@@ -465,8 +590,8 @@ export class BoostCore extends Deployable<
|
|
|
465
590
|
* @param {bigint} incentiveId
|
|
466
591
|
* @param {Address} address
|
|
467
592
|
* @param {Hex} data
|
|
468
|
-
* @param {?WriteParams
|
|
469
|
-
* @returns {
|
|
593
|
+
* @param {?WriteParams} [params]
|
|
594
|
+
* @returns {Promise<void>}
|
|
470
595
|
*/
|
|
471
596
|
public async claimIncentive(
|
|
472
597
|
boostId: bigint,
|
|
@@ -475,7 +600,7 @@ export class BoostCore extends Deployable<
|
|
|
475
600
|
data: Hex,
|
|
476
601
|
params?: WriteParams<typeof boostCoreAbi, 'claimIncentive'>,
|
|
477
602
|
) {
|
|
478
|
-
return this.awaitResult(
|
|
603
|
+
return await this.awaitResult(
|
|
479
604
|
this.claimIncentiveRaw(boostId, incentiveId, address, data, params),
|
|
480
605
|
);
|
|
481
606
|
}
|
|
@@ -487,23 +612,27 @@ export class BoostCore extends Deployable<
|
|
|
487
612
|
* @async
|
|
488
613
|
* @param {bigint} boostId - The ID of the Boost
|
|
489
614
|
* @param {bigint} incentiveId - The ID of the Incentive
|
|
490
|
-
* @param {Address}
|
|
615
|
+
* @param {Address} referrer - The address of the referrer (if any)
|
|
491
616
|
* @param {Hex} data- The data for the claim
|
|
492
|
-
* @param {?WriteParams
|
|
493
|
-
* @returns {
|
|
617
|
+
* @param {?WriteParams} [params]
|
|
618
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
494
619
|
*/
|
|
495
620
|
public async claimIncentiveRaw(
|
|
496
621
|
boostId: bigint,
|
|
497
622
|
incentiveId: bigint,
|
|
498
|
-
|
|
623
|
+
referrer: Address,
|
|
499
624
|
data: Hex,
|
|
500
625
|
params?: WriteParams<typeof boostCoreAbi, 'claimIncentive'>,
|
|
501
626
|
) {
|
|
502
627
|
const { request, result } = await simulateBoostCoreClaimIncentive(
|
|
503
628
|
this._config,
|
|
504
629
|
{
|
|
505
|
-
|
|
506
|
-
|
|
630
|
+
...assertValidAddressByChainId(
|
|
631
|
+
this._config,
|
|
632
|
+
this.addresses,
|
|
633
|
+
params?.chain?.id || params?.chainId,
|
|
634
|
+
),
|
|
635
|
+
args: [boostId, incentiveId, referrer, data],
|
|
507
636
|
...this.optionallyAttachAccount(),
|
|
508
637
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
509
638
|
...(params as any),
|
|
@@ -523,8 +652,8 @@ export class BoostCore extends Deployable<
|
|
|
523
652
|
* @param {Address} referrer
|
|
524
653
|
* @param {Hex} data
|
|
525
654
|
* @param {Address} claimant
|
|
526
|
-
* @param {?WriteParams
|
|
527
|
-
* @returns {
|
|
655
|
+
* @param {?WriteParams} [params]
|
|
656
|
+
* @returns {Promise<void>}
|
|
528
657
|
*/
|
|
529
658
|
public async claimIncentiveFor(
|
|
530
659
|
boostId: bigint,
|
|
@@ -534,7 +663,7 @@ export class BoostCore extends Deployable<
|
|
|
534
663
|
claimant: Address,
|
|
535
664
|
params?: WriteParams<typeof boostCoreAbi, 'claimIncentiveFor'>,
|
|
536
665
|
) {
|
|
537
|
-
return this.awaitResult(
|
|
666
|
+
return await this.awaitResult(
|
|
538
667
|
this.claimIncentiveForRaw(
|
|
539
668
|
boostId,
|
|
540
669
|
incentiveId,
|
|
@@ -556,8 +685,8 @@ export class BoostCore extends Deployable<
|
|
|
556
685
|
* @param {Address} referrer - The address of the referrer (if any)
|
|
557
686
|
* @param {Hex} data - The data for the claim
|
|
558
687
|
* @param {Address} claimant - The address of the user eligible for the incentive payout
|
|
559
|
-
* @param {?WriteParams
|
|
560
|
-
* @returns {
|
|
688
|
+
* @param {?WriteParams} [params]
|
|
689
|
+
* @returns {Promise<{ hash: Hex; result: void; }>}
|
|
561
690
|
*/
|
|
562
691
|
public async claimIncentiveForRaw(
|
|
563
692
|
boostId: bigint,
|
|
@@ -570,7 +699,11 @@ export class BoostCore extends Deployable<
|
|
|
570
699
|
const { request, result } = await simulateBoostCoreClaimIncentiveFor(
|
|
571
700
|
this._config,
|
|
572
701
|
{
|
|
573
|
-
|
|
702
|
+
...assertValidAddressByChainId(
|
|
703
|
+
this._config,
|
|
704
|
+
this.addresses,
|
|
705
|
+
params?.chain?.id || params?.chainId,
|
|
706
|
+
),
|
|
574
707
|
args: [boostId, incentiveId, referrer, data, claimant],
|
|
575
708
|
...this.optionallyAttachAccount(),
|
|
576
709
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -586,21 +719,37 @@ export class BoostCore extends Deployable<
|
|
|
586
719
|
*
|
|
587
720
|
* @public
|
|
588
721
|
* @async
|
|
589
|
-
* @param {bigint} id
|
|
590
|
-
* @param {?ReadParams
|
|
591
|
-
* @returns {
|
|
722
|
+
* @param {bigint | string} id
|
|
723
|
+
* @param {?ReadParams} [params]
|
|
724
|
+
* @returns {Promise<RawBoost>}
|
|
725
|
+
* @throws {@link BoostNotFoundError}
|
|
592
726
|
*/
|
|
593
727
|
public async readBoost(
|
|
594
|
-
|
|
728
|
+
_id: string | bigint,
|
|
595
729
|
params?: ReadParams<typeof boostCoreAbi, 'getBoost'>,
|
|
596
|
-
) {
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
730
|
+
): Promise<RawBoost> {
|
|
731
|
+
try {
|
|
732
|
+
let id: bigint;
|
|
733
|
+
if (typeof _id === 'string') {
|
|
734
|
+
id = BigInt(_id);
|
|
735
|
+
} else id = _id;
|
|
736
|
+
return await readBoostCoreGetBoost(this._config, {
|
|
737
|
+
...assertValidAddressByChainId(
|
|
738
|
+
this._config,
|
|
739
|
+
this.addresses,
|
|
740
|
+
params?.chainId,
|
|
741
|
+
),
|
|
742
|
+
args: [id],
|
|
743
|
+
...this.optionallyAttachAccount(),
|
|
744
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
745
|
+
...(params as any),
|
|
746
|
+
});
|
|
747
|
+
// biome-ignore lint/suspicious/noExplicitAny: unknown error
|
|
748
|
+
} catch (e: any) {
|
|
749
|
+
if (e?.message?.includes('bounds'))
|
|
750
|
+
throw new BoostNotFoundError(String(_id));
|
|
751
|
+
throw e;
|
|
752
|
+
}
|
|
604
753
|
}
|
|
605
754
|
|
|
606
755
|
/**
|
|
@@ -609,8 +758,9 @@ export class BoostCore extends Deployable<
|
|
|
609
758
|
* @public
|
|
610
759
|
* @async
|
|
611
760
|
* @param {(string | bigint)} _id
|
|
612
|
-
* @param {?ReadParams
|
|
613
|
-
* @returns {
|
|
761
|
+
* @param {?ReadParams} [params]
|
|
762
|
+
* @returns {Promise<Boost>}
|
|
763
|
+
* @throws {@link BoostNotFoundError}
|
|
614
764
|
*/
|
|
615
765
|
public async getBoost(
|
|
616
766
|
_id: string | bigint,
|
|
@@ -620,13 +770,8 @@ export class BoostCore extends Deployable<
|
|
|
620
770
|
if (typeof _id === 'string') {
|
|
621
771
|
id = BigInt(_id);
|
|
622
772
|
} else id = _id;
|
|
623
|
-
const {
|
|
624
|
-
|
|
625
|
-
referralFee,
|
|
626
|
-
maxParticipants,
|
|
627
|
-
owner,
|
|
628
|
-
...boostPayload
|
|
629
|
-
} = await this.readBoost(id, params);
|
|
773
|
+
const { protocolFee, maxParticipants, owner, ...boostPayload } =
|
|
774
|
+
await this.readBoost(id, params);
|
|
630
775
|
const options: DeployableOptions = {
|
|
631
776
|
config: this._config,
|
|
632
777
|
account: this._account,
|
|
@@ -651,7 +796,6 @@ export class BoostCore extends Deployable<
|
|
|
651
796
|
allowList,
|
|
652
797
|
incentives,
|
|
653
798
|
protocolFee,
|
|
654
|
-
referralFee,
|
|
655
799
|
maxParticipants,
|
|
656
800
|
owner,
|
|
657
801
|
});
|
|
@@ -662,14 +806,18 @@ export class BoostCore extends Deployable<
|
|
|
662
806
|
*
|
|
663
807
|
* @public
|
|
664
808
|
* @async
|
|
665
|
-
* @param {?ReadParams
|
|
809
|
+
* @param {?ReadParams} [params]
|
|
666
810
|
* @returns {Promise<bigint>}
|
|
667
811
|
*/
|
|
668
812
|
public async getBoostCount(
|
|
669
813
|
params?: ReadParams<typeof boostCoreAbi, 'getBoostCount'>,
|
|
670
814
|
) {
|
|
671
|
-
return readBoostCoreGetBoostCount(this._config, {
|
|
672
|
-
|
|
815
|
+
return await readBoostCoreGetBoostCount(this._config, {
|
|
816
|
+
...assertValidAddressByChainId(
|
|
817
|
+
this._config,
|
|
818
|
+
this.addresses,
|
|
819
|
+
params?.chainId,
|
|
820
|
+
),
|
|
673
821
|
args: [],
|
|
674
822
|
...this.optionallyAttachAccount(),
|
|
675
823
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -683,7 +831,7 @@ export class BoostCore extends Deployable<
|
|
|
683
831
|
* @public
|
|
684
832
|
* @async
|
|
685
833
|
* @param {Address} address
|
|
686
|
-
* @param {?ReadParams
|
|
834
|
+
* @param {?ReadParams &
|
|
687
835
|
* ReadParams<typeof iAuthAbi, 'isAuthorized'>} [params]
|
|
688
836
|
* @returns {Promise<boolean>}
|
|
689
837
|
*/
|
|
@@ -692,7 +840,7 @@ export class BoostCore extends Deployable<
|
|
|
692
840
|
params?: ReadParams<typeof boostCoreAbi, 'createBoostAuth'> &
|
|
693
841
|
ReadParams<typeof iAuthAbi, 'isAuthorized'>,
|
|
694
842
|
) {
|
|
695
|
-
const auth = await this.createBoostAuth();
|
|
843
|
+
const auth = await this.createBoostAuth(params);
|
|
696
844
|
return readIAuthIsAuthorized(this._config, {
|
|
697
845
|
address: auth,
|
|
698
846
|
args: [address],
|
|
@@ -707,14 +855,18 @@ export class BoostCore extends Deployable<
|
|
|
707
855
|
*
|
|
708
856
|
* @public
|
|
709
857
|
* @async
|
|
710
|
-
* @param {?ReadParams
|
|
711
|
-
* @returns {
|
|
858
|
+
* @param {?ReadParams} [params]
|
|
859
|
+
* @returns {Promise<Address>}
|
|
712
860
|
*/
|
|
713
861
|
public async createBoostAuth(
|
|
714
862
|
params?: ReadParams<typeof boostCoreAbi, 'createBoostAuth'>,
|
|
715
863
|
) {
|
|
716
|
-
return readBoostCoreCreateBoostAuth(this._config, {
|
|
717
|
-
|
|
864
|
+
return await readBoostCoreCreateBoostAuth(this._config, {
|
|
865
|
+
...assertValidAddressByChainId(
|
|
866
|
+
this._config,
|
|
867
|
+
this.addresses,
|
|
868
|
+
params?.chainId,
|
|
869
|
+
),
|
|
718
870
|
args: [],
|
|
719
871
|
...this.optionallyAttachAccount(),
|
|
720
872
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -728,14 +880,14 @@ export class BoostCore extends Deployable<
|
|
|
728
880
|
* @public
|
|
729
881
|
* @async
|
|
730
882
|
* @param {Auth} auth
|
|
731
|
-
* @param {?WriteParams
|
|
732
|
-
* @returns {
|
|
883
|
+
* @param {?WriteParams} [params]
|
|
884
|
+
* @returns {Promise<void>}
|
|
733
885
|
*/
|
|
734
886
|
public async setCreateBoostAuth(
|
|
735
887
|
auth: Auth,
|
|
736
888
|
params?: WriteParams<typeof boostCoreAbi, 'setCreateBoostAuth'>,
|
|
737
889
|
) {
|
|
738
|
-
return this.awaitResult(
|
|
890
|
+
return await this.awaitResult(
|
|
739
891
|
this.setCreateBoostAuthRaw(auth.assertValidAddress(), {
|
|
740
892
|
...params,
|
|
741
893
|
}),
|
|
@@ -748,8 +900,8 @@ export class BoostCore extends Deployable<
|
|
|
748
900
|
* @public
|
|
749
901
|
* @async
|
|
750
902
|
* @param {Address} address
|
|
751
|
-
* @param {?WriteParams
|
|
752
|
-
* @returns {
|
|
903
|
+
* @param {?WriteParams} [params]
|
|
904
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
753
905
|
*/
|
|
754
906
|
public async setCreateBoostAuthRaw(
|
|
755
907
|
address: Address,
|
|
@@ -758,7 +910,11 @@ export class BoostCore extends Deployable<
|
|
|
758
910
|
const { request, result } = await simulateBoostCoreSetCreateBoostAuth(
|
|
759
911
|
this._config,
|
|
760
912
|
{
|
|
761
|
-
|
|
913
|
+
...assertValidAddressByChainId(
|
|
914
|
+
this._config,
|
|
915
|
+
this.addresses,
|
|
916
|
+
params?.chainId,
|
|
917
|
+
),
|
|
762
918
|
args: [address],
|
|
763
919
|
...this.optionallyAttachAccount(),
|
|
764
920
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -774,14 +930,18 @@ export class BoostCore extends Deployable<
|
|
|
774
930
|
*
|
|
775
931
|
* @public
|
|
776
932
|
* @async
|
|
777
|
-
* @param {?ReadParams
|
|
933
|
+
* @param {?ReadParams} [params]
|
|
778
934
|
* @returns {unknown}
|
|
779
935
|
*/
|
|
780
936
|
public async protocolFee(
|
|
781
937
|
params?: ReadParams<typeof boostCoreAbi, 'protocolFee'>,
|
|
782
938
|
) {
|
|
783
|
-
return readBoostCoreProtocolFee(this._config, {
|
|
784
|
-
|
|
939
|
+
return await readBoostCoreProtocolFee(this._config, {
|
|
940
|
+
...assertValidAddressByChainId(
|
|
941
|
+
this._config,
|
|
942
|
+
this.addresses,
|
|
943
|
+
params?.chainId,
|
|
944
|
+
),
|
|
785
945
|
args: [],
|
|
786
946
|
...this.optionallyAttachAccount(),
|
|
787
947
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -794,14 +954,18 @@ export class BoostCore extends Deployable<
|
|
|
794
954
|
*
|
|
795
955
|
* @public
|
|
796
956
|
* @async
|
|
797
|
-
* @param {?ReadParams
|
|
798
|
-
* @returns {
|
|
957
|
+
* @param {?ReadParams} [params]
|
|
958
|
+
* @returns {Promise<Address>}
|
|
799
959
|
*/
|
|
800
960
|
public async protocolFeeReceiver(
|
|
801
961
|
params?: ReadParams<typeof boostCoreAbi, 'protocolFeeReceiver'>,
|
|
802
962
|
) {
|
|
803
|
-
return readBoostCoreProtocolFeeReceiver(this._config, {
|
|
804
|
-
|
|
963
|
+
return await readBoostCoreProtocolFeeReceiver(this._config, {
|
|
964
|
+
...assertValidAddressByChainId(
|
|
965
|
+
this._config,
|
|
966
|
+
this.addresses,
|
|
967
|
+
params?.chainId,
|
|
968
|
+
),
|
|
805
969
|
args: [],
|
|
806
970
|
...this.optionallyAttachAccount(),
|
|
807
971
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -815,14 +979,14 @@ export class BoostCore extends Deployable<
|
|
|
815
979
|
* @public
|
|
816
980
|
* @async
|
|
817
981
|
* @param {Address} address
|
|
818
|
-
* @param {?WriteParams
|
|
819
|
-
* @returns {
|
|
982
|
+
* @param {?WriteParams} [params]
|
|
983
|
+
* @returns {Promise<void>}
|
|
820
984
|
*/
|
|
821
985
|
public async setProcolFeeReceiver(
|
|
822
986
|
address: Address,
|
|
823
987
|
params?: WriteParams<typeof boostCoreAbi, 'setProtocolFeeReceiver'>,
|
|
824
988
|
) {
|
|
825
|
-
return this.awaitResult(
|
|
989
|
+
return await this.awaitResult(
|
|
826
990
|
this.setProcolFeeReceiverRaw(address, {
|
|
827
991
|
...params,
|
|
828
992
|
}),
|
|
@@ -835,8 +999,8 @@ export class BoostCore extends Deployable<
|
|
|
835
999
|
* @public
|
|
836
1000
|
* @async
|
|
837
1001
|
* @param {Address} address
|
|
838
|
-
* @param {?WriteParams
|
|
839
|
-
* @returns {
|
|
1002
|
+
* @param {?WriteParams} [params]
|
|
1003
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
840
1004
|
*/
|
|
841
1005
|
public async setProcolFeeReceiverRaw(
|
|
842
1006
|
address: Address,
|
|
@@ -845,7 +1009,11 @@ export class BoostCore extends Deployable<
|
|
|
845
1009
|
const { request, result } = await simulateBoostCoreSetProtocolFeeReceiver(
|
|
846
1010
|
this._config,
|
|
847
1011
|
{
|
|
848
|
-
|
|
1012
|
+
...assertValidAddressByChainId(
|
|
1013
|
+
this._config,
|
|
1014
|
+
this.addresses,
|
|
1015
|
+
params?.chainId,
|
|
1016
|
+
),
|
|
849
1017
|
args: [address],
|
|
850
1018
|
...this.optionallyAttachAccount(),
|
|
851
1019
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -860,64 +1028,38 @@ export class BoostCore extends Deployable<
|
|
|
860
1028
|
}
|
|
861
1029
|
|
|
862
1030
|
/**
|
|
863
|
-
*
|
|
1031
|
+
* Retrieves the claim information from a transaction receipt.
|
|
864
1032
|
*
|
|
865
|
-
* @
|
|
866
|
-
* @
|
|
867
|
-
* @param {?ReadParams<typeof boostCoreAbi, 'claimFee'>} [params]
|
|
868
|
-
* @returns {unknown}
|
|
869
|
-
*/
|
|
870
|
-
public async claimFee(params?: ReadParams<typeof boostCoreAbi, 'claimFee'>) {
|
|
871
|
-
return readBoostCoreClaimFee(this._config, {
|
|
872
|
-
address: this.assertValidAddress(),
|
|
873
|
-
args: [],
|
|
874
|
-
...this.optionallyAttachAccount(),
|
|
875
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
876
|
-
...(params as any),
|
|
877
|
-
});
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
/**
|
|
881
|
-
* Sets the claim fee.
|
|
1033
|
+
* @param {GetTransactionReceiptParameters} params - The parameters required to get the transaction receipt.
|
|
1034
|
+
* @returns {Promise<{ boostId: bigint, incentiveId: bigint, claimer: Address, amount: bigint } | undefined>} The claim information if found, undefined otherwise.
|
|
882
1035
|
*
|
|
883
|
-
* @
|
|
884
|
-
*
|
|
885
|
-
*
|
|
886
|
-
*
|
|
887
|
-
*
|
|
888
|
-
*/
|
|
889
|
-
public async setClaimFee(
|
|
890
|
-
claimFee: bigint,
|
|
891
|
-
params?: WriteParams<typeof boostCoreAbi, 'setClaimFee'>,
|
|
892
|
-
) {
|
|
893
|
-
return this.awaitResult(this.setClaimFeeRaw(claimFee, params));
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
/**
|
|
897
|
-
* Sets the claim fee.
|
|
1036
|
+
* @description
|
|
1037
|
+
* This method retrieves the transaction receipt using the provided parameters,
|
|
1038
|
+
* then parses the logs to find the 'BoostClaimed' event.
|
|
1039
|
+
* If found, it returns the arguments of the event, which include the boost ID,
|
|
1040
|
+
* incentive ID, claimer address, and claimed amount.
|
|
898
1041
|
*
|
|
899
|
-
* @
|
|
900
|
-
*
|
|
901
|
-
*
|
|
902
|
-
*
|
|
903
|
-
*
|
|
1042
|
+
* @example
|
|
1043
|
+
* ```ts
|
|
1044
|
+
* const claimInfo = await boostCore.getClaimFromTransaction({
|
|
1045
|
+
* hash: '0x...',
|
|
1046
|
+
* chainId: 1
|
|
1047
|
+
* });
|
|
1048
|
+
* if (claimInfo) {
|
|
1049
|
+
* console.log(`Boost ${claimInfo.boostId} claimed by ${claimInfo.claimer}`);
|
|
1050
|
+
* }
|
|
1051
|
+
* ```
|
|
904
1052
|
*/
|
|
905
|
-
public async
|
|
906
|
-
|
|
907
|
-
params?: WriteParams<typeof boostCoreAbi, 'setClaimFee'>,
|
|
1053
|
+
public async getClaimFromTransaction(
|
|
1054
|
+
params: GetTransactionReceiptParameters,
|
|
908
1055
|
) {
|
|
909
|
-
const
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
...(params as any),
|
|
917
|
-
},
|
|
918
|
-
);
|
|
919
|
-
const hash = await writeBoostCoreSetClaimFee(this._config, request);
|
|
920
|
-
return { hash, result };
|
|
1056
|
+
const receipt = await getTransactionReceipt(this._config, params);
|
|
1057
|
+
const logs = parseEventLogs({
|
|
1058
|
+
abi: boostCoreAbi,
|
|
1059
|
+
eventName: 'BoostClaimed',
|
|
1060
|
+
logs: receipt.logs,
|
|
1061
|
+
});
|
|
1062
|
+
return logs.at(0)?.args;
|
|
921
1063
|
}
|
|
922
1064
|
|
|
923
1065
|
/**
|
|
@@ -928,8 +1070,7 @@ export class BoostCore extends Deployable<
|
|
|
928
1070
|
* const auth = core.PassthroughAuth('0x') // is roughly equivalent to
|
|
929
1071
|
* const auth = new PassthroughAuth({ config: core._config, account: core._account }, '0x')
|
|
930
1072
|
* ```
|
|
931
|
-
* @param {
|
|
932
|
-
* @param {?boolean} [isBase]
|
|
1073
|
+
* @param {Address} address
|
|
933
1074
|
* @returns {PassthroughAuth}
|
|
934
1075
|
*/
|
|
935
1076
|
PassthroughAuth(address?: Address) {
|
|
@@ -1002,6 +1143,24 @@ export class BoostCore extends Deployable<
|
|
|
1002
1143
|
// isBase,
|
|
1003
1144
|
// );
|
|
1004
1145
|
// }
|
|
1146
|
+
/**
|
|
1147
|
+
* Bound {@link OpenAllowList} constructor that reuses the same configuration as the Boost Core instance.
|
|
1148
|
+
*
|
|
1149
|
+
* @example
|
|
1150
|
+
* ```ts
|
|
1151
|
+
* const list = core.OpenAllowList('0x') // is roughly equivalent to
|
|
1152
|
+
* const list = new OpenAllowList({ config: core._config, account: core._account }, '0x')
|
|
1153
|
+
* ```
|
|
1154
|
+
* @param {?boolean} [isBase]
|
|
1155
|
+
* @returns {OpenAllowList}
|
|
1156
|
+
*/
|
|
1157
|
+
OpenAllowList(isBase?: boolean) {
|
|
1158
|
+
return new OpenAllowList(
|
|
1159
|
+
{ config: this._config, account: this._account },
|
|
1160
|
+
undefined,
|
|
1161
|
+
isBase,
|
|
1162
|
+
);
|
|
1163
|
+
}
|
|
1005
1164
|
/**
|
|
1006
1165
|
* Bound {@link SimpleAllowList} constructor that reuses the same configuration as the Boost Core instance.
|
|
1007
1166
|
*
|
|
@@ -1206,6 +1365,30 @@ export class BoostCore extends Deployable<
|
|
|
1206
1365
|
isBase,
|
|
1207
1366
|
);
|
|
1208
1367
|
}
|
|
1368
|
+
|
|
1369
|
+
/**
|
|
1370
|
+
* Bound {@link ERC20VariableCriteriaIncentive} constructor that reuses the same configuration as the Boost Core instance.
|
|
1371
|
+
*
|
|
1372
|
+
* @example
|
|
1373
|
+
* ```ts
|
|
1374
|
+
* const validator = core.ERC20VariableCrtieriaIncentive({ ... }) // is roughly equivalent to
|
|
1375
|
+
* const validator = new ERC20VariableCrtieriaIncentive({ config: core._config, account: core._account }, { ... })
|
|
1376
|
+
* ```
|
|
1377
|
+
* @param {DeployablePayloadOrAddress<ERC20VariableCrtieriaIncentivePayload>} options
|
|
1378
|
+
* @param {?boolean} [isBase]
|
|
1379
|
+
* @returns {ERC20VariableCrtieriaIncentive}
|
|
1380
|
+
* */
|
|
1381
|
+
ERC20VariableCriteriaIncentive(
|
|
1382
|
+
options: DeployablePayloadOrAddress<ERC20VariableCriteriaIncentivePayload>,
|
|
1383
|
+
isBase?: boolean,
|
|
1384
|
+
) {
|
|
1385
|
+
return new ERC20VariableCriteriaIncentive(
|
|
1386
|
+
{ config: this._config, account: this._account },
|
|
1387
|
+
options,
|
|
1388
|
+
isBase,
|
|
1389
|
+
);
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1209
1392
|
/**
|
|
1210
1393
|
* Bound {@link ERC20VariableIncentive} constructor that reuses the same configuration as the Boost Core instance.
|
|
1211
1394
|
*
|