@boostxyz/sdk 5.5.0 → 6.0.1
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 +4 -4
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +2 -1
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +110 -105
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +3 -3
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +2 -2
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +25 -25
- 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 +261 -0
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +442 -262
- 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-CsqSI4NH.cjs +2 -0
- package/dist/Budget-CsqSI4NH.cjs.map +1 -0
- package/dist/Budget-bMiAGF8s.js +922 -0
- package/dist/Budget-bMiAGF8s.js.map +1 -0
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.d.ts +5 -4
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +3 -3
- 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/Budgets/ManagedBudgetWithFeesV2.d.ts +1331 -0
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts.map +1 -0
- 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-DZLG6T1-.js +1036 -0
- package/dist/Incentive-DZLG6T1-.js.map +1 -0
- package/dist/Incentive-DvNdIJ_x.cjs +2 -0
- package/dist/Incentive-DvNdIJ_x.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 +3 -3
- 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-BAIrFBAW.cjs +2 -0
- package/dist/{SimpleDenyList-CsRXJPwm.cjs.map → SimpleDenyList-BAIrFBAW.cjs.map} +1 -1
- package/dist/SimpleDenyList-C734XLxt.js +133 -0
- package/dist/{SimpleDenyList-ByAr4X1r.js.map → SimpleDenyList-C734XLxt.js.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
- package/dist/Validators/LimitedSignerValidator.d.ts +1 -1
- package/dist/Validators/LimitedSignerValidator.d.ts.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.d.ts +1 -1
- package/dist/Validators/SignerValidator.d.ts.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 +4 -4
- package/dist/componentInterfaces-5Ezh3Pvx.js +19 -0
- package/dist/componentInterfaces-5Ezh3Pvx.js.map +1 -0
- package/dist/componentInterfaces-Cm4Zfn1v.cjs +2 -0
- package/dist/componentInterfaces-Cm4Zfn1v.cjs.map +1 -0
- package/dist/{deployments-D0fs26TV.js → deployments-3RHH-eW7.js} +47 -47
- package/dist/{deployments-D0fs26TV.js.map → deployments-3RHH-eW7.js.map} +1 -1
- package/dist/deployments-CIXw_WKk.cjs +2 -0
- package/dist/deployments-CIXw_WKk.cjs.map +1 -0
- package/dist/deployments.json +24 -24
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/generated-BPiHi7W2.cjs +3 -0
- package/dist/generated-BPiHi7W2.cjs.map +1 -0
- package/dist/{generated-Cyvr_Tjx.js → generated-CElkFqkY.js} +1510 -608
- package/dist/generated-CElkFqkY.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +153 -150
- package/package.json +2 -2
- package/src/Actions/EventAction.ts +25 -6
- package/src/AllowLists/SimpleAllowList.ts +2 -2
- package/src/BoostCore.test.ts +124 -2
- package/src/BoostCore.ts +259 -0
- package/src/Budgets/Budget.ts +8 -2
- package/src/Budgets/ManagedBudgetWithFees.test.ts +0 -1
- package/src/Budgets/ManagedBudgetWithFeesV2.test.ts +327 -0
- package/src/Budgets/ManagedBudgetWithFeesV2.ts +713 -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/src/Validators/LimitedSignerValidator.ts +1 -1
- package/src/Validators/SignerValidator.ts +1 -1
- package/src/errors.ts +1 -1
- package/src/index.ts +1 -0
- package/dist/Budget-AoNx7uFd.cjs +0 -2
- package/dist/Budget-AoNx7uFd.cjs.map +0 -1
- package/dist/Budget-DYIV9iNK.js +0 -463
- package/dist/Budget-DYIV9iNK.js.map +0 -1
- 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/componentInterfaces-D7r9xJmt.cjs +0 -2
- package/dist/componentInterfaces-D7r9xJmt.cjs.map +0 -1
- package/dist/componentInterfaces-PR3ijhgZ.js +0 -18
- package/dist/componentInterfaces-PR3ijhgZ.js.map +0 -1
- 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":"ERC20Incentive.cjs","sources":["../../src/Incentives/ERC20Incentive.ts"],"sourcesContent":["import {\n erc20IncentiveAbi,\n readErc20IncentiveAsset,\n readErc20IncentiveClaimed,\n readErc20IncentiveClaims,\n readErc20IncentiveCurrentReward,\n readErc20IncentiveEntries,\n readErc20IncentiveIsClaimable,\n readErc20IncentiveLimit,\n readErc20IncentiveOwner,\n readErc20IncentiveReward,\n readErc20IncentiveStrategy,\n simulateErc20IncentiveClaim,\n simulateErc20IncentiveClawback,\n simulateErc20IncentiveDrawRaffle,\n writeErc20IncentiveClaim,\n writeErc20IncentiveClawback,\n writeErc20IncentiveDrawRaffle,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20Incentive.sol/ERC20Incentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20Incentive as ERC20IncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n type ClaimPayload,\n StrategyType,\n prepareClaimPayload,\n} from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20IncentiveAbi };\n\n/**\n * The object representation of a `ERC20Incentive.InitPayload`\n *\n * @export\n * @interface ERC20IncentivePayload\n * @typedef {ERC20IncentivePayload}\n */\nexport interface ERC20IncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The type of disbursement strategy for the incentive.\n *\n * @type {StrategyType}\n */\n strategy: StrategyType;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed. This should ideally be 1n for `RAFFLE` strategy types.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * (Optional) The address of the entity that can trigger a raffle.\n * If omitted, the incentive will have no manager with permissions to draw the raffle.\n *\n * @type {Address}\n * @optional\n */\n manager?: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20Incentive` event types.\n *\n * @export\n * @typedef {ERC20IncentiveLog}\n * @template {ContractEventName<typeof erc20IncentiveAbi>} [event=ContractEventName<\n * typeof erc20IncentiveAbi\n * >]\n */\nexport type ERC20IncentiveLog<\n event extends ContractEventName<typeof erc20IncentiveAbi> = ContractEventName<\n typeof erc20IncentiveAbi\n >,\n> = GenericLog<typeof erc20IncentiveAbi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class ERC20Incentive\n * @typedef {ERC20Incentive}\n * @extends {DeployableTarget<ERC20IncentivePayload>}\n */\nexport class ERC20Incentive extends DeployableTarget<\n ERC20IncentivePayload,\n typeof erc20IncentiveAbi\n> {\n public override readonly abi = erc20IncentiveAbi;\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_ERC20_INCENTIVE_BASE,\n ...(ERC20IncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams) {\n return await readErc20IncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\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 * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20IncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\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 * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readErc20IncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\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 * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readErc20IncentiveClaimed(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 * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20IncentiveAsset(this._config, {\n address: this.assertValidAddress(),\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 * The strategy for the incentive (MINT or POOL)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<StrategyType>}\n */\n public strategy(params?: ReadParams): Promise<StrategyType> {\n return readErc20IncentiveStrategy(this._config, {\n address: this.assertValidAddress(),\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 }) as Promise<StrategyType>;\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20IncentiveReward(this._config, {\n address: this.assertValidAddress(),\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 * The limit (max claims, or max entries for raffles)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20IncentiveLimit(this._config, {\n address: this.assertValidAddress(),\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 * The set of addresses that have claimed a slot in the incentive raffle, accessed by bigint index.\n *\n * @public\n * @async\n * @param {bigint} i - Index of address\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async entries(i: bigint, params?: ReadParams) {\n return await readErc20IncentiveEntries(this._config, {\n address: this.assertValidAddress(),\n args: [i],\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 * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20IncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\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 writeErc20IncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20IncentiveClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\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 writeErc20IncentiveClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readErc20IncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [payload.target, payload.data],\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 * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async drawRaffle(params?: WriteParams) {\n return await this.awaitResult(this.drawRaffleRaw(params));\n }\n\n /**\n * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async drawRaffleRaw(params?: WriteParams) {\n const { request, result } = await simulateErc20IncentiveDrawRaffle(\n this._config,\n {\n address: this.assertValidAddress(),\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 writeErc20IncentiveDrawRaffle(this._config, request);\n return { hash, result };\n }\n\n /**\n * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.\n */\n public async getTotalBudget(params?: ReadParams) {\n if (\n this.payload?.strategy !== undefined &&\n this.payload?.limit !== undefined &&\n this.payload?.reward !== undefined\n ) {\n return (this.payload.strategy as StrategyType) === StrategyType.POOL\n ? this.payload.limit * this.payload.reward\n : this.payload.reward;\n }\n const [strategy, limit, reward] = await Promise.all([\n this.strategy(params),\n this.limit(params),\n this.reward(params),\n ]);\n return strategy === StrategyType.POOL ? limit * reward : reward;\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if total claims is less than limit\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - True if total claims is less than limit\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [claims, limit] = await Promise.all([\n this.claims(params),\n this.limit(params),\n ]);\n return limit - claims;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20IncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20IncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20IncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20IncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Encodes an amount to clawback from the incentive\n *\n * @public\n * @param {bigint} amount - How much of the asset to clawback\n * @returns {Hex} - Returns an encoded uint256\n */\n public buildClawbackData(amount: bigint) {\n return encodeAbiParameters([{ type: 'uint256' }], [amount]);\n }\n\n /**\n * Builds the claim data for the ERC20Incentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as ERC20Incentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because ERC20Incentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link ERC20IncentivePayload}, properly encode a `ERC20Incentive.InitPayload` for use with {@link ERC20Incentive} initialization.\n *\n * @param {ERC20IncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @param {Address} [param0.manager=zeroAddress] - The entity that can draw raffles - defaults to unset\n * @returns {Hex}\n */\nexport function prepareERC20IncentivePayload({\n asset,\n strategy,\n reward,\n limit,\n manager = zeroAddress,\n}: ERC20IncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint8', name: 'strategy' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n ],\n [\n asset,\n strategy,\n reward,\n // unclear how user set limit should work for raffle, so in order to avoid passing 0's let's correct it\n limit === 0n && strategy === StrategyType.RAFFLE ? 1n : limit,\n manager,\n ],\n );\n}\n"],"names":["_ERC20Incentive","DeployableTarget","erc20IncentiveAbi","params","readErc20IncentiveOwner","readErc20IncentiveCurrentReward","readErc20IncentiveClaims","address","readErc20IncentiveClaimed","readErc20IncentiveAsset","readErc20IncentiveStrategy","readErc20IncentiveReward","readErc20IncentiveLimit","i","readErc20IncentiveEntries","payload","request","result","simulateErc20IncentiveClaim","prepareClaimPayload","writeErc20IncentiveClaim","simulateErc20IncentiveClawback","writeErc20IncentiveClawback","readErc20IncentiveIsClaimable","simulateErc20IncentiveDrawRaffle","writeErc20IncentiveDrawRaffle","_a","_b","_c","StrategyType","strategy","limit","reward","claims","_payload","_options","options","bytecode","prepareERC20IncentivePayload","amount","encodeAbiParameters","zeroHash","ERC20IncentiveBases","RegistryType","ERC20Incentive","asset","manager","zeroAddress"],"mappings":"00uBAiHaA,EAAN,MAAMA,UAAuBC,EAAAA,gBAGlC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA6B/B,MAAa,MAAMC,EAAqB,CAC/B,OAAA,MAAMC,EAAAA,GAAwB,KAAK,QAAS,CACjD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAID,CAAA,CACL,CACH,CAUA,MAAa,cAAcA,EAAqB,CACvC,OAAA,MAAME,EAAAA,GAAgC,KAAK,QAAS,CACzD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,OAAOA,EAAqB,CAChC,OAAA,MAAMG,E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,oBACL,CACE,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,QAAS,KAAM,UAAW,EAClC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,SAAU,CACrC,EACA,CACEK,EACAf,EACAE,EAEAD,IAAU,IAAMD,IAAaD,EAAA,aAAa,OAAS,GAAKE,EACxDe,CACF,CAAA,CAEJ"}
|
|
1
|
+
{"version":3,"file":"ERC20Incentive.cjs","sources":["../../src/Incentives/ERC20Incentive.ts"],"sourcesContent":["import {\n erc20IncentiveAbi,\n readErc20IncentiveAsset,\n readErc20IncentiveClaimed,\n readErc20IncentiveClaims,\n readErc20IncentiveCurrentReward,\n readErc20IncentiveEntries,\n readErc20IncentiveIsClaimable,\n readErc20IncentiveLimit,\n readErc20IncentiveOwner,\n readErc20IncentiveReward,\n readErc20IncentiveStrategy,\n simulateErc20IncentiveClaim,\n simulateErc20IncentiveClawback,\n simulateErc20IncentiveDrawRaffle,\n writeErc20IncentiveClaim,\n writeErc20IncentiveClawback,\n writeErc20IncentiveDrawRaffle,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20Incentive.sol/ERC20Incentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20Incentive as ERC20IncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n type ClaimPayload,\n StrategyType,\n prepareClaimPayload,\n} from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20IncentiveAbi };\n\n/**\n * The object representation of a `ERC20Incentive.InitPayload`\n *\n * @export\n * @interface ERC20IncentivePayload\n * @typedef {ERC20IncentivePayload}\n */\nexport interface ERC20IncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The type of disbursement strategy for the incentive.\n *\n * @type {StrategyType}\n */\n strategy: StrategyType;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed. This should ideally be 1n for `RAFFLE` strategy types.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * (Optional) The address of the entity that can trigger a raffle.\n * If omitted, the incentive will have no manager with permissions to draw the raffle.\n *\n * @type {Address}\n * @optional\n */\n manager?: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20Incentive` event types.\n *\n * @export\n * @typedef {ERC20IncentiveLog}\n * @template {ContractEventName<typeof erc20IncentiveAbi>} [event=ContractEventName<\n * typeof erc20IncentiveAbi\n * >]\n */\nexport type ERC20IncentiveLog<\n event extends ContractEventName<typeof erc20IncentiveAbi> = ContractEventName<\n typeof erc20IncentiveAbi\n >,\n> = GenericLog<typeof erc20IncentiveAbi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class ERC20Incentive\n * @typedef {ERC20Incentive}\n * @extends {DeployableTarget<ERC20IncentivePayload>}\n */\nexport class ERC20Incentive extends DeployableTarget<\n ERC20IncentivePayload,\n typeof erc20IncentiveAbi\n> {\n public override readonly abi = erc20IncentiveAbi;\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_ERC20_INCENTIVE_BASE,\n ...(ERC20IncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams) {\n return await readErc20IncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\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 * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20IncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\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 * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readErc20IncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\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 * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readErc20IncentiveClaimed(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 * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20IncentiveAsset(this._config, {\n address: this.assertValidAddress(),\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 * The strategy for the incentive (MINT or POOL)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<StrategyType>}\n */\n public strategy(params?: ReadParams): Promise<StrategyType> {\n return readErc20IncentiveStrategy(this._config, {\n address: this.assertValidAddress(),\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 }) as Promise<StrategyType>;\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20IncentiveReward(this._config, {\n address: this.assertValidAddress(),\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 * The limit (max claims, or max entries for raffles)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20IncentiveLimit(this._config, {\n address: this.assertValidAddress(),\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 * The set of addresses that have claimed a slot in the incentive raffle, accessed by bigint index.\n *\n * @public\n * @async\n * @param {bigint} i - Index of address\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async entries(i: bigint, params?: ReadParams) {\n return await readErc20IncentiveEntries(this._config, {\n address: this.assertValidAddress(),\n args: [i],\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 * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20IncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\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 writeErc20IncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20IncentiveClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\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 writeErc20IncentiveClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readErc20IncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [payload.target, payload.data],\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 * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async drawRaffle(params?: WriteParams) {\n return await this.awaitResult(this.drawRaffleRaw(params));\n }\n\n /**\n * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async drawRaffleRaw(params?: WriteParams) {\n const { request, result } = await simulateErc20IncentiveDrawRaffle(\n this._config,\n {\n address: this.assertValidAddress(),\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 writeErc20IncentiveDrawRaffle(this._config, request);\n return { hash, result };\n }\n\n /**\n * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.\n */\n public async getTotalBudget(params?: ReadParams) {\n if (\n this.payload?.strategy !== undefined &&\n this.payload?.limit !== undefined &&\n this.payload?.reward !== undefined\n ) {\n return (this.payload.strategy as StrategyType) === StrategyType.POOL\n ? this.payload.limit * this.payload.reward\n : this.payload.reward;\n }\n const [strategy, limit, reward] = await Promise.all([\n this.strategy(params),\n this.limit(params),\n this.reward(params),\n ]);\n return strategy === StrategyType.POOL ? limit * reward : reward;\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if total claims is less than limit\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - True if total claims is less than limit\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [claims, limit] = await Promise.all([\n this.claims(params),\n this.limit(params),\n ]);\n return limit - claims;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20IncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20IncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20IncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20IncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Encodes an amount to clawback from the incentive\n *\n * @public\n * @param {bigint} amount - How much of the asset to clawback\n * @returns {Hex} - Returns an encoded uint256\n */\n public buildClawbackData(amount: bigint) {\n return encodeAbiParameters([{ type: 'uint256' }], [amount]);\n }\n\n /**\n * A helper that composes a typed \"top-up\" parameter object\n * given a net top-up amount. You can name it whatever you like\n * (e.g. topupParamsFromNetAmount, getTopupPayload, etc.).\n *\n * @public\n * @param {bigint} netAmount The net top-up tokens the user wants to add\n * @param {?WriteParams} [params] (optional) if you need them\n * @returns {Hex} the ABI-encoded data for top-up\n */\n public async getTopupPayload(netAmount: bigint): Promise<Hex> {\n // 1. Build a typed object matching your `ERC20IncentivePayload`.\n // For example, you might want to increment `limit` by `netAmount`,\n // or set `reward = netAmount`. That’s up to your logic:\n const asset = await this.asset();\n const typed: ERC20IncentivePayload = {\n asset: asset || zeroAddress,\n strategy: StrategyType.POOL, // e.g. StrategyType.POOL\n reward: 1n, // store net top-up as the \"reward\"\n limit: netAmount, // or maybe add netAmount to existing limit\n manager: this.payload?.manager || zeroAddress,\n };\n\n // 2. Encode it with your existing `prepareERC20IncentivePayload(...)`.\n return prepareERC20IncentivePayload(typed);\n }\n\n /**\n * Builds the claim data for the ERC20Incentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as ERC20Incentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because ERC20Incentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link ERC20IncentivePayload}, properly encode a `ERC20Incentive.InitPayload` for use with {@link ERC20Incentive} initialization.\n *\n * @param {ERC20IncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @param {Address} [param0.manager=zeroAddress] - The entity that can draw raffles - defaults to unset\n * @returns {Hex}\n */\nexport function prepareERC20IncentivePayload({\n asset,\n strategy,\n reward,\n limit,\n manager = zeroAddress,\n}: ERC20IncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint8', name: 'strategy' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n ],\n [\n asset,\n strategy,\n reward,\n // unclear how user set limit should work for raffle, so in order to avoid passing 0's let's correct it\n limit === 0n && strategy === StrategyType.RAFFLE ? 1n : limit,\n manager,\n ],\n );\n}\n"],"names":["_ERC20Incentive","DeployableTarget","erc20IncentiveAbi","params","readErc20IncentiveOwner","readErc20IncentiveCurrentReward","readErc20IncentiveClaims","address","readErc20IncentiveClaimed","readErc20IncentiveAsset","readErc20IncentiveStrategy","readErc20IncentiveReward","readErc20IncentiveLimit","i","readErc20IncentiveEntries","payload","request","result","simulateErc20IncentiveClaim","prepareClaimPayload","writeErc20IncentiveClaim","simulateErc20IncentiveClawback","writeErc20IncentiveClawback","readErc20IncentiveIsClaimable","simulateErc20IncentiveDrawRaffle","writeErc20IncentiveDrawRaffle","_a","_b","_c","StrategyType","strategy","limit","reward","claims","_payload","_options","options","bytecode","prepareERC20IncentivePayload","amount","encodeAbiParameters","netAmount","typed","zeroAddress","zeroHash","ERC20IncentiveBases","RegistryType","ERC20Incentive","asset","manager"],"mappings":"0piBAiHaA,EAAN,MAAMA,UAAuBC,EAAAA,gBAGlC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA6B/B,MAAa,MAAMC,EAAqB,CAC/B,OAAA,MAAMC,EAAAA,GAAwB,KAAK,QAAS,CACjD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAID,CAAA,CACL,CACH,CAUA,MAAa,cAAcA,EAAqB,CACvC,OAAA,MAAME,EAAAA,GAAgC,KAAK,QAAS,CACzD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,OAAOA,EAAqB,CAChC,OAAA,MAAMG,EAAAA,GAAyB,KAAK,QAAS,CAClD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIH,CAAA,CACL,CACH,CAWA,MAAa,QAAQI,EAAkBJ,EAAqB,CACnD,OAAA,MAAMK,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACD,CAAO,EAEd,GAAIJ,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAqB,CAC/B,OAAA,MAAMM,EAAAA,GAAwB,KAAK,QAAS,CACjD,QAAS,KAAK,mBAAmB,EAEjC,GAAIN,CAAA,CACL,CACH,CAUO,SAASA,EAA4C,CACnD,OAAAO,EAAA,GAA2B,KAAK,QAAS,CAC9C,QA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EAEAD,IAAU,IAAMD,IAAaD,EAAA,aAAa,OAAS,GAAKE,EACxDkB,CACF,CAAA,CAEJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { erc20IncentiveAbi } from '@boostxyz/evm';
|
|
2
|
-
import { type Address, type ContractEventName } from 'viem';
|
|
2
|
+
import { type Address, type ContractEventName, type Hex } from 'viem';
|
|
3
3
|
import type { DeployableOptions, GenericDeployableParams } from '../Deployable/Deployable';
|
|
4
4
|
import { DeployableTarget } from '../Deployable/DeployableTarget';
|
|
5
5
|
import { type ClaimPayload, StrategyType } from '../claiming';
|
|
@@ -268,6 +268,21 @@ export declare class ERC20Incentive extends DeployableTarget<ERC20IncentivePaylo
|
|
|
268
268
|
readonly indexed: true;
|
|
269
269
|
}];
|
|
270
270
|
readonly name: "RolesUpdated";
|
|
271
|
+
}, {
|
|
272
|
+
readonly type: "event";
|
|
273
|
+
readonly anonymous: false;
|
|
274
|
+
readonly inputs: readonly [{
|
|
275
|
+
readonly name: "sender";
|
|
276
|
+
readonly internalType: "address";
|
|
277
|
+
readonly type: "address";
|
|
278
|
+
readonly indexed: false;
|
|
279
|
+
}, {
|
|
280
|
+
readonly name: "amount";
|
|
281
|
+
readonly internalType: "uint256";
|
|
282
|
+
readonly type: "uint256";
|
|
283
|
+
readonly indexed: false;
|
|
284
|
+
}];
|
|
285
|
+
readonly name: "ToppedUp";
|
|
271
286
|
}, {
|
|
272
287
|
readonly type: "function";
|
|
273
288
|
readonly inputs: readonly [];
|
|
@@ -680,6 +695,16 @@ export declare class ERC20Incentive extends DeployableTarget<ERC20IncentivePaylo
|
|
|
680
695
|
readonly type: "bool";
|
|
681
696
|
}];
|
|
682
697
|
readonly stateMutability: "view";
|
|
698
|
+
}, {
|
|
699
|
+
readonly type: "function";
|
|
700
|
+
readonly inputs: readonly [{
|
|
701
|
+
readonly name: "amount";
|
|
702
|
+
readonly internalType: "uint256";
|
|
703
|
+
readonly type: "uint256";
|
|
704
|
+
}];
|
|
705
|
+
readonly name: "topup";
|
|
706
|
+
readonly outputs: readonly [];
|
|
707
|
+
readonly stateMutability: "nonpayable";
|
|
683
708
|
}, {
|
|
684
709
|
readonly type: "function";
|
|
685
710
|
readonly inputs: readonly [{
|
|
@@ -911,6 +936,17 @@ export declare class ERC20Incentive extends DeployableTarget<ERC20IncentivePaylo
|
|
|
911
936
|
* @returns {Hex} - Returns an encoded uint256
|
|
912
937
|
*/
|
|
913
938
|
buildClawbackData(amount: bigint): `0x${string}`;
|
|
939
|
+
/**
|
|
940
|
+
* A helper that composes a typed "top-up" parameter object
|
|
941
|
+
* given a net top-up amount. You can name it whatever you like
|
|
942
|
+
* (e.g. topupParamsFromNetAmount, getTopupPayload, etc.).
|
|
943
|
+
*
|
|
944
|
+
* @public
|
|
945
|
+
* @param {bigint} netAmount The net top-up tokens the user wants to add
|
|
946
|
+
* @param {?WriteParams} [params] (optional) if you need them
|
|
947
|
+
* @returns {Hex} the ABI-encoded data for top-up
|
|
948
|
+
*/
|
|
949
|
+
getTopupPayload(netAmount: bigint): Promise<Hex>;
|
|
914
950
|
/**
|
|
915
951
|
* Builds the claim data for the ERC20Incentive.
|
|
916
952
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20Incentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC20Incentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAiBlB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ERC20Incentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC20Incentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAiBlB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,EAIT,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBA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|
|
3
|
-
import { E
|
|
1
|
+
import { m as n, aN as g, aO as w, aP as m, aQ as p, aR as A, aS as I, aT as R, aU as V, aV as _, aW as P, aX as C, aY as O, aZ as T, a_ as v, a$ as k, b0 as q } from "../generated-CElkFqkY.js";
|
|
2
|
+
import { encodeAbiParameters as y, zeroAddress as t, zeroHash as D } from "viem";
|
|
3
|
+
import { E } from "../deployments-3RHH-eW7.js";
|
|
4
4
|
import { DeployableTarget as L } from "../Deployable/DeployableTarget.js";
|
|
5
|
-
import { prepareClaimPayload as
|
|
6
|
-
import { RegistryType as
|
|
7
|
-
const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612d55806100bd5f395ff3fe608060405260043610610203575f3560e01c806354d1f13d11610117578063c884ef831161009f578063ec87621c1161006e578063ec87621c14610702578063f04e283e1461072c578063f2fde38b14610748578063fe9fbb8014610764578063fee81cf4146107a057610203565b8063c884ef8314610638578063db09da1214610674578063dcc21361146106b0578063dcc59b6f146106d857610203565b8063a4d66daf116100e6578063a4d66daf14610544578063a8c62e761461056e578063b30906d414610598578063bb1757cf146105d4578063be4994f81461061057610203565b806354d1f13d146104dc578063715018a6146104e657806375b238fc146104f05780638da5cb5b1461051a57610203565b806328d6183b1161019a578063439fab9111610169578063439fab91146103e3578063474f5a441461040b5780634a4ee7b1146104485780634e7165a214610464578063514e62fc146104a057610203565b806328d6183b1461032b5780632de948071461035557806338d52e0f146103915780634359d28a146103bb57610203565b80631cd64df4116101d65780631cd64df4146102a55780632275aea9146102e1578063228cb733146102f7578063256929621461032157610203565b806301ffc9a71461020757806307621eca14610243578063183a4f6e1461026d5780631c10893f14610289575b5f80fd5b348015610212575f80fd5b5061022d60048036038101906102289190611ec1565b6107dc565b60405161023a9190611f06565b60405180910390f35b34801561024e575f80fd5b50610257610855565b6040516102649190611f37565b60405180910390f35b61028760048036038101906102829190611f7a565b61085d565b005b6102a3600480360381019061029e9190611fff565b61086a565b005b3480156102b0575f80fd5b506102cb60048036038101906102c69190611fff565b610880565b6040516102d89190611f06565b60405180910390f35b3480156102ec575f80fd5b506102f5610896565b005b348015610302575f80fd5b5061030b610a64565b6040516103189190611f37565b60405180910390f35b610329610a69565b005b348015610336575f80fd5b5061033f610aba565b60405161034c919061204c565b60405180910390f35b348015610360575f80fd5b5061037b60048036038101906103769190612065565b610ae1565b6040516103889190611f37565b60405180910390f35b34801561039c575f80fd5b506103a5610afa565b6040516103b2919061209f565b60405180910390f35b3480156103c6575f80fd5b506103e160048036038101906103dc919061216e565b610b1f565b005b3480156103ee575f80fd5b5061040960048036038101906104049190612241565b610c2d565b005b348015610416575f80fd5b50610431600480360381019061042c9190612241565b610ed4565b60405161043f92919061228c565b60405180910390f35b610462600480360381019061045d9190611fff565b611175565b005b34801561046f575f80fd5b5061048a60048036038101906104859190612241565b61118b565b6040516104979190612323565b60405180910390f35b3480156104ab575f80fd5b506104c660048036038101906104c19190611fff565b6112a9565b6040516104d39190611f06565b60405180910390f35b6104e46112c0565b005b6104ee6112f9565b005b3480156104fb575f80fd5b5061050461130c565b6040516105119190611f37565b60405180910390f35b348015610525575f80fd5b5061052e611311565b60405161053b919061209f565b60405180910390f35b34801561054f575f80fd5b50610558611339565b6040516105659190611f37565b60405180910390f35b348015610579575f80fd5b5061058261133f565b60405161058f91906123b6565b60405180910390f35b3480156105a3575f80fd5b506105be60048036038101906105b99190611f7a565b611351565b6040516105cb919061209f565b60405180910390f35b3480156105df575f80fd5b506105fa60048036038101906105f591906123cf565b61138c565b6040516106079190611f06565b60405180910390f35b34801561061b575f80fd5b5061063660048036038101906106319190612481565b61167b565b005b348015610643575f80fd5b5061065e60048036038101906106599190612065565b611731565b60405161066b9190611f06565b60405180910390f35b34801561067f575f80fd5b5061069a600480360381019061069591906123cf565b61174e565b6040516106a79190611f06565b60405180910390f35b3480156106bb575f80fd5b506106d660048036038101906106d19190612481565b611761565b005b3480156106e3575f80fd5b506106ec611817565b6040516106f99190611f37565b60405180910390f35b34801561070d575f80fd5b5061071661181d565b6040516107239190611f37565b60405180910390f35b61074660048036038101906107419190612065565b611822565b005b610762600480360381019061075d9190612065565b611860565b005b34801561076f575f80fd5b5061078a60048036038101906107859190612065565b611889565b6040516107979190611f06565b60405180910390f35b3480156107ab575f80fd5b506107c660048036038101906107c19190612065565b6118dc565b6040516107d39190611f37565b60405180910390f35b5f7f7cc1d5bb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061084e575061084d826118f5565b5b9050919050565b5f8054905090565b610867338261196e565b50565b61087261197d565b61087c82826119b4565b5050565b5f818261088c85610ae1565b1614905092915050565b60016108a1816119c4565b6001808111156108b4576108b3612343565b5b60025f9054906101000a900460ff1660018111156108d5576108d4612343565b5b1461090c576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60405180602001604052804244610924919061252c565b81525090505f6003808054905061093a846119eb565b610944919061258c565b81548110610955576109546125bc565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506109cc815f5460045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166119fa9092919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16835f54604051602001610a3b9392919061264e565b604051602081830303815290604052604051610a579190612323565b60405180910390a2505050565b5f5481565b5f610a72611a43565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f7cc1d5bb00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6002610b2a81611a4d565b828290508585905014610b69576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610c25575f848483818110610b8a57610b896125bc565b5b9050602002016020810190610b9f91906126b4565b90506001151581151503610be457610bdf878784818110610bc357610bc26125bc565b5b9050602002016020810190610bd89190612065565b60016119b4565b610c17565b610c16878784818110610bfa57610bf96125bc565b5b9050602002016020810190610c0f9190612065565b600161196e565b5b508080600101915050610b6b565b505050505050565b5f610c36611a82565b90508054600382558015610c685760018160011c14303b10610c5f5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610c79919061280b565b90505f81604001511480610c9057505f8160600151145b15610cc7576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600180811115610cdb57610cda612343565b5b82602001516001811115610cf257610cf1612343565b5b03610d01578160400151610d16565b81606001518260400151610d159190612836565b5b90505f610d4530845f015173ffffffffffffffffffffffffffffffffffffffff16611aab90919063ffffffff16565b905081811015610d9357825f015181836040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610d8a93929190612877565b60405180910390fd5b825f015160045f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550826020015160025f6101000a81548160ff02191690836001811115610dfe57610dfd612343565b5b021790555082604001515f819055508260600151600681905550610e2133611ade565b610e3083608001516001611bb4565b825f015173ffffffffffffffffffffffffffffffffffffffff167fe83379cf1b79044fa1d0063e68012349f4f5fb730e6a875bdc9d463747ecd0858460200151856040015186606001518760800151604051610e8f94939291906128ac565b60405180910390a25050508015610ecf576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610ee181611a4d565b5f8585810190610ef19190612a08565b90505f8160200151806020019051810190610f0c9190612a63565b9050600180811115610f2157610f20612343565b5b60025f9054906101000a900460ff166001811115610f4257610f41612343565b5b03610fc7575f5481141580610f5857505f600554115b15610fbb573382604051602001610f6f9190612b1f565b6040516020818303038152906040526040517f4139d81d000000000000000000000000000000000000000000000000000000008152600401610fb2929190612b3f565b60405180910390fd5b5f60068190555061105d565b5f805482610fd5919061258c565b14611038573382604051602001610fec9190612b1f565b6040516020818303038152906040526040517f4139d81d00000000000000000000000000000000000000000000000000000000815260040161102f929190612b3f565b60405180910390fd5b5f54816110459190612b6d565b60065f8282546110559190612b9d565b925050819055505b6110ac825f01518260045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166119fa9092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f0151846040516020016111209392919061264e565b60405160208183030381529060405260405161113c9190612323565b60405180910390a28060045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b61117d61197d565b611187828261196e565b5050565b60605f838381019061119d919061280b565b90505f6001808111156111b3576111b2612343565b5b826020015160018111156111ca576111c9612343565b5b036111d95781604001516111ee565b816060015182604001516111ed9190612836565b5b905060405180608001604052806001600281111561120f5761120e612343565b5b8152602001835f015173ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052808481525060405160200161126e9190612bf9565b6040516020818303038152906040528152506040516020016112909190612cb8565b6040516020818303038152906040529250505092915050565b5f80826112b585610ae1565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61130161197d565b61130a5f611bf5565b565b600281565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60065481565b60025f9054906101000a900460ff1681565b60038181548110611360575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f61139561197d565b61139e84611cbb565b6113d4576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60018111156113e7576113e6612343565b5b60025f9054906101000a900460ff16600181111561140857611407612343565b5b036115615760055f81548092919061141f90612cd8565b91905055506001805f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506114c5845f5460045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166119fa9092919063ffffffff16565b8373ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16865f546040516020016115349392919061264e565b6040516020818303038152906040526040516115509190612323565b60405180910390a260019050611674565b60055f81548092919061157390612cd8565b91905055506001805f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550600384908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff167ff0abe0f5c6f02112a9a4332e7b091bf49040ffddeedb73785a9b9a0a3ca7f15360405160405180910390a2600190505b9392505050565b600261168681611a4d565b8282905085859050146116c5576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156117295761171c8686838181106116e8576116e76125bc565b5b90506020020160208101906116fd9190612065565b8585848181106117105761170f6125bc565b5b905060200201356119b4565b80806001019150506116c7565b505050505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b5f61175884611cbb565b90509392505050565b600261176c81611a4d565b8282905085859050146117ab576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561180f576118028686838181106117ce576117cd6125bc565b5b90506020020160208101906117e39190612065565b8585848181106117f6576117f56125bc565b5b9050602002013561196e565b80806001019150506117ad565b505050505050565b60055481565b600181565b61182a61197d565b63389a75e1600c52805f526020600c20805442111561185057636f5e88185f526004601cfd5b5f81555061185d81611bf5565b50565b61186861197d565b8060601b61187d57637448fbae5f526004601cfd5b61188681611bf5565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166118a9611311565b73ffffffffffffffffffffffffffffffffffffffff1614806118d557506118d48260026001176112a9565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611967575061196682611d1d565b5b9050919050565b61197982825f611d96565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146119b2576382b429005f526004601cfd5b565b6119c082826001611d96565b5050565b638b78c6d8600c52335f52806020600c2054166119e8576382b429005f526004601cfd5b50565b5f602082209050808252919050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611a3a576390b8ec185f526004601cfd5b5f603452505050565b5f6202a300905090565b638b78c6d819543314611a7f57638b78c6d8600c52335f52806020600c205416611a7e576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b611ae6611dee565b15611b5e577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415611b2057630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611bb1565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b611bfd611dee565b15611c62577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550611cb8565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16158015611d165750600654600554105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611d8f5750611d8e82611df2565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611db857848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611ea081611e6c565b8114611eaa575f80fd5b50565b5f81359050611ebb81611e97565b92915050565b5f60208284031215611ed657611ed5611e64565b5b5f611ee384828501611ead565b91505092915050565b5f8115159050919050565b611f0081611eec565b82525050565b5f602082019050611f195f830184611ef7565b92915050565b5f819050919050565b611f3181611f1f565b82525050565b5f602082019050611f4a5f830184611f28565b92915050565b611f5981611f1f565b8114611f63575f80fd5b50565b5f81359050611f7481611f50565b92915050565b5f60208284031215611f8f57611f8e611e64565b5b5f611f9c84828501611f66565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611fce82611fa5565b9050919050565b611fde81611fc4565b8114611fe8575f80fd5b50565b5f81359050611ff981611fd5565b92915050565b5f806040838503121561201557612014611e64565b5b5f61202285828601611feb565b925050602061203385828601611f66565b9150509250929050565b61204681611e6c565b82525050565b5f60208201905061205f5f83018461203d565b92915050565b5f6020828403121561207a57612079611e64565b5b5f61208784828501611feb565b91505092915050565b61209981611fc4565b82525050565b5f6020820190506120b25f830184612090565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126120d9576120d86120b8565b5b8235905067ffffffffffffffff8111156120f6576120f56120bc565b5b602083019150836020820283011115612112576121116120c0565b5b9250929050565b5f8083601f84011261212e5761212d6120b8565b5b8235905067ffffffffffffffff81111561214b5761214a6120bc565b5b602083019150836020820283011115612167576121666120c0565b5b9250929050565b5f805f806040858703121561218657612185611e64565b5b5f85013567ffffffffffffffff8111156121a3576121a2611e68565b5b6121af878288016120c4565b9450945050602085013567ffffffffffffffff8111156121d2576121d1611e68565b5b6121de87828801612119565b925092505092959194509250565b5f8083601f840112612201576122006120b8565b5b8235905067ffffffffffffffff81111561221e5761221d6120bc565b5b60208301915083600182028301111561223a576122396120c0565b5b9250929050565b5f806020838503121561225757612256611e64565b5b5f83013567ffffffffffffffff81111561227457612273611e68565b5b612280858286016121ec565b92509250509250929050565b5f60408201905061229f5f830185611f28565b6122ac6020830184612090565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6122f5826122b3565b6122ff81856122bd565b935061230f8185602086016122cd565b612318816122db565b840191505092915050565b5f6020820190508181035f83015261233b81846122eb565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061238157612380612343565b5b50565b5f81905061239182612370565b919050565b5f6123a082612384565b9050919050565b6123b081612396565b82525050565b5f6020820190506123c95f8301846123a7565b92915050565b5f805f604084860312156123e6576123e5611e64565b5b5f6123f386828701611feb565b935050602084013567ffffffffffffffff81111561241457612413611e68565b5b612420868287016121ec565b92509250509250925092565b5f8083601f840112612441576124406120b8565b5b8235905067ffffffffffffffff81111561245e5761245d6120bc565b5b60208301915083602082028301111561247a576124796120c0565b5b9250929050565b5f805f806040858703121561249957612498611e64565b5b5f85013567ffffffffffffffff8111156124b6576124b5611e68565b5b6124c2878288016120c4565b9450945050602085013567ffffffffffffffff8111156124e5576124e4611e68565b5b6124f18782880161242c565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61253682611f1f565b915061254183611f1f565b9250828201905080821115612559576125586124ff565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61259682611f1f565b91506125a183611f1f565b9250826125b1576125b061255f565b5b828206905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f8160601b9050919050565b5f6125ff826125e9565b9050919050565b5f612610826125f5565b9050919050565b61262861262382611fc4565b612606565b82525050565b5f819050919050565b61264861264382611f1f565b61262e565b82525050565b5f6126598286612617565b6014820191506126698285612617565b6014820191506126798284612637565b602082019150819050949350505050565b61269381611eec565b811461269d575f80fd5b50565b5f813590506126ae8161268a565b92915050565b5f602082840312156126c9576126c8611e64565b5b5f6126d6848285016126a0565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b612719826122db565b810181811067ffffffffffffffff82111715612738576127376126e3565b5b80604052505050565b5f61274a611e5b565b90506127568282612710565b919050565b5f80fd5b6002811061276b575f80fd5b50565b5f8135905061277c8161275f565b92915050565b5f60a08284031215612797576127966126df565b5b6127a160a0612741565b90505f6127b084828501611feb565b5f8301525060206127c38482850161276e565b60208301525060406127d784828501611f66565b60408301525060606127eb84828501611f66565b60608301525060806127ff84828501611feb565b60808301525092915050565b5f60a082840312156128205761281f611e64565b5b5f61282d84828501612782565b91505092915050565b5f61284082611f1f565b915061284b83611f1f565b925082820261285981611f1f565b915082820484148315176128705761286f6124ff565b5b5092915050565b5f60608201905061288a5f830186612090565b6128976020830185611f28565b6128a46040830184611f28565b949350505050565b5f6080820190506128bf5f8301876123a7565b6128cc6020830186611f28565b6128d96040830185611f28565b6128e66060830184612090565b95945050505050565b5f80fd5b5f67ffffffffffffffff82111561290d5761290c6126e3565b5b612916826122db565b9050602081019050919050565b828183375f83830152505050565b5f61294361293e846128f3565b612741565b90508281526020810184848401111561295f5761295e6128ef565b5b61296a848285612923565b509392505050565b5f82601f830112612986576129856120b8565b5b8135612996848260208601612931565b91505092915050565b5f604082840312156129b4576129b36126df565b5b6129be6040612741565b90505f6129cd84828501611feb565b5f83015250602082013567ffffffffffffffff8111156129f0576129ef61275b565b5b6129fc84828501612972565b60208301525092915050565b5f60208284031215612a1d57612a1c611e64565b5b5f82013567ffffffffffffffff811115612a3a57612a39611e68565b5b612a468482850161299f565b91505092915050565b5f81519050612a5d81611f50565b92915050565b5f60208284031215612a7857612a77611e64565b5b5f612a8584828501612a4f565b91505092915050565b612a9781611fc4565b82525050565b5f82825260208201905092915050565b5f612ab7826122b3565b612ac18185612a9d565b9350612ad18185602086016122cd565b612ada816122db565b840191505092915050565b5f604083015f830151612afa5f860182612a8e565b5060208301518482036020860152612b128282612aad565b9150508091505092915050565b5f6020820190508181035f830152612b378184612ae5565b905092915050565b5f604082019050612b525f830185612090565b8181036020830152612b6481846122eb565b90509392505050565b5f612b7782611f1f565b9150612b8283611f1f565b925082612b9257612b9161255f565b5b828204905092915050565b5f612ba782611f1f565b9150612bb283611f1f565b9250828203905081811115612bca57612bc96124ff565b5b92915050565b612bd981611f1f565b82525050565b602082015f820151612bf35f850182612bd0565b50505050565b5f602082019050612c0c5f830184612bdf565b92915050565b60038110612c2357612c22612343565b5b50565b5f819050612c3382612c12565b919050565b5f612c4282612c26565b9050919050565b612c5281612c38565b82525050565b5f608083015f830151612c6d5f860182612c49565b506020830151612c806020860182612a8e565b506040830151612c936040860182612a8e565b5060608301518482036060860152612cab8282612aad565b9150508091505092915050565b5f6020820190508181035f830152612cd08184612c58565b905092915050565b5f612ce282611f1f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d1457612d136124ff565b5b60018201905091905056fea26469706673582212200e8a391db838eb2d13d44a9dd216b23fdde42adae1f7d41ca77ddcbca2d4937864736f6c634300081a0033", c = class c extends L {
|
|
5
|
+
import { prepareClaimPayload as o, StrategyType as c } from "../claiming.js";
|
|
6
|
+
import { RegistryType as x } from "../utils.js";
|
|
7
|
+
const N = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b8160c01c808260011c146073578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b612135806100855f395ff3fe608060405260043610610243575f3560e01c806354d1f13d11610131578063c884ef83116100ac578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b14610677578063fe9fbb801461068a578063fee81cf4146106a9575f80fd5b8063ec87621c14610650578063f04e283e14610664575f80fd5b8063c884ef83146105cf578063db09da12146105fd578063dcc213611461061c578063dcc59b6f1461063b575f80fd5b8063a4d66daf11610101578063b30906d4116100e7578063b30906d414610572578063bb1757cf14610591578063be4994f8146105b0575f80fd5b8063a4d66daf14610537578063a8c62e761461054c575f80fd5b806354d1f13d146104fb578063715018a61461050357806375b238fc1461050b5780638da5cb5b1461051f575f80fd5b80632de94807116101c1578063439fab91116101915780634a4ee7b1116101775780634a4ee7b1146104875780634e7165a21461049a578063514e62fc146104c6575f80fd5b8063439fab911461041f578063474f5a441461043e575f80fd5b80632de948071461035f57806330db555f1461039057806338d52e0f146103af5780634359d28a14610400575f80fd5b80631cd64df411610216578063228cb733116101fc578063228cb73314610309578063256929621461031d57806328d6183b14610325575f80fd5b80631cd64df4146102c05780632275aea9146102f5575f80fd5b806301ffc9a71461024757806307621eca1461027b578063183a4f6e146102985780631c10893f146102ad575b5f80fd5b348015610252575f80fd5b506102666102613660046119da565b6106da565b60405190151581526020015b60405180910390f35b348015610286575f80fd5b505f545b604051908152602001610272565b6102ab6102a6366004611a19565b610735565b005b6102ab6102bb366004611a58565b610742565b3480156102cb575f80fd5b506102666102da366004611a58565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610300575f80fd5b506102ab610758565b348015610314575f80fd5b5061028a5f5481565b6102ab6108d7565b348015610330575f80fd5b506040517f7cc1d5bb000000000000000000000000000000000000000000000000000000008152602001610272565b34801561036a575f80fd5b5061028a610379366004611a80565b638b78c6d8600c9081525f91909152602090205490565b34801561039b575f80fd5b506102ab6103aa366004611a19565b610924565b3480156103ba575f80fd5b506004546103db9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610272565b34801561040b575f80fd5b506102ab61041a366004611ae1565b610a83565b34801561042a575f80fd5b506102ab610439366004611b8b565b610b7d565b348015610449575f80fd5b5061045d610458366004611b8b565b610e4a565b6040805192835273ffffffffffffffffffffffffffffffffffffffff909116602083015201610272565b6102ab610495366004611a58565b61104d565b3480156104a5575f80fd5b506104b96104b4366004611b8b565b61105f565b6040516102729190611bf8565b3480156104d1575f80fd5b506102666104e0366004611a58565b638b78c6d8600c9081525f9290925260209091205416151590565b6102ab61112f565b6102ab611168565b348015610516575f80fd5b5061028a600281565b34801561052a575f80fd5b50638b78c6d819546103db565b348015610542575f80fd5b5061028a60065481565b348015610557575f80fd5b506002546105659060ff1681565b6040516102729190611c4b565b34801561057d575f80fd5b506103db61058c366004611a19565b61117b565b34801561059c575f80fd5b506102666105ab366004611c59565b6111b0565b3480156105bb575f80fd5b506102ab6105ca366004611ae1565b611421565b3480156105da575f80fd5b506102666105e9366004611a80565b60016020525f908152604090205460ff1681565b348015610608575f80fd5b50610266610617366004611c59565b6114bf565b348015610627575f80fd5b506102ab610636366004611ae1565b6114d1565b348015610646575f80fd5b5061028a60055481565b34801561065b575f80fd5b5061028a600181565b6102ab610672366004611a80565b61156f565b6102ab610685366004611a80565b6115a9565b348015610695575f80fd5b506102666106a4366004611a80565b6115cf565b3480156106b4575f80fd5b5061028a6106c3366004611a80565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7cc1d5bb00000000000000000000000000000000000000000000000000000000148061072f575061072f8261162e565b92915050565b61073f3382611683565b50565b61074a61168e565b61075482826116a8565b5050565b6001610763816116b4565b600160025460ff16600181111561077c5761077c611c0a565b146107b3576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f604051806020016040528042446107cb9190611cd5565b905260038054602083208084529293505f926107e79190611d15565b815481106107f7576107f7611d28565b5f918252602082200154905460045473ffffffffffffffffffffffffffffffffffffffff928316935061082d92169083906116d8565b6004545f546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606093841b811660208301529284901b9092166034830152604882015273ffffffffffffffffffffffffffffffffffffffff8216907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d39060680160408051601f19818403018152908290526108ca91611bf8565b60405180910390a2505050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b600161092f81611721565b815f03610968576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60045461098d9073ffffffffffffffffffffffffffffffffffffffff16333085611752565b600160025460ff1660018111156109a6576109a6611c0a565b036109dd576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f546109e99083611d15565b15610a20576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8054610a2d9084611d55565b90508060065f828254610a409190611cd5565b909155505060408051338152602081018590527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a1505050565b6002610a8e81611721565b838214610ac7576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610b75575f848483818110610ae457610ae4611d28565b9050602002016020810190610af99190611d68565b9050801515600103610b3b57610b36878784818110610b1a57610b1a611d28565b9050602002016020810190610b2f9190611a80565b60016116a8565b610b6c565b610b6c878784818110610b5057610b50611d28565b9050602002016020810190610b659190611a80565b6001611683565b50600101610ac9565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610bce5760018160011c14303b10610bc55763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610bdc83850185611e0e565b905080604001515f1480610bf257506060810151155b15610c29576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600182602001516001811115610c4257610c42611c0a565b03610c51578160400151610c65565b81606001518260400151610c659190611e93565b82519091505f90610c8c9073ffffffffffffffffffffffffffffffffffffffff16306117aa565b905081811015610cf65782516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116600482015260248101829052604481018390526064015b60405180910390fd5b8251600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911790556020830151600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610d7a57610d7a611c0a565b021790555060408301515f556060830151600655610d97336117dd565b610da683608001516001611825565b825f015173ffffffffffffffffffffffffffffffffffffffff167fe83379cf1b79044fa1d0063e68012349f4f5fb730e6a875bdc9d463747ecd0858460200151856040015186606001518760800151604051610e059493929190611eaa565b60405180910390a25050508015610e45576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610e5781611721565b5f610e6485870187611ee9565b90505f8160200151806020019051810190610e7f9190611fc0565b9050600160025460ff166001811115610e9a57610e9a611c0a565b03610f11575f5481141580610eb057505f600554115b15610f08573382604051602001610ec79190611fd7565b60408051601f19818403018152908290527f4139d81d000000000000000000000000000000000000000000000000000000008252610ced9291600401612011565b5f600655610f56565b5f54610f1d9082611d15565b15610f34573382604051602001610ec79190611fd7565b5f54610f409082611d55565b60065f828254610f50919061203f565b90915550505b8151600454610f7e9173ffffffffffffffffffffffffffffffffffffffff90911690836116d8565b81516004546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d39060680160408051601f198184030181529082905261101e91611bf8565b60405180910390a260045490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b61105561168e565b6107548282611683565b60605f61106e83850185611e0e565b90505f60018260200151600181111561108957611089611c0a565b036110985781604001516110ac565b816060015182604001516110ac9190611e93565b6040805160808101825260018152845173ffffffffffffffffffffffffffffffffffffffff16602080830191909152308284015282518082018452849052825180820185905283518082038301815290840184526060830152915192935061111692909101612052565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61117061168e565b6111795f611866565b565b6003818154811061118a575f80fd5b5f9182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b5f6111b961168e565b6111c2846118b0565b6111f8576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60025460ff16600181111561121057611210611c0a565b036113375760058054905f611224836120c8565b909155505073ffffffffffffffffffffffffffffffffffffffff8085165f908152600160208190526040822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690911790555460045461128a92169086906116d8565b6004545f546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606093841b811660208301529287901b9092166034830152604882015273ffffffffffffffffffffffffffffffffffffffff8516907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d39060680160408051601f198184030181529082905261132791611bf8565b60405180910390a250600161141a565b60058054905f611346836120c8565b909155505073ffffffffffffffffffffffffffffffffffffffff84165f81815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168317905560038054928301815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055517ff0abe0f5c6f02112a9a4332e7b091bf49040ffddeedb73785a9b9a0a3ca7f1539190a25060015b9392505050565b600261142c81611721565b838214611465576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610b75576114b786868381811061148457611484611d28565b90506020020160208101906114999190611a80565b8585848181106114ab576114ab611d28565b905060200201356116a8565b600101611467565b5f6114c9846118b0565b949350505050565b60026114dc81611721565b838214611515576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610b755761156786868381811061153457611534611d28565b90506020020160208101906115499190611a80565b85858481811061155b5761155b611d28565b90506020020135611683565b600101611517565b61157761168e565b63389a75e1600c52805f526020600c20805442111561159d57636f5e88185f526004601cfd5b5f905561073f81611866565b6115b161168e565b8060601b6115c657637448fbae5f526004601cfd5b61073f81611866565b5f8173ffffffffffffffffffffffffffffffffffffffff166115f4638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff16148061072f5750638b78c6d8600c9081525f8390526020902054600316151561072f565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa921670500000000000000000000000000000000000000000000000000000000148061072f575061072f826118ed565b61075482825f611983565b638b78c6d819543314611179576382b429005f526004601cfd5b61075482826001611983565b638b78c6d8600c52335f52806020600c20541661073f576382b429005f526004601cfd5b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611718576390b8ec185f526004601cfd5b5f603452505050565b638b78c6d81954331461073f57638b78c6d8600c52335f52806020600c20541661073f576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f5114171661179d57637939f4245f526004601cfd5b5f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526001602052604081205460ff1615801561072f57506006546005541092915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061072f57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461072f565b638b78c6d8600c52825f526020600c208054838117836119a4575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f602082840312156119ea575f80fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461141a575f80fd5b5f60208284031215611a29575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611a53575f80fd5b919050565b5f8060408385031215611a69575f80fd5b611a7283611a30565b946020939093013593505050565b5f60208284031215611a90575f80fd5b61141a82611a30565b5f8083601f840112611aa9575f80fd5b50813567ffffffffffffffff811115611ac0575f80fd5b6020830191508360208260051b8501011115611ada575f80fd5b9250929050565b5f805f8060408587031215611af4575f80fd5b843567ffffffffffffffff811115611b0a575f80fd5b611b1687828801611a99565b909550935050602085013567ffffffffffffffff811115611b35575f80fd5b611b4187828801611a99565b95989497509550505050565b5f8083601f840112611b5d575f80fd5b50813567ffffffffffffffff811115611b74575f80fd5b602083019150836020828501011115611ada575f80fd5b5f8060208385031215611b9c575f80fd5b823567ffffffffffffffff811115611bb2575f80fd5b611bbe85828601611b4d565b90969095509350505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f61141a6020830184611bca565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611c4757611c47611c0a565b9052565b6020810161072f8284611c37565b5f805f60408486031215611c6b575f80fd5b611c7484611a30565b9250602084013567ffffffffffffffff811115611c8f575f80fd5b611c9b86828701611b4d565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561072f5761072f611ca8565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82611d2357611d23611ce8565b500690565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82611d6357611d63611ce8565b500490565b5f60208284031215611d78575f80fd5b8135801515811461141a575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040805190810167ffffffffffffffff81118282101715611dd757611dd7611d87565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611e0657611e06611d87565b604052919050565b5f60a0828403128015611e1f575f80fd5b5060405160a0810167ffffffffffffffff81118282101715611e4357611e43611d87565b604052611e4f83611a30565b8152602083013560028110611e62575f80fd5b60208201526040838101359082015260608084013590820152611e8760808401611a30565b60808201529392505050565b808202811582820484141761072f5761072f611ca8565b60808101611eb88287611c37565b84602083015283604083015273ffffffffffffffffffffffffffffffffffffffff8316606083015295945050505050565b5f60208284031215611ef9575f80fd5b813567ffffffffffffffff811115611f0f575f80fd5b820160408185031215611f20575f80fd5b611f28611db4565b611f3182611a30565b8152602082013567ffffffffffffffff811115611f4c575f80fd5b80830192505084601f830112611f60575f80fd5b813567ffffffffffffffff811115611f7a57611f7a611d87565b611f8d6020601f19601f84011601611ddd565b818152866020838601011115611fa1575f80fd5b816020850160208301375f602092820183015290820152949350505050565b5f60208284031215611fd0575f80fd5b5051919050565b6020815273ffffffffffffffffffffffffffffffffffffffff82511660208201525f60208301516040808401526114c96060840182611bca565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201525f6114c96040830184611bca565b8181038181111561072f5761072f611ca8565b602081525f82516003811061206957612069611c0a565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526114c960a0840182611bca565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036120f8576120f8611ca8565b506001019056fea264697066735822122088443730ea9175c8d52add442a13f07026ebe487eeb655e4277c54c4a70cdd2064736f6c634300081a0033", s = class s extends L {
|
|
8
8
|
constructor() {
|
|
9
|
-
super(...arguments), this.abi =
|
|
9
|
+
super(...arguments), this.abi = n;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* The owner of the incentive
|
|
@@ -33,7 +33,7 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
33
33
|
* @returns {Promise<bigint>} - The current reward
|
|
34
34
|
*/
|
|
35
35
|
async currentReward(f) {
|
|
36
|
-
return await
|
|
36
|
+
return await w(this._config, {
|
|
37
37
|
address: this.assertValidAddress(),
|
|
38
38
|
args: [],
|
|
39
39
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -49,7 +49,7 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
49
49
|
* @returns {Promise<bigint>}
|
|
50
50
|
*/
|
|
51
51
|
async claims(f) {
|
|
52
|
-
return await
|
|
52
|
+
return await m(this._config, {
|
|
53
53
|
address: this.assertValidAddress(),
|
|
54
54
|
args: [],
|
|
55
55
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -66,7 +66,7 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
66
66
|
* @returns {Promise<boolean>}
|
|
67
67
|
*/
|
|
68
68
|
async claimed(f, b) {
|
|
69
|
-
return await
|
|
69
|
+
return await p(this._config, {
|
|
70
70
|
address: this.assertValidAddress(),
|
|
71
71
|
args: [f],
|
|
72
72
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -82,7 +82,7 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
82
82
|
* @returns {Promise<Address>}
|
|
83
83
|
*/
|
|
84
84
|
async asset(f) {
|
|
85
|
-
return await
|
|
85
|
+
return await A(this._config, {
|
|
86
86
|
address: this.assertValidAddress(),
|
|
87
87
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
88
88
|
...f
|
|
@@ -97,7 +97,7 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
97
97
|
* @returns {Promise<StrategyType>}
|
|
98
98
|
*/
|
|
99
99
|
strategy(f) {
|
|
100
|
-
return
|
|
100
|
+
return I(this._config, {
|
|
101
101
|
address: this.assertValidAddress(),
|
|
102
102
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
103
103
|
...f
|
|
@@ -112,7 +112,7 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
112
112
|
* @returns {Promise<bigint>}
|
|
113
113
|
*/
|
|
114
114
|
async reward(f) {
|
|
115
|
-
return await
|
|
115
|
+
return await R(this._config, {
|
|
116
116
|
address: this.assertValidAddress(),
|
|
117
117
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
118
118
|
...f
|
|
@@ -127,7 +127,7 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
127
127
|
* @returns {Promise<bigint>}
|
|
128
128
|
*/
|
|
129
129
|
async limit(f) {
|
|
130
|
-
return await
|
|
130
|
+
return await V(this._config, {
|
|
131
131
|
address: this.assertValidAddress(),
|
|
132
132
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
133
133
|
...f
|
|
@@ -143,7 +143,7 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
143
143
|
* @returns {Promise<Address>}
|
|
144
144
|
*/
|
|
145
145
|
async entries(f, b) {
|
|
146
|
-
return await
|
|
146
|
+
return await _(this._config, {
|
|
147
147
|
address: this.assertValidAddress(),
|
|
148
148
|
args: [f],
|
|
149
149
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -172,17 +172,17 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
172
172
|
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed
|
|
173
173
|
*/
|
|
174
174
|
async claimRaw(f, b) {
|
|
175
|
-
const { request: a, result:
|
|
175
|
+
const { request: a, result: d } = await P(
|
|
176
176
|
this._config,
|
|
177
177
|
{
|
|
178
178
|
address: this.assertValidAddress(),
|
|
179
|
-
args: [
|
|
179
|
+
args: [o(f)],
|
|
180
180
|
...this.optionallyAttachAccount(),
|
|
181
181
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
182
182
|
...b
|
|
183
183
|
}
|
|
184
184
|
);
|
|
185
|
-
return { hash: await
|
|
185
|
+
return { hash: await C(this._config, a), result: d };
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
188
188
|
* Clawback assets from the incentive
|
|
@@ -206,17 +206,17 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
206
206
|
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
|
|
207
207
|
*/
|
|
208
208
|
async clawbackRaw(f, b) {
|
|
209
|
-
const { request: a, result:
|
|
209
|
+
const { request: a, result: d } = await O(
|
|
210
210
|
this._config,
|
|
211
211
|
{
|
|
212
212
|
address: this.assertValidAddress(),
|
|
213
|
-
args: [
|
|
213
|
+
args: [o(f)],
|
|
214
214
|
...this.optionallyAttachAccount(),
|
|
215
215
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
216
216
|
...b
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
|
-
return { hash: await T(this._config, a), result:
|
|
219
|
+
return { hash: await T(this._config, a), result: d };
|
|
220
220
|
}
|
|
221
221
|
/**
|
|
222
222
|
* Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.
|
|
@@ -228,7 +228,7 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
228
228
|
* @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
|
|
229
229
|
*/
|
|
230
230
|
async isClaimable(f, b) {
|
|
231
|
-
return await
|
|
231
|
+
return await v(this._config, {
|
|
232
232
|
address: this.assertValidAddress(),
|
|
233
233
|
args: [f.target, f.data],
|
|
234
234
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -264,7 +264,7 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
264
264
|
...f
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
|
-
return { hash: await
|
|
267
|
+
return { hash: await q(this._config, b), result: a };
|
|
268
268
|
}
|
|
269
269
|
/**
|
|
270
270
|
* Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`
|
|
@@ -275,15 +275,15 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
275
275
|
* @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.
|
|
276
276
|
*/
|
|
277
277
|
async getTotalBudget(f) {
|
|
278
|
-
var
|
|
279
|
-
if (((
|
|
280
|
-
return this.payload.strategy ===
|
|
281
|
-
const [b, a,
|
|
278
|
+
var e, i, r;
|
|
279
|
+
if (((e = this.payload) == null ? void 0 : e.strategy) !== void 0 && ((i = this.payload) == null ? void 0 : i.limit) !== void 0 && ((r = this.payload) == null ? void 0 : r.reward) !== void 0)
|
|
280
|
+
return this.payload.strategy === c.POOL ? this.payload.limit * this.payload.reward : this.payload.reward;
|
|
281
|
+
const [b, a, d] = await Promise.all([
|
|
282
282
|
this.strategy(f),
|
|
283
283
|
this.limit(f),
|
|
284
284
|
this.reward(f)
|
|
285
285
|
]);
|
|
286
|
-
return b ===
|
|
286
|
+
return b === c.POOL ? a * d : d;
|
|
287
287
|
}
|
|
288
288
|
/**
|
|
289
289
|
* Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
|
|
@@ -320,15 +320,15 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
320
320
|
* @returns {GenericDeployableParams}
|
|
321
321
|
*/
|
|
322
322
|
buildParameters(f, b) {
|
|
323
|
-
const [a,
|
|
323
|
+
const [a, d] = this.validateDeploymentConfig(
|
|
324
324
|
f,
|
|
325
325
|
b
|
|
326
326
|
);
|
|
327
327
|
return {
|
|
328
|
-
abi:
|
|
329
|
-
bytecode:
|
|
330
|
-
args: [
|
|
331
|
-
...this.optionallyAttachAccount(
|
|
328
|
+
abi: n,
|
|
329
|
+
bytecode: N,
|
|
330
|
+
args: [h(a)],
|
|
331
|
+
...this.optionallyAttachAccount(d.account)
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
334
|
/**
|
|
@@ -339,7 +339,31 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
339
339
|
* @returns {Hex} - Returns an encoded uint256
|
|
340
340
|
*/
|
|
341
341
|
buildClawbackData(f) {
|
|
342
|
-
return
|
|
342
|
+
return y([{ type: "uint256" }], [f]);
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* A helper that composes a typed "top-up" parameter object
|
|
346
|
+
* given a net top-up amount. You can name it whatever you like
|
|
347
|
+
* (e.g. topupParamsFromNetAmount, getTopupPayload, etc.).
|
|
348
|
+
*
|
|
349
|
+
* @public
|
|
350
|
+
* @param {bigint} netAmount The net top-up tokens the user wants to add
|
|
351
|
+
* @param {?WriteParams} [params] (optional) if you need them
|
|
352
|
+
* @returns {Hex} the ABI-encoded data for top-up
|
|
353
|
+
*/
|
|
354
|
+
async getTopupPayload(f) {
|
|
355
|
+
var d;
|
|
356
|
+
const a = {
|
|
357
|
+
asset: await this.asset() || t,
|
|
358
|
+
strategy: c.POOL,
|
|
359
|
+
// e.g. StrategyType.POOL
|
|
360
|
+
reward: 1n,
|
|
361
|
+
// store net top-up as the "reward"
|
|
362
|
+
limit: f,
|
|
363
|
+
// or maybe add netAmount to existing limit
|
|
364
|
+
manager: ((d = this.payload) == null ? void 0 : d.manager) || t
|
|
365
|
+
};
|
|
366
|
+
return h(a);
|
|
343
367
|
}
|
|
344
368
|
/**
|
|
345
369
|
* Builds the claim data for the ERC20Incentive.
|
|
@@ -349,22 +373,22 @@ const q = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
|
|
|
349
373
|
* @description This function returns `zeroHash` because ERC20Incentive doesn't use any specific claim data.
|
|
350
374
|
*/
|
|
351
375
|
buildClaimData() {
|
|
352
|
-
return
|
|
376
|
+
return D;
|
|
353
377
|
}
|
|
354
378
|
};
|
|
355
|
-
|
|
379
|
+
s.bases = {
|
|
356
380
|
31337: void 0,
|
|
357
|
-
...
|
|
358
|
-
},
|
|
359
|
-
let
|
|
360
|
-
function
|
|
361
|
-
asset:
|
|
381
|
+
...E
|
|
382
|
+
}, s.registryType = x.INCENTIVE;
|
|
383
|
+
let l = s;
|
|
384
|
+
function h({
|
|
385
|
+
asset: u,
|
|
362
386
|
strategy: f,
|
|
363
387
|
reward: b,
|
|
364
388
|
limit: a,
|
|
365
|
-
manager:
|
|
389
|
+
manager: d = t
|
|
366
390
|
}) {
|
|
367
|
-
return
|
|
391
|
+
return y(
|
|
368
392
|
[
|
|
369
393
|
{ type: "address", name: "asset" },
|
|
370
394
|
{ type: "uint8", name: "strategy" },
|
|
@@ -373,18 +397,18 @@ function B({
|
|
|
373
397
|
{ type: "address", name: "manager" }
|
|
374
398
|
],
|
|
375
399
|
[
|
|
376
|
-
|
|
400
|
+
u,
|
|
377
401
|
f,
|
|
378
402
|
b,
|
|
379
403
|
// unclear how user set limit should work for raffle, so in order to avoid passing 0's let's correct it
|
|
380
|
-
a === 0n && f ===
|
|
381
|
-
|
|
404
|
+
a === 0n && f === c.RAFFLE ? 1n : a,
|
|
405
|
+
d
|
|
382
406
|
]
|
|
383
407
|
);
|
|
384
408
|
}
|
|
385
409
|
export {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
410
|
+
l as ERC20Incentive,
|
|
411
|
+
n as erc20IncentiveAbi,
|
|
412
|
+
h as prepareERC20IncentivePayload
|
|
389
413
|
};
|
|
390
414
|
//# sourceMappingURL=ERC20Incentive.js.map
|