@boostxyz/sdk 5.3.1 → 6.0.0
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.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +13 -3
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +216 -193
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +2 -2
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +24 -24
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- 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.cjs.map +1 -1
- package/dist/Auth/PassthroughAuth.js +14 -14
- package/dist/Boost.cjs.map +1 -1
- package/dist/Boost.js.map +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +247 -0
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +421 -259
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.cjs.map +1 -1
- package/dist/BoostRegistry.js +43 -43
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budget-DMbfdTom.cjs +2 -0
- package/dist/{Budget-AoNx7uFd.cjs.map → Budget-DMbfdTom.cjs.map} +1 -1
- package/dist/Budget-DO6sGTIR.js +463 -0
- package/dist/{Budget-DYIV9iNK.js.map → Budget-DO6sGTIR.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.js +53 -53
- package/dist/Budgets/ManagedBudgetWithFees.d.ts +26 -0
- package/dist/Budgets/ManagedBudgetWithFees.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 +15 -15
- package/dist/Incentive-Boviez4z.js +1036 -0
- package/dist/Incentive-Boviez4z.js.map +1 -0
- package/dist/Incentive-wM4zizTH.cjs +2 -0
- package/dist/Incentive-wM4zizTH.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 +9 -1
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +64 -47
- 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 +12 -1
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +64 -33
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.d.ts +37 -1
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +73 -49
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20PeggedIncentive.d.ts +35 -0
- package/dist/Incentives/ERC20PeggedIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +35 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +25 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +24 -24
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +35 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +55 -38
- package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.d.ts +25 -0
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +2 -2
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.d.ts +8 -0
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +50 -28
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-CW4RwwRw.js +133 -0
- package/dist/{SimpleDenyList-ByAr4X1r.js.map → SimpleDenyList-CW4RwwRw.js.map} +1 -1
- package/dist/SimpleDenyList-Cybtz7AK.cjs +2 -0
- package/dist/{SimpleDenyList-CsRXJPwm.cjs.map → SimpleDenyList-Cybtz7AK.cjs.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
- package/dist/Validators/LimitedSignerValidator.js +33 -33
- package/dist/Validators/LimitedSignerValidator.js.map +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.js +26 -26
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +3 -3
- package/dist/deployments-CIXw_WKk.cjs +2 -0
- package/dist/deployments-CIXw_WKk.cjs.map +1 -0
- package/dist/{deployments-D0fs26TV.js → deployments-DqjtOTUr.js} +47 -47
- package/dist/{deployments-D0fs26TV.js.map → deployments-DqjtOTUr.js.map} +1 -1
- package/dist/deployments.json +24 -24
- package/dist/generated-DgXPUgXl.cjs +3 -0
- package/dist/generated-DgXPUgXl.cjs.map +1 -0
- package/dist/{generated-Cyvr_Tjx.js → generated-pJZHmRCK.js} +728 -459
- package/dist/generated-pJZHmRCK.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +137 -136
- package/package.json +1 -1
- package/src/Actions/EventAction.ts +108 -27
- package/src/BoostCore.test.ts +124 -2
- package/src/BoostCore.ts +227 -0
- package/src/Incentives/AllowListIncentive.ts +17 -0
- package/src/Incentives/CGDAIncentive.ts +31 -0
- package/src/Incentives/ERC20Incentive.ts +27 -0
- package/src/Incentives/ERC20PeggedIncentive.ts +18 -0
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts +26 -0
- package/src/Incentives/ERC20VariableIncentive.ts +18 -0
- package/src/Incentives/PointsIncentive.ts +22 -0
- package/dist/Budget-AoNx7uFd.cjs +0 -2
- package/dist/Budget-DYIV9iNK.js +0 -463
- package/dist/Incentive-BbkfwGOb.cjs +0 -2
- package/dist/Incentive-BbkfwGOb.cjs.map +0 -1
- package/dist/Incentive-qlnv5kQB.js +0 -991
- package/dist/Incentive-qlnv5kQB.js.map +0 -1
- package/dist/SimpleDenyList-ByAr4X1r.js +0 -133
- package/dist/SimpleDenyList-CsRXJPwm.cjs +0 -2
- package/dist/deployments-DoIOqxco.cjs +0 -2
- package/dist/deployments-DoIOqxco.cjs.map +0 -1
- package/dist/generated-Cyvr_Tjx.js.map +0 -1
- package/dist/generated-DtYPHhtX.cjs +0 -3
- package/dist/generated-DtYPHhtX.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleAllowList.cjs","sources":["../../src/AllowLists/SimpleAllowList.ts"],"sourcesContent":["import {\n readSimpleAllowListIsAllowed,\n readSimpleAllowListOwner,\n simpleAllowListAbi,\n simulateSimpleAllowListSetAllowed,\n writeSimpleAllowListSetAllowed,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleAllowList.sol/SimpleAllowList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { SimpleAllowList as SimpleAllowListBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport {\n DeployableTargetWithRBAC,\n Roles,\n} from '../Deployable/DeployableTargetWithRBAC';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { simpleAllowListAbi };\n\n/**\n * Object representation of a {@link SimpleAllowList} initialization payload.\n *\n * @export\n * @interface SimpleAllowListPayload\n * @typedef {SimpleAllowListPayload}\n */\nexport interface SimpleAllowListPayload {\n /**\n * The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of allowed addresses.\n *\n * @type {Address[]}\n */\n allowed: Address[];\n}\n\n/**\n * A generic `viem.Log` event with support for `SimpleAllowList` event types.\n *\n * @export\n * @typedef {SimpleAllowListLog}\n * @template {ContractEventName<\n * typeof simpleAllowListAbi\n * >} [event=ContractEventName<typeof simpleAllowListAbi>]\n */\nexport type SimpleAllowListLog<\n event extends ContractEventName<\n typeof simpleAllowListAbi\n > = ContractEventName<typeof simpleAllowListAbi>,\n> = GenericLog<typeof simpleAllowListAbi, event>;\n\n/**\n * A constant representing the list manager's role\n *\n * @deprecated use {@link Roles} instead\n * @type {1n}\n */\nexport const LIST_MANAGER_ROLE = Roles.MANAGER;\n/**\n * A simple implementation of an AllowList that checks if a user is authorized based on a list of allowed addresses\n *\n * @export\n * @class SimpleAllowList\n * @typedef {SimpleAllowList}\n * @extends {DeployableTargetWithRBAC<SimpleAllowListPayload>}\n */\nexport class SimpleAllowList extends DeployableTargetWithRBAC<\n SimpleAllowListPayload,\n typeof simpleAllowListAbi\n> {\n public override readonly abi = simpleAllowListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_SIMPLE_ALLOWLIST_BASE,\n ...(SimpleAllowListBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Retrieves the owner\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} - The address of the owner\n */\n public async owner(params?: ReadParams): Promise<Address> {\n return await readSimpleAllowListOwner(this._config, {\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n address: this.assertValidAddress(),\n args: [],\n });\n }\n\n /**\n * Check if a user is authorized.\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams,\n ): Promise<boolean> {\n return await readSimpleAllowListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams} [params]\n * @returns {Promise<void>}\n */\n public async setAllowed(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n return await this.awaitResult(\n this.setAllowedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setAllowedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: ReadParams,\n ) {\n const { request, result } = await simulateSimpleAllowListSetAllowed(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSimpleAllowListSetAllowed(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleAllowListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SimpleAllowListPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleAllowListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleAllowListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link SimpleAllowListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleAllowListPayload} param0\n * @param {Address} param0.owner - The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n * @param {Address[]} param0.allowed - List of allowed addresses.\n * @returns {Hex}\n */\nexport function prepareSimpleAllowListPayload({\n owner,\n allowed,\n}: SimpleAllowListPayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'allowed' },\n ],\n [owner, allowed],\n );\n}\n"],"names":["LIST_MANAGER_ROLE","Roles","_SimpleAllowList","DeployableTargetWithRBAC","simpleAllowListAbi","params","readSimpleAllowListOwner","address","readSimpleAllowListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleAllowListSetAllowed","writeSimpleAllowListSetAllowed","_payload","_options","payload","options","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleAllowListPayload","SimpleAllowListBases","RegistryType","SimpleAllowList","encodeAbiParameters"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SimpleAllowList.cjs","sources":["../../src/AllowLists/SimpleAllowList.ts"],"sourcesContent":["import {\n readSimpleAllowListIsAllowed,\n readSimpleAllowListOwner,\n simpleAllowListAbi,\n simulateSimpleAllowListSetAllowed,\n writeSimpleAllowListSetAllowed,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleAllowList.sol/SimpleAllowList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { SimpleAllowList as SimpleAllowListBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport {\n DeployableTargetWithRBAC,\n Roles,\n} from '../Deployable/DeployableTargetWithRBAC';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { simpleAllowListAbi };\n\n/**\n * Object representation of a {@link SimpleAllowList} initialization payload.\n *\n * @export\n * @interface SimpleAllowListPayload\n * @typedef {SimpleAllowListPayload}\n */\nexport interface SimpleAllowListPayload {\n /**\n * The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of allowed addresses.\n *\n * @type {Address[]}\n */\n allowed: Address[];\n}\n\n/**\n * A generic `viem.Log` event with support for `SimpleAllowList` event types.\n *\n * @export\n * @typedef {SimpleAllowListLog}\n * @template {ContractEventName<\n * typeof simpleAllowListAbi\n * >} [event=ContractEventName<typeof simpleAllowListAbi>]\n */\nexport type SimpleAllowListLog<\n event extends ContractEventName<\n typeof simpleAllowListAbi\n > = ContractEventName<typeof simpleAllowListAbi>,\n> = GenericLog<typeof simpleAllowListAbi, event>;\n\n/**\n * A constant representing the list manager's role\n *\n * @deprecated use {@link Roles} instead\n * @type {1n}\n */\nexport const LIST_MANAGER_ROLE = Roles.MANAGER;\n/**\n * A simple implementation of an AllowList that checks if a user is authorized based on a list of allowed addresses\n *\n * @export\n * @class SimpleAllowList\n * @typedef {SimpleAllowList}\n * @extends {DeployableTargetWithRBAC<SimpleAllowListPayload>}\n */\nexport class SimpleAllowList extends DeployableTargetWithRBAC<\n SimpleAllowListPayload,\n typeof simpleAllowListAbi\n> {\n public override readonly abi = simpleAllowListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_SIMPLE_ALLOWLIST_BASE,\n ...(SimpleAllowListBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Retrieves the owner\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} - The address of the owner\n */\n public async owner(params?: ReadParams): Promise<Address> {\n return await readSimpleAllowListOwner(this._config, {\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n address: this.assertValidAddress(),\n args: [],\n });\n }\n\n /**\n * Check if a user is authorized.\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams,\n ): Promise<boolean> {\n return await readSimpleAllowListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams} [params]\n * @returns {Promise<void>}\n */\n public async setAllowed(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n return await this.awaitResult(\n this.setAllowedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setAllowedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: ReadParams,\n ) {\n const { request, result } = await simulateSimpleAllowListSetAllowed(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSimpleAllowListSetAllowed(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleAllowListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SimpleAllowListPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleAllowListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleAllowListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link SimpleAllowListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleAllowListPayload} param0\n * @param {Address} param0.owner - The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n * @param {Address[]} param0.allowed - List of allowed addresses.\n * @returns {Hex}\n */\nexport function prepareSimpleAllowListPayload({\n owner,\n allowed,\n}: SimpleAllowListPayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'allowed' },\n ],\n [owner, allowed],\n );\n}\n"],"names":["LIST_MANAGER_ROLE","Roles","_SimpleAllowList","DeployableTargetWithRBAC","simpleAllowListAbi","params","readSimpleAllowListOwner","address","readSimpleAllowListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleAllowListSetAllowed","writeSimpleAllowListSetAllowed","_payload","_options","payload","options","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleAllowListPayload","SimpleAllowListBases","RegistryType","SimpleAllowList","encodeAbiParameters"],"mappings":"+wSA+EaA,EAAoBC,EAAM,MAAA,QAS1BC,EAAN,MAAMA,UAAwBC,EAAAA,wBAGnC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA6B/B,MAAa,MAAMC,EAAuC,CACjD,OAAA,MAAMC,EAAAA,GAAyB,KAAK,QAAS,CAClD,GAAG,KAAK,wBAAwB,EAEhC,GAAID,EACJ,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,CAAA,CACR,CACH,CAWA,MAAa,UACXE,EACAF,EACkB,CACX,OAAA,MAAMG,EAAAA,GAA6B,KAAK,QAAS,CACtD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACD,EAASE,UAAQ,EACxB,GAAG,KAAK,wBAAwB,EAEhC,GAAIJ,CAAA,CACL,CACH,CAaA,MAAa,WACXK,EACAC,EACAN,EACA,CACA,OAAO,MAAM,KAAK,YAChB,KAAK,cAAcK,EAAWC,EAASN,CAAM,CAAA,CAEjD,CAaA,MAAa,cACXK,EACAC,EACAN,EACA,CACA,KAAM,CAAE,QAAAO,EAAS,OAAAC,CAAO,EAAI,MAAMC,EAAA,GAChC,KAAK,QACL,CACE,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACJ,EAAWC,CAAO,EACzB,GAAG,KAAK,wBAAwB,EAEhC,GAAIN,CACN,CAAA,EAGK,MAAA,CAAE,KADI,MAAMU,EAA+B,GAAA,KAAK,QAASH,CAAO,EACxD,OAAAC,EACjB,CAUgB,gBACdG,EACAC,EACyB,OACzB,KAAM,CAACC,EAASC,CAAO,EAAI,KAAK,yBAC9BH,EACAC,CAAA,EAEF,GAAI,CAACC,EAAQ,OAASA,EAAQ,QAAUE,EAAAA,YAAa,CACnD,MAAMC,EAAQF,EAAQ,QAClBA,EAAQ,QAAQ,QAChBA,EAAQ,OACNG,EAAA,WAAWH,EAAQ,MAAM,EAAE,SAC3BI,EAAA,KAAK,WAAL,YAAAA,EAAe,QACrB,GAAIF,EACFH,EAAQ,MAAQG,MAEhB,OAAM,IAAIG,EAAoC,mCAElD,CACO,MAAA,CACL,IAAKpB,EAAA,EACL,SAAAqB,EACA,KAAM,CAACC,EAA8BR,CAAO,CAAC,EAC7C,GAAG,KAAK,wBAAwBC,EAAQ,OAAO,CAAA,CAEnD,CACF,EA3IEjB,EAAuB,MAAiC,CACtD,MAAO,OACP,GAAIyB,EAAA,eAAA,EASNzB,EAAuB,aAA6B0B,EAAa,aAAA,WAvB5D,IAAMC,EAAN3B,EAiKA,SAASwB,EAA8B,CAC5C,MAAAL,EACA,QAAAV,CACF,EAA2B,CAClB,OAAAmB,EAAA,oBACL,CACE,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,YAAa,KAAM,SAAU,CACvC,EACA,CAACT,EAAOV,CAAO,CAAA,CAEnB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z as s, as as i, at as n, au as l, av as h } from "../generated-pJZHmRCK.js";
|
|
2
2
|
import { getAccount as u } from "@wagmi/core";
|
|
3
3
|
import { zeroHash as A, zeroAddress as p, encodeAbiParameters as w } from "viem";
|
|
4
|
-
import { S as m } from "../deployments-
|
|
4
|
+
import { S as m } from "../deployments-DqjtOTUr.js";
|
|
5
5
|
import { Roles as y, DeployableTargetWithRBAC as g } from "../Deployable/DeployableTargetWithRBAC.js";
|
|
6
6
|
import { DeployableUnknownOwnerProvidedError as R } from "../errors.js";
|
|
7
|
-
import { RegistryType as
|
|
8
|
-
const L = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6118fe806100bd5f395ff3fe60806040526004361061014a575f3560e01c806354d1f13d116100b5578063e3f756de1161006e578063e3f756de146103f6578063ec87621c14610432578063f04e283e1461045c578063f2fde38b14610478578063fe9fbb8014610494578063fee81cf4146104d05761014a565b806354d1f13d1461033e578063715018a61461034857806375b238fc146103525780638da5cb5b1461037c578063be4994f8146103a6578063dcc21361146103ce5761014a565b80632de94807116101075780632de94807146102325780633abb06041461026e5780634359d28a14610296578063439fab91146102be5780634a4ee7b1146102e6578063514e62fc146103025761014a565b806301ffc9a71461014e578063183a4f6e1461018a5780631c10893f146101a65780631cd64df4146101c257806325692962146101fe57806328d6183b14610208575b5f80fd5b348015610159575f80fd5b50610174600480360381019061016f919061116e565b61050c565b60405161018191906111b3565b60405180910390f35b6101a4600480360381019061019f91906111ff565b610585565b005b6101c060048036038101906101bb9190611284565b610592565b005b3480156101cd575f80fd5b506101e860048036038101906101e39190611284565b6105a8565b6040516101f591906111b3565b60405180910390f35b6102066105be565b005b348015610213575f80fd5b5061021c61060f565b60405161022991906112d1565b60405180910390f35b34801561023d575f80fd5b50610258600480360381019061025391906112ea565b610636565b6040516102659190611324565b60405180910390f35b348015610279575f80fd5b50610294600480360381019061028f91906113f3565b61064f565b005b3480156102a1575f80fd5b506102bc60048036038101906102b791906113f3565b61078f565b005b3480156102c9575f80fd5b506102e460048036038101906102df91906114c6565b61089d565b005b61030060048036038101906102fb9190611284565b6109ba565b005b34801561030d575f80fd5b5061032860048036038101906103239190611284565b6109d0565b60405161033591906111b3565b60405180910390f35b6103466109e7565b005b610350610a20565b005b34801561035d575f80fd5b50610366610a33565b6040516103739190611324565b60405180910390f35b348015610387575f80fd5b50610390610a38565b60405161039d9190611520565b60405180910390f35b3480156103b1575f80fd5b506103cc60048036038101906103c7919061158e565b610a60565b005b3480156103d9575f80fd5b506103f460048036038101906103ef919061158e565b610b16565b005b348015610401575f80fd5b5061041c6004803603810190610417919061160c565b610bcc565b60405161042991906111b3565b60405180910390f35b34801561043d575f80fd5b50610446610c1f565b6040516104539190611324565b60405180910390f35b610476600480360381019061047191906112ea565b610c24565b005b610492600480360381019061048d91906112ea565b610c62565b005b34801561049f575f80fd5b506104ba60048036038101906104b591906112ea565b610c8b565b6040516104c791906111b3565b60405180910390f35b3480156104db575f80fd5b506104f660048036038101906104f191906112ea565b610cde565b6040516105039190611324565b60405180910390f35b5f7f1392d798000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061057e575061057d82610cf7565b5b9050919050565b61058f3382610d70565b50565b61059a610d7f565b6105a48282610db6565b5050565b5f81826105b485610636565b1614905092915050565b5f6105c7610dc6565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f1392d79800000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b61065833610c8b565b61068e576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8181905084849050146106cd576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84849050811015610788578282828181106106ed576106ec611669565b5b905060200201602081019061070291906116c0565b5f8087878581811061071757610716611669565b5b905060200201602081019061072c91906112ea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506106cf565b5050505050565b600261079a81610dd0565b8282905085859050146107d9576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610895575f8484838181106107fa576107f9611669565b5b905060200201602081019061080f91906116c0565b905060011515811515036108545761084f87878481811061083357610832611669565b5b905060200201602081019061084891906112ea565b6001610db6565b610887565b61088687878481811061086a57610869611669565b5b905060200201602081019061087f91906112ea565b6001610d70565b5b5080806001019150506107db565b505050505050565b5f6108a6610e05565b905080546003825580156108d85760018160011c14303b106108cf5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8084848101906108ea919061186e565b915091506108f782610e2e565b5f5b815181101561097d5760015f8084848151811061091957610918611669565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506108f9565b50505080156109b5576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6109c2610d7f565b6109cc8282610d70565b5050565b5f80826109dc85610636565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a28610d7f565b610a315f610f04565b565b600281565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6002610a6b81610dd0565b828290508585905014610aaa576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610b0e57610b01868683818110610acd57610acc611669565b5b9050602002016020810190610ae291906112ea565b858584818110610af557610af4611669565b5b90506020020135610db6565b8080600101915050610aac565b505050505050565b6002610b2181610dd0565b828290508585905014610b60576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610bc457610bb7868683818110610b8357610b82611669565b5b9050602002016020810190610b9891906112ea565b858584818110610bab57610baa611669565b5b90506020020135610d70565b8080600101915050610b62565b505050505050565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1690509392505050565b600181565b610c2c610d7f565b63389a75e1600c52805f526020600c208054421115610c5257636f5e88185f526004601cfd5b5f815550610c5f81610f04565b50565b610c6a610d7f565b8060601b610c7f57637448fbae5f526004601cfd5b610c8881610f04565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff16610cab610a38565b73ffffffffffffffffffffffffffffffffffffffff161480610cd75750610cd68260026001176109d0565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fe2089f79000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610d695750610d6882610fca565b5b9050919050565b610d7b82825f611043565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610db4576382b429005f526004601cfd5b565b610dc282826001611043565b5050565b5f6202a300905090565b638b78c6d819543314610e0257638b78c6d8600c52335f52806020600c205416610e01576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610e3661109b565b15610eae577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415610e7057630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350610f01565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b610f0c61109b565b15610f71577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550610fc7565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061103c575061103b8261109f565b5b9050919050565b638b78c6d8600c52825f526020600c2080548381178361106557848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61114d81611119565b8114611157575f80fd5b50565b5f8135905061116881611144565b92915050565b5f6020828403121561118357611182611111565b5b5f6111908482850161115a565b91505092915050565b5f8115159050919050565b6111ad81611199565b82525050565b5f6020820190506111c65f8301846111a4565b92915050565b5f819050919050565b6111de816111cc565b81146111e8575f80fd5b50565b5f813590506111f9816111d5565b92915050565b5f6020828403121561121457611213611111565b5b5f611221848285016111eb565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6112538261122a565b9050919050565b61126381611249565b811461126d575f80fd5b50565b5f8135905061127e8161125a565b92915050565b5f806040838503121561129a57611299611111565b5b5f6112a785828601611270565b92505060206112b8858286016111eb565b9150509250929050565b6112cb81611119565b82525050565b5f6020820190506112e45f8301846112c2565b92915050565b5f602082840312156112ff576112fe611111565b5b5f61130c84828501611270565b91505092915050565b61131e816111cc565b82525050565b5f6020820190506113375f830184611315565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261135e5761135d61133d565b5b8235905067ffffffffffffffff81111561137b5761137a611341565b5b60208301915083602082028301111561139757611396611345565b5b9250929050565b5f8083601f8401126113b3576113b261133d565b5b8235905067ffffffffffffffff8111156113d0576113cf611341565b5b6020830191508360208202830111156113ec576113eb611345565b5b9250929050565b5f805f806040858703121561140b5761140a611111565b5b5f85013567ffffffffffffffff81111561142857611427611115565b5b61143487828801611349565b9450945050602085013567ffffffffffffffff81111561145757611456611115565b5b6114638782880161139e565b925092505092959194509250565b5f8083601f8401126114865761148561133d565b5b8235905067ffffffffffffffff8111156114a3576114a2611341565b5b6020830191508360018202830111156114bf576114be611345565b5b9250929050565b5f80602083850312156114dc576114db611111565b5b5f83013567ffffffffffffffff8111156114f9576114f8611115565b5b61150585828601611471565b92509250509250929050565b61151a81611249565b82525050565b5f6020820190506115335f830184611511565b92915050565b5f8083601f84011261154e5761154d61133d565b5b8235905067ffffffffffffffff81111561156b5761156a611341565b5b60208301915083602082028301111561158757611586611345565b5b9250929050565b5f805f80604085870312156115a6576115a5611111565b5b5f85013567ffffffffffffffff8111156115c3576115c2611115565b5b6115cf87828801611349565b9450945050602085013567ffffffffffffffff8111156115f2576115f1611115565b5b6115fe87828801611539565b925092505092959194509250565b5f805f6040848603121561162357611622611111565b5b5f61163086828701611270565b935050602084013567ffffffffffffffff81111561165157611650611115565b5b61165d86828701611471565b92509250509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b61169f81611199565b81146116a9575f80fd5b50565b5f813590506116ba81611696565b92915050565b5f602082840312156116d5576116d4611111565b5b5f6116e2848285016116ac565b91505092915050565b5f6116f58261122a565b9050919050565b611705816116eb565b811461170f575f80fd5b50565b5f81359050611720816116fc565b92915050565b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61176c82611726565b810181811067ffffffffffffffff8211171561178b5761178a611736565b5b80604052505050565b5f61179d611108565b90506117a98282611763565b919050565b5f67ffffffffffffffff8211156117c8576117c7611736565b5b602082029050602081019050919050565b5f6117eb6117e6846117ae565b611794565b9050808382526020820190506020840283018581111561180e5761180d611345565b5b835b8181101561183757806118238882611270565b845260208401935050602081019050611810565b5050509392505050565b5f82601f8301126118555761185461133d565b5b81356118658482602086016117d9565b91505092915050565b5f806040838503121561188457611883611111565b5b5f61189185828601611712565b925050602083013567ffffffffffffffff8111156118b2576118b1611115565b5b6118be85828601611841565b915050925092905056fea264697066735822122090c78869e52e89aa7c5a8761f075c070cc7a94a0cc69bce24ebcce69c30c1b3464736f6c634300081a0033", O = y.MANAGER, d = class d extends g {
|
|
7
|
+
import { RegistryType as P } from "../utils.js";
|
|
8
|
+
const T = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b8160c01c808260011c146073578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b611160806100855f395ff3fe608060405260043610610183575f3560e01c806354d1f13d116100d1578063e3f756de1161007c578063f2fde38b11610057578063f2fde38b14610445578063fe9fbb8014610458578063fee81cf414610477575f80fd5b8063e3f756de146103d8578063ec87621c1461041e578063f04e283e14610432575f80fd5b80638da5cb5b116100ac5780638da5cb5b14610362578063be4994f81461039a578063dcc21361146103b9575f80fd5b806354d1f13d1461033e578063715018a61461034657806375b238fc1461034e575f80fd5b80632de9480711610131578063439fab911161010c578063439fab91146102d75780634a4ee7b1146102f6578063514e62fc14610309575f80fd5b80632de948071461025a5780633abb0604146102995780634359d28a146102b8575f80fd5b80631cd64df4116101615780631cd64df4146101e3578063256929621461021857806328d6183b14610220575f80fd5b806301ffc9a714610187578063183a4f6e146101bb5780631c10893f146101d0575b5f80fd5b348015610192575f80fd5b506101a66101a1366004610d5e565b6104a8565b60405190151581526020015b60405180910390f35b6101ce6101c9366004610da4565b610503565b005b6101ce6101de366004610dec565b610510565b3480156101ee575f80fd5b506101a66101fd366004610dec565b638b78c6d8600c9081525f9290925260209091205481161490565b6101ce610526565b34801561022b575f80fd5b506040517f1392d7980000000000000000000000000000000000000000000000000000000081526020016101b2565b348015610265575f80fd5b5061028b610274366004610e16565b638b78c6d8600c9081525f91909152602090205490565b6040519081526020016101b2565b3480156102a4575f80fd5b506101ce6102b3366004610e79565b610573565b3480156102c3575f80fd5b506101ce6102d2366004610e79565b6106a6565b3480156102e2575f80fd5b506101ce6102f1366004610f23565b6107a0565b6101ce610304366004610dec565b6108cf565b348015610314575f80fd5b506101a6610323366004610dec565b638b78c6d8600c9081525f9290925260209091205416151590565b6101ce6108e1565b6101ce61091a565b348015610359575f80fd5b5061028b600281565b34801561036d575f80fd5b50638b78c6d8195460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b2565b3480156103a5575f80fd5b506101ce6103b4366004610e79565b61092d565b3480156103c4575f80fd5b506101ce6103d3366004610e79565b6109cb565b3480156103e3575f80fd5b506101a66103f2366004610f62565b505073ffffffffffffffffffffffffffffffffffffffff165f9081526020819052604090205460ff1690565b348015610429575f80fd5b5061028b600181565b6101ce610440366004610e16565b610a69565b6101ce610453366004610e16565b610aa3565b348015610463575f80fd5b506101a6610472366004610e16565b610ac9565b348015610482575f80fd5b5061028b610491366004610e16565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f1392d7980000000000000000000000000000000000000000000000000000000014806104fd57506104fd82610b28565b92915050565b61050d3382610b7d565b50565b610518610b88565b6105228282610ba2565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b61057c33610ac9565b6105b2576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8281146105eb576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8381101561069f5782828281811061060757610607610fb3565b905060200201602081019061061c9190610fe0565b5f8087878581811061063057610630610fb3565b90506020020160208101906106459190610e16565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790556001016105ed565b5050505050565b60026106b181610bae565b8382146106ea576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610798575f84848381811061070757610707610fb3565b905060200201602081019061071c9190610fe0565b905080151560010361075e5761075987878481811061073d5761073d610fb3565b90506020020160208101906107529190610e16565b6001610ba2565b61078f565b61078f87878481811061077357610773610fb3565b90506020020160208101906107889190610e16565b6001610b7d565b506001016106ec565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60113280546003825580156107f15760018160011c14303b106107e85763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f806108008486018661102c565b9150915061080d82610bdf565b5f5b81518110156108925760015f8084848151811061082e5761082e610fb3565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905560010161080f565b50505080156108ca576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6108d7610b88565b6105228282610b7d565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610922610b88565b61092b5f610c27565b565b600261093881610bae565b838214610971576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610798576109c386868381811061099057610990610fb3565b90506020020160208101906109a59190610e16565b8585848181106109b7576109b7610fb3565b90506020020135610ba2565b600101610973565b60026109d681610bae565b838214610a0f576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8481101561079857610a61868683818110610a2e57610a2e610fb3565b9050602002016020810190610a439190610e16565b858584818110610a5557610a55610fb3565b90506020020135610b7d565b600101610a11565b610a71610b88565b63389a75e1600c52805f526020600c208054421115610a9757636f5e88185f526004601cfd5b5f905561050d81610c27565b610aab610b88565b8060601b610ac057637448fbae5f526004601cfd5b61050d81610c27565b5f8173ffffffffffffffffffffffffffffffffffffffff16610aee638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806104fd5750638b78c6d8600c9081525f839052602090205460031615156104fd565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fe2089f790000000000000000000000000000000000000000000000000000000014806104fd57506104fd82610c71565b61052282825f610d07565b638b78c6d81954331461092b576382b429005f526004601cfd5b61052282826001610d07565b638b78c6d81954331461050d57638b78c6d8600c52335f52806020600c20541661050d576382b429005f526004601cfd5b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806104fd57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146104fd565b638b78c6d8600c52825f526020600c20805483811783610d28575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f60208284031215610d6e575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610d9d575f80fd5b9392505050565b5f60208284031215610db4575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461050d575f80fd5b8035610de781610dbb565b919050565b5f8060408385031215610dfd575f80fd5b8235610e0881610dbb565b946020939093013593505050565b5f60208284031215610e26575f80fd5b8135610d9d81610dbb565b5f8083601f840112610e41575f80fd5b50813567ffffffffffffffff811115610e58575f80fd5b6020830191508360208260051b8501011115610e72575f80fd5b9250929050565b5f805f8060408587031215610e8c575f80fd5b843567ffffffffffffffff811115610ea2575f80fd5b610eae87828801610e31565b909550935050602085013567ffffffffffffffff811115610ecd575f80fd5b610ed987828801610e31565b95989497509550505050565b5f8083601f840112610ef5575f80fd5b50813567ffffffffffffffff811115610f0c575f80fd5b602083019150836020828501011115610e72575f80fd5b5f8060208385031215610f34575f80fd5b823567ffffffffffffffff811115610f4a575f80fd5b610f5685828601610ee5565b90969095509350505050565b5f805f60408486031215610f74575f80fd5b8335610f7f81610dbb565b9250602084013567ffffffffffffffff811115610f9a575f80fd5b610fa686828701610ee5565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215610ff0575f80fd5b81358015158114610d9d575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f806040838503121561103d575f80fd5b823561104881610dbb565b9150602083013567ffffffffffffffff811115611063575f80fd5b8301601f81018513611073575f80fd5b803567ffffffffffffffff81111561108d5761108d610fff565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811067ffffffffffffffff821117156110d8576110d8610fff565b6040529182526020818401810192908101888411156110f5575f80fd5b6020850194505b8385101561111b5761110d85610ddc565b8152602094850194016110fc565b5080945050505050925092905056fea2646970667358221220392d1f98427e115da35fb42135dcbab39c81d38fa3079a8b98ac9d488ba0c1f764736f6c634300081a0033", V = y.MANAGER, c = class c extends g {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.abi = s;
|
|
11
11
|
}
|
|
@@ -35,13 +35,13 @@ const L = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
35
35
|
* @param {?ReadParams} [params]
|
|
36
36
|
* @returns {Promise<boolean>} - True if the user is authorized
|
|
37
37
|
*/
|
|
38
|
-
async isAllowed(f,
|
|
38
|
+
async isAllowed(f, d) {
|
|
39
39
|
return await n(this._config, {
|
|
40
40
|
address: this.assertValidAddress(),
|
|
41
41
|
args: [f, A],
|
|
42
42
|
...this.optionallyAttachAccount(),
|
|
43
43
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
44
|
-
...
|
|
44
|
+
...d
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
@@ -55,9 +55,9 @@ const L = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
55
55
|
* @param {?ReadParams} [params]
|
|
56
56
|
* @returns {Promise<void>}
|
|
57
57
|
*/
|
|
58
|
-
async setAllowed(f,
|
|
58
|
+
async setAllowed(f, d, b) {
|
|
59
59
|
return await this.awaitResult(
|
|
60
|
-
this.setAllowedRaw(f,
|
|
60
|
+
this.setAllowedRaw(f, d, b)
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
@@ -71,18 +71,18 @@ const L = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
71
71
|
* @param {?ReadParams} [params]
|
|
72
72
|
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
73
73
|
*/
|
|
74
|
-
async setAllowedRaw(f,
|
|
75
|
-
const { request: e, result:
|
|
74
|
+
async setAllowedRaw(f, d, b) {
|
|
75
|
+
const { request: e, result: a } = await l(
|
|
76
76
|
this._config,
|
|
77
77
|
{
|
|
78
78
|
address: this.assertValidAddress(),
|
|
79
|
-
args: [f,
|
|
79
|
+
args: [f, d],
|
|
80
80
|
...this.optionallyAttachAccount(),
|
|
81
81
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
82
82
|
...b
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
|
-
return { hash: await h(this._config, e), result:
|
|
85
|
+
return { hash: await h(this._config, e), result: a };
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
88
|
* @inheritdoc
|
|
@@ -92,14 +92,14 @@ const L = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
92
92
|
* @param {?DeployableOptions} [_options]
|
|
93
93
|
* @returns {GenericDeployableParams}
|
|
94
94
|
*/
|
|
95
|
-
buildParameters(f,
|
|
96
|
-
var
|
|
95
|
+
buildParameters(f, d) {
|
|
96
|
+
var a;
|
|
97
97
|
const [b, e] = this.validateDeploymentConfig(
|
|
98
98
|
f,
|
|
99
|
-
|
|
99
|
+
d
|
|
100
100
|
);
|
|
101
101
|
if (!b.owner || b.owner === p) {
|
|
102
|
-
const t = e.account ? e.account.address : e.config ? u(e.config).address : (
|
|
102
|
+
const t = e.account ? e.account.address : e.config ? u(e.config).address : (a = this._account) == null ? void 0 : a.address;
|
|
103
103
|
if (t)
|
|
104
104
|
b.owner = t;
|
|
105
105
|
else
|
|
@@ -107,18 +107,18 @@ const L = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
107
107
|
}
|
|
108
108
|
return {
|
|
109
109
|
abi: s,
|
|
110
|
-
bytecode:
|
|
111
|
-
args: [
|
|
110
|
+
bytecode: T,
|
|
111
|
+
args: [_(b)],
|
|
112
112
|
...this.optionallyAttachAccount(e.account)
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
|
-
|
|
116
|
+
c.bases = {
|
|
117
117
|
31337: void 0,
|
|
118
118
|
...m
|
|
119
|
-
},
|
|
120
|
-
let r =
|
|
121
|
-
function
|
|
119
|
+
}, c.registryType = P.ALLOW_LIST;
|
|
120
|
+
let r = c;
|
|
121
|
+
function _({
|
|
122
122
|
owner: o,
|
|
123
123
|
allowed: f
|
|
124
124
|
}) {
|
|
@@ -131,9 +131,9 @@ function T({
|
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
133
|
export {
|
|
134
|
-
|
|
134
|
+
V as LIST_MANAGER_ROLE,
|
|
135
135
|
r as SimpleAllowList,
|
|
136
|
-
|
|
136
|
+
_ as prepareSimpleAllowListPayload,
|
|
137
137
|
s as simpleAllowListAbi
|
|
138
138
|
};
|
|
139
139
|
//# sourceMappingURL=SimpleAllowList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleAllowList.js","sources":["../../src/AllowLists/SimpleAllowList.ts"],"sourcesContent":["import {\n readSimpleAllowListIsAllowed,\n readSimpleAllowListOwner,\n simpleAllowListAbi,\n simulateSimpleAllowListSetAllowed,\n writeSimpleAllowListSetAllowed,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleAllowList.sol/SimpleAllowList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { SimpleAllowList as SimpleAllowListBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport {\n DeployableTargetWithRBAC,\n Roles,\n} from '../Deployable/DeployableTargetWithRBAC';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { simpleAllowListAbi };\n\n/**\n * Object representation of a {@link SimpleAllowList} initialization payload.\n *\n * @export\n * @interface SimpleAllowListPayload\n * @typedef {SimpleAllowListPayload}\n */\nexport interface SimpleAllowListPayload {\n /**\n * The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of allowed addresses.\n *\n * @type {Address[]}\n */\n allowed: Address[];\n}\n\n/**\n * A generic `viem.Log` event with support for `SimpleAllowList` event types.\n *\n * @export\n * @typedef {SimpleAllowListLog}\n * @template {ContractEventName<\n * typeof simpleAllowListAbi\n * >} [event=ContractEventName<typeof simpleAllowListAbi>]\n */\nexport type SimpleAllowListLog<\n event extends ContractEventName<\n typeof simpleAllowListAbi\n > = ContractEventName<typeof simpleAllowListAbi>,\n> = GenericLog<typeof simpleAllowListAbi, event>;\n\n/**\n * A constant representing the list manager's role\n *\n * @deprecated use {@link Roles} instead\n * @type {1n}\n */\nexport const LIST_MANAGER_ROLE = Roles.MANAGER;\n/**\n * A simple implementation of an AllowList that checks if a user is authorized based on a list of allowed addresses\n *\n * @export\n * @class SimpleAllowList\n * @typedef {SimpleAllowList}\n * @extends {DeployableTargetWithRBAC<SimpleAllowListPayload>}\n */\nexport class SimpleAllowList extends DeployableTargetWithRBAC<\n SimpleAllowListPayload,\n typeof simpleAllowListAbi\n> {\n public override readonly abi = simpleAllowListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_SIMPLE_ALLOWLIST_BASE,\n ...(SimpleAllowListBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Retrieves the owner\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} - The address of the owner\n */\n public async owner(params?: ReadParams): Promise<Address> {\n return await readSimpleAllowListOwner(this._config, {\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n address: this.assertValidAddress(),\n args: [],\n });\n }\n\n /**\n * Check if a user is authorized.\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams,\n ): Promise<boolean> {\n return await readSimpleAllowListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams} [params]\n * @returns {Promise<void>}\n */\n public async setAllowed(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n return await this.awaitResult(\n this.setAllowedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setAllowedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: ReadParams,\n ) {\n const { request, result } = await simulateSimpleAllowListSetAllowed(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSimpleAllowListSetAllowed(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleAllowListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SimpleAllowListPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleAllowListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleAllowListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link SimpleAllowListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleAllowListPayload} param0\n * @param {Address} param0.owner - The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n * @param {Address[]} param0.allowed - List of allowed addresses.\n * @returns {Hex}\n */\nexport function prepareSimpleAllowListPayload({\n owner,\n allowed,\n}: SimpleAllowListPayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'allowed' },\n ],\n [owner, allowed],\n );\n}\n"],"names":["LIST_MANAGER_ROLE","Roles","_SimpleAllowList","DeployableTargetWithRBAC","simpleAllowListAbi","params","readSimpleAllowListOwner","address","readSimpleAllowListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleAllowListSetAllowed","writeSimpleAllowListSetAllowed","_payload","_options","payload","options","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleAllowListPayload","SimpleAllowListBases","RegistryType","SimpleAllowList","encodeAbiParameters"],"mappings":";;;;;;;s4ZA+EaA,IAAoBC,EAAM,SAS1BC,IAAN,MAAMA,UAAwBC,EAGnC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,MAAMC,GAAuC;AACjD,WAAA,MAAMC,EAAyB,KAAK,SAAS;AAAA,MAClD,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAID;AAAA,MACJ,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA,IAAA,CACR;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAa,UACXE,GACAF,GACkB;AACX,WAAA,MAAMG,EAA6B,KAAK,SAAS;AAAA,MACtD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACD,GAASE,CAAQ;AAAA,MACxB,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAIJ;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAa,WACXK,GACAC,GACAN,GACA;AACA,WAAO,MAAM,KAAK;AAAA,MAChB,KAAK,cAAcK,GAAWC,GAASN,CAAM;AAAA,IAAA;AAAA,EAEjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAa,cACXK,GACAC,GACAN,GACA;AACA,UAAM,EAAE,SAAAO,GAAS,QAAAC,EAAO,IAAI,MAAMC;AAAAA,MAChC,KAAK;AAAA,MACL;AAAA,QACE,SAAS,KAAK,mBAAmB;AAAA,QACjC,MAAM,CAACJ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\n readSimpleAllowListIsAllowed,\n readSimpleAllowListOwner,\n simpleAllowListAbi,\n simulateSimpleAllowListSetAllowed,\n writeSimpleAllowListSetAllowed,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleAllowList.sol/SimpleAllowList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { SimpleAllowList as SimpleAllowListBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport {\n DeployableTargetWithRBAC,\n Roles,\n} from '../Deployable/DeployableTargetWithRBAC';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { simpleAllowListAbi };\n\n/**\n * Object representation of a {@link SimpleAllowList} initialization payload.\n *\n * @export\n * @interface SimpleAllowListPayload\n * @typedef {SimpleAllowListPayload}\n */\nexport interface SimpleAllowListPayload {\n /**\n * The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of allowed addresses.\n *\n * @type {Address[]}\n */\n allowed: Address[];\n}\n\n/**\n * A generic `viem.Log` event with support for `SimpleAllowList` event types.\n *\n * @export\n * @typedef {SimpleAllowListLog}\n * @template {ContractEventName<\n * typeof simpleAllowListAbi\n * >} [event=ContractEventName<typeof simpleAllowListAbi>]\n */\nexport type SimpleAllowListLog<\n event extends ContractEventName<\n typeof simpleAllowListAbi\n > = ContractEventName<typeof simpleAllowListAbi>,\n> = GenericLog<typeof simpleAllowListAbi, event>;\n\n/**\n * A constant representing the list manager's role\n *\n * @deprecated use {@link Roles} instead\n * @type {1n}\n */\nexport const LIST_MANAGER_ROLE = Roles.MANAGER;\n/**\n * A simple implementation of an AllowList that checks if a user is authorized based on a list of allowed addresses\n *\n * @export\n * @class SimpleAllowList\n * @typedef {SimpleAllowList}\n * @extends {DeployableTargetWithRBAC<SimpleAllowListPayload>}\n */\nexport class SimpleAllowList extends DeployableTargetWithRBAC<\n SimpleAllowListPayload,\n typeof simpleAllowListAbi\n> {\n public override readonly abi = simpleAllowListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_SIMPLE_ALLOWLIST_BASE,\n ...(SimpleAllowListBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Retrieves the owner\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} - The address of the owner\n */\n public async owner(params?: ReadParams): Promise<Address> {\n return await readSimpleAllowListOwner(this._config, {\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n address: this.assertValidAddress(),\n args: [],\n });\n }\n\n /**\n * Check if a user is authorized.\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams,\n ): Promise<boolean> {\n return await readSimpleAllowListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams} [params]\n * @returns {Promise<void>}\n */\n public async setAllowed(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n return await this.awaitResult(\n this.setAllowedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setAllowedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: ReadParams,\n ) {\n const { request, result } = await simulateSimpleAllowListSetAllowed(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSimpleAllowListSetAllowed(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleAllowListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SimpleAllowListPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleAllowListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleAllowListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link SimpleAllowListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleAllowListPayload} param0\n * @param {Address} param0.owner - The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.\n * @param {Address[]} param0.allowed - List of allowed addresses.\n * @returns {Hex}\n */\nexport function prepareSimpleAllowListPayload({\n owner,\n allowed,\n}: SimpleAllowListPayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'allowed' },\n ],\n [owner, allowed],\n );\n}\n"],"names":["LIST_MANAGER_ROLE","Roles","_SimpleAllowList","DeployableTargetWithRBAC","simpleAllowListAbi","params","readSimpleAllowListOwner","address","readSimpleAllowListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleAllowListSetAllowed","writeSimpleAllowListSetAllowed","_payload","_options","payload","options","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleAllowListPayload","SimpleAllowListBases","RegistryType","SimpleAllowList","encodeAbiParameters"],"mappings":";;;;;;;09RA+EaA,IAAoBC,EAAM,SAS1BC,IAAN,MAAMA,UAAwBC,EAGnC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,MAAMC,GAAuC;AACjD,WAAA,MAAMC,EAAyB,KAAK,SAAS;AAAA,MAClD,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAID;AAAA,MACJ,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA,IAAA,CACR;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAa,UACXE,GACAF,GACkB;AACX,WAAA,MAAMG,EAA6B,KAAK,SAAS;AAAA,MACtD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACD,GAASE,CAAQ;AAAA,MACxB,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAIJ;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,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eAA6B0B,EAAa;AAvB5D,IAAMC,IAAN3B;AAiKA,SAASwB,EAA8B;AAAA,EAC5C,OAAAL;AAAA,EACA,SAAAV;AACF,GAA2B;AAClB,SAAAmB;AAAA,IACL;AAAA,MACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,aAAa,MAAM,UAAU;AAAA,IACvC;AAAA,IACA,CAACT,GAAOV,CAAO;AAAA,EAAA;AAEnB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../generated-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../generated-DgXPUgXl.cjs"),e=require("../SimpleDenyList-Cybtz7AK.cjs");require("@wagmi/core");require("viem");require("../deployments-CIXw_WKk.cjs");require("../Deployable/DeployableTargetWithRBAC.cjs");require("../errors.cjs");require("../utils.cjs");exports.simpleDenyListAbi=r.B;exports.SimpleDenyList=e.SimpleDenyList;exports.prepareSimpleDenyListPayload=e.prepareSimpleDenyListPayload;
|
|
2
2
|
//# sourceMappingURL=SimpleDenyList.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as y, p as n } from "../SimpleDenyList-
|
|
1
|
+
import { B as a } from "../generated-pJZHmRCK.js";
|
|
2
|
+
import { S as y, p as n } from "../SimpleDenyList-CW4RwwRw.js";
|
|
3
3
|
import "@wagmi/core";
|
|
4
4
|
import "viem";
|
|
5
|
-
import "../deployments-
|
|
5
|
+
import "../deployments-DqjtOTUr.js";
|
|
6
6
|
import "../Deployable/DeployableTargetWithRBAC.js";
|
|
7
7
|
import "../errors.js";
|
|
8
8
|
import "../utils.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../generated-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../generated-DgXPUgXl.cjs"),s=require("../Deployable/Deployable.cjs"),r="0x6080604052348015600e575f80fd5b5060bd80601a5f395ff3fe6080604052348015600e575f80fd5b50600436106026575f3560e01c8063fe9fbb8014602a575b5f80fd5b603b6035366004604f565b50600190565b604051901515815260200160405180910390f35b5f60208284031215605e575f80fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146080575f80fd5b939250505056fea26469706673582212209d268ab735201492a016395f826a0af564ff7d365d582344470d8cb83e05fc4464736f6c634300081a0033";class o extends s.Deployable{constructor(){super(...arguments),this.abi=f.$e}async isAuthorized(t,e){return await f.X1(this._config,{address:this.assertValidAddress(),args:[t],...e})}buildParameters(t,e){const[d,a]=this.validateDeploymentConfig({},e);return{abi:f.$e,bytecode:r,args:[],...this.optionallyAttachAccount(a.account)}}}exports.passthroughAuthAbi=f.$e;exports.PassthroughAuth=o;
|
|
2
2
|
//# sourceMappingURL=PassthroughAuth.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PassthroughAuth.cjs","sources":["../../src/Auth/PassthroughAuth.ts"],"sourcesContent":["import {\n passthroughAuthAbi,\n readPassthroughAuthIsAuthorized,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/auth/PassthroughAuth.sol/PassthroughAuth.json';\nimport type { Address, ContractEventName, Hex } from 'viem';\nimport {\n Deployable,\n type DeployableOptions,\n type GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport type { GenericLog, ReadParams } from '../utils';\n\nexport { passthroughAuthAbi };\n\n/**\n * A generic `viem.Log` event with support for `PassthroughAuth` event types.\n *\n * @export\n * @typedef {PassthroughAuthLog}\n * @template {ContractEventName<\n * typeof passthroughAuthAbi\n * >} [event=ContractEventName<typeof passthroughAuthAbi>]\n */\nexport type PassthroughAuthLog<\n event extends ContractEventName<\n typeof passthroughAuthAbi\n > = ContractEventName<typeof passthroughAuthAbi>,\n> = GenericLog<typeof passthroughAuthAbi, event>;\n\n/**\n * A simple implementation of a Validator that verifies a given signature and checks the recovered address against a set of authorized signers\n *\n * @export\n * @class PassthroughAuth\n * @typedef {PassthroughAuth}\n * @extends {DeployableTarget<PassthroughAuthPayload>}\n */\nexport class PassthroughAuth extends Deployable<\n // biome-ignore lint/suspicious/noExplicitAny: takes no parameters\n any,\n typeof passthroughAuthAbi\n> {\n public override readonly abi = passthroughAuthAbi;\n\n public async isAuthorized(address: Address, params?: ReadParams) {\n return await readPassthroughAuthIsAuthorized(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?PassthroughAuthPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: never,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [_, options] = this.validateDeploymentConfig({}, _options);\n return {\n abi: passthroughAuthAbi,\n bytecode: bytecode as Hex,\n // biome-ignore lint/suspicious/noExplicitAny: <takes no payload>\n args: [] as any,\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["PassthroughAuth","Deployable","passthroughAuthAbi","address","params","readPassthroughAuthIsAuthorized","_payload","_options","_","options","bytecode"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PassthroughAuth.cjs","sources":["../../src/Auth/PassthroughAuth.ts"],"sourcesContent":["import {\n passthroughAuthAbi,\n readPassthroughAuthIsAuthorized,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/auth/PassthroughAuth.sol/PassthroughAuth.json';\nimport type { Address, ContractEventName, Hex } from 'viem';\nimport {\n Deployable,\n type DeployableOptions,\n type GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport type { GenericLog, ReadParams } from '../utils';\n\nexport { passthroughAuthAbi };\n\n/**\n * A generic `viem.Log` event with support for `PassthroughAuth` event types.\n *\n * @export\n * @typedef {PassthroughAuthLog}\n * @template {ContractEventName<\n * typeof passthroughAuthAbi\n * >} [event=ContractEventName<typeof passthroughAuthAbi>]\n */\nexport type PassthroughAuthLog<\n event extends ContractEventName<\n typeof passthroughAuthAbi\n > = ContractEventName<typeof passthroughAuthAbi>,\n> = GenericLog<typeof passthroughAuthAbi, event>;\n\n/**\n * A simple implementation of a Validator that verifies a given signature and checks the recovered address against a set of authorized signers\n *\n * @export\n * @class PassthroughAuth\n * @typedef {PassthroughAuth}\n * @extends {DeployableTarget<PassthroughAuthPayload>}\n */\nexport class PassthroughAuth extends Deployable<\n // biome-ignore lint/suspicious/noExplicitAny: takes no parameters\n any,\n typeof passthroughAuthAbi\n> {\n public override readonly abi = passthroughAuthAbi;\n\n public async isAuthorized(address: Address, params?: ReadParams) {\n return await readPassthroughAuthIsAuthorized(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?PassthroughAuthPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: never,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [_, options] = this.validateDeploymentConfig({}, _options);\n return {\n abi: passthroughAuthAbi,\n bytecode: bytecode as Hex,\n // biome-ignore lint/suspicious/noExplicitAny: <takes no payload>\n args: [] as any,\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["PassthroughAuth","Deployable","passthroughAuthAbi","address","params","readPassthroughAuthIsAuthorized","_payload","_options","_","options","bytecode"],"mappings":"4lBAuCO,MAAMA,UAAwBC,EAAAA,UAInC,CAJK,aAAA,CAAA,MAAA,GAAA,SAAA,EAKL,KAAyB,IAAMC,IAAA,CAE/B,MAAa,aAAaC,EAAkBC,EAAqB,CACxD,OAAA,MAAMC,EAAAA,GAAgC,KAAK,QAAS,CACzD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACF,CAAO,EAEd,GAAIC,CAAA,CACL,CACH,CAUgB,gBACdE,EACAC,EACyB,CACnB,KAAA,CAACC,EAAGC,CAAO,EAAI,KAAK,yBAAyB,CAAA,EAAIF,CAAQ,EACxD,MAAA,CACL,IAAKL,EAAA,GACL,SAAAQ,EAEA,KAAM,CAAC,EACP,GAAG,KAAK,wBAAwBD,EAAQ,OAAO,CAAA,CAEnD,CACF"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Deployable as
|
|
3
|
-
const
|
|
4
|
-
class n extends
|
|
1
|
+
import { $ as t, a3 as e } from "../generated-pJZHmRCK.js";
|
|
2
|
+
import { Deployable as o } from "../Deployable/Deployable.js";
|
|
3
|
+
const r = "0x6080604052348015600e575f80fd5b5060bd80601a5f395ff3fe6080604052348015600e575f80fd5b50600436106026575f3560e01c8063fe9fbb8014602a575b5f80fd5b603b6035366004604f565b50600190565b604051901515815260200160405180910390f35b5f60208284031215605e575f80fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146080575f80fd5b939250505056fea26469706673582212209d268ab735201492a016395f826a0af564ff7d365d582344470d8cb83e05fc4464736f6c634300081a0033";
|
|
4
|
+
class n extends o {
|
|
5
5
|
constructor() {
|
|
6
|
-
super(...arguments), this.abi =
|
|
6
|
+
super(...arguments), this.abi = t;
|
|
7
7
|
}
|
|
8
|
-
async isAuthorized(
|
|
9
|
-
return await
|
|
8
|
+
async isAuthorized(a, f) {
|
|
9
|
+
return await e(this._config, {
|
|
10
10
|
address: this.assertValidAddress(),
|
|
11
|
-
args: [
|
|
11
|
+
args: [a],
|
|
12
12
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
13
13
|
...f
|
|
14
14
|
});
|
|
@@ -21,19 +21,19 @@ class n extends e {
|
|
|
21
21
|
* @param {?DeployableOptions} [_options]
|
|
22
22
|
* @returns {GenericDeployableParams}
|
|
23
23
|
*/
|
|
24
|
-
buildParameters(
|
|
25
|
-
const [
|
|
24
|
+
buildParameters(a, f) {
|
|
25
|
+
const [d, s] = this.validateDeploymentConfig({}, f);
|
|
26
26
|
return {
|
|
27
|
-
abi:
|
|
28
|
-
bytecode:
|
|
27
|
+
abi: t,
|
|
28
|
+
bytecode: r,
|
|
29
29
|
// biome-ignore lint/suspicious/noExplicitAny: <takes no payload>
|
|
30
30
|
args: [],
|
|
31
|
-
...this.optionallyAttachAccount(
|
|
31
|
+
...this.optionallyAttachAccount(s.account)
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
36
36
|
n as PassthroughAuth,
|
|
37
|
-
|
|
37
|
+
t as passthroughAuthAbi
|
|
38
38
|
};
|
|
39
39
|
//# sourceMappingURL=PassthroughAuth.js.map
|
package/dist/Boost.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Boost.cjs","sources":["../../../node_modules/.pnpm/solady@0.0.208/node_modules/solady/js/solady.js","../src/Boost.ts"],"sourcesContent":["/**\n * Accompanying JavaScript library for Solady.\n *\n * To install:\n * \n * ```\n * npm install solady\n * ```\n *\n * Module exports:\n * \n * - `LibZip`\n * - `flzCompress(data)`: Compresses hex encoded data with FastLZ.\n * - `flzDecompress(data)`: Decompresses hex encoded data with FastLZ.\n * - `cdCompress(data)`: Compresses hex encoded calldata.\n * - `cdDecompress(data)`: Decompresses hex encoded calldata.\n * \n * - `ERC1967Factory`\n * - `address`: Canonical address of Solady's ERC1967Factory.\n * - `abi`: ABI of Solady's ERC1967Factory.\n *\n * @module solady\n */\n(function(global, factory) {\n\n \"use strict\";\n\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n module.exports = factory(global, 1);\n if (typeof exports === \"object\") {\n exports.LibZip = module.exports.LibZip;\n exports.ERC1967Factory = module.exports.ERC1967Factory;\n }\n } else {\n factory(global);\n }\n\n})(typeof window !== \"undefined\" ? window : this, function(window, noGlobal) {\n\n \"use strict\";\n\n var solady = {};\n\n /*============================================================*/\n /* LibZip Operations */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/LibZip.sol\n\n /**\n * FastLZ and calldata compression / decompression functions.\n * @namespace\n * @alias module:solady.LibZip\n */\n var LibZip = {};\n\n solady.LibZip = LibZip;\n\n function hexString(data) {\n if (typeof data === \"string\" || data instanceof String) {\n if (data = data.match(/^[\\s\\uFEFF\\xA0]*(0[Xx])?([0-9A-Fa-f]*)[\\s\\uFEFF\\xA0]*$/)) {\n if (data[2].length % 2) {\n throw new Error(\"Hex string length must be a multiple of 2.\");\n }\n return data[2];\n }\n }\n throw new Error(\"Data must be a hex string.\");\n }\n\n function byteToString(b) {\n return (b | 0x100).toString(16).slice(1);\n }\n\n function parseByte(data, i) {\n return parseInt(data.substr(i, 2), 16);\n }\n\n function hexToBytes(data) {\n var a = [], i = 0;\n for (; i < data.length; i += 2) a.push(parseByte(data, i));\n return a;\n }\n\n function bytesToHex(a) {\n var o = \"0x\", i = 0;\n for (; i < a.length; o += byteToString(a[i++])) ;\n return o;\n }\n\n /**\n * Compresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.flzCompress = function(data) {\n var ib = hexToBytes(hexString(data)), b = ib.length - 4;\n var ht = [], ob = [], a = 0, i = 2, o = 0, j, s, h, d, c, l, r, p, q, e;\n\n function u24(i) {\n return ib[i] | (ib[++i] << 8) | (ib[++i] << 16);\n }\n\n function hash(x) {\n return ((2654435769 * x) >> 19) & 8191;\n }\n\n function literals(r, s) {\n while (r >= 32) for (ob[o++] = 31, j = 32; j--; r--) ob[o++] = ib[s++];\n if (r) for (ob[o++] = r - 1; r--; ) ob[o++] = ib[s++];\n }\n\n while (i < b - 9) {\n do {\n r = ht[h = hash(s = u24(i))] || 0;\n c = (d = (ht[h] = i) - r) < 8192 ? u24(r) : 0x1000000;\n } while (i < b - 9 && i++ && s != c);\n if (i >= b - 9) break;\n if (--i > a) literals(i - a, a);\n for (l = 0, p = r + 3, q = i + 3, e = b - q; l < e; l++) e *= ib[p + l] === ib[q + l];\n i += l;\n for (--d; l > 262; l -= 262) ob[o++] = 224 + (d >> 8), ob[o++] = 253, ob[o++] = d & 255;\n if (l < 7) ob[o++] = (l << 5) + (d >> 8), ob[o++] = d & 255;\n else ob[o++] = 224 + (d >> 8), ob[o++] = l - 7, ob[o++] = d & 255;\n ht[hash(u24(i))] = i++, ht[hash(u24(i))] = i++, a = i;\n }\n literals(b + 4 - a, a);\n return bytesToHex(ob);\n }\n\n /**\n * Decompresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.flzDecompress = function(data) {\n var ib = hexToBytes(hexString(data)), i = 0, o = 0, l, f, t, r, h, ob = [];\n while (i < ib.length) {\n if (!(t = ib[i] >> 5)) {\n for (l = 1 + ib[i++]; l--;) ob[o++] = ib[i++];\n } else {\n f = 256 * (ib[i] & 31) + ib[i + 2 - (t = t < 7)];\n l = t ? 2 + (ib[i] >> 5) : 9 + ib[i + 1];\n i = i + 3 - t;\n r = o - f - 1;\n while (l--) ob[o++] = ob[r++];\n }\n }\n return bytesToHex(ob);\n }\n\n /**\n * Compresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.cdCompress = function(data) {\n data = hexString(data);\n var o = \"0x\", z = 0, y = 0, i = 0, c;\n\n function pushByte(b) {\n o += byteToString(((o.length < 4 * 2 + 2) * 0xff) ^ b);\n }\n\n function rle(v, d) {\n pushByte(0x00);\n pushByte(d - 1 + v * 0x80);\n }\n\n for (; i < data.length; i += 2) {\n c = parseByte(data, i);\n if (!c) {\n if (y) rle(1, y), y = 0;\n if (++z === 0x80) rle(0, 0x80), z = 0;\n continue;\n }\n if (c === 0xff) {\n if (z) rle(0, z), z = 0;\n if (++y === 0x20) rle(1, 0x20), y = 0;\n continue;\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n pushByte(c);\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n return o;\n }\n\n /**\n * Decompresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.cdDecompress = function(data) {\n data = hexString(data);\n var o = \"0x\", i = 0, j, c, s;\n\n while (i < data.length) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n i += 2;\n if (!c) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n s = (c & 0x7f) + 1;\n i += 2;\n for (j = 0; j < s; ++j) o += byteToString((c >> 7 && j < 32) * 0xff);\n continue;\n }\n o += byteToString(c);\n }\n return o;\n }\n\n /*============================================================*/\n /* ERC1967Factory */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/ERC1967Factory.sol\n\n /**\n * ERC1967Factory canonical address and ABI.\n * @namespace\n * @alias module:solady.ERC1967Factory\n */\n var ERC1967Factory = {};\n\n solady.ERC1967Factory = ERC1967Factory;\n\n /**\n * Canonical address of Solady's ERC1967Factory.\n * @type {string}\n */\n ERC1967Factory.address = \"0x0000000000006396FF2a80c067f99B3d2Ab4Df24\";\n\n /**\n * ABI of Solady's ERC1967Factory.\n * @type {Object}\n */\n ERC1967Factory.abi = JSON.parse('[{0:[],1:\"DeploymentFailed\"96\"SaltDoesNotStartWithCaller\"96\"Unauthorized\"96\"UpgradeFailed\",2:3959790,9791],1:\"AdminChanged\",2:10959790,9792,9791],1:\"Deployed\",2:10959790,9792],1:\"Upgraded\",2:10},{0:[{90],1:\"adminOf\",12:[{9199{0:[{90,{91],1:\"changeAdmin\",12:[],13:\"nonpayable\",2:15},{0:[{92,{91],1:\"deploy\",12:[{9098,{0:[{92,{91,{94],1:\"deployAndCall\",12:[{9098,{0:[{92,{91,{93],1:\"deployDeterministic\",12:[{9098,{0:[{92,{91,{93,{94],1:\"deployDeterministicAndCall\",12:[{9098,{0:[],1:\"initCodeHash\",12:[{6:19,1:\"result\",2:19}99{0:[{93],1:\"predictDeterministicAddress\",12:[{6:7,1:\"predicted\",2:7}99{0:[{90,{92],1:\"upgrade\",12:[98,{0:[{90,{92,{94],1:\"upgradeAndCall\",12:[98]'.replace(/9\\d/g, function (m) { return [\"6:7,1:8,2:7}\",\"6:7,1:9,2:7}\",\"6:7,1:11,2:7}\",\"6:19,1:20,2:19}\",\"6:17,1:18,2:17}\",\"},{4:false,0:[\",\",2:3},{0:[],1:\",\"{5:true,\",\"],13:16,2:15}\",\"],13:14,2:15},\"][m-90] }).replace(/\\d+/g, function (m) { return '\"' + (\"inputs,name,type,error,anonymous,indexed,internalType,address,proxy,admin,event,implementation,outputs,stateMutability,view,function,payable,bytes,data,bytes32,salt\".split(\",\")[m]) + '\"' }));\n\n /*--------------------------- END ----------------------------*/\n\n if (typeof define === \"function\" && define.amd) {\n define(\"solady\", [], function() {\n return solady\n });\n }\n\n if (!noGlobal) {\n window.solady = solady;\n }\n\n return solady;\n});\n","import { LibZip } from 'solady';\nimport {\n type Address,\n type Hex,\n encodeAbiParameters,\n parseAbiParameters,\n zeroAddress,\n} from 'viem';\nimport type { Action } from './Actions/Action';\nimport type { AllowList } from './AllowLists/AllowList';\nimport type { Budget } from './Budgets/Budget';\nimport type { Incentive } from './Incentives/Incentive';\nimport type { Validator } from './Validators/Validator';\n\n/**\n * Interface representing a `BoostLib.Boost` on-chain struct\n *\n * @export\n * @interface RawBoost\n * @typedef {RawBoost}\n */\nexport interface RawBoost {\n action: Address;\n validator: Address;\n allowList: Address;\n budget: Address;\n incentives: readonly Address[];\n protocolFee: bigint;\n maxParticipants: bigint;\n owner: Address;\n}\n\n/**\n * Configuration used to instantiate a `Boost` instance.\n *\n * @export\n * @interface BoostConfig\n * @typedef {BoostConfig}\n */\nexport interface BoostConfig {\n /**\n *\n * @type {bigint}\n */\n id: bigint;\n /**\n *\n * @type {Budget}\n */\n budget: Budget;\n /**\n *\n * @type {Action}\n */\n action: Action;\n /**\n *\n * @type {Validator}\n */\n validator: Validator;\n /**\n *\n * @type {AllowList}\n */\n allowList: AllowList;\n /**\n *\n * @type {Array<Incentive>}\n */\n incentives: Array<Incentive>;\n /**\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n *\n * @type {?Address}\n */\n owner?: Address;\n}\n\n/**\n * A struct representing a single Boost. Typically you would not construct this directly, rather get an instance from `BoostCore.createBoost` or `BoostCore.getBoost`\n *\n * @export\n * @class Boost\n * @typedef {Boost}\n */\nexport class Boost {\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly id: bigint;\n /**\n *\n * @readonly\n * @type {Budget}\n */\n readonly budget: Budget;\n /**\n *\n * @readonly\n * @type {Action}\n */\n readonly action: Action;\n /**\n *\n * @readonly\n * @type {Validator}\n */\n readonly validator: Validator;\n /**\n *\n * @readonly\n * @type {AllowList}\n */\n readonly allowList: AllowList;\n /**\n *\n * @readonly\n * @type {Array<Incentive>}\n */\n readonly incentives: Array<Incentive>;\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly protocolFee: bigint;\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly maxParticipants: bigint;\n /**\n *\n * @readonly\n * @type {Address}\n */\n readonly owner: Address;\n\n /**\n * Creates an instance of Boost.\n *\n * @constructor\n * @param {BoostConfig} config\n */\n constructor(config: BoostConfig) {\n this.id = config.id;\n this.budget = config.budget;\n this.action = config.action;\n this.validator = config.validator;\n this.allowList = config.allowList;\n this.incentives = config.incentives;\n this.protocolFee = config.protocolFee || 0n;\n this.maxParticipants = config.maxParticipants || 0n;\n this.owner = config.owner || zeroAddress;\n }\n}\n\n/**\n * Object representation of `BoostLib.Target` struct. Used for low level Boost creation operations.\n * This is used to pass the base contract and its initialization parameters in an efficient manner\n *\n * @export\n * @typedef {Target}\n */\nexport type Target = {\n isBase: boolean;\n instance: Address;\n parameters: Hex;\n};\n\n/**\n * Object representation of `BoostCore.InitPayload` struct.\n *\n * @export\n * @interface BoostPayload\n * @typedef {BoostPayload}\n */\nexport interface BoostPayload {\n /**\n * Address to valid budget.\n *\n * @type {Address}\n */\n budget: Address;\n /**\n * Target for existing action, or base with initialization payload.\n *\n * @type {Target}\n */\n action: Target;\n /**\n * Target for existing validator, or base with initialization payload.\n *\n * @type {Target}\n */\n validator: Target;\n /**\n * Target for existing allowList, or base with initialization payload.\n *\n * @type {Target}\n */\n allowList: Target;\n /**\n * Targets for new incentives, with initialization payloads.\n *\n * @type {Target[]}\n */\n incentives: Target[];\n /**\n * The base protocol fee (in bps)\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n * Optional maximum amount of participants in the Boost.\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n * The owner of the Boost.\n *\n * @type {Address}\n */\n owner: Address;\n}\n\n/**\n * Given a valid {@link BoostPayload}, properly encode and compress the payload for use with `createBoost`\n *\n * @export\n * @param {BoostPayload} param0\n * @param {Address} param0.budget - Address to valid budget.\n * @param {Target} param0.action - Target for existing action, or base with initialization payload.\n * @param {Target} param0.validator - Target for existing validator, or base with initialization payload.\n * @param {Target} param0.allowList - Target for existing allowList, or base with initialization payload.\n * @param {Target[]} param0.incentives - Targets for new incentives, with initialization payloads.\n * @param {bigint} [param0.protocolFee=0n] - The base protocol fee (in bps)\n * @param {bigint} [param0.maxParticipants=0n] - Optional maximum amount of participants in the Boost.\n * @param {Address} param0.owner - The owner of the Boost.\n * @returns {Hex}\n */\nexport function prepareBoostPayload({\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee = 0n,\n maxParticipants = 0n,\n owner,\n}: BoostPayload): Hex {\n return LibZip.cdCompress(\n encodeAbiParameters(\n parseAbiParameters([\n 'BoostPayload payload',\n 'struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint256 maxParticipants; address owner; }',\n 'struct Target { bool isBase; address instance; bytes parameters; }',\n ]),\n [\n {\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee,\n maxParticipants,\n owner,\n },\n ],\n ),\n ) as Hex;\n}\n"],"names":["global","factory","module","exports","this","window","noGlobal","solady","LibZip","hexString","data","byteToString","b","parseByte","hexToBytes","a","i","bytesToHex","o","ib","ht","ob","j","s","h","d","c","l","r","p","q","e","u24","hash","x","literals","f","t","z","y","pushByte","rle","v","ERC1967Factory","m","Boost","config","zeroAddress","prepareBoostPayload","budget","action","validator","allowList","incentives","protocolFee","maxParticipants","owner","encodeAbiParameters","parseAbiParameters"],"mappings":"wPAuBC,SAASA,EAAQC,EAAS,CAKnBC,UAAiBD,EAAQD,EAAQ,CAAC,EAE9BG,SAAiBD,EAAO,QAAQ,OAChCC,iBAAyBD,EAAO,QAAQ,cAMpD,GAAG,OAAO,OAAW,IAAc,OAASE,EAAM,SAASC,EAAQC,EAAU,CAIzE,IAAIC,EAAS,CAAA,EAaTC,EAAS,CAAA,EAEbD,EAAO,OAASC,EAEhB,SAASC,EAAUC,EAAM,CACrB,IAAI,OAAOA,GAAS,UAAYA,aAAgB,UACxCA,EAAOA,EAAK,MAAM,wDAAwD,GAAG,CAC7E,GAAIA,EAAK,CAAC,EAAE,OAAS,EACjB,MAAM,IAAI,MAAM,4CAA4C,EAEhE,OAAOA,EAAK,CAAC,CAChB,CAEL,MAAM,IAAI,MAAM,4BAA4B,CAC/C,CAED,SAASC,EAAaC,EAAG,CACrB,OAAQA,EAAI,KAAO,SAAS,EAAE,EAAE,MAAM,CAAC,CAC1C,CAED,SAASC,EAAUH,EAAM,EAAG,CACxB,OAAO,SAASA,EAAK,OAAO,EAAG,CAAC,EAAG,EA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C,EAAc,GACd,gBAAAC,EAAkB,GAClB,MAAAC,CACF,EAAsB,CACpB,OAAOhD,EAAO,OAAA,WACZiD,EAAA,oBACEC,qBAAmB,CACjB,uBACA,8KACA,oEAAA,CACD,EACD,CACE,CACE,OAAAT,EACA,OAAAC,EACA,UAAAC,EACA,UAAAC,EACA,WAAAC,EACA,YAAAC,EACA,gBAAAC,EACA,MAAAC,CACF,CACF,CACF,CAAA,CAEJ","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"Boost.cjs","sources":["../../../node_modules/.pnpm/solady@0.0.288/node_modules/solady/js/solady.js","../src/Boost.ts"],"sourcesContent":["/**\n * Accompanying JavaScript library for Solady.\n *\n * To install:\n * \n * ```\n * npm install solady\n * ```\n *\n * Module exports:\n * \n * - `LibZip`\n * - `flzCompress(data)`: Compresses hex encoded data with FastLZ.\n * - `flzDecompress(data)`: Decompresses hex encoded data with FastLZ.\n * - `cdCompress(data)`: Compresses hex encoded calldata.\n * - `cdDecompress(data)`: Decompresses hex encoded calldata.\n * \n * - `ERC1967Factory`\n * - `address`: Canonical address of Solady's ERC1967Factory.\n * - `abi`: ABI of Solady's ERC1967Factory.\n *\n * @module solady\n */\n(function(global, factory) {\n\n \"use strict\";\n\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n module.exports = factory(global, 1);\n if (typeof exports === \"object\") {\n exports.LibZip = module.exports.LibZip;\n exports.ERC1967Factory = module.exports.ERC1967Factory;\n }\n } else {\n factory(global);\n }\n\n})(typeof window !== \"undefined\" ? window : this, function(window, noGlobal) {\n\n \"use strict\";\n\n var solady = {};\n\n /*============================================================*/\n /* LibZip Operations */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/LibZip.sol\n\n /**\n * FastLZ and calldata compression / decompression functions.\n * @namespace\n * @alias module:solady.LibZip\n */\n var LibZip = {};\n\n solady.LibZip = LibZip;\n\n function hexString(data) {\n if (typeof data === \"string\" || data instanceof String) {\n if (data = data.match(/^[\\s\\uFEFF\\xA0]*(0[Xx])?([0-9A-Fa-f]*)[\\s\\uFEFF\\xA0]*$/)) {\n if (data[2].length % 2) {\n throw new Error(\"Hex string length must be a multiple of 2.\");\n }\n return data[2];\n }\n }\n throw new Error(\"Data must be a hex string.\");\n }\n\n function byteToString(b) {\n return (b | 0x100).toString(16).slice(1);\n }\n\n function parseByte(data, i) {\n return parseInt(data.substr(i, 2), 16);\n }\n\n function hexToBytes(data) {\n var a = [], i = 0;\n for (; i < data.length; i += 2) a.push(parseByte(data, i));\n return a;\n }\n\n function bytesToHex(a) {\n var o = \"0x\", i = 0;\n for (; i < a.length; o += byteToString(a[i++])) ;\n return o;\n }\n\n /**\n * Compresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.flzCompress = function(data) {\n var ib = hexToBytes(hexString(data)), b = ib.length - 4;\n var ht = [], ob = [], a = 0, i = 2, o = 0, j, s, h, d, c, l, r, p, q, e;\n\n function u24(i) {\n return ib[i] | (ib[++i] << 8) | (ib[++i] << 16);\n }\n\n function hash(x) {\n return ((2654435769 * x) >> 19) & 8191;\n }\n\n function literals(r, s) {\n while (r >= 32) for (ob[o++] = 31, j = 32; j--; r--) ob[o++] = ib[s++];\n if (r) for (ob[o++] = r - 1; r--; ) ob[o++] = ib[s++];\n }\n\n while (i < b - 9) {\n do {\n r = ht[h = hash(s = u24(i))] || 0;\n c = (d = (ht[h] = i) - r) < 8192 ? u24(r) : 0x1000000;\n } while (i < b - 9 && i++ && s != c);\n if (i >= b - 9) break;\n if (--i > a) literals(i - a, a);\n for (l = 0, p = r + 3, q = i + 3, e = b - q; l < e; l++) e *= ib[p + l] === ib[q + l];\n i += l;\n for (--d; l > 262; l -= 262) ob[o++] = 224 + (d >> 8), ob[o++] = 253, ob[o++] = d & 255;\n if (l < 7) ob[o++] = (l << 5) + (d >> 8), ob[o++] = d & 255;\n else ob[o++] = 224 + (d >> 8), ob[o++] = l - 7, ob[o++] = d & 255;\n ht[hash(u24(i))] = i++, ht[hash(u24(i))] = i++, a = i;\n }\n literals(b + 4 - a, a);\n return bytesToHex(ob);\n }\n\n /**\n * Decompresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.flzDecompress = function(data) {\n var ib = hexToBytes(hexString(data)), i = 0, o = 0, l, f, t, r, h, ob = [];\n while (i < ib.length) {\n if (!(t = ib[i] >> 5)) {\n for (l = 1 + ib[i++]; l--;) ob[o++] = ib[i++];\n } else {\n f = 256 * (ib[i] & 31) + ib[i + 2 - (t = t < 7)];\n l = t ? 2 + (ib[i] >> 5) : 9 + ib[i + 1];\n i = i + 3 - t;\n r = o - f - 1;\n while (l--) ob[o++] = ob[r++];\n }\n }\n return bytesToHex(ob);\n }\n\n /**\n * Compresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.cdCompress = function(data) {\n data = hexString(data);\n var o = \"0x\", z = 0, y = 0, i = 0, c;\n\n function pushByte(b) {\n o += byteToString(((o.length < 4 * 2 + 2) * 0xff) ^ b);\n }\n\n function rle(v, d) {\n pushByte(0x00);\n pushByte(d - 1 + v * 0x80);\n }\n\n for (; i < data.length; i += 2) {\n c = parseByte(data, i);\n if (!c) {\n if (y) rle(1, y), y = 0;\n if (++z === 0x80) rle(0, 0x80), z = 0;\n continue;\n }\n if (c === 0xff) {\n if (z) rle(0, z), z = 0;\n if (++y === 0x20) rle(1, 0x20), y = 0;\n continue;\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n pushByte(c);\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n return o;\n }\n\n /**\n * Decompresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.cdDecompress = function(data) {\n data = hexString(data);\n var o = \"0x\", i = 0, j, c, s;\n\n while (i < data.length) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n i += 2;\n if (!c) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n s = (c & 0x7f) + 1;\n i += 2;\n for (j = 0; j < s; ++j) o += byteToString((c >> 7 && j < 32) * 0xff);\n continue;\n }\n o += byteToString(c);\n }\n return o;\n }\n\n /*============================================================*/\n /* ERC1967Factory */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/ERC1967Factory.sol\n\n /**\n * ERC1967Factory canonical address and ABI.\n * @namespace\n * @alias module:solady.ERC1967Factory\n */\n var ERC1967Factory = {};\n\n solady.ERC1967Factory = ERC1967Factory;\n\n /**\n * Canonical address of Solady's ERC1967Factory.\n * @type {string}\n */\n ERC1967Factory.address = \"0x0000000000006396FF2a80c067f99B3d2Ab4Df24\";\n\n /**\n * ABI of Solady's ERC1967Factory.\n * @type {Object}\n */\n ERC1967Factory.abi = JSON.parse('[{0:[],1:\"DeploymentFailed\"96\"SaltDoesNotStartWithCaller\"96\"Unauthorized\"96\"UpgradeFailed\",2:3959790,9791],1:\"AdminChanged\",2:10959790,9792,9791],1:\"Deployed\",2:10959790,9792],1:\"Upgraded\",2:10},{0:[{90],1:\"adminOf\",12:[{9199{0:[{90,{91],1:\"changeAdmin\",12:[],13:\"nonpayable\",2:15},{0:[{92,{91],1:\"deploy\",12:[{9098,{0:[{92,{91,{94],1:\"deployAndCall\",12:[{9098,{0:[{92,{91,{93],1:\"deployDeterministic\",12:[{9098,{0:[{92,{91,{93,{94],1:\"deployDeterministicAndCall\",12:[{9098,{0:[],1:\"initCodeHash\",12:[{6:19,1:\"result\",2:19}99{0:[{93],1:\"predictDeterministicAddress\",12:[{6:7,1:\"predicted\",2:7}99{0:[{90,{92],1:\"upgrade\",12:[98,{0:[{90,{92,{94],1:\"upgradeAndCall\",12:[98]'.replace(/9\\d/g, function (m) { return [\"6:7,1:8,2:7}\",\"6:7,1:9,2:7}\",\"6:7,1:11,2:7}\",\"6:19,1:20,2:19}\",\"6:17,1:18,2:17}\",\"},{4:false,0:[\",\",2:3},{0:[],1:\",\"{5:true,\",\"],13:16,2:15}\",\"],13:14,2:15},\"][m-90] }).replace(/\\d+/g, function (m) { return '\"' + (\"inputs,name,type,error,anonymous,indexed,internalType,address,proxy,admin,event,implementation,outputs,stateMutability,view,function,payable,bytes,data,bytes32,salt\".split(\",\")[m]) + '\"' }));\n\n /*--------------------------- END ----------------------------*/\n\n if (typeof define === \"function\" && define.amd) {\n define(\"solady\", [], function() {\n return solady\n });\n }\n\n if (!noGlobal) {\n window.solady = solady;\n }\n\n return solady;\n});\n","import { LibZip } from 'solady';\nimport {\n type Address,\n type Hex,\n encodeAbiParameters,\n parseAbiParameters,\n zeroAddress,\n} from 'viem';\nimport type { Action } from './Actions/Action';\nimport type { AllowList } from './AllowLists/AllowList';\nimport type { Budget } from './Budgets/Budget';\nimport type { Incentive } from './Incentives/Incentive';\nimport type { Validator } from './Validators/Validator';\n\n/**\n * Interface representing a `BoostLib.Boost` on-chain struct\n *\n * @export\n * @interface RawBoost\n * @typedef {RawBoost}\n */\nexport interface RawBoost {\n action: Address;\n validator: Address;\n allowList: Address;\n budget: Address;\n incentives: readonly Address[];\n protocolFee: bigint;\n maxParticipants: bigint;\n owner: Address;\n}\n\n/**\n * Configuration used to instantiate a `Boost` instance.\n *\n * @export\n * @interface BoostConfig\n * @typedef {BoostConfig}\n */\nexport interface BoostConfig {\n /**\n *\n * @type {bigint}\n */\n id: bigint;\n /**\n *\n * @type {Budget}\n */\n budget: Budget;\n /**\n *\n * @type {Action}\n */\n action: Action;\n /**\n *\n * @type {Validator}\n */\n validator: Validator;\n /**\n *\n * @type {AllowList}\n */\n allowList: AllowList;\n /**\n *\n * @type {Array<Incentive>}\n */\n incentives: Array<Incentive>;\n /**\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n *\n * @type {?Address}\n */\n owner?: Address;\n}\n\n/**\n * A struct representing a single Boost. Typically you would not construct this directly, rather get an instance from `BoostCore.createBoost` or `BoostCore.getBoost`\n *\n * @export\n * @class Boost\n * @typedef {Boost}\n */\nexport class Boost {\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly id: bigint;\n /**\n *\n * @readonly\n * @type {Budget}\n */\n readonly budget: Budget;\n /**\n *\n * @readonly\n * @type {Action}\n */\n readonly action: Action;\n /**\n *\n * @readonly\n * @type {Validator}\n */\n readonly validator: Validator;\n /**\n *\n * @readonly\n * @type {AllowList}\n */\n readonly allowList: AllowList;\n /**\n *\n * @readonly\n * @type {Array<Incentive>}\n */\n readonly incentives: Array<Incentive>;\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly protocolFee: bigint;\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly maxParticipants: bigint;\n /**\n *\n * @readonly\n * @type {Address}\n */\n readonly owner: Address;\n\n /**\n * Creates an instance of Boost.\n *\n * @constructor\n * @param {BoostConfig} config\n */\n constructor(config: BoostConfig) {\n this.id = config.id;\n this.budget = config.budget;\n this.action = config.action;\n this.validator = config.validator;\n this.allowList = config.allowList;\n this.incentives = config.incentives;\n this.protocolFee = config.protocolFee || 0n;\n this.maxParticipants = config.maxParticipants || 0n;\n this.owner = config.owner || zeroAddress;\n }\n}\n\n/**\n * Object representation of `BoostLib.Target` struct. Used for low level Boost creation operations.\n * This is used to pass the base contract and its initialization parameters in an efficient manner\n *\n * @export\n * @typedef {Target}\n */\nexport type Target = {\n isBase: boolean;\n instance: Address;\n parameters: Hex;\n};\n\n/**\n * Object representation of `BoostCore.InitPayload` struct.\n *\n * @export\n * @interface BoostPayload\n * @typedef {BoostPayload}\n */\nexport interface BoostPayload {\n /**\n * Address to valid budget.\n *\n * @type {Address}\n */\n budget: Address;\n /**\n * Target for existing action, or base with initialization payload.\n *\n * @type {Target}\n */\n action: Target;\n /**\n * Target for existing validator, or base with initialization payload.\n *\n * @type {Target}\n */\n validator: Target;\n /**\n * Target for existing allowList, or base with initialization payload.\n *\n * @type {Target}\n */\n allowList: Target;\n /**\n * Targets for new incentives, with initialization payloads.\n *\n * @type {Target[]}\n */\n incentives: Target[];\n /**\n * The base protocol fee (in bps)\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n * Optional maximum amount of participants in the Boost.\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n * The owner of the Boost.\n *\n * @type {Address}\n */\n owner: Address;\n}\n\n/**\n * Given a valid {@link BoostPayload}, properly encode and compress the payload for use with `createBoost`\n *\n * @export\n * @param {BoostPayload} param0\n * @param {Address} param0.budget - Address to valid budget.\n * @param {Target} param0.action - Target for existing action, or base with initialization payload.\n * @param {Target} param0.validator - Target for existing validator, or base with initialization payload.\n * @param {Target} param0.allowList - Target for existing allowList, or base with initialization payload.\n * @param {Target[]} param0.incentives - Targets for new incentives, with initialization payloads.\n * @param {bigint} [param0.protocolFee=0n] - The base protocol fee (in bps)\n * @param {bigint} [param0.maxParticipants=0n] - Optional maximum amount of participants in the Boost.\n * @param {Address} param0.owner - The owner of the Boost.\n * @returns {Hex}\n */\nexport function prepareBoostPayload({\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee = 0n,\n maxParticipants = 0n,\n owner,\n}: BoostPayload): Hex {\n return LibZip.cdCompress(\n encodeAbiParameters(\n parseAbiParameters([\n 'BoostPayload payload',\n 'struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint256 maxParticipants; address owner; }',\n 'struct Target { bool isBase; address instance; bytes parameters; }',\n ]),\n [\n {\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee,\n maxParticipants,\n owner,\n },\n ],\n ),\n ) as Hex;\n}\n"],"names":["global","factory","module","exports","this","window","noGlobal","solady","LibZip","hexString","data","byteToString","b","parseByte","hexToBytes","a","i","bytesToHex","o","ib","ht","ob","j","s","h","d","c","l","r","p","q","e","u24","hash","x","literals","f","t","z","y","pushByte","rle","v","ERC1967Factory","m","Boost","config","zeroAddress","prepareBoostPayload","budget","action","validator","allowList","incentives","protocolFee","maxParticipants","owner","encodeAbiParameters","parseAbiParameters"],"mappings":"wPAuBC,SAASA,EAAQC,EAAS,CAKnBC,UAAiBD,EAAQD,EAAQ,CAAC,EAE9BG,SAAiBD,EAAO,QAAQ,OAChCC,iBAAyBD,EAAO,QAAQ,cAMpD,GAAG,OAAO,OAAW,IAAc,OAASE,EAAM,SAASC,EAAQC,EAAU,CAIzE,IAAIC,EAAS,CAAA,EAaTC,EAAS,CAAA,EAEbD,EAAO,OAASC,EAEhB,SAASC,EAAUC,EAAM,CACrB,IAAI,OAAOA,GAAS,UAAYA,aAAgB,UACxCA,EAAOA,EAAK,MAAM,wDAAwD,GAAG,CAC7E,GAAIA,EAAK,CAAC,EAAE,OAAS,EACjB,MAAM,IAAI,MAAM,4CAA4C,EAEhE,OAAOA,EAAK,CAAC,CAChB,CAEL,MAAM,IAAI,MAAM,4BAA4B,CAC/C,CAED,SAASC,EAAaC,EAAG,CACrB,OAAQA,EAAI,KAAO,SAAS,EAAE,EAAE,MAAM,CAAC,CAC1C,CAED,SAASC,EAAUH,EAAM,EAAG,CACxB,OAAO,SAASA,EAAK,OAAO,EAAG,CAAC,EAAG,EAAE,CACxC,CAED,SAASI,EAAWJ,EAAM,CAEtB,QADIK,EAAI,CAAA,EAAIC,EAAI,EACTA,EAAIN,EAAK,OAAQM,GAAK,EAAGD,EAAE,KAAKF,EAAUH,EAAMM,CAAC,CAAC,EACzD,OAAOD,CACV,CAED,SAASE,EAAWF,EAAG,CAEnB,QADIG,EAAI,KAAMF,EAAI,EACXA,EAAID,EAAE,OAAQG,GAAKP,EAAaI,EAAEC,GAAG,CAAC,EAAG,CAChD,OAAOE,CACV,CAODV,EAAO,YAAc,SAASE,EAAM,CAChC,IAAIS,EAAKL,EAAWL,EAAUC,CAAI,CAAC,EAAGE,EA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aD,IAAIyB,EAAiB,CAAA,EAErB,OAAApC,EAAO,eAAiBoC,EAMxBA,EAAe,QAAU,6CAMzBA,EAAe,IAAM,KAAK,MAAM,iqBAAiqB,QAAQ,OAAQ,SAAUC,EAAG,CAAE,MAAO,CAAC,eAAe,eAAe,gBAAgB,kBAAkB,kBAAkB,iBAAiB,iBAAiB,WAAW,gBAAgB,gBAAgB,EAAEA,EAAE,EAAE,CAAC,CAAE,EAAE,QAAQ,OAAQ,SAAUA,EAAG,CAAE,MAAO,IAAO,uKAAuK,MAAM,GAAG,EAAEA,CAAC,EAAK,GAAK,CAAA,CAAC,EAUxnCtC,IACDD,EAAO,OAASE,GAGbA,CACX,CAAC,iCChKM,MAAMsC,CAAM,CA8DjB,YAAYC,EAAqB,CAC/B,KAAK,GAAKA,EAAO,GACjB,KAAK,OAASA,EAAO,OACrB,KAAK,OAASA,EAAO,OACrB,KAAK,UAAYA,EAAO,UACxB,KAAK,UAAYA,EAAO,UACxB,KAAK,WAAaA,EAAO,WACpB,KAAA,YAAcA,EAAO,aAAe,GACpC,KAAA,gBAAkBA,EAAO,iBAAmB,GAC5C,KAAA,MAAQA,EAAO,OAASC,EAAAA,WAC/B,CACF,CAwFO,SAASC,EAAoB,CAClC,OAAAC,EACA,OAAAC,EACA,UAAAC,EACA,UAAAC,EACA,WAAAC,EACA,YAAAC,EAAc,GACd,gBAAAC,EAAkB,GAClB,MAAAC,CACF,EAAsB,CACpB,OAAOhD,EAAO,OAAA,WACZiD,EAAA,oBACEC,qBAAmB,CACjB,uBACA,8KACA,oEAAA,CACD,EACD,CACE,CACE,OAAAT,EACA,OAAAC,EACA,UAAAC,EACA,UAAAC,EACA,WAAAC,EACA,YAAAC,EACA,gBAAAC,EACA,MAAAC,CACF,CACF,CACF,CAAA,CAEJ","x_google_ignoreList":[0]}
|
package/dist/Boost.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Boost.js","sources":["../../../node_modules/.pnpm/solady@0.0.208/node_modules/solady/js/solady.js","../src/Boost.ts"],"sourcesContent":["/**\n * Accompanying JavaScript library for Solady.\n *\n * To install:\n * \n * ```\n * npm install solady\n * ```\n *\n * Module exports:\n * \n * - `LibZip`\n * - `flzCompress(data)`: Compresses hex encoded data with FastLZ.\n * - `flzDecompress(data)`: Decompresses hex encoded data with FastLZ.\n * - `cdCompress(data)`: Compresses hex encoded calldata.\n * - `cdDecompress(data)`: Decompresses hex encoded calldata.\n * \n * - `ERC1967Factory`\n * - `address`: Canonical address of Solady's ERC1967Factory.\n * - `abi`: ABI of Solady's ERC1967Factory.\n *\n * @module solady\n */\n(function(global, factory) {\n\n \"use strict\";\n\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n module.exports = factory(global, 1);\n if (typeof exports === \"object\") {\n exports.LibZip = module.exports.LibZip;\n exports.ERC1967Factory = module.exports.ERC1967Factory;\n }\n } else {\n factory(global);\n }\n\n})(typeof window !== \"undefined\" ? window : this, function(window, noGlobal) {\n\n \"use strict\";\n\n var solady = {};\n\n /*============================================================*/\n /* LibZip Operations */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/LibZip.sol\n\n /**\n * FastLZ and calldata compression / decompression functions.\n * @namespace\n * @alias module:solady.LibZip\n */\n var LibZip = {};\n\n solady.LibZip = LibZip;\n\n function hexString(data) {\n if (typeof data === \"string\" || data instanceof String) {\n if (data = data.match(/^[\\s\\uFEFF\\xA0]*(0[Xx])?([0-9A-Fa-f]*)[\\s\\uFEFF\\xA0]*$/)) {\n if (data[2].length % 2) {\n throw new Error(\"Hex string length must be a multiple of 2.\");\n }\n return data[2];\n }\n }\n throw new Error(\"Data must be a hex string.\");\n }\n\n function byteToString(b) {\n return (b | 0x100).toString(16).slice(1);\n }\n\n function parseByte(data, i) {\n return parseInt(data.substr(i, 2), 16);\n }\n\n function hexToBytes(data) {\n var a = [], i = 0;\n for (; i < data.length; i += 2) a.push(parseByte(data, i));\n return a;\n }\n\n function bytesToHex(a) {\n var o = \"0x\", i = 0;\n for (; i < a.length; o += byteToString(a[i++])) ;\n return o;\n }\n\n /**\n * Compresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.flzCompress = function(data) {\n var ib = hexToBytes(hexString(data)), b = ib.length - 4;\n var ht = [], ob = [], a = 0, i = 2, o = 0, j, s, h, d, c, l, r, p, q, e;\n\n function u24(i) {\n return ib[i] | (ib[++i] << 8) | (ib[++i] << 16);\n }\n\n function hash(x) {\n return ((2654435769 * x) >> 19) & 8191;\n }\n\n function literals(r, s) {\n while (r >= 32) for (ob[o++] = 31, j = 32; j--; r--) ob[o++] = ib[s++];\n if (r) for (ob[o++] = r - 1; r--; ) ob[o++] = ib[s++];\n }\n\n while (i < b - 9) {\n do {\n r = ht[h = hash(s = u24(i))] || 0;\n c = (d = (ht[h] = i) - r) < 8192 ? u24(r) : 0x1000000;\n } while (i < b - 9 && i++ && s != c);\n if (i >= b - 9) break;\n if (--i > a) literals(i - a, a);\n for (l = 0, p = r + 3, q = i + 3, e = b - q; l < e; l++) e *= ib[p + l] === ib[q + l];\n i += l;\n for (--d; l > 262; l -= 262) ob[o++] = 224 + (d >> 8), ob[o++] = 253, ob[o++] = d & 255;\n if (l < 7) ob[o++] = (l << 5) + (d >> 8), ob[o++] = d & 255;\n else ob[o++] = 224 + (d >> 8), ob[o++] = l - 7, ob[o++] = d & 255;\n ht[hash(u24(i))] = i++, ht[hash(u24(i))] = i++, a = i;\n }\n literals(b + 4 - a, a);\n return bytesToHex(ob);\n }\n\n /**\n * Decompresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.flzDecompress = function(data) {\n var ib = hexToBytes(hexString(data)), i = 0, o = 0, l, f, t, r, h, ob = [];\n while (i < ib.length) {\n if (!(t = ib[i] >> 5)) {\n for (l = 1 + ib[i++]; l--;) ob[o++] = ib[i++];\n } else {\n f = 256 * (ib[i] & 31) + ib[i + 2 - (t = t < 7)];\n l = t ? 2 + (ib[i] >> 5) : 9 + ib[i + 1];\n i = i + 3 - t;\n r = o - f - 1;\n while (l--) ob[o++] = ob[r++];\n }\n }\n return bytesToHex(ob);\n }\n\n /**\n * Compresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.cdCompress = function(data) {\n data = hexString(data);\n var o = \"0x\", z = 0, y = 0, i = 0, c;\n\n function pushByte(b) {\n o += byteToString(((o.length < 4 * 2 + 2) * 0xff) ^ b);\n }\n\n function rle(v, d) {\n pushByte(0x00);\n pushByte(d - 1 + v * 0x80);\n }\n\n for (; i < data.length; i += 2) {\n c = parseByte(data, i);\n if (!c) {\n if (y) rle(1, y), y = 0;\n if (++z === 0x80) rle(0, 0x80), z = 0;\n continue;\n }\n if (c === 0xff) {\n if (z) rle(0, z), z = 0;\n if (++y === 0x20) rle(1, 0x20), y = 0;\n continue;\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n pushByte(c);\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n return o;\n }\n\n /**\n * Decompresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.cdDecompress = function(data) {\n data = hexString(data);\n var o = \"0x\", i = 0, j, c, s;\n\n while (i < data.length) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n i += 2;\n if (!c) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n s = (c & 0x7f) + 1;\n i += 2;\n for (j = 0; j < s; ++j) o += byteToString((c >> 7 && j < 32) * 0xff);\n continue;\n }\n o += byteToString(c);\n }\n return o;\n }\n\n /*============================================================*/\n /* ERC1967Factory */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/ERC1967Factory.sol\n\n /**\n * ERC1967Factory canonical address and ABI.\n * @namespace\n * @alias module:solady.ERC1967Factory\n */\n var ERC1967Factory = {};\n\n solady.ERC1967Factory = ERC1967Factory;\n\n /**\n * Canonical address of Solady's ERC1967Factory.\n * @type {string}\n */\n ERC1967Factory.address = \"0x0000000000006396FF2a80c067f99B3d2Ab4Df24\";\n\n /**\n * ABI of Solady's ERC1967Factory.\n * @type {Object}\n */\n ERC1967Factory.abi = JSON.parse('[{0:[],1:\"DeploymentFailed\"96\"SaltDoesNotStartWithCaller\"96\"Unauthorized\"96\"UpgradeFailed\",2:3959790,9791],1:\"AdminChanged\",2:10959790,9792,9791],1:\"Deployed\",2:10959790,9792],1:\"Upgraded\",2:10},{0:[{90],1:\"adminOf\",12:[{9199{0:[{90,{91],1:\"changeAdmin\",12:[],13:\"nonpayable\",2:15},{0:[{92,{91],1:\"deploy\",12:[{9098,{0:[{92,{91,{94],1:\"deployAndCall\",12:[{9098,{0:[{92,{91,{93],1:\"deployDeterministic\",12:[{9098,{0:[{92,{91,{93,{94],1:\"deployDeterministicAndCall\",12:[{9098,{0:[],1:\"initCodeHash\",12:[{6:19,1:\"result\",2:19}99{0:[{93],1:\"predictDeterministicAddress\",12:[{6:7,1:\"predicted\",2:7}99{0:[{90,{92],1:\"upgrade\",12:[98,{0:[{90,{92,{94],1:\"upgradeAndCall\",12:[98]'.replace(/9\\d/g, function (m) { return [\"6:7,1:8,2:7}\",\"6:7,1:9,2:7}\",\"6:7,1:11,2:7}\",\"6:19,1:20,2:19}\",\"6:17,1:18,2:17}\",\"},{4:false,0:[\",\",2:3},{0:[],1:\",\"{5:true,\",\"],13:16,2:15}\",\"],13:14,2:15},\"][m-90] }).replace(/\\d+/g, function (m) { return '\"' + (\"inputs,name,type,error,anonymous,indexed,internalType,address,proxy,admin,event,implementation,outputs,stateMutability,view,function,payable,bytes,data,bytes32,salt\".split(\",\")[m]) + '\"' }));\n\n /*--------------------------- END ----------------------------*/\n\n if (typeof define === \"function\" && define.amd) {\n define(\"solady\", [], function() {\n return solady\n });\n }\n\n if (!noGlobal) {\n window.solady = solady;\n }\n\n return solady;\n});\n","import { LibZip } from 'solady';\nimport {\n type Address,\n type Hex,\n encodeAbiParameters,\n parseAbiParameters,\n zeroAddress,\n} from 'viem';\nimport type { Action } from './Actions/Action';\nimport type { AllowList } from './AllowLists/AllowList';\nimport type { Budget } from './Budgets/Budget';\nimport type { Incentive } from './Incentives/Incentive';\nimport type { Validator } from './Validators/Validator';\n\n/**\n * Interface representing a `BoostLib.Boost` on-chain struct\n *\n * @export\n * @interface RawBoost\n * @typedef {RawBoost}\n */\nexport interface RawBoost {\n action: Address;\n validator: Address;\n allowList: Address;\n budget: Address;\n incentives: readonly Address[];\n protocolFee: bigint;\n maxParticipants: bigint;\n owner: Address;\n}\n\n/**\n * Configuration used to instantiate a `Boost` instance.\n *\n * @export\n * @interface BoostConfig\n * @typedef {BoostConfig}\n */\nexport interface BoostConfig {\n /**\n *\n * @type {bigint}\n */\n id: bigint;\n /**\n *\n * @type {Budget}\n */\n budget: Budget;\n /**\n *\n * @type {Action}\n */\n action: Action;\n /**\n *\n * @type {Validator}\n */\n validator: Validator;\n /**\n *\n * @type {AllowList}\n */\n allowList: AllowList;\n /**\n *\n * @type {Array<Incentive>}\n */\n incentives: Array<Incentive>;\n /**\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n *\n * @type {?Address}\n */\n owner?: Address;\n}\n\n/**\n * A struct representing a single Boost. Typically you would not construct this directly, rather get an instance from `BoostCore.createBoost` or `BoostCore.getBoost`\n *\n * @export\n * @class Boost\n * @typedef {Boost}\n */\nexport class Boost {\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly id: bigint;\n /**\n *\n * @readonly\n * @type {Budget}\n */\n readonly budget: Budget;\n /**\n *\n * @readonly\n * @type {Action}\n */\n readonly action: Action;\n /**\n *\n * @readonly\n * @type {Validator}\n */\n readonly validator: Validator;\n /**\n *\n * @readonly\n * @type {AllowList}\n */\n readonly allowList: AllowList;\n /**\n *\n * @readonly\n * @type {Array<Incentive>}\n */\n readonly incentives: Array<Incentive>;\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly protocolFee: bigint;\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly maxParticipants: bigint;\n /**\n *\n * @readonly\n * @type {Address}\n */\n readonly owner: Address;\n\n /**\n * Creates an instance of Boost.\n *\n * @constructor\n * @param {BoostConfig} config\n */\n constructor(config: BoostConfig) {\n this.id = config.id;\n this.budget = config.budget;\n this.action = config.action;\n this.validator = config.validator;\n this.allowList = config.allowList;\n this.incentives = config.incentives;\n this.protocolFee = config.protocolFee || 0n;\n this.maxParticipants = config.maxParticipants || 0n;\n this.owner = config.owner || zeroAddress;\n }\n}\n\n/**\n * Object representation of `BoostLib.Target` struct. Used for low level Boost creation operations.\n * This is used to pass the base contract and its initialization parameters in an efficient manner\n *\n * @export\n * @typedef {Target}\n */\nexport type Target = {\n isBase: boolean;\n instance: Address;\n parameters: Hex;\n};\n\n/**\n * Object representation of `BoostCore.InitPayload` struct.\n *\n * @export\n * @interface BoostPayload\n * @typedef {BoostPayload}\n */\nexport interface BoostPayload {\n /**\n * Address to valid budget.\n *\n * @type {Address}\n */\n budget: Address;\n /**\n * Target for existing action, or base with initialization payload.\n *\n * @type {Target}\n */\n action: Target;\n /**\n * Target for existing validator, or base with initialization payload.\n *\n * @type {Target}\n */\n validator: Target;\n /**\n * Target for existing allowList, or base with initialization payload.\n *\n * @type {Target}\n */\n allowList: Target;\n /**\n * Targets for new incentives, with initialization payloads.\n *\n * @type {Target[]}\n */\n incentives: Target[];\n /**\n * The base protocol fee (in bps)\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n * Optional maximum amount of participants in the Boost.\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n * The owner of the Boost.\n *\n * @type {Address}\n */\n owner: Address;\n}\n\n/**\n * Given a valid {@link BoostPayload}, properly encode and compress the payload for use with `createBoost`\n *\n * @export\n * @param {BoostPayload} param0\n * @param {Address} param0.budget - Address to valid budget.\n * @param {Target} param0.action - Target for existing action, or base with initialization payload.\n * @param {Target} param0.validator - Target for existing validator, or base with initialization payload.\n * @param {Target} param0.allowList - Target for existing allowList, or base with initialization payload.\n * @param {Target[]} param0.incentives - Targets for new incentives, with initialization payloads.\n * @param {bigint} [param0.protocolFee=0n] - The base protocol fee (in bps)\n * @param {bigint} [param0.maxParticipants=0n] - Optional maximum amount of participants in the Boost.\n * @param {Address} param0.owner - The owner of the Boost.\n * @returns {Hex}\n */\nexport function prepareBoostPayload({\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee = 0n,\n maxParticipants = 0n,\n owner,\n}: BoostPayload): Hex {\n return LibZip.cdCompress(\n encodeAbiParameters(\n parseAbiParameters([\n 'BoostPayload payload',\n 'struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint256 maxParticipants; address owner; }',\n 'struct Target { bool isBase; address instance; bytes parameters; }',\n ]),\n [\n {\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee,\n maxParticipants,\n owner,\n },\n ],\n ),\n ) as Hex;\n}\n"],"names":["global","factory","module","exports","this","window","noGlobal","solady","LibZip","hexString","data","byteToString","b","parseByte","hexToBytes","a","i","bytesToHex","o","ib","ht","ob","j","s","h","d","c","l","r","p","q","e","u24","hash","x","literals","f","t","z","y","pushByte","rle","v","ERC1967Factory","m","Boost","config","zeroAddress","prepareBoostPayload","budget","action","validator","allowList","incentives","protocolFee","maxParticipants","owner","encodeAbiParameters","parseAbiParameters"],"mappings":";;;AAuBA,GAAC,SAASA,GAAQC,GAAS;AAKnB,IAAAC,YAAiBD,EAAQD,GAAQ,CAAC,GAE9BG,WAAiBD,EAAO,QAAQ,QAChCC,mBAAyBD,EAAO,QAAQ;AAAA,EAMpD,GAAG,OAAO,SAAW,MAAc,SAASE,GAAM,SA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A,IACF;AAAA,EAAA;AAEJ;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"Boost.js","sources":["../../../node_modules/.pnpm/solady@0.0.288/node_modules/solady/js/solady.js","../src/Boost.ts"],"sourcesContent":["/**\n * Accompanying JavaScript library for Solady.\n *\n * To install:\n * \n * ```\n * npm install solady\n * ```\n *\n * Module exports:\n * \n * - `LibZip`\n * - `flzCompress(data)`: Compresses hex encoded data with FastLZ.\n * - `flzDecompress(data)`: Decompresses hex encoded data with FastLZ.\n * - `cdCompress(data)`: Compresses hex encoded calldata.\n * - `cdDecompress(data)`: Decompresses hex encoded calldata.\n * \n * - `ERC1967Factory`\n * - `address`: Canonical address of Solady's ERC1967Factory.\n * - `abi`: ABI of Solady's ERC1967Factory.\n *\n * @module solady\n */\n(function(global, factory) {\n\n \"use strict\";\n\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n module.exports = factory(global, 1);\n if (typeof exports === \"object\") {\n exports.LibZip = module.exports.LibZip;\n exports.ERC1967Factory = module.exports.ERC1967Factory;\n }\n } else {\n factory(global);\n }\n\n})(typeof window !== \"undefined\" ? window : this, function(window, noGlobal) {\n\n \"use strict\";\n\n var solady = {};\n\n /*============================================================*/\n /* LibZip Operations */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/LibZip.sol\n\n /**\n * FastLZ and calldata compression / decompression functions.\n * @namespace\n * @alias module:solady.LibZip\n */\n var LibZip = {};\n\n solady.LibZip = LibZip;\n\n function hexString(data) {\n if (typeof data === \"string\" || data instanceof String) {\n if (data = data.match(/^[\\s\\uFEFF\\xA0]*(0[Xx])?([0-9A-Fa-f]*)[\\s\\uFEFF\\xA0]*$/)) {\n if (data[2].length % 2) {\n throw new Error(\"Hex string length must be a multiple of 2.\");\n }\n return data[2];\n }\n }\n throw new Error(\"Data must be a hex string.\");\n }\n\n function byteToString(b) {\n return (b | 0x100).toString(16).slice(1);\n }\n\n function parseByte(data, i) {\n return parseInt(data.substr(i, 2), 16);\n }\n\n function hexToBytes(data) {\n var a = [], i = 0;\n for (; i < data.length; i += 2) a.push(parseByte(data, i));\n return a;\n }\n\n function bytesToHex(a) {\n var o = \"0x\", i = 0;\n for (; i < a.length; o += byteToString(a[i++])) ;\n return o;\n }\n\n /**\n * Compresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.flzCompress = function(data) {\n var ib = hexToBytes(hexString(data)), b = ib.length - 4;\n var ht = [], ob = [], a = 0, i = 2, o = 0, j, s, h, d, c, l, r, p, q, e;\n\n function u24(i) {\n return ib[i] | (ib[++i] << 8) | (ib[++i] << 16);\n }\n\n function hash(x) {\n return ((2654435769 * x) >> 19) & 8191;\n }\n\n function literals(r, s) {\n while (r >= 32) for (ob[o++] = 31, j = 32; j--; r--) ob[o++] = ib[s++];\n if (r) for (ob[o++] = r - 1; r--; ) ob[o++] = ib[s++];\n }\n\n while (i < b - 9) {\n do {\n r = ht[h = hash(s = u24(i))] || 0;\n c = (d = (ht[h] = i) - r) < 8192 ? u24(r) : 0x1000000;\n } while (i < b - 9 && i++ && s != c);\n if (i >= b - 9) break;\n if (--i > a) literals(i - a, a);\n for (l = 0, p = r + 3, q = i + 3, e = b - q; l < e; l++) e *= ib[p + l] === ib[q + l];\n i += l;\n for (--d; l > 262; l -= 262) ob[o++] = 224 + (d >> 8), ob[o++] = 253, ob[o++] = d & 255;\n if (l < 7) ob[o++] = (l << 5) + (d >> 8), ob[o++] = d & 255;\n else ob[o++] = 224 + (d >> 8), ob[o++] = l - 7, ob[o++] = d & 255;\n ht[hash(u24(i))] = i++, ht[hash(u24(i))] = i++, a = i;\n }\n literals(b + 4 - a, a);\n return bytesToHex(ob);\n }\n\n /**\n * Decompresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.flzDecompress = function(data) {\n var ib = hexToBytes(hexString(data)), i = 0, o = 0, l, f, t, r, h, ob = [];\n while (i < ib.length) {\n if (!(t = ib[i] >> 5)) {\n for (l = 1 + ib[i++]; l--;) ob[o++] = ib[i++];\n } else {\n f = 256 * (ib[i] & 31) + ib[i + 2 - (t = t < 7)];\n l = t ? 2 + (ib[i] >> 5) : 9 + ib[i + 1];\n i = i + 3 - t;\n r = o - f - 1;\n while (l--) ob[o++] = ob[r++];\n }\n }\n return bytesToHex(ob);\n }\n\n /**\n * Compresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.cdCompress = function(data) {\n data = hexString(data);\n var o = \"0x\", z = 0, y = 0, i = 0, c;\n\n function pushByte(b) {\n o += byteToString(((o.length < 4 * 2 + 2) * 0xff) ^ b);\n }\n\n function rle(v, d) {\n pushByte(0x00);\n pushByte(d - 1 + v * 0x80);\n }\n\n for (; i < data.length; i += 2) {\n c = parseByte(data, i);\n if (!c) {\n if (y) rle(1, y), y = 0;\n if (++z === 0x80) rle(0, 0x80), z = 0;\n continue;\n }\n if (c === 0xff) {\n if (z) rle(0, z), z = 0;\n if (++y === 0x20) rle(1, 0x20), y = 0;\n continue;\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n pushByte(c);\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n return o;\n }\n\n /**\n * Decompresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.cdDecompress = function(data) {\n data = hexString(data);\n var o = \"0x\", i = 0, j, c, s;\n\n while (i < data.length) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n i += 2;\n if (!c) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n s = (c & 0x7f) + 1;\n i += 2;\n for (j = 0; j < s; ++j) o += byteToString((c >> 7 && j < 32) * 0xff);\n continue;\n }\n o += byteToString(c);\n }\n return o;\n }\n\n /*============================================================*/\n /* ERC1967Factory */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/ERC1967Factory.sol\n\n /**\n * ERC1967Factory canonical address and ABI.\n * @namespace\n * @alias module:solady.ERC1967Factory\n */\n var ERC1967Factory = {};\n\n solady.ERC1967Factory = ERC1967Factory;\n\n /**\n * Canonical address of Solady's ERC1967Factory.\n * @type {string}\n */\n ERC1967Factory.address = \"0x0000000000006396FF2a80c067f99B3d2Ab4Df24\";\n\n /**\n * ABI of Solady's ERC1967Factory.\n * @type {Object}\n */\n ERC1967Factory.abi = JSON.parse('[{0:[],1:\"DeploymentFailed\"96\"SaltDoesNotStartWithCaller\"96\"Unauthorized\"96\"UpgradeFailed\",2:3959790,9791],1:\"AdminChanged\",2:10959790,9792,9791],1:\"Deployed\",2:10959790,9792],1:\"Upgraded\",2:10},{0:[{90],1:\"adminOf\",12:[{9199{0:[{90,{91],1:\"changeAdmin\",12:[],13:\"nonpayable\",2:15},{0:[{92,{91],1:\"deploy\",12:[{9098,{0:[{92,{91,{94],1:\"deployAndCall\",12:[{9098,{0:[{92,{91,{93],1:\"deployDeterministic\",12:[{9098,{0:[{92,{91,{93,{94],1:\"deployDeterministicAndCall\",12:[{9098,{0:[],1:\"initCodeHash\",12:[{6:19,1:\"result\",2:19}99{0:[{93],1:\"predictDeterministicAddress\",12:[{6:7,1:\"predicted\",2:7}99{0:[{90,{92],1:\"upgrade\",12:[98,{0:[{90,{92,{94],1:\"upgradeAndCall\",12:[98]'.replace(/9\\d/g, function (m) { return [\"6:7,1:8,2:7}\",\"6:7,1:9,2:7}\",\"6:7,1:11,2:7}\",\"6:19,1:20,2:19}\",\"6:17,1:18,2:17}\",\"},{4:false,0:[\",\",2:3},{0:[],1:\",\"{5:true,\",\"],13:16,2:15}\",\"],13:14,2:15},\"][m-90] }).replace(/\\d+/g, function (m) { return '\"' + (\"inputs,name,type,error,anonymous,indexed,internalType,address,proxy,admin,event,implementation,outputs,stateMutability,view,function,payable,bytes,data,bytes32,salt\".split(\",\")[m]) + '\"' }));\n\n /*--------------------------- END ----------------------------*/\n\n if (typeof define === \"function\" && define.amd) {\n define(\"solady\", [], function() {\n return solady\n });\n }\n\n if (!noGlobal) {\n window.solady = solady;\n }\n\n return solady;\n});\n","import { LibZip } from 'solady';\nimport {\n type Address,\n type Hex,\n encodeAbiParameters,\n parseAbiParameters,\n zeroAddress,\n} from 'viem';\nimport type { Action } from './Actions/Action';\nimport type { AllowList } from './AllowLists/AllowList';\nimport type { Budget } from './Budgets/Budget';\nimport type { Incentive } from './Incentives/Incentive';\nimport type { Validator } from './Validators/Validator';\n\n/**\n * Interface representing a `BoostLib.Boost` on-chain struct\n *\n * @export\n * @interface RawBoost\n * @typedef {RawBoost}\n */\nexport interface RawBoost {\n action: Address;\n validator: Address;\n allowList: Address;\n budget: Address;\n incentives: readonly Address[];\n protocolFee: bigint;\n maxParticipants: bigint;\n owner: Address;\n}\n\n/**\n * Configuration used to instantiate a `Boost` instance.\n *\n * @export\n * @interface BoostConfig\n * @typedef {BoostConfig}\n */\nexport interface BoostConfig {\n /**\n *\n * @type {bigint}\n */\n id: bigint;\n /**\n *\n * @type {Budget}\n */\n budget: Budget;\n /**\n *\n * @type {Action}\n */\n action: Action;\n /**\n *\n * @type {Validator}\n */\n validator: Validator;\n /**\n *\n * @type {AllowList}\n */\n allowList: AllowList;\n /**\n *\n * @type {Array<Incentive>}\n */\n incentives: Array<Incentive>;\n /**\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n *\n * @type {?Address}\n */\n owner?: Address;\n}\n\n/**\n * A struct representing a single Boost. Typically you would not construct this directly, rather get an instance from `BoostCore.createBoost` or `BoostCore.getBoost`\n *\n * @export\n * @class Boost\n * @typedef {Boost}\n */\nexport class Boost {\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly id: bigint;\n /**\n *\n * @readonly\n * @type {Budget}\n */\n readonly budget: Budget;\n /**\n *\n * @readonly\n * @type {Action}\n */\n readonly action: Action;\n /**\n *\n * @readonly\n * @type {Validator}\n */\n readonly validator: Validator;\n /**\n *\n * @readonly\n * @type {AllowList}\n */\n readonly allowList: AllowList;\n /**\n *\n * @readonly\n * @type {Array<Incentive>}\n */\n readonly incentives: Array<Incentive>;\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly protocolFee: bigint;\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly maxParticipants: bigint;\n /**\n *\n * @readonly\n * @type {Address}\n */\n readonly owner: Address;\n\n /**\n * Creates an instance of Boost.\n *\n * @constructor\n * @param {BoostConfig} config\n */\n constructor(config: BoostConfig) {\n this.id = config.id;\n this.budget = config.budget;\n this.action = config.action;\n this.validator = config.validator;\n this.allowList = config.allowList;\n this.incentives = config.incentives;\n this.protocolFee = config.protocolFee || 0n;\n this.maxParticipants = config.maxParticipants || 0n;\n this.owner = config.owner || zeroAddress;\n }\n}\n\n/**\n * Object representation of `BoostLib.Target` struct. Used for low level Boost creation operations.\n * This is used to pass the base contract and its initialization parameters in an efficient manner\n *\n * @export\n * @typedef {Target}\n */\nexport type Target = {\n isBase: boolean;\n instance: Address;\n parameters: Hex;\n};\n\n/**\n * Object representation of `BoostCore.InitPayload` struct.\n *\n * @export\n * @interface BoostPayload\n * @typedef {BoostPayload}\n */\nexport interface BoostPayload {\n /**\n * Address to valid budget.\n *\n * @type {Address}\n */\n budget: Address;\n /**\n * Target for existing action, or base with initialization payload.\n *\n * @type {Target}\n */\n action: Target;\n /**\n * Target for existing validator, or base with initialization payload.\n *\n * @type {Target}\n */\n validator: Target;\n /**\n * Target for existing allowList, or base with initialization payload.\n *\n * @type {Target}\n */\n allowList: Target;\n /**\n * Targets for new incentives, with initialization payloads.\n *\n * @type {Target[]}\n */\n incentives: Target[];\n /**\n * The base protocol fee (in bps)\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n * Optional maximum amount of participants in the Boost.\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n * The owner of the Boost.\n *\n * @type {Address}\n */\n owner: Address;\n}\n\n/**\n * Given a valid {@link BoostPayload}, properly encode and compress the payload for use with `createBoost`\n *\n * @export\n * @param {BoostPayload} param0\n * @param {Address} param0.budget - Address to valid budget.\n * @param {Target} param0.action - Target for existing action, or base with initialization payload.\n * @param {Target} param0.validator - Target for existing validator, or base with initialization payload.\n * @param {Target} param0.allowList - Target for existing allowList, or base with initialization payload.\n * @param {Target[]} param0.incentives - Targets for new incentives, with initialization payloads.\n * @param {bigint} [param0.protocolFee=0n] - The base protocol fee (in bps)\n * @param {bigint} [param0.maxParticipants=0n] - Optional maximum amount of participants in the Boost.\n * @param {Address} param0.owner - The owner of the Boost.\n * @returns {Hex}\n */\nexport function prepareBoostPayload({\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee = 0n,\n maxParticipants = 0n,\n owner,\n}: BoostPayload): Hex {\n return LibZip.cdCompress(\n encodeAbiParameters(\n parseAbiParameters([\n 'BoostPayload payload',\n 'struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint256 maxParticipants; address owner; }',\n 'struct Target { bool isBase; address instance; bytes parameters; }',\n ]),\n [\n {\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee,\n maxParticipants,\n owner,\n },\n ],\n ),\n ) as Hex;\n}\n"],"names":["global","factory","module","exports","this","window","noGlobal","solady","LibZip","hexString","data","byteToString","b","parseByte","hexToBytes","a","i","bytesToHex","o","ib","ht","ob","j","s","h","d","c","l","r","p","q","e","u24","hash","x","literals","f","t","z","y","pushByte","rle","v","ERC1967Factory","m","Boost","config","zeroAddress","prepareBoostPayload","budget","action","validator","allowList","incentives","protocolFee","maxParticipants","owner","encodeAbiParameters","parseAbiParameters"],"mappings":";;;AAuBA,GAAC,SAASA,GAAQC,GAAS;AAKnB,IAAAC,YAAiBD,EAAQD,GAAQ,CAAC,GAE9B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