@boostxyz/sdk 0.0.0-alpha.9 → 1.1.0-alpha.23
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 +2 -2
- 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 +174 -41
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +557 -129
- 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 +60 -75
- 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-Btl5BdAs.cjs +3 -0
- package/dist/BoostCore-Btl5BdAs.cjs.map +1 -0
- package/dist/BoostCore-CD56zbYX.js +2641 -0
- package/dist/BoostCore-CD56zbYX.js.map +1 -0
- package/dist/BoostCore.cjs +1 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +749 -78
- 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 +164 -82
- 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 +103 -221
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +81 -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 +248 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js +320 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
- package/dist/Incentive-CcnOIc8L.cjs +2 -0
- package/dist/Incentive-CcnOIc8L.cjs.map +1 -0
- package/dist/Incentive-rM5nKznp.js +313 -0
- package/dist/Incentive-rM5nKznp.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 +43 -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 +46 -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 +234 -30
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +62 -46
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +333 -438
- 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 +38 -24
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-BDXpY74P.js +133 -0
- package/dist/SimpleDenyList-BDXpY74P.js.map +1 -0
- package/dist/SimpleDenyList-DNj5qDWM.cjs +2 -0
- package/dist/SimpleDenyList-DNj5qDWM.cjs.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 +32 -28
- 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-DF_6-7hH.cjs +2 -0
- package/dist/deployments-DF_6-7hH.cjs.map +1 -0
- package/dist/deployments-fJsWblwS.js +56 -0
- package/dist/deployments-fJsWblwS.js.map +1 -0
- package/dist/deployments.json +58 -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-CsNyWPKA.js} +3843 -2084
- package/dist/generated-CsNyWPKA.js.map +1 -0
- package/dist/generated-DHerxf1y.cjs +3 -0
- package/dist/generated-DHerxf1y.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 +735 -109
- package/src/Actions/EventAction.ts +527 -88
- 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 +40 -61
- package/src/AllowLists/SimpleDenyList.test.ts +4 -4
- package/src/AllowLists/SimpleDenyList.ts +41 -17
- package/src/Auth/PassthroughAuth.test.ts +1 -1
- package/src/Boost.ts +21 -24
- package/src/BoostCore.test.ts +361 -306
- package/src/BoostCore.ts +403 -220
- 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 +106 -19
- package/src/Budgets/ManagedBudget.ts +49 -321
- package/src/Budgets/VestingBudget.test.ts +7 -7
- package/src/Budgets/VestingBudget.ts +36 -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.test.ts +103 -0
- package/src/Deployable/DeployableTargetWithRBAC.ts +447 -0
- package/src/Incentives/AllowListIncentive.test.ts +12 -12
- package/src/Incentives/AllowListIncentive.ts +30 -15
- package/src/Incentives/CGDAIncentive.test.ts +9 -6
- package/src/Incentives/CGDAIncentive.ts +39 -18
- package/src/Incentives/ERC1155Incentive.test.ts +3 -3
- package/src/Incentives/ERC1155Incentive.ts +30 -29
- package/src/Incentives/ERC20Incentive.test.ts +9 -6
- package/src/Incentives/ERC20Incentive.ts +54 -27
- package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
- package/src/Incentives/ERC20VariableCriteriaIncentive.ts +325 -0
- package/src/Incentives/ERC20VariableIncentive.test.ts +8 -11
- package/src/Incentives/ERC20VariableIncentive.ts +50 -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 +32 -17
- package/src/Validators/SignerValidator.test.ts +6 -6
- package/src/Validators/SignerValidator.ts +20 -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,12 @@ 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
|
-
.VITE_SIMPLE_ALLOWLIST_BASE
|
|
101
|
+
public static override bases: Record<number, Address> = {
|
|
102
|
+
31337: import.meta.env.VITE_SIMPLE_ALLOWLIST_BASE,
|
|
103
|
+
...(SimpleAllowListBases as Record<number, Address>),
|
|
104
|
+
};
|
|
99
105
|
/**
|
|
100
106
|
* @inheritdoc
|
|
101
107
|
*
|
|
@@ -105,13 +111,33 @@ export class SimpleAllowList extends DeployableTarget<
|
|
|
105
111
|
*/
|
|
106
112
|
public static override registryType: RegistryType = RegistryType.ALLOW_LIST;
|
|
107
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Retrieves the owner
|
|
116
|
+
*
|
|
117
|
+
* @public
|
|
118
|
+
* @async
|
|
119
|
+
* @param {?ReadParams} [params]
|
|
120
|
+
* @returns {Promise<Address>} - The address of the owner
|
|
121
|
+
*/
|
|
122
|
+
public async owner(
|
|
123
|
+
params?: ReadParams<typeof simpleAllowListAbi, 'owner'>,
|
|
124
|
+
): Promise<Address> {
|
|
125
|
+
return await readSimpleAllowListOwner(this._config, {
|
|
126
|
+
...this.optionallyAttachAccount(),
|
|
127
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
128
|
+
...(params as any),
|
|
129
|
+
address: this.assertValidAddress(),
|
|
130
|
+
args: [],
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
108
134
|
/**
|
|
109
135
|
* Check if a user is authorized.
|
|
110
136
|
*
|
|
111
137
|
* @public
|
|
112
138
|
* @async
|
|
113
139
|
* @param {Address} address - The address of the user
|
|
114
|
-
* @param {?ReadParams
|
|
140
|
+
* @param {?ReadParams} [params]
|
|
115
141
|
* @returns {Promise<boolean>} - True if the user is authorized
|
|
116
142
|
*/
|
|
117
143
|
public async isAllowed(
|
|
@@ -135,7 +161,7 @@ export class SimpleAllowList extends DeployableTarget<
|
|
|
135
161
|
* @async
|
|
136
162
|
* @param {Address[]} addresses - The list of users to update
|
|
137
163
|
* @param {boolean[]} allowed - The allowed status of each user
|
|
138
|
-
* @param {?ReadParams
|
|
164
|
+
* @param {?ReadParams} [params]
|
|
139
165
|
* @returns {Promise<void>}
|
|
140
166
|
*/
|
|
141
167
|
public async setAllowed(
|
|
@@ -156,8 +182,8 @@ export class SimpleAllowList extends DeployableTarget<
|
|
|
156
182
|
* @async
|
|
157
183
|
* @param {Address[]} addresses - The list of users to update
|
|
158
184
|
* @param {boolean[]} allowed - The allowed status of each user
|
|
159
|
-
* @param {?ReadParams
|
|
160
|
-
* @returns {Promise<void>}
|
|
185
|
+
* @param {?ReadParams} [params]
|
|
186
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
161
187
|
*/
|
|
162
188
|
public async setAllowedRaw(
|
|
163
189
|
addresses: Address[],
|
|
@@ -178,53 +204,6 @@ export class SimpleAllowList extends DeployableTarget<
|
|
|
178
204
|
return { hash, result };
|
|
179
205
|
}
|
|
180
206
|
|
|
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
207
|
/**
|
|
229
208
|
* @inheritdoc
|
|
230
209
|
*
|
|
@@ -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,12 @@ 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
|
-
.VITE_SIMPLE_DENYLIST_BASE
|
|
93
|
+
public static override bases: Record<number, Address> = {
|
|
94
|
+
31337: import.meta.env.VITE_SIMPLE_DENYLIST_BASE,
|
|
95
|
+
...(SimpleDenyListBases as Record<number, Address>),
|
|
96
|
+
};
|
|
91
97
|
/**
|
|
92
98
|
* @inheritdoc
|
|
93
99
|
*
|
|
@@ -97,13 +103,33 @@ export class SimpleDenyList extends DeployableTarget<
|
|
|
97
103
|
*/
|
|
98
104
|
public static override registryType: RegistryType = RegistryType.ALLOW_LIST;
|
|
99
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Retrieves the owner
|
|
108
|
+
*
|
|
109
|
+
* @public
|
|
110
|
+
* @async
|
|
111
|
+
* @param {?ReadParams} [params]
|
|
112
|
+
* @returns {Promise<Address>} - The address of the owner
|
|
113
|
+
*/
|
|
114
|
+
public async owner(
|
|
115
|
+
params?: ReadParams<typeof simpleDenyListAbi, 'owner'>,
|
|
116
|
+
): Promise<Address> {
|
|
117
|
+
return await readSimpleAllowListOwner(this._config, {
|
|
118
|
+
...this.optionallyAttachAccount(),
|
|
119
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
120
|
+
...(params as any),
|
|
121
|
+
address: this.assertValidAddress(),
|
|
122
|
+
args: [],
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
100
126
|
/**
|
|
101
127
|
* Check if a user is authorized (i.e. not denied)
|
|
102
128
|
*
|
|
103
129
|
* @public
|
|
104
130
|
* @async
|
|
105
131
|
* @param {Address} address - The address of the user
|
|
106
|
-
* @param {?ReadParams
|
|
132
|
+
* @param {?ReadParams} [params]
|
|
107
133
|
* @returns {Promise<boolean>} - True if the user is authorized
|
|
108
134
|
*/
|
|
109
135
|
public async isAllowed(
|
|
@@ -126,8 +152,8 @@ export class SimpleDenyList extends DeployableTarget<
|
|
|
126
152
|
* @async
|
|
127
153
|
* @param {Address[]} addresses - The list of users to update
|
|
128
154
|
* @param {boolean[]} allowed - The denied status of each user
|
|
129
|
-
* @param {?WriteParams
|
|
130
|
-
* @returns {
|
|
155
|
+
* @param {?WriteParams} [params]
|
|
156
|
+
* @returns {Promise<void>}
|
|
131
157
|
*/
|
|
132
158
|
public async setDenied(
|
|
133
159
|
addresses: Address[],
|
|
@@ -146,8 +172,8 @@ export class SimpleDenyList extends DeployableTarget<
|
|
|
146
172
|
* @async
|
|
147
173
|
* @param {Address[]} addresses - The list of users to update
|
|
148
174
|
* @param {boolean[]} allowed - The denied status of each user
|
|
149
|
-
* @param {?WriteParams
|
|
150
|
-
* @returns {
|
|
175
|
+
* @param {?WriteParams} [params]
|
|
176
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
151
177
|
*/
|
|
152
178
|
public async setDeniedRaw(
|
|
153
179
|
addresses: Address[],
|
|
@@ -177,13 +203,11 @@ export class SimpleDenyList extends DeployableTarget<
|
|
|
177
203
|
* @returns {GenericDeployableParams}
|
|
178
204
|
*/
|
|
179
205
|
public override buildParameters(
|
|
180
|
-
_payload?:
|
|
206
|
+
_payload?: Payload,
|
|
181
207
|
_options?: DeployableOptions,
|
|
182
208
|
): GenericDeployableParams {
|
|
183
|
-
const [
|
|
184
|
-
|
|
185
|
-
_options,
|
|
186
|
-
);
|
|
209
|
+
const [p, options] = this.validateDeploymentConfig(_payload, _options);
|
|
210
|
+
const payload = p as SimpleDenyListPayload;
|
|
187
211
|
if (!payload.owner || payload.owner === zeroAddress) {
|
|
188
212
|
const owner = options.account
|
|
189
213
|
? 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
|
},
|