@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
|
@@ -33,11 +33,13 @@ import {
|
|
|
33
33
|
parseAbiParameters,
|
|
34
34
|
zeroAddress,
|
|
35
35
|
} from 'viem';
|
|
36
|
+
import { ManagedBudget as ManagedBudgetBases } from '../../dist/deployments.json';
|
|
36
37
|
import type {
|
|
37
38
|
DeployableOptions,
|
|
38
39
|
GenericDeployableParams,
|
|
39
40
|
} from '../Deployable/Deployable';
|
|
40
41
|
import { DeployableTarget } from '../Deployable/DeployableTarget';
|
|
42
|
+
import { DeployableTargetWithRBAC } from '../Deployable/DeployableTargetWithRBAC';
|
|
41
43
|
import {
|
|
42
44
|
DeployableUnknownOwnerProvidedError,
|
|
43
45
|
UnknownTransferPayloadSupplied,
|
|
@@ -54,7 +56,6 @@ import {
|
|
|
54
56
|
RegistryType,
|
|
55
57
|
type WriteParams,
|
|
56
58
|
} from '../utils';
|
|
57
|
-
|
|
58
59
|
export { managedBudgetAbi };
|
|
59
60
|
export type { ERC1155TransferPayload, FungibleTransferPayload };
|
|
60
61
|
|
|
@@ -81,22 +82,26 @@ export interface ManagedBudgetPayload {
|
|
|
81
82
|
/**
|
|
82
83
|
* List of roles to assign to the corresponding account by index.
|
|
83
84
|
*
|
|
84
|
-
* @type {
|
|
85
|
+
* @type {ManagedBudgetRoles[]}
|
|
85
86
|
*/
|
|
86
|
-
roles:
|
|
87
|
+
roles: ManagedBudgetRoles[];
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
/**
|
|
90
|
-
*
|
|
91
|
+
* Enum representing available roles for use in the `ManagedBudget`.
|
|
91
92
|
* `MANAGER` can disburse funds.
|
|
92
93
|
* `ADMIN` can additionally manage authorized users on the budget.
|
|
93
94
|
*
|
|
95
|
+
* @export
|
|
94
96
|
* @type {{ readonly MANAGER: 1n; readonly ADMIN_ROLE: 2n; }}
|
|
97
|
+
* @enum {bigint}
|
|
95
98
|
*/
|
|
96
|
-
export
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
export enum ManagedBudgetRoles {
|
|
100
|
+
//@ts-expect-error ts doesn't like bigint enum values
|
|
101
|
+
MANAGER = 1n,
|
|
102
|
+
//@ts-expect-error ts doesn't like bigint enum values
|
|
103
|
+
ADMIN = 2n,
|
|
104
|
+
}
|
|
100
105
|
|
|
101
106
|
/**
|
|
102
107
|
* A generic `viem.Log` event with support for `ManagedBudget` event types.
|
|
@@ -144,7 +149,7 @@ export function isERC1155TransferPayload(
|
|
|
144
149
|
*
|
|
145
150
|
* @export
|
|
146
151
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
147
|
-
* @returns {
|
|
152
|
+
* @returns {Hex}
|
|
148
153
|
* @throws {@link UnknownTransferPayloadSupplied}
|
|
149
154
|
*/
|
|
150
155
|
export function prepareTransfer(
|
|
@@ -152,9 +157,11 @@ export function prepareTransfer(
|
|
|
152
157
|
) {
|
|
153
158
|
if (isFungibleTransfer(transfer)) {
|
|
154
159
|
return prepareFungibleTransfer(transfer);
|
|
155
|
-
}
|
|
160
|
+
}
|
|
161
|
+
if (isERC1155TransferPayload(transfer)) {
|
|
156
162
|
return prepareERC1155Transfer(transfer);
|
|
157
|
-
}
|
|
163
|
+
}
|
|
164
|
+
throw new UnknownTransferPayloadSupplied(transfer);
|
|
158
165
|
}
|
|
159
166
|
|
|
160
167
|
/**
|
|
@@ -164,9 +171,9 @@ export function prepareTransfer(
|
|
|
164
171
|
* @export
|
|
165
172
|
* @class ManagedBudget
|
|
166
173
|
* @typedef {ManagedBudget}
|
|
167
|
-
* @extends {
|
|
174
|
+
* @extends {DeployableTargetWithRBAC<ManagedBudgetPayload>}
|
|
168
175
|
*/
|
|
169
|
-
export class ManagedBudget extends
|
|
176
|
+
export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
170
177
|
ManagedBudgetPayload,
|
|
171
178
|
typeof managedBudgetAbi
|
|
172
179
|
> {
|
|
@@ -183,10 +190,11 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
183
190
|
*
|
|
184
191
|
* @public
|
|
185
192
|
* @static
|
|
186
|
-
* @type {Address}
|
|
193
|
+
* @type {Record<number, Address>}
|
|
187
194
|
*/
|
|
188
|
-
public static override
|
|
189
|
-
|
|
195
|
+
public static override bases: Record<number, Address> = {
|
|
196
|
+
...(ManagedBudgetBases as Record<number, Address>),
|
|
197
|
+
};
|
|
190
198
|
/**
|
|
191
199
|
* @inheritdoc
|
|
192
200
|
*
|
|
@@ -204,7 +212,7 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
204
212
|
* @public
|
|
205
213
|
* @async
|
|
206
214
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
207
|
-
* @param {?WriteParams
|
|
215
|
+
* @param {?WriteParams} [params]
|
|
208
216
|
* @returns {Promise<boolean>} - True if the allocation was successful
|
|
209
217
|
*/
|
|
210
218
|
public async allocate(
|
|
@@ -222,8 +230,8 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
222
230
|
* @public
|
|
223
231
|
* @async
|
|
224
232
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
225
|
-
* @param {?WriteParams
|
|
226
|
-
* @returns {Promise<boolean>} - True if the allocation was successful
|
|
233
|
+
* @param {?WriteParams} [params]
|
|
234
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the allocation was successful
|
|
227
235
|
*/
|
|
228
236
|
public async allocateRaw(
|
|
229
237
|
transfer: FungibleTransferPayload | ERC1155TransferPayload,
|
|
@@ -252,7 +260,7 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
252
260
|
* @public
|
|
253
261
|
* @async
|
|
254
262
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
255
|
-
* @param {?WriteParams
|
|
263
|
+
* @param {?WriteParams} [params]
|
|
256
264
|
* @returns {Promise<boolean>} - True if the request was successful
|
|
257
265
|
*/
|
|
258
266
|
public async clawback(
|
|
@@ -271,8 +279,8 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
271
279
|
* @public
|
|
272
280
|
* @async
|
|
273
281
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
274
|
-
* @param {?WriteParams
|
|
275
|
-
* @returns {Promise<boolean>} - True if the request was successful
|
|
282
|
+
* @param {?WriteParams} [params]
|
|
283
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the request was successful
|
|
276
284
|
*/
|
|
277
285
|
public async clawbackRaw(
|
|
278
286
|
transfer: FungibleTransferPayload | ERC1155TransferPayload,
|
|
@@ -299,7 +307,7 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
299
307
|
* @public
|
|
300
308
|
* @async
|
|
301
309
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
302
|
-
* @param {?WriteParams
|
|
310
|
+
* @param {?WriteParams} [params]
|
|
303
311
|
* @returns {Promise<boolean>} - True if the disbursement was successful
|
|
304
312
|
*/
|
|
305
313
|
public async disburse(
|
|
@@ -316,8 +324,8 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
316
324
|
* @public
|
|
317
325
|
* @async
|
|
318
326
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
319
|
-
* @param {?WriteParams
|
|
320
|
-
* @returns {Promise<boolean>} - True if the disbursement was successful
|
|
327
|
+
* @param {?WriteParams} [params]
|
|
328
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the disbursement was successful
|
|
321
329
|
*/
|
|
322
330
|
public async disburseRaw(
|
|
323
331
|
transfer: FungibleTransferPayload | ERC1155TransferPayload,
|
|
@@ -343,7 +351,7 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
343
351
|
* @public
|
|
344
352
|
* @async
|
|
345
353
|
* @param {Array<FungibleTransferPayload | ERC1155TransferPayload>} transfers
|
|
346
|
-
* @param {?WriteParams
|
|
354
|
+
* @param {?WriteParams} [params]
|
|
347
355
|
* @returns {Promise<boolean>} - True if all disbursements were successful
|
|
348
356
|
*/
|
|
349
357
|
public async disburseBatch(
|
|
@@ -359,8 +367,8 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
359
367
|
* @public
|
|
360
368
|
* @async
|
|
361
369
|
* @param {Array<FungibleTransferPayload | ERC1155TransferPayload>} transfers
|
|
362
|
-
* @param {?WriteParams
|
|
363
|
-
* @returns {Promise<boolean>} - True if all disbursements were successful
|
|
370
|
+
* @param {?WriteParams} [params]
|
|
371
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if all disbursements were successful
|
|
364
372
|
*/
|
|
365
373
|
public async disburseBatchRaw(
|
|
366
374
|
transfers: Array<FungibleTransferPayload | ERC1155TransferPayload>,
|
|
@@ -380,281 +388,11 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
380
388
|
return { hash, result };
|
|
381
389
|
}
|
|
382
390
|
|
|
383
|
-
/**
|
|
384
|
-
* Set the authorized status of the given accounts
|
|
385
|
-
* The mechanism for managing authorization is left to the implementing contract
|
|
386
|
-
*
|
|
387
|
-
* @public
|
|
388
|
-
* @async
|
|
389
|
-
* @param {Address[]} addresses - The accounts to authorize or deauthorize
|
|
390
|
-
* @param {boolean[]} allowed - The authorization status for the given accounts
|
|
391
|
-
* @param {?WriteParams<typeof managedBudgetAbi, 'setAuthorized'>} [params]
|
|
392
|
-
* @returns {Promise<void>}
|
|
393
|
-
*/
|
|
394
|
-
public async setAuthorized(
|
|
395
|
-
addresses: Address[],
|
|
396
|
-
allowed: boolean[],
|
|
397
|
-
params?: WriteParams<typeof managedBudgetAbi, 'setAuthorized'>,
|
|
398
|
-
) {
|
|
399
|
-
return await this.awaitResult(
|
|
400
|
-
this.setAuthorizedRaw(addresses, allowed, params),
|
|
401
|
-
);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* Set the authorized status of the given accounts
|
|
406
|
-
* The mechanism for managing authorization is left to the implementing contract
|
|
407
|
-
*
|
|
408
|
-
* @public
|
|
409
|
-
* @async
|
|
410
|
-
* @param {Address[]} addresses - The accounts to authorize or deauthorize
|
|
411
|
-
* @param {boolean[]} allowed - The authorization status for the given accounts
|
|
412
|
-
* @param {?WriteParams<typeof managedBudgetAbi, 'setAuthorized'>} [params]
|
|
413
|
-
* @returns {Promise<void>}
|
|
414
|
-
*/
|
|
415
|
-
public async setAuthorizedRaw(
|
|
416
|
-
addresses: Address[],
|
|
417
|
-
allowed: boolean[],
|
|
418
|
-
params?: WriteParams<typeof managedBudgetAbi, 'setAuthorized'>,
|
|
419
|
-
) {
|
|
420
|
-
const { request, result } = await simulateManagedBudgetSetAuthorized(
|
|
421
|
-
this._config,
|
|
422
|
-
{
|
|
423
|
-
address: this.assertValidAddress(),
|
|
424
|
-
args: [addresses, allowed],
|
|
425
|
-
...this.optionallyAttachAccount(),
|
|
426
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
427
|
-
...(params as any),
|
|
428
|
-
},
|
|
429
|
-
);
|
|
430
|
-
const hash = await writeManagedBudgetSetAuthorized(this._config, request);
|
|
431
|
-
return { hash, result };
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* Grant many accounts permissions on the budget.
|
|
436
|
-
*
|
|
437
|
-
* @example
|
|
438
|
-
* ```ts
|
|
439
|
-
* await budget.grantRoles(['0xfoo', '0xbar], [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN])
|
|
440
|
-
* ```
|
|
441
|
-
* @public
|
|
442
|
-
* @async
|
|
443
|
-
* @param {Address[]} addresses
|
|
444
|
-
* @param {bigint[]} roles
|
|
445
|
-
* @param {?WriteParams<typeof managedBudgetAbi, 'grantRoles'>} [params]
|
|
446
|
-
* @returns {unknown}
|
|
447
|
-
*/
|
|
448
|
-
public async grantRoles(
|
|
449
|
-
addresses: Address[],
|
|
450
|
-
roles: bigint[],
|
|
451
|
-
params?: WriteParams<typeof managedBudgetAbi, 'grantRoles'>,
|
|
452
|
-
) {
|
|
453
|
-
return await this.awaitResult(this.grantRolesRaw(addresses, roles, params));
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* Grant many accounts permissions on the budget.
|
|
458
|
-
*
|
|
459
|
-
* @example
|
|
460
|
-
* ```ts
|
|
461
|
-
* await budget.grantRoles(['0xfoo', '0xbar], [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN])
|
|
462
|
-
*
|
|
463
|
-
* @public
|
|
464
|
-
* @async
|
|
465
|
-
* @param {Address[]} addresses
|
|
466
|
-
* @param {bigint[]} roles
|
|
467
|
-
* @param {?WriteParams<typeof managedBudgetAbi, 'grantRoles'>} [params]
|
|
468
|
-
* @returns {unknown}
|
|
469
|
-
*/
|
|
470
|
-
public async grantRolesRaw(
|
|
471
|
-
addresses: Address[],
|
|
472
|
-
roles: bigint[],
|
|
473
|
-
params?: WriteParams<typeof managedBudgetAbi, 'grantRoles'>,
|
|
474
|
-
) {
|
|
475
|
-
const { request, result } = await simulateManagedBudgetGrantRoles(
|
|
476
|
-
this._config,
|
|
477
|
-
{
|
|
478
|
-
address: this.assertValidAddress(),
|
|
479
|
-
args: [addresses, roles],
|
|
480
|
-
...this.optionallyAttachAccount(),
|
|
481
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
482
|
-
...(params as any),
|
|
483
|
-
},
|
|
484
|
-
);
|
|
485
|
-
const hash = await writeManagedBudgetGrantRoles(
|
|
486
|
-
this._config,
|
|
487
|
-
// biome-ignore lint/suspicious/noExplicitAny: negligible low level lack of type intersection
|
|
488
|
-
request as any,
|
|
489
|
-
);
|
|
490
|
-
return { hash, result };
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* Revoke many accounts' permissions on the budget.
|
|
495
|
-
*
|
|
496
|
-
* @example
|
|
497
|
-
* ```ts
|
|
498
|
-
* await budget.revokeRoles(['0xfoo', '0xbar], [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN])
|
|
499
|
-
*
|
|
500
|
-
* @public
|
|
501
|
-
* @async
|
|
502
|
-
* @param {Address[]} addresses
|
|
503
|
-
* @param {bigint[]} roles
|
|
504
|
-
* @param {?WriteParams<typeof managedBudgetAbi, 'revokeRoles'>} [params]
|
|
505
|
-
* @returns {unknown}
|
|
506
|
-
*/
|
|
507
|
-
public async revokeRoles(
|
|
508
|
-
addresses: Address[],
|
|
509
|
-
roles: bigint[],
|
|
510
|
-
params?: WriteParams<typeof managedBudgetAbi, 'revokeRoles'>,
|
|
511
|
-
) {
|
|
512
|
-
return await this.awaitResult(
|
|
513
|
-
this.revokeRolesRaw(addresses, roles, params),
|
|
514
|
-
);
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
/**
|
|
518
|
-
* Revoke many accounts' permissions on the budget.
|
|
519
|
-
*
|
|
520
|
-
* @example
|
|
521
|
-
* ```ts
|
|
522
|
-
* await budget.revokeRoles(['0xfoo', '0xbar], [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN])
|
|
523
|
-
* @public
|
|
524
|
-
* @async
|
|
525
|
-
* @param {Address[]} addresses
|
|
526
|
-
* @param {bigint[]} roles
|
|
527
|
-
* @param {?WriteParams<typeof managedBudgetAbi, 'revokeRoles'>} [params]
|
|
528
|
-
* @returns {unknown}
|
|
529
|
-
*/
|
|
530
|
-
public async revokeRolesRaw(
|
|
531
|
-
addresses: Address[],
|
|
532
|
-
roles: bigint[],
|
|
533
|
-
params?: WriteParams<typeof managedBudgetAbi, 'revokeRoles'>,
|
|
534
|
-
) {
|
|
535
|
-
const { request, result } = await simulateManagedBudgetRevokeRoles(
|
|
536
|
-
this._config,
|
|
537
|
-
{
|
|
538
|
-
address: this.assertValidAddress(),
|
|
539
|
-
args: [addresses, roles],
|
|
540
|
-
...this.optionallyAttachAccount(),
|
|
541
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
542
|
-
...(params as any),
|
|
543
|
-
},
|
|
544
|
-
);
|
|
545
|
-
const hash = await writeManagedBudgetRevokeRoles(
|
|
546
|
-
this._config,
|
|
547
|
-
// biome-ignore lint/suspicious/noExplicitAny: negligible low level lack of type intersection
|
|
548
|
-
request as any,
|
|
549
|
-
);
|
|
550
|
-
return { hash, result };
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
/**
|
|
554
|
-
* Return an array of the roles assigned to the given account.
|
|
555
|
-
* @example
|
|
556
|
-
* ```ts
|
|
557
|
-
* (await budget.rolesOf(0xfoo)).includes(ManagedBudgetRoles.ADMIN)
|
|
558
|
-
* @public
|
|
559
|
-
* @param {Address} account
|
|
560
|
-
* @param {?ReadParams<typeof managedBudgetAbi, 'rolesOf'>} [params]
|
|
561
|
-
* @returns {Promise<Array<bigint>>}
|
|
562
|
-
*/
|
|
563
|
-
public async rolesOf(
|
|
564
|
-
account: Address,
|
|
565
|
-
params?: ReadParams<typeof managedBudgetAbi, 'rolesOf'>,
|
|
566
|
-
) {
|
|
567
|
-
const roles = await readManagedBudgetRolesOf(this._config, {
|
|
568
|
-
address: this.assertValidAddress(),
|
|
569
|
-
args: [account],
|
|
570
|
-
...this.optionallyAttachAccount(),
|
|
571
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
572
|
-
...(params as any),
|
|
573
|
-
});
|
|
574
|
-
return [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN].filter(
|
|
575
|
-
(role) => (roles & role) === role,
|
|
576
|
-
);
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
/**
|
|
580
|
-
* Returns whether given account has any of the provided roles bitmap.
|
|
581
|
-
*
|
|
582
|
-
* @example
|
|
583
|
-
* ```ts
|
|
584
|
-
* await budget.hasAnyRole(0xfoo, ManagedBudgetRoles.ADMIN | ManagedBudgetRoles.MANAGER)
|
|
585
|
-
* @public
|
|
586
|
-
* @param {Address} account
|
|
587
|
-
* @param {bigint} roles
|
|
588
|
-
* @param {?ReadParams<typeof managedBudgetAbi, 'hasAnyRole'>} [params]
|
|
589
|
-
* @returns {Promise<boolean>}
|
|
590
|
-
*/
|
|
591
|
-
public hasAnyRole(
|
|
592
|
-
account: Address,
|
|
593
|
-
roles: bigint,
|
|
594
|
-
params?: ReadParams<typeof managedBudgetAbi, 'hasAnyRole'>,
|
|
595
|
-
) {
|
|
596
|
-
return readManagedBudgetHasAnyRole(this._config, {
|
|
597
|
-
address: this.assertValidAddress(),
|
|
598
|
-
args: [account, roles],
|
|
599
|
-
...this.optionallyAttachAccount(),
|
|
600
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
601
|
-
...(params as any),
|
|
602
|
-
});
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
/**
|
|
606
|
-
* Returns whether given account has all of the provided roles bitmap.
|
|
607
|
-
*
|
|
608
|
-
* @example
|
|
609
|
-
* ```ts
|
|
610
|
-
* await budget.hasAllRoles(0xfoo, ManagedBudgetRoles.ADMIN & ManagedBudgetRoles.MANAGER)
|
|
611
|
-
*
|
|
612
|
-
* @public
|
|
613
|
-
* @param {Address} account
|
|
614
|
-
* @param {bigint} roles
|
|
615
|
-
* @param {?ReadParams<typeof managedBudgetAbi, 'hasAllRoles'>} [params]
|
|
616
|
-
* @returns {*}
|
|
617
|
-
*/
|
|
618
|
-
public hasAllRoles(
|
|
619
|
-
account: Address,
|
|
620
|
-
roles: bigint,
|
|
621
|
-
params?: ReadParams<typeof managedBudgetAbi, 'hasAllRoles'>,
|
|
622
|
-
) {
|
|
623
|
-
return readManagedBudgetHasAllRoles(this._config, {
|
|
624
|
-
address: this.assertValidAddress(),
|
|
625
|
-
args: [account, roles],
|
|
626
|
-
...this.optionallyAttachAccount(),
|
|
627
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
628
|
-
...(params as any),
|
|
629
|
-
});
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
/**
|
|
633
|
-
* Check if the given account is authorized to use the budget
|
|
634
|
-
*
|
|
635
|
-
* @public
|
|
636
|
-
* @param {Address} account
|
|
637
|
-
* @param {?ReadParams<typeof managedBudgetAbi, 'isAuthorized'>} [params]
|
|
638
|
-
* @returns {Promise<boolean>} - True if the account is authorized
|
|
639
|
-
*/
|
|
640
|
-
public isAuthorized(
|
|
641
|
-
account: Address,
|
|
642
|
-
params?: ReadParams<typeof managedBudgetAbi, 'isAuthorized'>,
|
|
643
|
-
) {
|
|
644
|
-
return readManagedBudgetIsAuthorized(this._config, {
|
|
645
|
-
address: this.assertValidAddress(),
|
|
646
|
-
args: [account],
|
|
647
|
-
...this.optionallyAttachAccount(),
|
|
648
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
649
|
-
...(params as any),
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
|
|
653
391
|
/**
|
|
654
392
|
* Get the owner of the budget
|
|
655
393
|
*
|
|
656
394
|
* @public
|
|
657
|
-
* @param {?ReadParams
|
|
395
|
+
* @param {?ReadParams} [params]
|
|
658
396
|
* @returns {Promise<Address>}
|
|
659
397
|
*/
|
|
660
398
|
public owner(params?: ReadParams<typeof managedBudgetAbi, 'owner'>) {
|
|
@@ -671,13 +409,13 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
671
409
|
* If a tokenId is provided, get the total amount of ERC1155 assets allocated to the budget, including any that have been distributed
|
|
672
410
|
*
|
|
673
411
|
* @public
|
|
674
|
-
* @param {Address} asset - The address of the asset
|
|
412
|
+
* @param {Address} [asset="0x0000000000000000000000000000000000000000"] - The address of the asset
|
|
675
413
|
* @param {?(bigint | undefined)} [tokenId] - The ID of the token
|
|
676
|
-
* @param {?ReadParams
|
|
414
|
+
* @param {?ReadParams} [params]
|
|
677
415
|
* @returns {Promise<bigint>} - The total amount of assets
|
|
678
416
|
*/
|
|
679
417
|
public total(
|
|
680
|
-
asset: Address,
|
|
418
|
+
asset: Address = zeroAddress,
|
|
681
419
|
tokenId?: bigint | undefined,
|
|
682
420
|
params?: ReadParams<typeof managedBudgetAbi, 'total'>,
|
|
683
421
|
) {
|
|
@@ -694,13 +432,13 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
694
432
|
* If a tokenId is provided, get the amount of ERC1155 assets available for distribution from the budget
|
|
695
433
|
*
|
|
696
434
|
* @public
|
|
697
|
-
* @param {Address} asset
|
|
435
|
+
* @param {Address} [asset="0x0000000000000000000000000000000000000000"]
|
|
698
436
|
* @param {?(bigint | undefined)} [tokenId]
|
|
699
|
-
* @param {?ReadParams
|
|
437
|
+
* @param {?ReadParams} [params]
|
|
700
438
|
* @returns {Promise<bigint>} - The amount of assets available
|
|
701
439
|
*/
|
|
702
440
|
public available(
|
|
703
|
-
asset: Address,
|
|
441
|
+
asset: Address = zeroAddress,
|
|
704
442
|
tokenId?: bigint | undefined,
|
|
705
443
|
params?: ReadParams<typeof managedBudgetAbi, 'available'>,
|
|
706
444
|
) {
|
|
@@ -717,13 +455,13 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
717
455
|
* If a tokenId is provided, get the amount of ERC1155 assets that have been distributed from the budget
|
|
718
456
|
*
|
|
719
457
|
* @public
|
|
720
|
-
* @param {Address} asset
|
|
458
|
+
* @param {Address} [asset="0x0000000000000000000000000000000000000000"]
|
|
721
459
|
* @param {?(bigint | undefined)} [tokenId]
|
|
722
|
-
* @param {?ReadParams
|
|
460
|
+
* @param {?ReadParams} [params]
|
|
723
461
|
* @returns {Promise<bigint>} - The amount of assets distributed
|
|
724
462
|
*/
|
|
725
463
|
public distributed(
|
|
726
|
-
asset: Address,
|
|
464
|
+
asset: Address = zeroAddress,
|
|
727
465
|
tokenId?: bigint | undefined,
|
|
728
466
|
params?: ReadParams<typeof managedBudgetAbi, 'distributed'>,
|
|
729
467
|
) {
|
|
@@ -779,7 +517,7 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
779
517
|
* @param {Address} param0.owner - The budget's owner
|
|
780
518
|
* @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.
|
|
781
519
|
* @param {{}} param0.roles - List of roles to assign to the corresponding account by index.
|
|
782
|
-
* @returns {
|
|
520
|
+
* @returns {Hex}
|
|
783
521
|
*/
|
|
784
522
|
export const prepareManagedBudgetPayload = ({
|
|
785
523
|
owner,
|
|
@@ -791,6 +529,6 @@ export const prepareManagedBudgetPayload = ({
|
|
|
791
529
|
'ManagedBudgetPayload payload',
|
|
792
530
|
'struct ManagedBudgetPayload { address owner; address[] authorized; uint256[] roles; }',
|
|
793
531
|
]),
|
|
794
|
-
[{ owner, authorized, roles }],
|
|
532
|
+
[{ owner, authorized, roles: roles as unknown as Array<bigint> }],
|
|
795
533
|
);
|
|
796
534
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
|
|
2
2
|
import { isAddress, parseEther, zeroAddress } from 'viem';
|
|
3
3
|
import { beforeAll, beforeEach, describe, expect, test } from 'vitest';
|
|
4
|
-
import type { MockERC20 } from '
|
|
4
|
+
import type { MockERC20 } from '@boostxyz/test/MockERC20';
|
|
5
5
|
import {
|
|
6
6
|
type Fixtures,
|
|
7
7
|
defaultOptions,
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
freshVestingBudget,
|
|
10
10
|
fundErc20,
|
|
11
11
|
fundVestingBudget,
|
|
12
|
-
} from '
|
|
13
|
-
import { testAccount } from '
|
|
12
|
+
} from '@boostxyz/test/helpers';
|
|
13
|
+
import { testAccount } from '@boostxyz/test/viem';
|
|
14
14
|
import { VestingBudget } from './VestingBudget';
|
|
15
15
|
|
|
16
16
|
let fixtures: Fixtures, budget: VestingBudget, erc20: MockERC20;
|
|
17
17
|
|
|
18
18
|
beforeAll(async () => {
|
|
19
|
-
fixtures = await loadFixture(deployFixtures);
|
|
19
|
+
fixtures = await loadFixture(deployFixtures(defaultOptions));
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
describe.skip('VestingBudget', () => {
|
|
@@ -53,7 +53,7 @@ describe.skip('VestingBudget', () => {
|
|
|
53
53
|
const budget = await loadFixture(
|
|
54
54
|
freshVestingBudget(defaultOptions, fixtures),
|
|
55
55
|
);
|
|
56
|
-
expect(await budget.available(
|
|
56
|
+
expect(await budget.available()).toBe(0n);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
describe('can allocate', () => {
|
|
@@ -73,7 +73,7 @@ describe.skip('VestingBudget', () => {
|
|
|
73
73
|
value: parseEther('1.0'),
|
|
74
74
|
},
|
|
75
75
|
);
|
|
76
|
-
expect(await budget.available(
|
|
76
|
+
expect(await budget.available()).toBe(parseEther('1.0'));
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
test('erc20', async () => {
|
|
@@ -105,7 +105,7 @@ describe.skip('VestingBudget', () => {
|
|
|
105
105
|
target: defaultOptions.account.address,
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
-
expect(await budget.available(
|
|
108
|
+
expect(await budget.available()).toBe(0n);
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
test('erc20 assets', async () => {
|