@boostxyz/sdk 0.0.0-alpha.20 → 0.0.0-alpha.21
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 +3 -3
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +3 -3
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +3 -3
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.js +13 -13
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +3 -3
- 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 +5 -24
- package/dist/Boost.d.ts.map +1 -1
- package/dist/Boost.js +42 -44
- package/dist/Boost.js.map +1 -1
- package/dist/BoostCore-DolmDuXW.cjs +3 -0
- package/dist/BoostCore-DolmDuXW.cjs.map +1 -0
- package/dist/BoostCore-Z97KVu4V.js +1448 -0
- package/dist/BoostCore-Z97KVu4V.js.map +1 -0
- package/dist/BoostCore.cjs +1 -1
- package/dist/BoostCore.d.ts +633 -47
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +6 -6
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.cjs.map +1 -1
- package/dist/BoostRegistry.d.ts +31 -3
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +68 -48
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +2 -2
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +34 -4
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +45 -45
- package/dist/Budgets/VestingBudget.d.ts +34 -4
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.js +17 -17
- package/dist/EventAction-CBKzuNoN.cjs +2 -0
- package/dist/EventAction-CBKzuNoN.cjs.map +1 -0
- package/dist/{EventAction-CIPqmAoP.js → EventAction-DWuuc_Qy.js} +295 -217
- package/dist/EventAction-DWuuc_Qy.js.map +1 -0
- package/dist/Incentive-BxzEtN26.js +298 -0
- package/dist/Incentive-BxzEtN26.js.map +1 -0
- package/dist/Incentive-CrF3-ayL.cjs +2 -0
- package/dist/Incentive-CrF3-ayL.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.d.ts +16 -2
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +13 -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 +197 -4
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +31 -31
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC1155Incentive.d.ts +192 -5
- 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 +197 -4
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +17 -17
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +189 -2
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +197 -4
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.d.ts +1 -1
- package/dist/Incentives/Incentive.js +3 -3
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.d.ts +16 -2
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +8 -8
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/{SimpleDenyList-BwfNjRsg.cjs → SimpleDenyList-BUR17Tt1.cjs} +2 -2
- package/dist/{SimpleDenyList-BwfNjRsg.cjs.map → SimpleDenyList-BUR17Tt1.cjs.map} +1 -1
- package/dist/{SimpleDenyList-Cn5WpNn0.js → SimpleDenyList-CGaWjuld.js} +15 -15
- package/dist/{SimpleDenyList-Cn5WpNn0.js.map → SimpleDenyList-CGaWjuld.js.map} +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.js +3 -3
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +6 -6
- 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 +16 -13
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +18 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +16 -4
- package/dist/errors.js.map +1 -1
- package/dist/{generated-B7VaSah4.js → generated-CKt2yCQd.js} +1071 -447
- 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.js +79 -78
- package/package.json +4 -4
- package/src/Actions/EventAction.ts +24 -20
- package/src/Boost.ts +5 -27
- package/src/BoostCore.test.ts +113 -46
- package/src/BoostCore.ts +162 -171
- package/src/BoostRegistry.test.ts +53 -0
- package/src/BoostRegistry.ts +48 -3
- package/src/Budgets/ManagedBudget.test.ts +7 -7
- package/src/Incentives/CGDAIncentive.test.ts +4 -1
- package/src/Incentives/CGDAIncentive.ts +6 -0
- package/src/Incentives/ERC20Incentive.test.ts +3 -0
- package/src/Incentives/ERC20Incentive.ts +6 -0
- package/src/Incentives/ERC20VariableIncentive.test.ts +3 -0
- package/src/Incentives/ERC20VariableIncentive.ts +6 -0
- package/src/Incentives/Incentive.test.ts +3 -0
- package/src/Incentives/Incentive.ts +1 -1
- package/src/Incentives/PointsIncentive.test.ts +1 -2
- package/src/errors.ts +22 -0
- package/dist/BoostCore-3-U1xTQN.cjs +0 -3
- package/dist/BoostCore-3-U1xTQN.cjs.map +0 -1
- package/dist/BoostCore-DVGBUr2y.js +0 -1477
- package/dist/BoostCore-DVGBUr2y.js.map +0 -1
- package/dist/EventAction-CIPqmAoP.js.map +0 -1
- package/dist/EventAction-d-oeqZQs.cjs +0 -2
- package/dist/EventAction-d-oeqZQs.cjs.map +0 -1
- package/dist/Incentive-Bp8Sez7M.js +0 -298
- package/dist/Incentive-Bp8Sez7M.js.map +0 -1
- package/dist/Incentive-Djnzseoj.cjs +0 -2
- package/dist/Incentive-Djnzseoj.cjs.map +0 -1
- package/dist/componentInterfaces-D09mhzxO.cjs +0 -2
- package/dist/componentInterfaces-D09mhzxO.cjs.map +0 -1
- package/dist/componentInterfaces-RXBMI5yH.js +0 -14
- package/dist/componentInterfaces-RXBMI5yH.js.map +0 -1
- package/dist/deployments-BM42vImE.js +0 -43
- package/dist/deployments-BM42vImE.js.map +0 -1
- package/dist/deployments-CMdF5uEC.cjs +0 -2
- package/dist/deployments-CMdF5uEC.cjs.map +0 -1
- package/dist/generated-B0tk-c9b.cjs +0 -3
- package/dist/generated-B0tk-c9b.cjs.map +0 -1
- package/dist/generated-B7VaSah4.js.map +0 -1
package/src/BoostCore.test.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { pad, parseEther, zeroAddress } from 'viem';
|
|
3
|
-
import { beforeAll, beforeEach, describe, expect, test, vi } from 'vitest';
|
|
1
|
+
import { accounts } from '@boostxyz/test/accounts';
|
|
4
2
|
import {
|
|
5
3
|
type BudgetFixtures,
|
|
6
4
|
type Fixtures,
|
|
@@ -10,13 +8,15 @@ import {
|
|
|
10
8
|
fundBudget,
|
|
11
9
|
makeMockEventActionPayload,
|
|
12
10
|
} from '@boostxyz/test/helpers';
|
|
11
|
+
import { loadFixture } from '@nomicfoundation/hardhat-toolbox-viem/network-helpers';
|
|
12
|
+
import { pad, parseEther, zeroAddress } from 'viem';
|
|
13
|
+
import { beforeAll, beforeEach, describe, expect, test, vi } from 'vitest';
|
|
13
14
|
import { ContractAction } from './Actions/ContractAction';
|
|
15
|
+
import { BOOST_CORE_CLAIM_FEE } from './BoostCore';
|
|
14
16
|
import type { ERC20Incentive } from './Incentives/ERC20Incentive';
|
|
15
17
|
import { StrategyType } from './claiming';
|
|
16
|
-
import { IncentiveNotCloneableError } from './errors';
|
|
18
|
+
import { BoostNotFoundError, IncentiveNotCloneableError } from './errors';
|
|
17
19
|
import { bytes4 } from './utils';
|
|
18
|
-
import { BOOST_CORE_CLAIM_FEE } from './BoostCore';
|
|
19
|
-
import { accounts } from '@boostxyz/test/accounts';
|
|
20
20
|
|
|
21
21
|
let fixtures: Fixtures, budgets: BudgetFixtures;
|
|
22
22
|
|
|
@@ -33,8 +33,7 @@ describe('BoostCore', () => {
|
|
|
33
33
|
|
|
34
34
|
const { budget, erc20 } = budgets;
|
|
35
35
|
await core.createBoost({
|
|
36
|
-
protocolFee:
|
|
37
|
-
referralFee: 2n,
|
|
36
|
+
protocolFee: 0n,
|
|
38
37
|
maxParticipants: 100n,
|
|
39
38
|
budget: budget,
|
|
40
39
|
action: core.EventAction(
|
|
@@ -57,18 +56,28 @@ describe('BoostCore', () => {
|
|
|
57
56
|
reward: parseEther('1'),
|
|
58
57
|
limit: 100n,
|
|
59
58
|
strategy: StrategyType.POOL,
|
|
59
|
+
manager: budget.assertValidAddress(),
|
|
60
60
|
}),
|
|
61
61
|
],
|
|
62
62
|
});
|
|
63
63
|
expect(await core.getBoostCount()).toBe(1n);
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
+
test('throws a typed error if no boost exists', async () => {
|
|
67
|
+
const { core } = fixtures;
|
|
68
|
+
try {
|
|
69
|
+
await core.getBoost(1000n)
|
|
70
|
+
} catch(e) {
|
|
71
|
+
expect(e instanceof BoostNotFoundError).toBe(true)
|
|
72
|
+
expect(e.id).toBe('1000')
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
|
|
66
76
|
test('can successfully create a boost using all base contract implementations', async () => {
|
|
67
77
|
const { core } = fixtures;
|
|
68
78
|
const { budget, erc20 } = budgets;
|
|
69
79
|
const boost = await core.createBoost({
|
|
70
80
|
protocolFee: 1n,
|
|
71
|
-
referralFee: 2n,
|
|
72
81
|
maxParticipants: 100n,
|
|
73
82
|
budget: budget,
|
|
74
83
|
action: core.EventAction(
|
|
@@ -91,6 +100,7 @@ describe('BoostCore', () => {
|
|
|
91
100
|
reward: parseEther('1'),
|
|
92
101
|
limit: 100n,
|
|
93
102
|
strategy: StrategyType.POOL,
|
|
103
|
+
manager: budget.assertValidAddress(),
|
|
94
104
|
}),
|
|
95
105
|
],
|
|
96
106
|
});
|
|
@@ -98,7 +108,6 @@ describe('BoostCore', () => {
|
|
|
98
108
|
|
|
99
109
|
expect(boost.owner).toBe(onChainBoost.owner);
|
|
100
110
|
expect(boost.protocolFee).toBe(onChainBoost.protocolFee);
|
|
101
|
-
expect(boost.referralFee).toBe(onChainBoost.referralFee);
|
|
102
111
|
expect(boost.maxParticipants).toBe(onChainBoost.maxParticipants);
|
|
103
112
|
|
|
104
113
|
expect(boost.action.address).toBe(onChainBoost.action);
|
|
@@ -151,7 +160,6 @@ describe('BoostCore', () => {
|
|
|
151
160
|
const { budget, erc20 } = budgets;
|
|
152
161
|
const _boost = await core.createBoost({
|
|
153
162
|
protocolFee: 1n,
|
|
154
|
-
referralFee: 2n,
|
|
155
163
|
maxParticipants: 100n,
|
|
156
164
|
budget: budget,
|
|
157
165
|
action: core.EventAction(
|
|
@@ -174,12 +182,12 @@ describe('BoostCore', () => {
|
|
|
174
182
|
reward: parseEther('1'),
|
|
175
183
|
limit: 100n,
|
|
176
184
|
strategy: StrategyType.POOL,
|
|
185
|
+
manager: budget.assertValidAddress(),
|
|
177
186
|
}),
|
|
178
187
|
],
|
|
179
188
|
});
|
|
180
189
|
const boost = await core.readBoost(_boost.id);
|
|
181
190
|
expect(boost.protocolFee).toBe(1001n);
|
|
182
|
-
expect(boost.referralFee).toBe(1002n);
|
|
183
191
|
expect(boost.maxParticipants).toBe(100n);
|
|
184
192
|
expect(boost.budget).toBe(_boost.budget.assertValidAddress());
|
|
185
193
|
expect(boost.action).toBe(_boost.action.assertValidAddress());
|
|
@@ -190,15 +198,76 @@ describe('BoostCore', () => {
|
|
|
190
198
|
);
|
|
191
199
|
});
|
|
192
200
|
|
|
201
|
+
test('can optionally supply a validator', async () => {
|
|
202
|
+
const { core } = fixtures;
|
|
203
|
+
const { budget, erc20 } = budgets;
|
|
204
|
+
const _boost = await core.createBoost({
|
|
205
|
+
protocolFee: 1n,
|
|
206
|
+
maxParticipants: 100n,
|
|
207
|
+
budget: budget,
|
|
208
|
+
action: core.EventAction(
|
|
209
|
+
makeMockEventActionPayload(
|
|
210
|
+
core.assertValidAddress(),
|
|
211
|
+
erc20.assertValidAddress(),
|
|
212
|
+
),
|
|
213
|
+
),
|
|
214
|
+
allowList: core.SimpleAllowList({
|
|
215
|
+
owner: defaultOptions.account.address,
|
|
216
|
+
allowed: [defaultOptions.account.address],
|
|
217
|
+
}),
|
|
218
|
+
incentives: [
|
|
219
|
+
core.ERC20Incentive({
|
|
220
|
+
asset: erc20.assertValidAddress(),
|
|
221
|
+
reward: parseEther('1'),
|
|
222
|
+
limit: 100n,
|
|
223
|
+
strategy: StrategyType.POOL,
|
|
224
|
+
manager: budget.assertValidAddress(),
|
|
225
|
+
}),
|
|
226
|
+
],
|
|
227
|
+
});
|
|
228
|
+
const boost = await core.readBoost(_boost.id);
|
|
229
|
+
expect(boost.validator).toBe(_boost.validator.assertValidAddress());
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
test('can simulate a boost creation', async () => {
|
|
233
|
+
const { core } = fixtures;
|
|
234
|
+
const { budget, erc20 } = budgets;
|
|
235
|
+
const simulated = await core.simulateCreateBoost({
|
|
236
|
+
protocolFee: 1n,
|
|
237
|
+
maxParticipants: 100n,
|
|
238
|
+
budget: budget,
|
|
239
|
+
action: core.EventAction(
|
|
240
|
+
makeMockEventActionPayload(
|
|
241
|
+
core.assertValidAddress(),
|
|
242
|
+
erc20.assertValidAddress(),
|
|
243
|
+
),
|
|
244
|
+
),
|
|
245
|
+
allowList: core.SimpleAllowList({
|
|
246
|
+
owner: defaultOptions.account.address,
|
|
247
|
+
allowed: [defaultOptions.account.address],
|
|
248
|
+
}),
|
|
249
|
+
incentives: [
|
|
250
|
+
core.ERC20Incentive({
|
|
251
|
+
asset: erc20.assertValidAddress(),
|
|
252
|
+
reward: parseEther('1'),
|
|
253
|
+
limit: 100n,
|
|
254
|
+
strategy: StrategyType.POOL,
|
|
255
|
+
manager: budget.assertValidAddress(),
|
|
256
|
+
}),
|
|
257
|
+
],
|
|
258
|
+
});
|
|
259
|
+
expect(simulated.request.__mode).toBe('prepared')
|
|
260
|
+
});
|
|
261
|
+
|
|
193
262
|
test('can reuse an existing action', async () => {
|
|
194
263
|
const { core } = fixtures;
|
|
195
264
|
const { budget, erc20 } = budgets;
|
|
196
265
|
|
|
197
266
|
// allocate more funds to the budget
|
|
198
|
-
await erc20.mint(defaultOptions.account.address, parseEther('
|
|
199
|
-
await erc20.approve(budget.assertValidAddress(), parseEther('
|
|
267
|
+
await erc20.mint(defaultOptions.account.address, parseEther('110'));
|
|
268
|
+
await erc20.approve(budget.assertValidAddress(), parseEther('110'));
|
|
200
269
|
await budget.allocate({
|
|
201
|
-
amount: parseEther('
|
|
270
|
+
amount: parseEther('110'),
|
|
202
271
|
asset: erc20.assertValidAddress(),
|
|
203
272
|
target: defaultOptions.account.address,
|
|
204
273
|
});
|
|
@@ -225,6 +294,7 @@ describe('BoostCore', () => {
|
|
|
225
294
|
reward: parseEther('1'),
|
|
226
295
|
limit: 100n,
|
|
227
296
|
strategy: StrategyType.POOL,
|
|
297
|
+
manager: budget.assertValidAddress(),
|
|
228
298
|
}),
|
|
229
299
|
],
|
|
230
300
|
});
|
|
@@ -245,6 +315,7 @@ describe('BoostCore', () => {
|
|
|
245
315
|
reward: parseEther('1'),
|
|
246
316
|
limit: 100n,
|
|
247
317
|
strategy: StrategyType.POOL,
|
|
318
|
+
manager: budget.assertValidAddress(),
|
|
248
319
|
}),
|
|
249
320
|
],
|
|
250
321
|
});
|
|
@@ -257,10 +328,10 @@ describe('BoostCore', () => {
|
|
|
257
328
|
const { budget, erc20 } = budgets;
|
|
258
329
|
|
|
259
330
|
// allocate more erc20 funds to the budget from the owning accound
|
|
260
|
-
await erc20.mint(defaultOptions.account.address, parseEther('
|
|
261
|
-
await erc20.approve(budget.assertValidAddress(), parseEther('
|
|
331
|
+
await erc20.mint(defaultOptions.account.address, parseEther('110'));
|
|
332
|
+
await erc20.approve(budget.assertValidAddress(), parseEther('110'));
|
|
262
333
|
await budget.allocate({
|
|
263
|
-
amount: parseEther('
|
|
334
|
+
amount: parseEther('110'),
|
|
264
335
|
asset: erc20.assertValidAddress(),
|
|
265
336
|
target: defaultOptions.account.address,
|
|
266
337
|
});
|
|
@@ -287,6 +358,7 @@ describe('BoostCore', () => {
|
|
|
287
358
|
reward: parseEther('1'),
|
|
288
359
|
limit: 100n,
|
|
289
360
|
strategy: StrategyType.POOL,
|
|
361
|
+
manager: budget.assertValidAddress(),
|
|
290
362
|
}),
|
|
291
363
|
],
|
|
292
364
|
});
|
|
@@ -312,6 +384,7 @@ describe('BoostCore', () => {
|
|
|
312
384
|
reward: parseEther('1'),
|
|
313
385
|
limit: 100n,
|
|
314
386
|
strategy: StrategyType.POOL,
|
|
387
|
+
manager: budget.assertValidAddress(),
|
|
315
388
|
}),
|
|
316
389
|
],
|
|
317
390
|
});
|
|
@@ -324,10 +397,10 @@ describe('BoostCore', () => {
|
|
|
324
397
|
const { budget, erc20 } = budgets;
|
|
325
398
|
|
|
326
399
|
// allocate more erc20 funds to the budget from the owning accound
|
|
327
|
-
await erc20.mint(defaultOptions.account.address, parseEther('
|
|
328
|
-
await erc20.approve(budget.assertValidAddress(), parseEther('
|
|
400
|
+
await erc20.mint(defaultOptions.account.address, parseEther('110'));
|
|
401
|
+
await erc20.approve(budget.assertValidAddress(), parseEther('110'));
|
|
329
402
|
await budget.allocate({
|
|
330
|
-
amount: parseEther('
|
|
403
|
+
amount: parseEther('110'),
|
|
331
404
|
asset: erc20.assertValidAddress(),
|
|
332
405
|
target: defaultOptions.account.address,
|
|
333
406
|
});
|
|
@@ -354,6 +427,7 @@ describe('BoostCore', () => {
|
|
|
354
427
|
reward: parseEther('1'),
|
|
355
428
|
limit: 100n,
|
|
356
429
|
strategy: StrategyType.POOL,
|
|
430
|
+
manager: budget.assertValidAddress(),
|
|
357
431
|
}),
|
|
358
432
|
],
|
|
359
433
|
});
|
|
@@ -379,6 +453,7 @@ describe('BoostCore', () => {
|
|
|
379
453
|
reward: parseEther('1'),
|
|
380
454
|
limit: 100n,
|
|
381
455
|
strategy: StrategyType.POOL,
|
|
456
|
+
manager: budget.assertValidAddress(),
|
|
382
457
|
}),
|
|
383
458
|
],
|
|
384
459
|
});
|
|
@@ -391,10 +466,10 @@ describe('BoostCore', () => {
|
|
|
391
466
|
const { budget, erc20 } = budgets;
|
|
392
467
|
|
|
393
468
|
// allocate more erc20 funds to the budget from the owning accound
|
|
394
|
-
await erc20.mint(defaultOptions.account.address, parseEther('
|
|
395
|
-
await erc20.approve(budget.assertValidAddress(), parseEther('
|
|
469
|
+
await erc20.mint(defaultOptions.account.address, parseEther('110'));
|
|
470
|
+
await erc20.approve(budget.assertValidAddress(), parseEther('110'));
|
|
396
471
|
await budget.allocate({
|
|
397
|
-
amount: parseEther('
|
|
472
|
+
amount: parseEther('110'),
|
|
398
473
|
asset: erc20.assertValidAddress(),
|
|
399
474
|
target: defaultOptions.account.address,
|
|
400
475
|
});
|
|
@@ -404,6 +479,7 @@ describe('BoostCore', () => {
|
|
|
404
479
|
reward: parseEther('1'),
|
|
405
480
|
limit: 100n,
|
|
406
481
|
strategy: StrategyType.POOL,
|
|
482
|
+
manager: budget.assertValidAddress(),
|
|
407
483
|
});
|
|
408
484
|
const _boost = await core.createBoost({
|
|
409
485
|
budget: budget,
|
|
@@ -463,6 +539,7 @@ describe('BoostCore', () => {
|
|
|
463
539
|
reward: 1n,
|
|
464
540
|
limit: 10n,
|
|
465
541
|
strategy: StrategyType.POOL,
|
|
542
|
+
manager: budget.assertValidAddress(),
|
|
466
543
|
});
|
|
467
544
|
// const erc1155Incentive = core.ERC1155Incentive({
|
|
468
545
|
// asset: erc1155.assertValidAddress(),
|
|
@@ -477,6 +554,7 @@ describe('BoostCore', () => {
|
|
|
477
554
|
totalBudget: 10n,
|
|
478
555
|
rewardBoost: 1n,
|
|
479
556
|
rewardDecay: 1n,
|
|
557
|
+
manager: budget.assertValidAddress(),
|
|
480
558
|
});
|
|
481
559
|
const allowListIncentive = core.AllowListIncentive({
|
|
482
560
|
allowList: allowList.assertValidAddress(),
|
|
@@ -491,7 +569,6 @@ describe('BoostCore', () => {
|
|
|
491
569
|
|
|
492
570
|
await core.createBoost({
|
|
493
571
|
protocolFee: 1n,
|
|
494
|
-
referralFee: 2n,
|
|
495
572
|
maxParticipants: 100n,
|
|
496
573
|
budget: budget,
|
|
497
574
|
action: core.EventAction(
|
|
@@ -551,20 +628,6 @@ describe('BoostCore', () => {
|
|
|
551
628
|
expect(await core.protocolFeeReceiver()).toBe(zeroAddress);
|
|
552
629
|
});
|
|
553
630
|
|
|
554
|
-
test('can get the claim fee', async () => {
|
|
555
|
-
const { core } = fixtures;
|
|
556
|
-
|
|
557
|
-
expect(await core.claimFee()).toBe(75000000000000n);
|
|
558
|
-
});
|
|
559
|
-
|
|
560
|
-
test('can set the claim fee', async () => {
|
|
561
|
-
const { core } = fixtures;
|
|
562
|
-
|
|
563
|
-
await core.setClaimFee(100n);
|
|
564
|
-
|
|
565
|
-
expect(await core.claimFee()).toBe(100n);
|
|
566
|
-
});
|
|
567
|
-
|
|
568
631
|
test('binds all actions, budgets, allowlists, incentives, and validators to reuse core options and account', () => {
|
|
569
632
|
const { core } = fixtures;
|
|
570
633
|
|
|
@@ -613,6 +676,7 @@ describe('BoostCore', () => {
|
|
|
613
676
|
rewardDecay: 0n,
|
|
614
677
|
rewardBoost: 0n,
|
|
615
678
|
totalBudget: 0n,
|
|
679
|
+
manager: zeroAddress,
|
|
616
680
|
});
|
|
617
681
|
expect(cgdaIncentive._config).toEqual(defaultOptions.config);
|
|
618
682
|
expect(cgdaIncentive._account).toEqual(defaultOptions.account);
|
|
@@ -666,7 +730,6 @@ describe('BoostCore', () => {
|
|
|
666
730
|
const { budget, erc20 } = budgets;
|
|
667
731
|
await core.createBoost({
|
|
668
732
|
protocolFee: 1n,
|
|
669
|
-
referralFee: 2n,
|
|
670
733
|
maxParticipants: 100n,
|
|
671
734
|
budget: budget,
|
|
672
735
|
action: core.EventAction(
|
|
@@ -689,6 +752,7 @@ describe('BoostCore', () => {
|
|
|
689
752
|
reward: parseEther('1'),
|
|
690
753
|
limit: 100n,
|
|
691
754
|
strategy: StrategyType.POOL,
|
|
755
|
+
manager: budget.assertValidAddress(),
|
|
692
756
|
}),
|
|
693
757
|
],
|
|
694
758
|
});
|
|
@@ -739,6 +803,7 @@ describe('BoostCore', () => {
|
|
|
739
803
|
reward: parseEther('1'),
|
|
740
804
|
limit: 100n,
|
|
741
805
|
strategy: StrategyType.POOL,
|
|
806
|
+
manager: budget.assertValidAddress(),
|
|
742
807
|
}),
|
|
743
808
|
],
|
|
744
809
|
});
|
|
@@ -767,6 +832,7 @@ describe('BoostCore', () => {
|
|
|
767
832
|
reward: parseEther('1'),
|
|
768
833
|
limit: 100n,
|
|
769
834
|
strategy: StrategyType.POOL,
|
|
835
|
+
manager: budget.assertValidAddress(),
|
|
770
836
|
}),
|
|
771
837
|
],
|
|
772
838
|
});
|
|
@@ -792,6 +858,7 @@ describe('BoostCore', () => {
|
|
|
792
858
|
strategy: StrategyType.POOL,
|
|
793
859
|
reward: 1n,
|
|
794
860
|
limit: 1n,
|
|
861
|
+
manager: budgets.budget.assertValidAddress(),
|
|
795
862
|
});
|
|
796
863
|
const boost = await freshBoost(fixtures, {
|
|
797
864
|
budget: budgets.budget,
|
|
@@ -810,7 +877,7 @@ describe('BoostCore', () => {
|
|
|
810
877
|
boostId: boost.id,
|
|
811
878
|
});
|
|
812
879
|
|
|
813
|
-
const {hash} = await fixtures.core.claimIncentiveRaw(
|
|
880
|
+
const { hash } = await fixtures.core.claimIncentiveRaw(
|
|
814
881
|
boost.id,
|
|
815
882
|
0n,
|
|
816
883
|
referrer,
|
|
@@ -818,10 +885,10 @@ describe('BoostCore', () => {
|
|
|
818
885
|
{ value: BOOST_CORE_CLAIM_FEE },
|
|
819
886
|
);
|
|
820
887
|
|
|
821
|
-
const claimInfo = await fixtures.core.getClaimFromTransaction({ hash })
|
|
822
|
-
expect(claimInfo).toBeDefined()
|
|
823
|
-
expect(claimInfo?.claimant).toBe(claimant)
|
|
824
|
-
expect(typeof claimInfo?.boostId).toBe('bigint')
|
|
825
|
-
expect(claimInfo?.referrer).toBe(referrer)
|
|
888
|
+
const claimInfo = await fixtures.core.getClaimFromTransaction({ hash });
|
|
889
|
+
expect(claimInfo).toBeDefined();
|
|
890
|
+
expect(claimInfo?.claimant).toBe(claimant);
|
|
891
|
+
expect(typeof claimInfo?.boostId).toBe('bigint');
|
|
892
|
+
expect(claimInfo?.referrer).toBe(referrer);
|
|
826
893
|
});
|
|
827
894
|
});
|