@boostxyz/sdk 0.0.0-alpha.12 → 0.0.0-alpha.13
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.js +1 -1
- package/dist/Actions/ContractAction.d.ts +2 -2
- package/dist/Actions/ContractAction.d.ts.map +1 -1
- package/dist/Actions/ERC721MintAction.d.ts +2 -2
- 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 +2 -2
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +47 -43
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +2 -2
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +2 -2
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +23 -19
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.d.ts +2 -2
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleDenyList.js +6 -5
- package/dist/AllowLists/SimpleDenyList.js.map +1 -1
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +27 -5
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +438 -347
- 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 +26 -5
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +125 -64
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +1 -1
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +2 -2
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +41 -37
- package/dist/Budgets/ManagedBudget.js.map +1 -1
- package/dist/Budgets/SimpleBudget.d.ts +2 -2
- package/dist/Budgets/SimpleBudget.d.ts.map +1 -1
- package/dist/Budgets/VestingBudget.d.ts +2 -2
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.cjs.map +1 -1
- package/dist/Deployable/DeployableTarget.d.ts +6 -6
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.js +22 -17
- package/dist/Deployable/DeployableTarget.js.map +1 -1
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.d.ts +2 -2
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +17 -13
- 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 +14 -2
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +27 -23
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC1155Incentive.d.ts +2 -2
- 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 +2 -2
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +17 -13
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +2 -2
- 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.js +32 -28
- 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 +2 -2
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +13 -9
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/{SimpleDenyList-IJ9Ipya7.js → SimpleDenyList-C21O9Yfi.js} +23 -19
- package/dist/SimpleDenyList-C21O9Yfi.js.map +1 -0
- package/dist/SimpleDenyList-DeJRKD2D.cjs +2 -0
- package/dist/{SimpleDenyList-IJ9Ipya7.js.map → SimpleDenyList-DeJRKD2D.cjs.map} +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.d.ts +2 -2
- package/dist/Validators/SignerValidator.d.ts.map +1 -1
- package/dist/Validators/SignerValidator.js +18 -14
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +1 -1
- package/dist/deployments-BvFcK_eR.js +40 -0
- package/dist/deployments-BvFcK_eR.js.map +1 -0
- package/dist/deployments-Ho4PnGCS.cjs +2 -0
- package/dist/deployments-Ho4PnGCS.cjs.map +1 -0
- package/dist/deployments.json +38 -0
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +6 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +70 -54
- package/dist/errors.js.map +1 -1
- package/dist/{generated-HGddZXHJ.js → generated-LpgSHrH0.js} +130 -90
- package/dist/generated-LpgSHrH0.js.map +1 -0
- package/dist/generated-tq_HLZJ0.cjs +3 -0
- package/dist/generated-tq_HLZJ0.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +113 -109
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +25 -11
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +38 -23
- package/dist/utils.js.map +1 -1
- package/package.json +6 -5
- package/src/Actions/ContractAction.ts +5 -3
- package/src/Actions/ERC721MintAction.ts +5 -3
- package/src/Actions/EventAction.ts +6 -2
- package/src/AllowLists/AllowList.test.ts +1 -1
- package/src/AllowLists/SimpleAllowList.ts +6 -3
- package/src/AllowLists/SimpleDenyList.ts +6 -3
- package/src/BoostCore.test.ts +31 -91
- package/src/BoostCore.ts +137 -34
- package/src/BoostRegistry.ts +89 -21
- package/src/Budgets/ManagedBudget.ts +6 -4
- package/src/Budgets/SimpleBudget.ts +4 -3
- package/src/Budgets/VestingBudget.ts +4 -3
- package/src/Deployable/DeployableTarget.ts +22 -11
- package/src/Incentives/AllowListIncentive.ts +6 -3
- package/src/Incentives/CGDAIncentive.ts +6 -3
- package/src/Incentives/ERC1155Incentive.ts +4 -3
- package/src/Incentives/ERC20Incentive.ts +6 -3
- package/src/Incentives/ERC20VariableIncentive.ts +6 -3
- package/src/Incentives/PointsIncentive.ts +6 -3
- package/src/Validators/SignerValidator.ts +6 -3
- package/src/errors.ts +17 -1
- package/src/utils.ts +60 -11
- package/dist/SimpleDenyList-CqT0BMP7.cjs +0 -2
- package/dist/SimpleDenyList-CqT0BMP7.cjs.map +0 -1
- package/dist/generated-HGddZXHJ.js.map +0 -1
- package/dist/generated-wKBNvm48.cjs +0 -3
- package/dist/generated-wKBNvm48.cjs.map +0 -1
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
trim,
|
|
28
28
|
} from 'viem';
|
|
29
29
|
import { getLogs } from 'viem/actions';
|
|
30
|
+
import { EventAction as EventActionBases } from '../../dist/deployments.json';
|
|
30
31
|
import type {
|
|
31
32
|
DeployableOptions,
|
|
32
33
|
GenericDeployableParams,
|
|
@@ -373,9 +374,12 @@ export class EventAction extends DeployableTarget<
|
|
|
373
374
|
*
|
|
374
375
|
* @public
|
|
375
376
|
* @static
|
|
376
|
-
* @type {Address}
|
|
377
|
+
* @type {Record<number, Address>}
|
|
377
378
|
*/
|
|
378
|
-
public static override
|
|
379
|
+
public static override bases: Record<number, Address> = {
|
|
380
|
+
...(EventActionBases as Record<number, Address>),
|
|
381
|
+
31337: import.meta.env.VITE_EVENT_ACTION_BASE,
|
|
382
|
+
};
|
|
379
383
|
/**
|
|
380
384
|
* @inheritdoc
|
|
381
385
|
*
|
|
@@ -52,7 +52,7 @@ describe('AllowList', () => {
|
|
|
52
52
|
).toBeInstanceOf(SimpleAllowList);
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
test('can automatically instantiate
|
|
55
|
+
test('can automatically instantiate SimpleDenyList given an address', async () => {
|
|
56
56
|
const _allowList = await loadFixture(freshDenyList(fixtures));
|
|
57
57
|
expect(
|
|
58
58
|
await allowListFromAddress(
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
zeroAddress,
|
|
17
17
|
zeroHash,
|
|
18
18
|
} from 'viem';
|
|
19
|
+
import { SimpleAllowList as SimpleAllowListBases } from '../../dist/deployments.json';
|
|
19
20
|
import type {
|
|
20
21
|
DeployableOptions,
|
|
21
22
|
GenericDeployableParams,
|
|
@@ -92,10 +93,12 @@ export class SimpleAllowList extends DeployableTarget<
|
|
|
92
93
|
*
|
|
93
94
|
* @public
|
|
94
95
|
* @static
|
|
95
|
-
* @type {Address}
|
|
96
|
+
* @type {Record<number, Address>}
|
|
96
97
|
*/
|
|
97
|
-
public static override
|
|
98
|
-
|
|
98
|
+
public static override bases: Record<number, Address> = {
|
|
99
|
+
...(SimpleAllowListBases as Record<number, Address>),
|
|
100
|
+
31337: import.meta.env.VITE_SIMPLE_ALLOWLIST_BASE,
|
|
101
|
+
};
|
|
99
102
|
/**
|
|
100
103
|
* @inheritdoc
|
|
101
104
|
*
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
zeroAddress,
|
|
15
15
|
zeroHash,
|
|
16
16
|
} from 'viem';
|
|
17
|
+
import { SimpleDenyList as SimpleDenyListBases } from '../../dist/deployments.json';
|
|
17
18
|
import type {
|
|
18
19
|
DeployableOptions,
|
|
19
20
|
GenericDeployableParams,
|
|
@@ -83,10 +84,12 @@ export class SimpleDenyList<
|
|
|
83
84
|
*
|
|
84
85
|
* @public
|
|
85
86
|
* @static
|
|
86
|
-
* @type {Address}
|
|
87
|
+
* @type {Record<number, Address>}
|
|
87
88
|
*/
|
|
88
|
-
public static override
|
|
89
|
-
|
|
89
|
+
public static override bases: Record<number, Address> = {
|
|
90
|
+
...(SimpleDenyListBases as Record<number, Address>),
|
|
91
|
+
31337: import.meta.env.VITE_SIMPLE_DENYLIST_BASE,
|
|
92
|
+
};
|
|
90
93
|
/**
|
|
91
94
|
* @inheritdoc
|
|
92
95
|
*
|
package/src/BoostCore.test.ts
CHANGED
|
@@ -29,13 +29,9 @@ describe('BoostCore', () => {
|
|
|
29
29
|
|
|
30
30
|
test('can get the total number of boosts', async () => {
|
|
31
31
|
const { core } = fixtures;
|
|
32
|
-
const client = new BoostCore({
|
|
33
|
-
...defaultOptions,
|
|
34
|
-
address: core.assertValidAddress(),
|
|
35
|
-
});
|
|
36
32
|
|
|
37
33
|
const { budget, erc20 } = budgets;
|
|
38
|
-
await
|
|
34
|
+
await core.createBoost({
|
|
39
35
|
protocolFee: 1n,
|
|
40
36
|
referralFee: 2n,
|
|
41
37
|
maxParticipants: 100n,
|
|
@@ -63,17 +59,13 @@ describe('BoostCore', () => {
|
|
|
63
59
|
}),
|
|
64
60
|
],
|
|
65
61
|
});
|
|
66
|
-
expect(await
|
|
62
|
+
expect(await core.getBoostCount()).toBe(1n);
|
|
67
63
|
});
|
|
68
64
|
|
|
69
65
|
test('can successfully create a boost using all base contract implementations', async () => {
|
|
70
66
|
const { core } = fixtures;
|
|
71
|
-
const client = new BoostCore({
|
|
72
|
-
...defaultOptions,
|
|
73
|
-
address: core.assertValidAddress(),
|
|
74
|
-
});
|
|
75
67
|
const { budget, erc20 } = budgets;
|
|
76
|
-
const boost = await
|
|
68
|
+
const boost = await core.createBoost({
|
|
77
69
|
protocolFee: 1n,
|
|
78
70
|
referralFee: 2n,
|
|
79
71
|
maxParticipants: 100n,
|
|
@@ -101,7 +93,7 @@ describe('BoostCore', () => {
|
|
|
101
93
|
}),
|
|
102
94
|
],
|
|
103
95
|
});
|
|
104
|
-
const onChainBoost = await
|
|
96
|
+
const onChainBoost = await core.readBoost(boost.id);
|
|
105
97
|
|
|
106
98
|
expect(boost.owner).toBe(onChainBoost.owner);
|
|
107
99
|
expect(boost.protocolFee).toBe(onChainBoost.protocolFee);
|
|
@@ -155,12 +147,8 @@ describe('BoostCore', () => {
|
|
|
155
147
|
|
|
156
148
|
test('can read the raw on chain representation of a boost', async () => {
|
|
157
149
|
const { core } = fixtures;
|
|
158
|
-
const client = new BoostCore({
|
|
159
|
-
...defaultOptions,
|
|
160
|
-
address: core.assertValidAddress(),
|
|
161
|
-
});
|
|
162
150
|
const { budget, erc20 } = budgets;
|
|
163
|
-
const _boost = await
|
|
151
|
+
const _boost = await core.createBoost({
|
|
164
152
|
protocolFee: 1n,
|
|
165
153
|
referralFee: 2n,
|
|
166
154
|
maxParticipants: 100n,
|
|
@@ -188,7 +176,7 @@ describe('BoostCore', () => {
|
|
|
188
176
|
}),
|
|
189
177
|
],
|
|
190
178
|
});
|
|
191
|
-
const boost = await
|
|
179
|
+
const boost = await core.readBoost(_boost.id);
|
|
192
180
|
expect(boost.protocolFee).toBe(1001n);
|
|
193
181
|
expect(boost.referralFee).toBe(1002n);
|
|
194
182
|
expect(boost.maxParticipants).toBe(100n);
|
|
@@ -203,10 +191,6 @@ describe('BoostCore', () => {
|
|
|
203
191
|
|
|
204
192
|
test('can reuse an existing action', async () => {
|
|
205
193
|
const { core } = fixtures;
|
|
206
|
-
const client = new BoostCore({
|
|
207
|
-
...defaultOptions,
|
|
208
|
-
address: core.assertValidAddress(),
|
|
209
|
-
});
|
|
210
194
|
const { budget, erc20 } = budgets;
|
|
211
195
|
|
|
212
196
|
// allocate more funds to the budget
|
|
@@ -218,7 +202,7 @@ describe('BoostCore', () => {
|
|
|
218
202
|
target: defaultOptions.account.address,
|
|
219
203
|
});
|
|
220
204
|
|
|
221
|
-
const _boost = await
|
|
205
|
+
const _boost = await core.createBoost({
|
|
222
206
|
budget: budget,
|
|
223
207
|
action: core.EventAction(
|
|
224
208
|
makeMockEventActionPayload(
|
|
@@ -243,7 +227,7 @@ describe('BoostCore', () => {
|
|
|
243
227
|
}),
|
|
244
228
|
],
|
|
245
229
|
});
|
|
246
|
-
const boost = await
|
|
230
|
+
const boost = await core.createBoost({
|
|
247
231
|
budget: budget,
|
|
248
232
|
action: core.EventAction(_boost.action.assertValidAddress(), false),
|
|
249
233
|
validator: core.SignerValidator({
|
|
@@ -263,16 +247,12 @@ describe('BoostCore', () => {
|
|
|
263
247
|
}),
|
|
264
248
|
],
|
|
265
249
|
});
|
|
266
|
-
const onChainBoost = await
|
|
250
|
+
const onChainBoost = await core.readBoost(boost.id);
|
|
267
251
|
expect(onChainBoost.action).toBe(_boost.action.assertValidAddress());
|
|
268
252
|
});
|
|
269
253
|
|
|
270
254
|
test('can reuse an existing validator', async () => {
|
|
271
255
|
const { core } = fixtures;
|
|
272
|
-
const client = new BoostCore({
|
|
273
|
-
...defaultOptions,
|
|
274
|
-
address: core.assertValidAddress(),
|
|
275
|
-
});
|
|
276
256
|
const { budget, erc20 } = budgets;
|
|
277
257
|
|
|
278
258
|
// allocate more erc20 funds to the budget from the owning accound
|
|
@@ -284,7 +264,7 @@ describe('BoostCore', () => {
|
|
|
284
264
|
target: defaultOptions.account.address,
|
|
285
265
|
});
|
|
286
266
|
|
|
287
|
-
const _boost = await
|
|
267
|
+
const _boost = await core.createBoost({
|
|
288
268
|
budget: budget,
|
|
289
269
|
action: core.EventAction(
|
|
290
270
|
makeMockEventActionPayload(
|
|
@@ -309,7 +289,7 @@ describe('BoostCore', () => {
|
|
|
309
289
|
}),
|
|
310
290
|
],
|
|
311
291
|
});
|
|
312
|
-
const boost = await
|
|
292
|
+
const boost = await core.createBoost({
|
|
313
293
|
budget: budget,
|
|
314
294
|
action: core.EventAction(
|
|
315
295
|
makeMockEventActionPayload(
|
|
@@ -334,16 +314,12 @@ describe('BoostCore', () => {
|
|
|
334
314
|
}),
|
|
335
315
|
],
|
|
336
316
|
});
|
|
337
|
-
const onChainBoost = await
|
|
317
|
+
const onChainBoost = await core.readBoost(boost.id);
|
|
338
318
|
expect(onChainBoost.validator).toBe(_boost.validator.assertValidAddress());
|
|
339
319
|
});
|
|
340
320
|
|
|
341
321
|
test('can reuse an existing allowlist', async () => {
|
|
342
322
|
const { core } = fixtures;
|
|
343
|
-
const client = new BoostCore({
|
|
344
|
-
...defaultOptions,
|
|
345
|
-
address: core.assertValidAddress(),
|
|
346
|
-
});
|
|
347
323
|
const { budget, erc20 } = budgets;
|
|
348
324
|
|
|
349
325
|
// allocate more erc20 funds to the budget from the owning accound
|
|
@@ -355,7 +331,7 @@ describe('BoostCore', () => {
|
|
|
355
331
|
target: defaultOptions.account.address,
|
|
356
332
|
});
|
|
357
333
|
|
|
358
|
-
const _boost = await
|
|
334
|
+
const _boost = await core.createBoost({
|
|
359
335
|
budget: budget,
|
|
360
336
|
action: core.EventAction(
|
|
361
337
|
makeMockEventActionPayload(
|
|
@@ -380,7 +356,7 @@ describe('BoostCore', () => {
|
|
|
380
356
|
}),
|
|
381
357
|
],
|
|
382
358
|
});
|
|
383
|
-
const boost = await
|
|
359
|
+
const boost = await core.createBoost({
|
|
384
360
|
budget: budget,
|
|
385
361
|
action: core.EventAction(
|
|
386
362
|
makeMockEventActionPayload(
|
|
@@ -405,16 +381,12 @@ describe('BoostCore', () => {
|
|
|
405
381
|
}),
|
|
406
382
|
],
|
|
407
383
|
});
|
|
408
|
-
const onChainBoost = await
|
|
384
|
+
const onChainBoost = await core.readBoost(boost.id);
|
|
409
385
|
expect(onChainBoost.allowList).toBe(_boost.allowList.assertValidAddress());
|
|
410
386
|
});
|
|
411
387
|
|
|
412
388
|
test('cannot reuse an existing incentive', async () => {
|
|
413
389
|
const { core } = fixtures;
|
|
414
|
-
const client = new BoostCore({
|
|
415
|
-
...defaultOptions,
|
|
416
|
-
address: core.assertValidAddress(),
|
|
417
|
-
});
|
|
418
390
|
const { budget, erc20 } = budgets;
|
|
419
391
|
|
|
420
392
|
// allocate more erc20 funds to the budget from the owning accound
|
|
@@ -432,7 +404,7 @@ describe('BoostCore', () => {
|
|
|
432
404
|
limit: 100n,
|
|
433
405
|
strategy: StrategyType.POOL,
|
|
434
406
|
});
|
|
435
|
-
const _boost = await
|
|
407
|
+
const _boost = await core.createBoost({
|
|
436
408
|
budget: budget,
|
|
437
409
|
action: core.EventAction(
|
|
438
410
|
makeMockEventActionPayload(
|
|
@@ -451,7 +423,7 @@ describe('BoostCore', () => {
|
|
|
451
423
|
incentives: [incentive],
|
|
452
424
|
});
|
|
453
425
|
try {
|
|
454
|
-
await
|
|
426
|
+
await core.createBoost({
|
|
455
427
|
budget: budget,
|
|
456
428
|
action: core.EventAction(
|
|
457
429
|
makeMockEventActionPayload(
|
|
@@ -476,10 +448,6 @@ describe('BoostCore', () => {
|
|
|
476
448
|
|
|
477
449
|
test('can offer multiple incentives', async () => {
|
|
478
450
|
const { registry, core } = fixtures;
|
|
479
|
-
const client = new BoostCore({
|
|
480
|
-
...defaultOptions,
|
|
481
|
-
address: core.assertValidAddress(),
|
|
482
|
-
});
|
|
483
451
|
const { budget, erc20, points, erc1155 } = budgets;
|
|
484
452
|
const allowList = await registry.initialize(
|
|
485
453
|
'SharedAllowList',
|
|
@@ -520,7 +488,7 @@ describe('BoostCore', () => {
|
|
|
520
488
|
limit: 10n,
|
|
521
489
|
});
|
|
522
490
|
|
|
523
|
-
await
|
|
491
|
+
await core.createBoost({
|
|
524
492
|
protocolFee: 1n,
|
|
525
493
|
referralFee: 2n,
|
|
526
494
|
maxParticipants: 100n,
|
|
@@ -562,58 +530,38 @@ describe('BoostCore', () => {
|
|
|
562
530
|
|
|
563
531
|
test('can get the protocol fee', async () => {
|
|
564
532
|
const { core } = fixtures;
|
|
565
|
-
const client = new BoostCore({
|
|
566
|
-
...defaultOptions,
|
|
567
|
-
address: core.assertValidAddress(),
|
|
568
|
-
});
|
|
569
533
|
|
|
570
|
-
expect(await
|
|
534
|
+
expect(await core.protocolFee()).toBe(1000n);
|
|
571
535
|
});
|
|
572
536
|
|
|
573
537
|
test('can get the protocol fee receiver', async () => {
|
|
574
538
|
const { core } = fixtures;
|
|
575
|
-
const client = new BoostCore({
|
|
576
|
-
...defaultOptions,
|
|
577
|
-
address: core.assertValidAddress(),
|
|
578
|
-
});
|
|
579
539
|
|
|
580
|
-
expect(await
|
|
540
|
+
expect(await core.protocolFeeReceiver()).toBe(
|
|
581
541
|
defaultOptions.account.address,
|
|
582
542
|
);
|
|
583
543
|
});
|
|
584
544
|
|
|
585
545
|
test('can set the protocol fee receiver', async () => {
|
|
586
546
|
const { core } = fixtures;
|
|
587
|
-
const client = new BoostCore({
|
|
588
|
-
...defaultOptions,
|
|
589
|
-
address: core.assertValidAddress(),
|
|
590
|
-
});
|
|
591
547
|
|
|
592
|
-
await
|
|
548
|
+
await core.setProcolFeeReceiver(zeroAddress);
|
|
593
549
|
|
|
594
|
-
expect(await
|
|
550
|
+
expect(await core.protocolFeeReceiver()).toBe(zeroAddress);
|
|
595
551
|
});
|
|
596
552
|
|
|
597
553
|
test('can get the claim fee', async () => {
|
|
598
554
|
const { core } = fixtures;
|
|
599
|
-
const client = new BoostCore({
|
|
600
|
-
...defaultOptions,
|
|
601
|
-
address: core.assertValidAddress(),
|
|
602
|
-
});
|
|
603
555
|
|
|
604
|
-
expect(await
|
|
556
|
+
expect(await core.claimFee()).toBe(75000000000000n);
|
|
605
557
|
});
|
|
606
558
|
|
|
607
559
|
test('can set the claim fee', async () => {
|
|
608
560
|
const { core } = fixtures;
|
|
609
|
-
const client = new BoostCore({
|
|
610
|
-
...defaultOptions,
|
|
611
|
-
address: core.assertValidAddress(),
|
|
612
|
-
});
|
|
613
561
|
|
|
614
|
-
await
|
|
562
|
+
await core.setClaimFee(100n);
|
|
615
563
|
|
|
616
|
-
expect(await
|
|
564
|
+
expect(await core.claimFee()).toBe(100n);
|
|
617
565
|
});
|
|
618
566
|
|
|
619
567
|
test('binds all actions, budgets, allowlists, incentives, and validators to reuse core options and account', () => {
|
|
@@ -713,13 +661,9 @@ describe('BoostCore', () => {
|
|
|
713
661
|
const subscription = vi.fn();
|
|
714
662
|
|
|
715
663
|
const { core } = fixtures;
|
|
716
|
-
|
|
717
|
-
...defaultOptions,
|
|
718
|
-
address: core.assertValidAddress(),
|
|
719
|
-
});
|
|
720
|
-
client.subscribe(subscription, { pollingInterval: 100 });
|
|
664
|
+
core.subscribe(subscription, { pollingInterval: 100 });
|
|
721
665
|
const { budget, erc20 } = budgets;
|
|
722
|
-
await
|
|
666
|
+
await core.createBoost({
|
|
723
667
|
protocolFee: 1n,
|
|
724
668
|
referralFee: 2n,
|
|
725
669
|
maxParticipants: 100n,
|
|
@@ -757,17 +701,13 @@ describe('BoostCore', () => {
|
|
|
757
701
|
|
|
758
702
|
test('can set a passthrough auth scheme', async () => {
|
|
759
703
|
const { core } = fixtures;
|
|
760
|
-
const client = new BoostCore({
|
|
761
|
-
...defaultOptions,
|
|
762
|
-
address: core.assertValidAddress(),
|
|
763
|
-
});
|
|
764
704
|
|
|
765
|
-
const auth =
|
|
705
|
+
const auth = core.PassthroughAuth();
|
|
766
706
|
await auth.deploy();
|
|
767
|
-
await
|
|
768
|
-
expect((await
|
|
707
|
+
await core.setCreateBoostAuth(auth);
|
|
708
|
+
expect((await core.createBoostAuth()).toLowerCase()).toBe(
|
|
769
709
|
auth.assertValidAddress(),
|
|
770
710
|
);
|
|
771
|
-
expect(await
|
|
711
|
+
expect(await core.isAuthorized(zeroAddress)).toBe(true);
|
|
772
712
|
});
|
|
773
713
|
});
|