@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
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
type Fixtures,
|
|
5
5
|
defaultOptions,
|
|
6
6
|
deployFixtures,
|
|
7
|
-
} from '
|
|
7
|
+
} from '@boostxyz/test/helpers';
|
|
8
8
|
import {
|
|
9
9
|
SimpleAllowList,
|
|
10
10
|
SimpleDenyList,
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
let fixtures: Fixtures;
|
|
15
15
|
|
|
16
16
|
beforeAll(async () => {
|
|
17
|
-
fixtures = await loadFixture(deployFixtures);
|
|
17
|
+
fixtures = await loadFixture(deployFixtures(defaultOptions));
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
function freshAllowList(fixtures: Fixtures) {
|
|
21
21
|
return function freshAllowList() {
|
|
22
|
-
return fixtures.registry.
|
|
22
|
+
return fixtures.registry.initialize(
|
|
23
23
|
crypto.randomUUID(),
|
|
24
|
-
|
|
24
|
+
fixtures.core.SimpleAllowList({
|
|
25
25
|
owner: defaultOptions.account.address,
|
|
26
26
|
allowed: [defaultOptions.account.address],
|
|
27
27
|
}),
|
|
@@ -31,9 +31,9 @@ function freshAllowList(fixtures: Fixtures) {
|
|
|
31
31
|
|
|
32
32
|
function freshDenyList(fixtures: Fixtures) {
|
|
33
33
|
return function freshDenyList() {
|
|
34
|
-
return fixtures.registry.
|
|
34
|
+
return fixtures.registry.initialize(
|
|
35
35
|
crypto.randomUUID(),
|
|
36
|
-
|
|
36
|
+
fixtures.core.SimpleDenyList({
|
|
37
37
|
owner: defaultOptions.account.address,
|
|
38
38
|
denied: [defaultOptions.account.address],
|
|
39
39
|
}),
|
|
@@ -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(
|
|
@@ -7,10 +7,11 @@ import { readContract } from '@wagmi/core';
|
|
|
7
7
|
import type { Address, Hex } from 'viem';
|
|
8
8
|
import type { DeployableOptions } from '../Deployable/Deployable';
|
|
9
9
|
import { InvalidComponentInterfaceError } from '../errors';
|
|
10
|
+
import { OpenAllowList } from './OpenAllowList';
|
|
10
11
|
import { SimpleAllowList } from './SimpleAllowList';
|
|
11
12
|
import { SimpleDenyList } from './SimpleDenyList';
|
|
12
13
|
|
|
13
|
-
export { SimpleAllowList, SimpleDenyList };
|
|
14
|
+
export { OpenAllowList, SimpleAllowList, SimpleDenyList };
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* A union type representing all valid protocol AllowList implementations
|
|
@@ -18,7 +19,7 @@ export { SimpleAllowList, SimpleDenyList };
|
|
|
18
19
|
* @export
|
|
19
20
|
* @typedef {AllowList}
|
|
20
21
|
*/
|
|
21
|
-
export type AllowList = SimpleAllowList | SimpleDenyList;
|
|
22
|
+
export type AllowList = OpenAllowList | SimpleAllowList | SimpleDenyList;
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* A map of AllowList component interfaces to their constructors.
|
|
@@ -32,6 +33,7 @@ export const AllowListByComponentInterface = {
|
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.
|
|
36
|
+
* This function will never return an instance of {@link OpenAllowList} because it has the same component interface as {@link SimpleDenyList}
|
|
35
37
|
*
|
|
36
38
|
* @export
|
|
37
39
|
* @async
|
|
@@ -56,5 +58,5 @@ export async function allowListFromAddress(
|
|
|
56
58
|
interfaceId as Hex,
|
|
57
59
|
);
|
|
58
60
|
}
|
|
59
|
-
return new Ctor(options, address);
|
|
61
|
+
return new Ctor(options, address) as SimpleDenyList | SimpleAllowList;
|
|
60
62
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
|
|
2
|
+
import { isAddress, zeroAddress } from 'viem';
|
|
3
|
+
import { beforeAll, describe, expect, test } from 'vitest';
|
|
4
|
+
import { accounts } from '@boostxyz/test/accounts';
|
|
5
|
+
import {
|
|
6
|
+
type Fixtures,
|
|
7
|
+
defaultOptions,
|
|
8
|
+
deployFixtures,
|
|
9
|
+
} from '@boostxyz/test/helpers';
|
|
10
|
+
import { OpenAllowList } from './OpenAllowList';
|
|
11
|
+
|
|
12
|
+
let fixtures: Fixtures;
|
|
13
|
+
|
|
14
|
+
beforeAll(async () => {
|
|
15
|
+
fixtures = await loadFixture(deployFixtures(defaultOptions));
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
function freshOpenAllowList(fixtures: Fixtures) {
|
|
19
|
+
return function freshOpenAllowList() {
|
|
20
|
+
return fixtures.registry.initialize(
|
|
21
|
+
crypto.randomUUID(),
|
|
22
|
+
new fixtures.bases.OpenAllowList(defaultOptions),
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
describe('OpenAllowList', () => {
|
|
28
|
+
test('can successfully be deployed', async () => {
|
|
29
|
+
const denyList = new OpenAllowList(defaultOptions);
|
|
30
|
+
await denyList.deploy();
|
|
31
|
+
expect(isAddress(denyList.assertValidAddress())).toBe(true);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('allows anyone', async () => {
|
|
35
|
+
const denyList = await loadFixture(freshOpenAllowList(fixtures));
|
|
36
|
+
expect(await denyList.isAllowed(defaultOptions.account.address)).toBe(true);
|
|
37
|
+
expect(await denyList.isAllowed(zeroAddress)).toBe(true);
|
|
38
|
+
expect(await denyList.isAllowed(accounts.at(1)!.account)).toBe(true);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { simpleDenyListAbi } from '@boostxyz/evm';
|
|
2
|
+
import { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleDenyList.sol/SimpleDenyList.json';
|
|
3
|
+
import { type Hex, zeroAddress } from 'viem';
|
|
4
|
+
import type {
|
|
5
|
+
DeployableOptions,
|
|
6
|
+
GenericDeployableParams,
|
|
7
|
+
} from '../Deployable/Deployable';
|
|
8
|
+
import {
|
|
9
|
+
SimpleDenyList,
|
|
10
|
+
type SimpleDenyListPayload,
|
|
11
|
+
prepareSimpleDenyListPayload,
|
|
12
|
+
} from './SimpleDenyList';
|
|
13
|
+
|
|
14
|
+
export const openAllowListAbi = simpleDenyListAbi;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A simple AllowList, extending {@link DenyList}, that is ownerless and allows anyone to claim.
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @class OpenAllowList
|
|
21
|
+
* @typedef {OpenAllowList}
|
|
22
|
+
* @extends {DeployableTarget<OpenAllowListPayload>}
|
|
23
|
+
*/
|
|
24
|
+
export class OpenAllowList extends SimpleDenyList<undefined> {
|
|
25
|
+
/**
|
|
26
|
+
* @inheritdoc
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
* @param {?SimpleDenyListPayload} [_payload]
|
|
30
|
+
* @param {?DeployableOptions} [_options]
|
|
31
|
+
* @returns {GenericDeployableParams}
|
|
32
|
+
*/
|
|
33
|
+
public override buildParameters(
|
|
34
|
+
_payload?: SimpleDenyListPayload,
|
|
35
|
+
_options?: DeployableOptions,
|
|
36
|
+
): GenericDeployableParams {
|
|
37
|
+
const [_, options] = this.validateDeploymentConfig({}, _options);
|
|
38
|
+
return {
|
|
39
|
+
abi: openAllowListAbi,
|
|
40
|
+
bytecode: bytecode as Hex,
|
|
41
|
+
args: [prepareSimpleDenyListPayload({ owner: zeroAddress, denied: [] })],
|
|
42
|
+
...this.optionallyAttachAccount(options.account),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -5,20 +5,20 @@ import {
|
|
|
5
5
|
type Fixtures,
|
|
6
6
|
defaultOptions,
|
|
7
7
|
deployFixtures,
|
|
8
|
-
} from '
|
|
8
|
+
} from '@boostxyz/test/helpers';
|
|
9
9
|
import { SimpleAllowList } from './SimpleAllowList';
|
|
10
10
|
|
|
11
11
|
let fixtures: Fixtures;
|
|
12
12
|
|
|
13
13
|
beforeAll(async () => {
|
|
14
|
-
fixtures = await loadFixture(deployFixtures);
|
|
14
|
+
fixtures = await loadFixture(deployFixtures(defaultOptions));
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
function freshAllowList(fixtures: Fixtures) {
|
|
18
18
|
return function freshAllowList() {
|
|
19
|
-
return fixtures.registry.
|
|
19
|
+
return fixtures.registry.initialize(
|
|
20
20
|
crypto.randomUUID(),
|
|
21
|
-
|
|
21
|
+
fixtures.core.SimpleAllowList({
|
|
22
22
|
owner: defaultOptions.account.address,
|
|
23
23
|
allowed: [defaultOptions.account.address],
|
|
24
24
|
}),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readSimpleAllowListIsAllowed,
|
|
3
|
+
readSimpleAllowListOwner,
|
|
3
4
|
simpleAllowListAbi,
|
|
4
|
-
simulateSimpleAllowListGrantRoles,
|
|
5
5
|
simulateSimpleAllowListSetAllowed,
|
|
6
|
-
writeSimpleAllowListGrantRoles,
|
|
7
6
|
writeSimpleAllowListSetAllowed,
|
|
8
7
|
} from '@boostxyz/evm';
|
|
9
8
|
import { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleAllowList.sol/SimpleAllowList.json';
|
|
@@ -16,11 +15,15 @@ import {
|
|
|
16
15
|
zeroAddress,
|
|
17
16
|
zeroHash,
|
|
18
17
|
} from 'viem';
|
|
18
|
+
import { SimpleAllowList as SimpleAllowListBases } from '../../dist/deployments.json';
|
|
19
19
|
import type {
|
|
20
20
|
DeployableOptions,
|
|
21
21
|
GenericDeployableParams,
|
|
22
22
|
} from '../Deployable/Deployable';
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
DeployableTargetWithRBAC,
|
|
25
|
+
Roles,
|
|
26
|
+
} from '../Deployable/DeployableTargetWithRBAC';
|
|
24
27
|
import { DeployableUnknownOwnerProvidedError } from '../errors';
|
|
25
28
|
import {
|
|
26
29
|
type GenericLog,
|
|
@@ -71,18 +74,19 @@ export type SimpleAllowListLog<
|
|
|
71
74
|
/**
|
|
72
75
|
* A constant representing the list manager's role
|
|
73
76
|
*
|
|
74
|
-
* @
|
|
77
|
+
* @deprecated use {@link Roles} instead
|
|
78
|
+
* @type {1n}
|
|
75
79
|
*/
|
|
76
|
-
export const LIST_MANAGER_ROLE =
|
|
80
|
+
export const LIST_MANAGER_ROLE = Roles.MANAGER;
|
|
77
81
|
/**
|
|
78
82
|
* A simple implementation of an AllowList that checks if a user is authorized based on a list of allowed addresses
|
|
79
83
|
*
|
|
80
84
|
* @export
|
|
81
85
|
* @class SimpleAllowList
|
|
82
86
|
* @typedef {SimpleAllowList}
|
|
83
|
-
* @extends {
|
|
87
|
+
* @extends {DeployableTargetWithRBAC<SimpleAllowListPayload>}
|
|
84
88
|
*/
|
|
85
|
-
export class SimpleAllowList extends
|
|
89
|
+
export class SimpleAllowList extends DeployableTargetWithRBAC<
|
|
86
90
|
SimpleAllowListPayload,
|
|
87
91
|
typeof simpleAllowListAbi
|
|
88
92
|
> {
|
|
@@ -92,10 +96,11 @@ export class SimpleAllowList extends DeployableTarget<
|
|
|
92
96
|
*
|
|
93
97
|
* @public
|
|
94
98
|
* @static
|
|
95
|
-
* @type {Address}
|
|
99
|
+
* @type {Record<number, Address>}
|
|
96
100
|
*/
|
|
97
|
-
public static override
|
|
98
|
-
|
|
101
|
+
public static override bases: Record<number, Address> = {
|
|
102
|
+
...(SimpleAllowListBases as Record<number, Address>),
|
|
103
|
+
};
|
|
99
104
|
/**
|
|
100
105
|
* @inheritdoc
|
|
101
106
|
*
|
|
@@ -105,13 +110,33 @@ export class SimpleAllowList extends DeployableTarget<
|
|
|
105
110
|
*/
|
|
106
111
|
public static override registryType: RegistryType = RegistryType.ALLOW_LIST;
|
|
107
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Retrieves the owner
|
|
115
|
+
*
|
|
116
|
+
* @public
|
|
117
|
+
* @async
|
|
118
|
+
* @param {?ReadParams} [params]
|
|
119
|
+
* @returns {Promise<Address>} - The address of the owner
|
|
120
|
+
*/
|
|
121
|
+
public async owner(
|
|
122
|
+
params?: ReadParams<typeof simpleAllowListAbi, 'owner'>,
|
|
123
|
+
): Promise<Address> {
|
|
124
|
+
return await readSimpleAllowListOwner(this._config, {
|
|
125
|
+
...this.optionallyAttachAccount(),
|
|
126
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
127
|
+
...(params as any),
|
|
128
|
+
address: this.assertValidAddress(),
|
|
129
|
+
args: [],
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
108
133
|
/**
|
|
109
134
|
* Check if a user is authorized.
|
|
110
135
|
*
|
|
111
136
|
* @public
|
|
112
137
|
* @async
|
|
113
138
|
* @param {Address} address - The address of the user
|
|
114
|
-
* @param {?ReadParams
|
|
139
|
+
* @param {?ReadParams} [params]
|
|
115
140
|
* @returns {Promise<boolean>} - True if the user is authorized
|
|
116
141
|
*/
|
|
117
142
|
public async isAllowed(
|
|
@@ -135,7 +160,7 @@ export class SimpleAllowList extends DeployableTarget<
|
|
|
135
160
|
* @async
|
|
136
161
|
* @param {Address[]} addresses - The list of users to update
|
|
137
162
|
* @param {boolean[]} allowed - The allowed status of each user
|
|
138
|
-
* @param {?ReadParams
|
|
163
|
+
* @param {?ReadParams} [params]
|
|
139
164
|
* @returns {Promise<void>}
|
|
140
165
|
*/
|
|
141
166
|
public async setAllowed(
|
|
@@ -156,8 +181,8 @@ export class SimpleAllowList extends DeployableTarget<
|
|
|
156
181
|
* @async
|
|
157
182
|
* @param {Address[]} addresses - The list of users to update
|
|
158
183
|
* @param {boolean[]} allowed - The allowed status of each user
|
|
159
|
-
* @param {?ReadParams
|
|
160
|
-
* @returns {Promise<void>}
|
|
184
|
+
* @param {?ReadParams} [params]
|
|
185
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
161
186
|
*/
|
|
162
187
|
public async setAllowedRaw(
|
|
163
188
|
addresses: Address[],
|
|
@@ -178,53 +203,6 @@ export class SimpleAllowList extends DeployableTarget<
|
|
|
178
203
|
return { hash, result };
|
|
179
204
|
}
|
|
180
205
|
|
|
181
|
-
/**
|
|
182
|
-
* Allows the owner to grant `user` `roles`.
|
|
183
|
-
*
|
|
184
|
-
* @public
|
|
185
|
-
* @async
|
|
186
|
-
* @param {Address} address
|
|
187
|
-
* @param {bigint} role
|
|
188
|
-
* @param {?ReadParams<typeof simpleAllowListAbi, 'grantRoles'>} [params]
|
|
189
|
-
* @returns {Promise<void>}
|
|
190
|
-
*/
|
|
191
|
-
public async grantRoles(
|
|
192
|
-
address: Address,
|
|
193
|
-
role: bigint,
|
|
194
|
-
params?: WriteParams<typeof simpleAllowListAbi, 'grantRoles'>,
|
|
195
|
-
) {
|
|
196
|
-
return await this.awaitResult(this.grantRolesRaw(address, role, params));
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Allows the owner to grant `user` `roles`.
|
|
201
|
-
*
|
|
202
|
-
* @public
|
|
203
|
-
* @async
|
|
204
|
-
* @param {Address} address
|
|
205
|
-
* @param {bigint} role
|
|
206
|
-
* @param {?ReadParams<typeof simpleAllowListAbi, 'grantRoles'>} [params]
|
|
207
|
-
* @returns {Promise<void>}
|
|
208
|
-
*/
|
|
209
|
-
public async grantRolesRaw(
|
|
210
|
-
address: Address,
|
|
211
|
-
role: bigint,
|
|
212
|
-
params?: ReadParams<typeof simpleAllowListAbi, 'grantRoles'>,
|
|
213
|
-
) {
|
|
214
|
-
const { request, result } = await simulateSimpleAllowListGrantRoles(
|
|
215
|
-
this._config,
|
|
216
|
-
{
|
|
217
|
-
address: this.assertValidAddress(),
|
|
218
|
-
args: [address, role],
|
|
219
|
-
...this.optionallyAttachAccount(),
|
|
220
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
221
|
-
...(params as any),
|
|
222
|
-
},
|
|
223
|
-
);
|
|
224
|
-
const hash = await writeSimpleAllowListGrantRoles(this._config, request);
|
|
225
|
-
return { hash, result };
|
|
226
|
-
}
|
|
227
|
-
|
|
228
206
|
/**
|
|
229
207
|
* @inheritdoc
|
|
230
208
|
*
|
|
@@ -5,20 +5,20 @@ import {
|
|
|
5
5
|
type Fixtures,
|
|
6
6
|
defaultOptions,
|
|
7
7
|
deployFixtures,
|
|
8
|
-
} from '
|
|
8
|
+
} from '@boostxyz/test/helpers';
|
|
9
9
|
import { SimpleDenyList } from './SimpleDenyList';
|
|
10
10
|
|
|
11
11
|
let fixtures: Fixtures;
|
|
12
12
|
|
|
13
13
|
beforeAll(async () => {
|
|
14
|
-
fixtures = await loadFixture(deployFixtures);
|
|
14
|
+
fixtures = await loadFixture(deployFixtures(defaultOptions));
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
function freshDenyList(fixtures: Fixtures) {
|
|
18
18
|
return function freshDenyList() {
|
|
19
|
-
return fixtures.registry.
|
|
19
|
+
return fixtures.registry.initialize(
|
|
20
20
|
crypto.randomUUID(),
|
|
21
|
-
|
|
21
|
+
fixtures.core.SimpleDenyList({
|
|
22
22
|
owner: defaultOptions.account.address,
|
|
23
23
|
denied: [defaultOptions.account.address],
|
|
24
24
|
}),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
readSimpleAllowListOwner,
|
|
2
3
|
readSimpleDenyListIsAllowed,
|
|
3
4
|
simpleDenyListAbi,
|
|
4
5
|
simulateSimpleDenyListSetDenied,
|
|
@@ -14,11 +15,12 @@ import {
|
|
|
14
15
|
zeroAddress,
|
|
15
16
|
zeroHash,
|
|
16
17
|
} from 'viem';
|
|
18
|
+
import { SimpleDenyList as SimpleDenyListBases } from '../../dist/deployments.json';
|
|
17
19
|
import type {
|
|
18
20
|
DeployableOptions,
|
|
19
21
|
GenericDeployableParams,
|
|
20
22
|
} from '../Deployable/Deployable';
|
|
21
|
-
import {
|
|
23
|
+
import { DeployableTargetWithRBAC } from '../Deployable/DeployableTargetWithRBAC';
|
|
22
24
|
import { DeployableUnknownOwnerProvidedError } from '../errors';
|
|
23
25
|
import {
|
|
24
26
|
type GenericLog,
|
|
@@ -72,10 +74,12 @@ export type SimpleDenyListLog<
|
|
|
72
74
|
* @export
|
|
73
75
|
* @class SimpleDenyList
|
|
74
76
|
* @typedef {SimpleDenyList}
|
|
75
|
-
* @extends {
|
|
77
|
+
* @extends {DeployableTargetWithRBAC<SimpleDenyListPayload>}
|
|
76
78
|
*/
|
|
77
|
-
export class SimpleDenyList
|
|
78
|
-
SimpleDenyListPayload,
|
|
79
|
+
export class SimpleDenyList<
|
|
80
|
+
Payload = SimpleDenyListPayload,
|
|
81
|
+
> extends DeployableTargetWithRBAC<
|
|
82
|
+
Payload | undefined,
|
|
79
83
|
typeof simpleDenyListAbi
|
|
80
84
|
> {
|
|
81
85
|
public override readonly abi = simpleDenyListAbi;
|
|
@@ -84,10 +88,11 @@ export class SimpleDenyList extends DeployableTarget<
|
|
|
84
88
|
*
|
|
85
89
|
* @public
|
|
86
90
|
* @static
|
|
87
|
-
* @type {Address}
|
|
91
|
+
* @type {Record<number, Address>}
|
|
88
92
|
*/
|
|
89
|
-
public static override
|
|
90
|
-
|
|
93
|
+
public static override bases: Record<number, Address> = {
|
|
94
|
+
...(SimpleDenyListBases as Record<number, Address>),
|
|
95
|
+
};
|
|
91
96
|
/**
|
|
92
97
|
* @inheritdoc
|
|
93
98
|
*
|
|
@@ -97,13 +102,33 @@ export class SimpleDenyList extends DeployableTarget<
|
|
|
97
102
|
*/
|
|
98
103
|
public static override registryType: RegistryType = RegistryType.ALLOW_LIST;
|
|
99
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Retrieves the owner
|
|
107
|
+
*
|
|
108
|
+
* @public
|
|
109
|
+
* @async
|
|
110
|
+
* @param {?ReadParams} [params]
|
|
111
|
+
* @returns {Promise<Address>} - The address of the owner
|
|
112
|
+
*/
|
|
113
|
+
public async owner(
|
|
114
|
+
params?: ReadParams<typeof simpleDenyListAbi, 'owner'>,
|
|
115
|
+
): Promise<Address> {
|
|
116
|
+
return await readSimpleAllowListOwner(this._config, {
|
|
117
|
+
...this.optionallyAttachAccount(),
|
|
118
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
119
|
+
...(params as any),
|
|
120
|
+
address: this.assertValidAddress(),
|
|
121
|
+
args: [],
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
100
125
|
/**
|
|
101
126
|
* Check if a user is authorized (i.e. not denied)
|
|
102
127
|
*
|
|
103
128
|
* @public
|
|
104
129
|
* @async
|
|
105
130
|
* @param {Address} address - The address of the user
|
|
106
|
-
* @param {?ReadParams
|
|
131
|
+
* @param {?ReadParams} [params]
|
|
107
132
|
* @returns {Promise<boolean>} - True if the user is authorized
|
|
108
133
|
*/
|
|
109
134
|
public async isAllowed(
|
|
@@ -126,8 +151,8 @@ export class SimpleDenyList extends DeployableTarget<
|
|
|
126
151
|
* @async
|
|
127
152
|
* @param {Address[]} addresses - The list of users to update
|
|
128
153
|
* @param {boolean[]} allowed - The denied status of each user
|
|
129
|
-
* @param {?WriteParams
|
|
130
|
-
* @returns {
|
|
154
|
+
* @param {?WriteParams} [params]
|
|
155
|
+
* @returns {Promise<void>}
|
|
131
156
|
*/
|
|
132
157
|
public async setDenied(
|
|
133
158
|
addresses: Address[],
|
|
@@ -146,8 +171,8 @@ export class SimpleDenyList extends DeployableTarget<
|
|
|
146
171
|
* @async
|
|
147
172
|
* @param {Address[]} addresses - The list of users to update
|
|
148
173
|
* @param {boolean[]} allowed - The denied status of each user
|
|
149
|
-
* @param {?WriteParams
|
|
150
|
-
* @returns {
|
|
174
|
+
* @param {?WriteParams} [params]
|
|
175
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
151
176
|
*/
|
|
152
177
|
public async setDeniedRaw(
|
|
153
178
|
addresses: Address[],
|
|
@@ -177,13 +202,11 @@ export class SimpleDenyList extends DeployableTarget<
|
|
|
177
202
|
* @returns {GenericDeployableParams}
|
|
178
203
|
*/
|
|
179
204
|
public override buildParameters(
|
|
180
|
-
_payload?:
|
|
205
|
+
_payload?: Payload,
|
|
181
206
|
_options?: DeployableOptions,
|
|
182
207
|
): GenericDeployableParams {
|
|
183
|
-
const [
|
|
184
|
-
|
|
185
|
-
_options,
|
|
186
|
-
);
|
|
208
|
+
const [p, options] = this.validateDeploymentConfig(_payload, _options);
|
|
209
|
+
const payload = p as SimpleDenyListPayload;
|
|
187
210
|
if (!payload.owner || payload.owner === zeroAddress) {
|
|
188
211
|
const owner = options.account
|
|
189
212
|
? options.account.address
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { zeroAddress } from 'viem';
|
|
2
2
|
import { describe, expect, test } from 'vitest';
|
|
3
|
-
import { defaultOptions } from '
|
|
3
|
+
import { defaultOptions } from '@boostxyz/test/helpers';
|
|
4
4
|
import { PassthroughAuth } from './PassthroughAuth';
|
|
5
5
|
|
|
6
6
|
describe('PassthroughAuth', () => {
|
package/src/Boost.ts
CHANGED
|
@@ -12,12 +12,30 @@ import type { Budget } from './Budgets/Budget';
|
|
|
12
12
|
import type { Incentive } from './Incentives/Incentive';
|
|
13
13
|
import type { Validator } from './Validators/Validator';
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Interface representing a `BoostLib.Boost` on-chain struct
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface RawBoost
|
|
20
|
+
* @typedef {RawBoost}
|
|
21
|
+
*/
|
|
22
|
+
export interface RawBoost {
|
|
23
|
+
action: Address;
|
|
24
|
+
validator: Address;
|
|
25
|
+
allowList: Address;
|
|
26
|
+
budget: Address;
|
|
27
|
+
incentives: readonly Address[];
|
|
28
|
+
protocolFee: bigint;
|
|
29
|
+
maxParticipants: bigint;
|
|
30
|
+
owner: Address;
|
|
31
|
+
}
|
|
32
|
+
|
|
15
33
|
/**
|
|
16
34
|
* Configuration used to instantiate a `Boost` instance.
|
|
17
35
|
*
|
|
18
36
|
* @export
|
|
19
|
-
* @interface
|
|
20
|
-
* @typedef {
|
|
37
|
+
* @interface BoostConfig
|
|
38
|
+
* @typedef {BoostConfig}
|
|
21
39
|
*/
|
|
22
40
|
export interface BoostConfig {
|
|
23
41
|
/**
|
|
@@ -55,11 +73,6 @@ export interface BoostConfig {
|
|
|
55
73
|
* @type {?bigint}
|
|
56
74
|
*/
|
|
57
75
|
protocolFee?: bigint;
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
* @type {?bigint}
|
|
61
|
-
*/
|
|
62
|
-
referralFee?: bigint;
|
|
63
76
|
/**
|
|
64
77
|
*
|
|
65
78
|
* @type {?bigint}
|
|
@@ -122,12 +135,6 @@ export class Boost {
|
|
|
122
135
|
* @type {bigint}
|
|
123
136
|
*/
|
|
124
137
|
readonly protocolFee: bigint;
|
|
125
|
-
/**
|
|
126
|
-
*
|
|
127
|
-
* @readonly
|
|
128
|
-
* @type {bigint}
|
|
129
|
-
*/
|
|
130
|
-
readonly referralFee: bigint;
|
|
131
138
|
/**
|
|
132
139
|
*
|
|
133
140
|
* @readonly
|
|
@@ -155,7 +162,6 @@ export class Boost {
|
|
|
155
162
|
this.allowList = config.allowList;
|
|
156
163
|
this.incentives = config.incentives;
|
|
157
164
|
this.protocolFee = config.protocolFee || 0n;
|
|
158
|
-
this.referralFee = config.referralFee || 0n;
|
|
159
165
|
this.maxParticipants = config.maxParticipants || 0n;
|
|
160
166
|
this.owner = config.owner || zeroAddress;
|
|
161
167
|
}
|
|
@@ -218,12 +224,6 @@ export interface BoostPayload {
|
|
|
218
224
|
* @type {?bigint}
|
|
219
225
|
*/
|
|
220
226
|
protocolFee?: bigint;
|
|
221
|
-
/**
|
|
222
|
-
* The base referral fee (in bps)
|
|
223
|
-
*
|
|
224
|
-
* @type {?bigint}
|
|
225
|
-
*/
|
|
226
|
-
referralFee?: bigint;
|
|
227
227
|
/**
|
|
228
228
|
* Optional maximum amount of participants in the Boost.
|
|
229
229
|
*
|
|
@@ -249,7 +249,6 @@ export interface BoostPayload {
|
|
|
249
249
|
* @param {Target} param0.allowList - Target for existing allowList, or base with initialization payload.
|
|
250
250
|
* @param {Target[]} param0.incentives - Targets for new incentives, with initialization payloads.
|
|
251
251
|
* @param {bigint} [param0.protocolFee=0n] - The base protocol fee (in bps)
|
|
252
|
-
* @param {bigint} [param0.referralFee=0n] - The base referral fee (in bps)
|
|
253
252
|
* @param {bigint} [param0.maxParticipants=0n] - Optional maximum amount of participants in the Boost.
|
|
254
253
|
* @param {Address} param0.owner - The owner of the Boost.
|
|
255
254
|
* @returns {Hex}
|
|
@@ -261,7 +260,6 @@ export function prepareBoostPayload({
|
|
|
261
260
|
allowList,
|
|
262
261
|
incentives,
|
|
263
262
|
protocolFee = 0n,
|
|
264
|
-
referralFee = 0n,
|
|
265
263
|
maxParticipants = 0n,
|
|
266
264
|
owner,
|
|
267
265
|
}: BoostPayload): Hex {
|
|
@@ -269,7 +267,7 @@ export function prepareBoostPayload({
|
|
|
269
267
|
encodeAbiParameters(
|
|
270
268
|
parseAbiParameters([
|
|
271
269
|
'BoostPayload payload',
|
|
272
|
-
'struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee;
|
|
270
|
+
'struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint256 maxParticipants; address owner; }',
|
|
273
271
|
'struct Target { bool isBase; address instance; bytes parameters; }',
|
|
274
272
|
]),
|
|
275
273
|
[
|
|
@@ -280,7 +278,6 @@ export function prepareBoostPayload({
|
|
|
280
278
|
allowList,
|
|
281
279
|
incentives,
|
|
282
280
|
protocolFee,
|
|
283
|
-
referralFee,
|
|
284
281
|
maxParticipants,
|
|
285
282
|
owner,
|
|
286
283
|
},
|