@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.js","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":";;;;;;ojuBAiHaA,IAAN,MAAMA,UAAuBC,EAGlC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,MAAMC,GAAqB;AAC/B,WAAA,MAAMC,EAAwB,KAAK,SAAS;AAAA,MACjD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,cAAcA,GAAqB;AACvC,WAAA,MAAME,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A;AAAA,EAEnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,kBAAkBG,GAAgB;AAChC,WAAAC,EAAoB,CAAC,EAAE,MAAM,WAAW,GAAG,CAACD,CAAM,CAAC;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,iBAAiB;AACf,WAAAE;AAAA,EACT;AACF;AArYEzC,EAAuB,QAAiC;AAAA,EACtD,OAAO;AAAA,EACP,GAAI0C;AAAA,GASN1C,EAAuB,eAA6B2C,EAAa;AAvB5D,IAAMC,IAAN5C;AA8ZA,SAASsC,EAA6B;AAAA,EAC3C,OAAAO;AAAA,EACA,UAAAf;AAAA,EACA,QAAAE;AAAA,EACA,OAAAD;AAAA,EACA,SAAAe,IAAUC;AACZ,GAA0B;AACjB,SAAAP;AAAA,IACL;AAAA,MACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,SAAS,MAAM,WAAW;AAAA,MAClC,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,MAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,WAAW,MAAM,UAAU;AAAA,IACrC;AAAA,IACA;AAAA,MACEK;AAAA,MACAf;AAAA,MACAE;AAAA;AAAA,MAEAD,MAAU,MAAMD,MAAaD,EAAa,SAAS,KAAKE;AAAA,MACxDe;AAAA,IACF;AAAA,EAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"ERC20Incentive.js","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":";;;;;;o4hBAiHaA,IAAN,MAAMA,UAAuBC,EAGlC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,MAAMC,GAAqB;AAC/B,WAAA,MAAMC,EAAwB,KAAK,SAAS;AAAA,MACjD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,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AM,WAAW,MAAM,UAAU;AAAA,IACrC;AAAA,IACA;AAAA,MACEQ;AAAA,MACAlB;AAAA,MACAE;AAAA;AAAA,MAEAD,MAAU,MAAMD,MAAaD,EAAa,SAAS,KAAKE;AAAA,MACxDkB;AAAA,IACF;AAAA,EAAA;AAEJ;"}
|
|
@@ -241,6 +241,21 @@ export declare class ERC20PeggedIncentive extends DeployableTarget<ERC20PeggedIn
|
|
|
241
241
|
readonly indexed: true;
|
|
242
242
|
}];
|
|
243
243
|
readonly name: "RolesUpdated";
|
|
244
|
+
}, {
|
|
245
|
+
readonly type: "event";
|
|
246
|
+
readonly anonymous: false;
|
|
247
|
+
readonly inputs: readonly [{
|
|
248
|
+
readonly name: "sender";
|
|
249
|
+
readonly internalType: "address";
|
|
250
|
+
readonly type: "address";
|
|
251
|
+
readonly indexed: false;
|
|
252
|
+
}, {
|
|
253
|
+
readonly name: "amount";
|
|
254
|
+
readonly internalType: "uint256";
|
|
255
|
+
readonly type: "uint256";
|
|
256
|
+
readonly indexed: false;
|
|
257
|
+
}];
|
|
258
|
+
readonly name: "ToppedUp";
|
|
244
259
|
}, {
|
|
245
260
|
readonly type: "function";
|
|
246
261
|
readonly inputs: readonly [];
|
|
@@ -643,6 +658,16 @@ export declare class ERC20PeggedIncentive extends DeployableTarget<ERC20PeggedIn
|
|
|
643
658
|
readonly type: "bool";
|
|
644
659
|
}];
|
|
645
660
|
readonly stateMutability: "view";
|
|
661
|
+
}, {
|
|
662
|
+
readonly type: "function";
|
|
663
|
+
readonly inputs: readonly [{
|
|
664
|
+
readonly name: "amount";
|
|
665
|
+
readonly internalType: "uint256";
|
|
666
|
+
readonly type: "uint256";
|
|
667
|
+
}];
|
|
668
|
+
readonly name: "topup";
|
|
669
|
+
readonly outputs: readonly [];
|
|
670
|
+
readonly stateMutability: "nonpayable";
|
|
646
671
|
}, {
|
|
647
672
|
readonly type: "function";
|
|
648
673
|
readonly inputs: readonly [];
|
|
@@ -890,6 +915,16 @@ export declare class ERC20PeggedIncentive extends DeployableTarget<ERC20PeggedIn
|
|
|
890
915
|
* @description This function returns the encoded claim data for the ERC20PeggedIncentive.
|
|
891
916
|
*/
|
|
892
917
|
buildClaimData(rewardAmount: bigint): `0x${string}`;
|
|
918
|
+
/**
|
|
919
|
+
* Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing
|
|
920
|
+
* the existing `limit` field by `netAmount`. The entire payload is then re-encoded
|
|
921
|
+
* via `prepareERC20PeggedIncentivePayload(...)`.
|
|
922
|
+
*
|
|
923
|
+
* @public
|
|
924
|
+
* @param {bigint} netAmount - The additional limit to add to this incentive.
|
|
925
|
+
* @returns {Hex} The ABI-encoded payload with the updated `limit`.
|
|
926
|
+
*/
|
|
927
|
+
getTopupPayload(netAmount: bigint): Promise<Hex>;
|
|
893
928
|
/**
|
|
894
929
|
* Decodes claim data for the ERC20PeggedIncentive, returning the claim amount.
|
|
895
930
|
* Useful when deriving amount claimed from logs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20PeggedIncentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC20PeggedIncentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAgBxB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,EAIT,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;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OG;IACU,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU;IAI/C;;;;;;;OAOG;IACU,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU;IAI7C;;;;;;;OAOG;IACU,0BAA0B,CAAC,MAAM,CAAC,EAAE,UAAU;IAQ3D;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,2BAA2B,EACtC,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;IAa1B;;;;;;OAMG;IACI,iBAAiB,CAAC,MAAM,EAAE,MAAM;IAIvC;;;;;;;OAOG;IACI,cAAc,CAAC,YAAY,EAAE,MAAM;IAM1C;;;;;;;;OAQG;IACU,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAU7D;;;;;;;OAOG;IACI,eAAe,CAAC,SAAS,EAAE,GAAG;CAoBtC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kCAAkC,CAAC,EACjD,KAAK,EACL,GAAG,EACH,MAAM,EACN,KAAK,EACL,OAAqB,GACtB,EAAE,2BAA2B,iBAW7B"}
|
|
@@ -281,6 +281,21 @@ export declare class ERC20PeggedVariableCriteriaIncentive extends DeployableTarg
|
|
|
281
281
|
readonly indexed: true;
|
|
282
282
|
}];
|
|
283
283
|
readonly name: "RolesUpdated";
|
|
284
|
+
}, {
|
|
285
|
+
readonly type: "event";
|
|
286
|
+
readonly anonymous: false;
|
|
287
|
+
readonly inputs: readonly [{
|
|
288
|
+
readonly name: "sender";
|
|
289
|
+
readonly internalType: "address";
|
|
290
|
+
readonly type: "address";
|
|
291
|
+
readonly indexed: false;
|
|
292
|
+
}, {
|
|
293
|
+
readonly name: "amount";
|
|
294
|
+
readonly internalType: "uint256";
|
|
295
|
+
readonly type: "uint256";
|
|
296
|
+
readonly indexed: false;
|
|
297
|
+
}];
|
|
298
|
+
readonly name: "ToppedUp";
|
|
284
299
|
}, {
|
|
285
300
|
readonly type: "function";
|
|
286
301
|
readonly inputs: readonly [];
|
|
@@ -742,6 +757,16 @@ export declare class ERC20PeggedVariableCriteriaIncentive extends DeployableTarg
|
|
|
742
757
|
readonly type: "bool";
|
|
743
758
|
}];
|
|
744
759
|
readonly stateMutability: "view";
|
|
760
|
+
}, {
|
|
761
|
+
readonly type: "function";
|
|
762
|
+
readonly inputs: readonly [{
|
|
763
|
+
readonly name: "amount";
|
|
764
|
+
readonly internalType: "uint256";
|
|
765
|
+
readonly type: "uint256";
|
|
766
|
+
}];
|
|
767
|
+
readonly name: "topup";
|
|
768
|
+
readonly outputs: readonly [];
|
|
769
|
+
readonly stateMutability: "nonpayable";
|
|
745
770
|
}, {
|
|
746
771
|
readonly type: "function";
|
|
747
772
|
readonly inputs: readonly [];
|
|
@@ -992,6 +1017,16 @@ export declare class ERC20PeggedVariableCriteriaIncentive extends DeployableTarg
|
|
|
992
1017
|
* @throws {IncentiveCriteriaNotFoundError}
|
|
993
1018
|
*/
|
|
994
1019
|
getIncentiveCriteria(params?: ReadParams): Promise<IncentiveCriteria>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing
|
|
1022
|
+
* the existing `limit` field by `netAmount`. The entire payload is then re-encoded
|
|
1023
|
+
* via `prepareERC20PeggedIncentivePayload(...)`.
|
|
1024
|
+
*
|
|
1025
|
+
* @public
|
|
1026
|
+
* @param {bigint} netAmount - The additional limit to add to this incentive.
|
|
1027
|
+
* @returns {Hex} The ABI-encoded payload with the updated `limit`.
|
|
1028
|
+
*/
|
|
1029
|
+
getTopupPayload(netAmount: bigint): Promise<Hex>;
|
|
995
1030
|
/**
|
|
996
1031
|
* @inheritdoc
|
|
997
1032
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20PeggedVariableCriteriaIncentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uCAAuC,EAkBxC,MAA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C,EAAE,UAAU;IAI/C;;;;;;;OAOG;IACU,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU;IAI7C;;;;;;;OAOG;IACU,0BAA0B,CAAC,MAAM,CAAC,EAAE,UAAU;IAQ3D;;OAEG;IAEH;;;;;;OAMG;IACU,oBAAoB,CAC/B,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,iBAAiB,CAAC;IAiB7B;;;;;;;;OAQG;IACU,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAiB7D;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,2CAA2C,EACtD,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;IAa1B;;;;;;OAMG;IACI,iBAAiB,CAAC,MAAM,EAAE,MAAM;IAIvC;;;;;;;OAOG;IACI,cAAc,CAAC,YAAY,EAAE,MAAM;IAO1C;;;;;;;OAOG;IACU,eAAe,CAAC,SAAS,EAAE,GAAG;IAqC3C;;;;;;;;;;OAUG;IACI,gCAAgC,CACrC,SAAS,EAAE,GAAG,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM;CAiCpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kDAAkD,CAAC,EACjE,KAAK,EACL,GAAG,EACH,MAAM,EACN,KAAK,EACL,SAAc,EACd,OAAqB,EACrB,QAAQ,GACT,EAAE,2CAA2C,iBA2C7C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../generated-DtYPHhtX.cjs"),E=require("@wagmi/core"),o=require("viem"),C=require("../deployments-DoIOqxco.cjs"),u=require("../Actions/EventAction.cjs"),a=require("../errors.cjs"),h=require("../utils.cjs"),I=require("./ERC20VariableIncentive.cjs"),w="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612d1b806100bd5f395ff3fe608060405260043610610219575f3560e01c8063715018a611610122578063c884ef83116100aa578063ec87621c1161006e578063ec87621c14610771578063f04e283e1461079b578063f2fde38b146107b7578063fe9fbb80146107d3578063fee81cf41461080f57610219565b8063c884ef831461067d578063d54ad2a1146106b9578063db09da12146106e3578063dcc213611461071f578063dcc59b6f1461074757610219565b8063a4d66daf116100f1578063a4d66daf1461059b578063a871ced2146105c5578063bb1757cf146105ef578063be4994f81461062b578063c213f3f91461065357610219565b8063715018a61461051057806375b238fc1461051a57806377548687146105445780638da5cb5b1461057157610219565b806338d52e0f116101a55780634a4ee7b1116101745780634a4ee7b1146104485780634e7165a214610464578063514e62fc146104a057806354d1f13d146104dc57806366a78e6c146104e657610219565b806338d52e0f146103915780634359d28a146103bb578063439fab91146103e3578063474f5a441461040b57610219565b80631cd64df4116101ec5780631cd64df4146102bb578063228cb733146102f7578063256929621461032157806328d6183b1461032b5780632de948071461035557610219565b806301ffc9a71461021d57806307621eca14610259578063183a4f6e146102835780631c10893f1461029f575b5f80fd5b348015610228575f80fd5b50610243600480360381019061023e9190611c6e565b61084b565b6040516102509190611cb3565b60405180910390f35b348015610264575f80fd5b5061026d6108c4565b60405161027a9190611ce4565b60405180910390f35b61029d60048036038101906102989190611d27565b6108cc565b005b6102b960048036038101906102b49190611dac565b6108d9565b005b3480156102c6575f80fd5b506102e160048036038101906102dc9190611dac565b6108ef565b6040516102ee9190611cb3565b60405180910390f35b348015610302575f80fd5b5061030b610905565b6040516103189190611ce4565b60405180910390f35b61032961090a565b005b348015610336575f80fd5b5061033f61095b565b60405161034c9190611df9565b60405180910390f35b348015610360575f80fd5b5061037b60048036038101906103769190611e12565b610982565b6040516103889190611ce4565b60405180910390f35b34801561039c575f80fd5b506103a561099b565b6040516103b29190611e4c565b60405180910390f35b3480156103c6575f80fd5b506103e160048036038101906103dc9190611f1b565b6109c0565b005b3480156103ee575f80fd5b5061040960048036038101906104049190611fee565b610ace565b005b348015610416575f80fd5b50610431600480360381019061042c9190611fee565b610d9c565b60405161043f929190612039565b60405180910390f35b610462600480360381019061045d9190611dac565b610f06565b005b34801561046f575f80fd5b5061048a60048036038101906104859190611fee565b610f1c565b60405161049791906120d0565b60405180910390f35b3480156104ab575f80fd5b506104c660048036038101906104c19190611dac565b610fea565b6040516104d39190611cb3565b60405180910390f35b6104e4611001565b005b3480156104f1575f80fd5b506104fa61103a565b6040516105079190611ce4565b60405180910390f35b610518611040565b005b348015610525575f80fd5b5061052e611053565b60405161053b9190611ce4565b60405180910390f35b34801561054f575f80fd5b50610558611058565b6040516105689493929190612196565b60405180910390f35b34801561057c575f80fd5b506105856110ad565b6040516105929190611e4c565b60405180910390f35b3480156105a6575f80fd5b506105af6110d5565b6040516105bc9190611ce4565b60405180910390f35b3480156105d0575f80fd5b506105d96110db565b6040516105e69190612268565b60405180910390f35b3480156105fa575f80fd5b5061061560048036038101906106109190612281565b6111aa565b6040516106229190611cb3565b60405180910390f35b348015610636575f80fd5b50610651600480360381019061064c9190612333565b6113d7565b005b34801561065e575f80fd5b5061066761148d565b6040516106749190611ce4565b60405180910390f35b348015610688575f80fd5b506106a3600480360381019061069e9190611e12565b611496565b6040516106b09190611cb3565b60405180910390f35b3480156106c4575f80fd5b506106cd6114b3565b6040516106da9190611ce4565b60405180910390f35b3480156106ee575f80fd5b5061070960048036038101906107049190612281565b6114b9565b6040516107169190611cb3565b60405180910390f35b34801561072a575f80fd5b5061074560048036038101906107409190612333565b6114cc565b005b348015610752575f80fd5b5061075b611582565b6040516107689190611ce4565b60405180910390f35b34801561077c575f80fd5b50610785611588565b6040516107929190611ce4565b60405180910390f35b6107b560048036038101906107b09190611e12565b61158d565b005b6107d160048036038101906107cc9190611e12565b6115cb565b005b3480156107de575f80fd5b506107f960048036038101906107f49190611e12565b6115f4565b6040516108069190611cb3565b60405180910390f35b34801561081a575f80fd5b5061083560048036038101906108309190611e12565b611647565b6040516108429190611ce4565b60405180910390f35b5f7f52b8e45c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108bd57506108bc82611660565b5b9050919050565b5f8054905090565b6108d633826116d9565b50565b6108e16116e8565b6108eb828261171f565b5050565b5f81826108fb85610982565b1614905092915050565b5f5481565b5f61091361172f565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f52b8e45c00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026109cb81611739565b828290508585905014610a0a576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610ac6575f848483818110610a2b57610a2a6123b1565b5b9050602002016020810190610a409190612408565b90506001151581151503610a8557610a80878784818110610a6457610a636123b1565b5b9050602002016020810190610a799190611e12565b600161171f565b610ab8565b610ab7878784818110610a9b57610a9a6123b1565b5b9050602002016020810190610ab09190611e12565b60016116d9565b5b508080600101915050610a0c565b505050505050565b5f610ad761176e565b90508054600382558015610b095760018160011c14303b10610b005763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610b1a9190612629565b90505f815f015190505f826020015190505f836040015190505f846060015190505f856080015190505f8303610b7c576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ba6308773ffffffffffffffffffffffffffffffffffffffff1661179790919063ffffffff16565b905083811015610bf457865f015181856040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610beb93929190612655565b60405180910390fd5b8560035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550845f8190555083600281905550826006819055505f6005819055508160075f820151815f015f6101000a81548160ff02191690836001811115610c7a57610c796120f0565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050610cfc336117ca565b610d073360016118a0565b8573ffffffffffffffffffffffffffffffffffffffff167f4dfcc2b9ad954a56fe7153ce6568e2d30033d056714ca4acaa4620b12e1a1a2486868686604051610d53949392919061268a565b60405180910390a2505050505050508015610d97576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610da981611739565b5f8585810190610db991906127e6565b90505f8160200151806020019051810190610dd49190612841565b90508060025f828254610de79190612899565b92505081905550610e3d825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118e19092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610eb193929190612931565b604051602081830303815290604052604051610ecd91906120d0565b60405180910390a28060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610f0e6116e8565b610f1882826116d9565b5050565b60605f808484810190610f2f91906129a8565b9250509150604051806080016040528060016002811115610f5357610f526120f0565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610faf9190612a21565b604051602081830303815290604052815250604051602001610fd19190612b28565b6040516020818303038152906040529250505092915050565b5f8082610ff685610982565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b60065481565b6110486116e8565b6110515f61192a565b565b600281565b6007805f015f9054906101000a900460ff1690806001015490806002015f9054906101000a900460ff16908060020160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025481565b6110e3611bb6565b60076040518060800160405290815f82015f9054906101000a900460ff166001811115611113576111126120f0565b5b6001811115611125576111246120f0565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f6111b36116e8565b5f83838101906111c39190612bcd565b90505f81602001518060200190518101906111de9190612841565b90505f6111ea876119f0565b611220576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80540361123057819050611253565b670de0b6b3a7640000825f546112469190612c14565b6112509190612c82565b90505b5f60065414158015611266575060065481115b156112715760065490505b600254816005546112829190612cb2565b11156112ba576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546112cb9190612cb2565b92505081905550600160045f8282546112e49190612cb2565b92505081905550611337878260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118e19092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689846040516020016113a593929190612931565b6040516020818303038152906040526040516113c191906120d0565b60405180910390a2600193505050509392505050565b60026113e281611739565b828290508585905014611421576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561148557611478868683818110611444576114436123b1565b5b90506020020160208101906114599190611e12565b85858481811061146c5761146b6123b1565b5b9050602002013561171f565b8080600101915050611423565b505050505050565b5f600654905090565b6001602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f6114c3846119f0565b90509392505050565b60026114d781611739565b828290508585905014611516576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561157a5761156d868683818110611539576115386123b1565b5b905060200201602081019061154e9190611e12565b858584818110611561576115606123b1565b5b905060200201356116d9565b8080600101915050611518565b505050505050565b60045481565b600181565b6115956116e8565b63389a75e1600c52805f526020600c2080544211156115bb57636f5e88185f526004601cfd5b5f8155506115c88161192a565b50565b6115d36116e8565b8060601b6115e857637448fbae5f526004601cfd5b6115f18161192a565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166116146110ad565b73ffffffffffffffffffffffffffffffffffffffff161480611640575061163f826002600117610fea565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f90318111000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806116d257506116d1826119ff565b5b9050919050565b6116e482825f611a78565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754331461171d576382b429005f526004601cfd5b565b61172b82826001611a78565b5050565b5f6202a300905090565b638b78c6d81954331461176b57638b78c6d8600c52335f52806020600c20541661176a576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b6117d2611ad0565b1561184a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561180c57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061189d565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611921576390b8ec185f526004601cfd5b5f603452505050565b611932611ad0565b15611997577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506119ed565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600254600554109050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611a715750611a7082611ad4565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611a9a57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611b465750611b4582611b4d565b5b9050919050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60405180608001604052805f6001811115611bd457611bd36120f0565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c4d81611c19565b8114611c57575f80fd5b50565b5f81359050611c6881611c44565b92915050565b5f60208284031215611c8357611c82611c11565b5b5f611c9084828501611c5a565b91505092915050565b5f8115159050919050565b611cad81611c99565b82525050565b5f602082019050611cc65f830184611ca4565b92915050565b5f819050919050565b611cde81611ccc565b82525050565b5f602082019050611cf75f830184611cd5565b92915050565b611d0681611ccc565b8114611d10575f80fd5b50565b5f81359050611d2181611cfd565b92915050565b5f60208284031215611d3c57611d3b611c11565b5b5f611d4984828501611d13565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611d7b82611d52565b9050919050565b611d8b81611d71565b8114611d95575f80fd5b50565b5f81359050611da681611d82565b92915050565b5f8060408385031215611dc257611dc1611c11565b5b5f611dcf85828601611d98565b9250506020611de085828601611d13565b9150509250929050565b611df381611c19565b82525050565b5f602082019050611e0c5f830184611dea565b92915050565b5f60208284031215611e2757611e26611c11565b5b5f611e3484828501611d98565b91505092915050565b611e4681611d71565b82525050565b5f602082019050611e5f5f830184611e3d565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611e8657611e85611e65565b5b8235905067ffffffffffffffff811115611ea357611ea2611e69565b5b602083019150836020820283011115611ebf57611ebe611e6d565b5b9250929050565b5f8083601f840112611edb57611eda611e65565b5b8235905067ffffffffffffffff811115611ef857611ef7611e69565b5b602083019150836020820283011115611f1457611f13611e6d565b5b9250929050565b5f805f8060408587031215611f3357611f32611c11565b5b5f85013567ffffffffffffffff811115611f5057611f4f611c15565b5b611f5c87828801611e71565b9450945050602085013567ffffffffffffffff811115611f7f57611f7e611c15565b5b611f8b87828801611ec6565b925092505092959194509250565b5f8083601f840112611fae57611fad611e65565b5b8235905067ffffffffffffffff811115611fcb57611fca611e69565b5b602083019150836001820283011115611fe757611fe6611e6d565b5b9250929050565b5f806020838503121561200457612003611c11565b5b5f83013567ffffffffffffffff81111561202157612020611c15565b5b61202d85828601611f99565b92509250509250929050565b5f60408201905061204c5f830185611cd5565b6120596020830184611e3d565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6120a282612060565b6120ac818561206a565b93506120bc81856020860161207a565b6120c581612088565b840191505092915050565b5f6020820190508181035f8301526120e88184612098565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061212e5761212d6120f0565b5b50565b5f81905061213e8261211d565b919050565b5f61214d82612131565b9050919050565b61215d81612143565b82525050565b5f819050919050565b61217581612163565b82525050565b5f60ff82169050919050565b6121908161217b565b82525050565b5f6080820190506121a95f830187612154565b6121b6602083018661216c565b6121c36040830185612187565b6121d06060830184611e3d565b95945050505050565b6121e281612143565b82525050565b6121f181612163565b82525050565b6122008161217b565b82525050565b61220f81611d71565b82525050565b608082015f8201516122295f8501826121d9565b50602082015161223c60208501826121e8565b50604082015161224f60408501826121f7565b5060608201516122626060850182612206565b50505050565b5f60808201905061227b5f830184612215565b92915050565b5f805f6040848603121561229857612297611c11565b5b5f6122a586828701611d98565b935050602084013567ffffffffffffffff8111156122c6576122c5611c15565b5b6122d286828701611f99565b92509250509250925092565b5f8083601f8401126122f3576122f2611e65565b5b8235905067ffffffffffffffff8111156123105761230f611e69565b5b60208301915083602082028301111561232c5761232b611e6d565b5b9250929050565b5f805f806040858703121561234b5761234a611c11565b5b5f85013567ffffffffffffffff81111561236857612367611c15565b5b61237487828801611e71565b9450945050602085013567ffffffffffffffff81111561239757612396611c15565b5b6123a3878288016122de565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6123e781611c99565b81146123f1575f80fd5b50565b5f81359050612402816123de565b92915050565b5f6020828403121561241d5761241c611c11565b5b5f61242a848285016123f4565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61246d82612088565b810181811067ffffffffffffffff8211171561248c5761248b612437565b5b80604052505050565b5f61249e611c08565b90506124aa8282612464565b919050565b5f80fd5b600281106124bf575f80fd5b50565b5f813590506124d0816124b3565b92915050565b6124df81612163565b81146124e9575f80fd5b50565b5f813590506124fa816124d6565b92915050565b6125098161217b565b8114612513575f80fd5b50565b5f8135905061252481612500565b92915050565b5f6080828403121561253f5761253e612433565b5b6125496080612495565b90505f612558848285016124c2565b5f83015250602061256b848285016124ec565b602083015250604061257f84828501612516565b604083015250606061259384828501611d98565b60608301525092915050565b5f61010082840312156125b5576125b4612433565b5b6125bf60a0612495565b90505f6125ce84828501611d98565b5f8301525060206125e184828501611d13565b60208301525060406125f584828501611d13565b604083015250606061260984828501611d13565b606083015250608061261d8482850161252a565b60808301525092915050565b5f610100828403121561263f5761263e611c11565b5b5f61264c8482850161259f565b91505092915050565b5f6060820190506126685f830186611e3d565b6126756020830185611cd5565b6126826040830184611cd5565b949350505050565b5f60e08201905061269d5f830187611cd5565b6126aa6020830186611cd5565b6126b76040830185611cd5565b6126c46060830184612215565b95945050505050565b5f80fd5b5f67ffffffffffffffff8211156126eb576126ea612437565b5b6126f482612088565b9050602081019050919050565b828183375f83830152505050565b5f61272161271c846126d1565b612495565b90508281526020810184848401111561273d5761273c6126cd565b5b612748848285612701565b509392505050565b5f82601f83011261276457612763611e65565b5b813561277484826020860161270f565b91505092915050565b5f6040828403121561279257612791612433565b5b61279c6040612495565b90505f6127ab84828501611d98565b5f83015250602082013567ffffffffffffffff8111156127ce576127cd6124af565b5b6127da84828501612750565b60208301525092915050565b5f602082840312156127fb576127fa611c11565b5b5f82013567ffffffffffffffff81111561281857612817611c15565b5b6128248482850161277d565b91505092915050565b5f8151905061283b81611cfd565b92915050565b5f6020828403121561285657612855611c11565b5b5f6128638482850161282d565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6128a382611ccc565b91506128ae83611ccc565b92508282039050818111156128c6576128c561286c565b5b92915050565b5f8160601b9050919050565b5f6128e2826128cc565b9050919050565b5f6128f3826128d8565b9050919050565b61290b61290682611d71565b6128e9565b82525050565b5f819050919050565b61292b61292682611ccc565b612911565b82525050565b5f61293c82866128fa565b60148201915061294c82856128fa565b60148201915061295c828461291a565b602082019150819050949350505050565b5f61297782611d52565b9050919050565b6129878161296d565b8114612991575f80fd5b50565b5f813590506129a28161297e565b92915050565b5f805f606084860312156129bf576129be611c11565b5b5f6129cc86828701612994565b93505060206129dd86828701611d13565b92505060406129ee86828701611d13565b9150509250925092565b612a0181611ccc565b82525050565b602082015f820151612a1b5f8501826129f8565b50505050565b5f602082019050612a345f830184612a07565b92915050565b60038110612a4b57612a4a6120f0565b5b50565b5f819050612a5b82612a3a565b919050565b5f612a6a82612a4e565b9050919050565b612a7a81612a60565b82525050565b5f82825260208201905092915050565b5f612a9a82612060565b612aa48185612a80565b9350612ab481856020860161207a565b612abd81612088565b840191505092915050565b5f608083015f830151612add5f860182612a71565b506020830151612af06020860182612206565b506040830151612b036040860182612206565b5060608301518482036060860152612b1b8282612a90565b9150508091505092915050565b5f6020820190508181035f830152612b408184612ac8565b905092915050565b5f60408284031215612b5d57612b5c612433565b5b612b676040612495565b90505f82013567ffffffffffffffff811115612b8657612b856124af565b5b612b9284828501612750565b5f83015250602082013567ffffffffffffffff811115612bb557612bb46124af565b5b612bc184828501612750565b60208301525092915050565b5f60208284031215612be257612be1611c11565b5b5f82013567ffffffffffffffff811115612bff57612bfe611c15565b5b612c0b84828501612b48565b91505092915050565b5f612c1e82611ccc565b9150612c2983611ccc565b9250828202612c3781611ccc565b91508282048414831517612c4e57612c4d61286c565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612c8c82611ccc565b9150612c9783611ccc565b925082612ca757612ca6612c55565b5b828204905092915050565b5f612cbc82611ccc565b9150612cc783611ccc565b9250828201905080821115612cdf57612cde61286c565b5b9291505056fea2646970667358221220238a2694ac11aa8bece7145721bd76ab9cc7b07442e8c97be4bdd87624df868664736f6c634300081a0033",l=class l extends I.ERC20VariableIncentive{constructor(){super(...arguments),this.abi=s.d}async getIncentiveCriteria(b){try{return await s.YN(this._config,{...b,address:this.assertValidAddress()})}catch(e){throw new a.IncentiveCriteriaNotFoundError(e)}}async getMaxReward(b){return await s.e5(this._config,{...b,address:this.assertValidAddress()})}async getIncentiveScalar({chainId:b,hash:e,knownSignatures:r},c){var p;const f=await this.getIncentiveCriteria(c);if(f.criteriaType===u.SignatureType.EVENT){const d=await E.getTransactionReceipt(this._config,{chainId:b,hash:e});if(f.fieldIndex===h.CheatCodes.GAS_REBATE_INCENTIVE)return d.gasUsed*d.effectiveGasPrice+(d.blobGasUsed??0n)*(d.blobGasPrice??0n);const n=d.logs;if(n.length===0)throw new a.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);try{const i=r[f.signature],t=o.parseEventLogs({abi:[i],logs:n});if(t==null||t.length===0)throw new a.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);const y=((p=t[0])==null?void 0:p.args)[f.fieldIndex];if(y===void 0)throw new a.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(y)}catch(i){throw new a.DecodedArgsError(`Failed to decode event log for signature ${f.signature}: ${i.message}`)}}else if(f.criteriaType===u.SignatureType.FUNC){const d=await E.getTransaction(this._config,{chainId:b,hash:e});try{const n=r[f.signature],t=o.decodeFunctionData({abi:[n],data:d.input}).args[f.fieldIndex];if(t==null)throw new a.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(t)}catch(n){throw new a.DecodedArgsError(`Failed to decode function data for signature ${f.signature}: ${n.message}`)}}else throw new a.InvalidCriteriaTypeError(`Invalid criteria type ${f.criteriaType}`)}buildParameters(b,e){const[r,c]=this.validateDeploymentConfig(b,e);return{abi:s.d,bytecode:w,args:[m(r)],...this.optionallyAttachAccount(c.account)}}};l.bases={31337:void 0,...C.ERC20VariableCriteriaIncentive};let g=l;function T(){return{criteriaType:u.SignatureType.EVENT,signature:o.zeroHash,fieldIndex:h.CheatCodes.GAS_REBATE_INCENTIVE,targetContract:o.zeroAddress}}function m({asset:v,reward:b,limit:e,maxReward:r=0n,criteria:c}){return o.encodeAbiParameters([{type:"tuple",name:"initPayloadExtended",components:[{type:"address",name:"asset"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"},{type:"uint256",name:"maxReward"},{type:"tuple",name:"criteria",components:[{type:"uint8",name:"criteriaType"},{type:"bytes32",name:"signature"},{type:"uint8",name:"fieldIndex"},{type:"address",name:"targetContract"}]}]}],[{asset:v,reward:b,limit:e,maxReward:r,criteria:{criteriaType:c.criteriaType,signature:c.signature,fieldIndex:c.fieldIndex,targetContract:c.targetContract}}])}exports.erc20VariableCriteriaIncentiveAbi=s.d;exports.ERC20VariableCriteriaIncentive=g;exports.gasRebateIncentiveCriteria=T;exports.prepareERC20VariableCriteriaIncentivePayload=m;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../generated-BPiHi7W2.cjs"),E=require("@wagmi/core"),o=require("viem"),C=require("../deployments-CIXw_WKk.cjs"),u=require("../Actions/EventAction.cjs"),d=require("../errors.cjs"),h=require("../utils.cjs"),I=require("./ERC20VariableIncentive.cjs"),w="0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b8160c01c808260011c146073578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b612096806100855f395ff3fe608060405260043610610277575f3560e01c8063715018a61161014b578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b14610703578063fe9fbb8014610716578063fee81cf414610735575f80fd5b8063ec87621c146106dc578063f04e283e146106f0575f80fd5b8063db09da12116100ac578063db09da1214610689578063dcc21361146106a8578063dcc59b6f146106c7575f80fd5b8063c884ef8314610646578063d54ad2a114610674575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf146105f4578063be4994f814610613578063c213f3f914610632575f80fd5b8063a4d66daf146105be578063a871ced2146105d3575f80fd5b8063715018a61461053857806375b238fc1461054057806377548687146105545780638da5cb5b146105a6575f80fd5b806330db555f116101f55780634a4ee7b1116101ab578063514e62fc11610191578063514e62fc146104e657806354d1f13d1461051b57806366a78e6c14610523575f80fd5b80634a4ee7b1146104a75780634e7165a2146104ba575f80fd5b80634359d28a116101db5780634359d28a14610420578063439fab911461043f578063474f5a441461045e575f80fd5b806330db555f146103b057806338d52e0f146103cf575f80fd5b80631cd64df41161024a5780632569296211610230578063256929621461033d57806328d6183b146103455780632de948071461037f575f80fd5b80631cd64df4146102f4578063228cb73314610329575f80fd5b806301ffc9a71461027b57806307621eca146102af578063183a4f6e146102cc5780631c10893f146102e1575b5f80fd5b348015610286575f80fd5b5061029a6102953660046117f6565b610766565b60405190151581526020015b60405180910390f35b3480156102ba575f80fd5b505f545b6040519081526020016102a6565b6102df6102da36600461183c565b6107c1565b005b6102df6102ef366004611874565b6107ce565b3480156102ff575f80fd5b5061029a61030e366004611874565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610334575f80fd5b506102be5f5481565b6102df6107e4565b348015610350575f80fd5b506040517f52b8e45c0000000000000000000000000000000000000000000000000000000081526020016102a6565b34801561038a575f80fd5b506102be61039936600461189e565b638b78c6d8600c9081525f91909152602090205490565b3480156103bb575f80fd5b506102df6103ca36600461183c565b610831565b3480156103da575f80fd5b506003546103fb9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102a6565b34801561042b575f80fd5b506102df61043a366004611901565b6108ed565b34801561044a575f80fd5b506102df6104593660046119ab565b6109e7565b348015610469575f80fd5b5061047d6104783660046119ab565b610cd1565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102a6565b6102df6104b5366004611874565b610e33565b3480156104c5575f80fd5b506104d96104d43660046119ab565b610e45565b6040516102a69190611a36565b3480156104f1575f80fd5b5061029a610500366004611874565b638b78c6d8600c9081525f9290925260209091205416151590565b6102df610f2e565b34801561052e575f80fd5b506102be60065481565b6102df610f67565b34801561054b575f80fd5b506102be600281565b34801561055f575f80fd5b506007546008546009546105969260ff908116929190811690610100900473ffffffffffffffffffffffffffffffffffffffff1684565b6040516102a69493929190611a89565b3480156105b1575f80fd5b50638b78c6d819546103fb565b3480156105c9575f80fd5b506102be60025481565b3480156105de575f80fd5b506105e7610f7a565b6040516102a69190611b11565b3480156105ff575f80fd5b5061029a61060e366004611b1f565b611014565b34801561061e575f80fd5b506102df61062d366004611901565b611245565b34801561063d575f80fd5b506006546102be565b348015610651575f80fd5b5061029a61066036600461189e565b60016020525f908152604090205460ff1681565b34801561067f575f80fd5b506102be60055481565b348015610694575f80fd5b5061029a6106a3366004611b1f565b6112e3565b3480156106b3575f80fd5b506102df6106c2366004611901565b6112f9565b3480156106d2575f80fd5b506102be60045481565b3480156106e7575f80fd5b506102be600181565b6102df6106fe36600461189e565b611397565b6102df61071136600461189e565b6113d1565b348015610721575f80fd5b5061029a61073036600461189e565b6113f7565b348015610740575f80fd5b506102be61074f36600461189e565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f52b8e45c0000000000000000000000000000000000000000000000000000000014806107bb57506107bb82611456565b92915050565b6107cb33826114ab565b50565b6107d66114b6565b6107e082826114d0565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b600161083c816114dc565b815f03610875576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035461089a9073ffffffffffffffffffffffffffffffffffffffff1633308561150d565b8160025f8282546108ab9190611b9d565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b60026108f8816114dc565b838214610931576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109df575f84848381811061094e5761094e611bb0565b90506020020160208101906109639190611bdd565b90508015156001036109a5576109a087878481811061098457610984611bb0565b9050602002016020810190610999919061189e565b60016114d0565b6109d6565b6109d68787848181106109ba576109ba611bb0565b90506020020160208101906109cf919061189e565b60016114ab565b50600101610933565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610a385760018160011c14303b10610a2f5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610a4683850185611c98565b805160208201516040830151606084015160808501519495509293919290915f839003610a9f576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ac073ffffffffffffffffffffffffffffffffffffffff871630611565565b905083811015610b295786516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810185905260640160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88161790555f8581556002859055600684905560055581516007805484929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610bba57610bba611a48565b02179055506020820151600182015560408201516002909101805460609093015173ffffffffffffffffffffffffffffffffffffffff16610100027fffffffffffffffffffffff00000000000000000000000000000000000000000090931660ff90921691909117919091179055610c3133611598565b610c3c3360016115e0565b8573ffffffffffffffffffffffffffffffffffffffff167f4dfcc2b9ad954a56fe7153ce6568e2d30033d056714ca4acaa4620b12e1a1a2486868686604051610c889493929190611d6f565b60405180910390a2505050505050508015610ccc576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610cde816114dc565b5f610ceb85870187611e43565b90505f8160200151806020019051810190610d069190611ec2565b90508060025f828254610d199190611ed9565b90915550508151600354610d469173ffffffffffffffffffffffffffffffffffffffff9091169083611621565b81516003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610e0491611a36565b60405180910390a260035490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610e3b6114b6565b6107e082826114ab565b60605f80610e5584860186611eec565b9250509150604051806080016040528060016002811115610e7857610e78611a48565b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610ed79151815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152915251610f159190602001611f1e565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610f6f6114b6565b610f785f61166a565b565b604080516080810182525f808252602082018190529181018290526060810191909152604080516080810190915260078054829060ff166001811115610fc257610fc2611a48565b6001811115610fd357610fd3611a48565b81526001820154602082015260029091015460ff81166040830152610100900473ffffffffffffffffffffffffffffffffffffffff16606090910152919050565b5f61101d6114b6565b5f61102a83850185611f94565b90505f81602001518060200190518101906110459190611ec2565b90505f6110556002546005541090565b61108b576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f545f0361109a5750806110bd565b670de0b6b3a7640000825f546110b09190612011565b6110ba9190612028565b90505b600654158015906110cf575060065481115b156110d957506006545b600254816005546110ea9190611b9d565b1115611122576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546111339190611b9d565b92505081905550600160045f82825461114c9190611b9d565b90915550506003546111759073ffffffffffffffffffffffffffffffffffffffff168883611621565b6003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261123091611a36565b60405180910390a25060019695505050505050565b6002611250816114dc565b838214611289576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109df576112db8686838181106112a8576112a8611bb0565b90506020020160208101906112bd919061189e565b8585848181106112cf576112cf611bb0565b905060200201356114d0565b60010161128b565b5f6112f16002546005541090565b949350505050565b6002611304816114dc565b83821461133d576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848110156109df5761138f86868381811061135c5761135c611bb0565b9050602002016020810190611371919061189e565b85858481811061138357611383611bb0565b905060200201356114ab565b60010161133f565b61139f6114b6565b63389a75e1600c52805f526020600c2080544211156113c557636f5e88185f526004601cfd5b5f90556107cb8161166a565b6113d96114b6565b8060601b6113ee57637448fbae5f526004601cfd5b6107cb8161166a565b5f8173ffffffffffffffffffffffffffffffffffffffff1661141c638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806107bb5750638b78c6d8600c9081525f839052602090205460031615156107bb565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f903181110000000000000000000000000000000000000000000000000000000014806107bb57506107bb826116b4565b6107e082825f611709565b638b78c6d819543314610f78576382b429005f526004601cfd5b6107e082826001611709565b638b78c6d8195433146107cb57638b78c6d8600c52335f52806020600c2054166107cb576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f5114171661155857637939f4245f526004601cfd5b5f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611661576390b8ec185f526004601cfd5b5f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa92167050000000000000000000000000000000000000000000000000000000014806107bb57506107bb82611760565b638b78c6d8600c52825f526020600c2080548381178361172a575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806107bb57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146107bb565b5f60208284031215611806575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611835575f80fd5b9392505050565b5f6020828403121561184c575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146107cb575f80fd5b5f8060408385031215611885575f80fd5b823561189081611853565b946020939093013593505050565b5f602082840312156118ae575f80fd5b813561183581611853565b5f8083601f8401126118c9575f80fd5b50813567ffffffffffffffff8111156118e0575f80fd5b6020830191508360208260051b85010111156118fa575f80fd5b9250929050565b5f805f8060408587031215611914575f80fd5b843567ffffffffffffffff81111561192a575f80fd5b611936878288016118b9565b909550935050602085013567ffffffffffffffff811115611955575f80fd5b611961878288016118b9565b95989497509550505050565b5f8083601f84011261197d575f80fd5b50813567ffffffffffffffff811115611994575f80fd5b6020830191508360208285010111156118fa575f80fd5b5f80602083850312156119bc575f80fd5b823567ffffffffffffffff8111156119d2575f80fd5b6119de8582860161196d565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f61183560208301846119ea565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611a8557611a85611a48565b9052565b60808101611a978287611a75565b84602083015260ff8416604083015273ffffffffffffffffffffffffffffffffffffffff8316606083015295945050505050565b611ad6828251611a75565b6020810151602083015260ff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301525050565b608081016107bb8284611acb565b5f805f60408486031215611b31575f80fd5b8335611b3c81611853565b9250602084013567ffffffffffffffff811115611b57575f80fd5b611b638682870161196d565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156107bb576107bb611b70565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611bed575f80fd5b81358015158114611835575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160a0810167ffffffffffffffff81118282101715611c4c57611c4c611bfc565b60405290565b6040516080810167ffffffffffffffff81118282101715611c4c57611c4c611bfc565b6040805190810167ffffffffffffffff81118282101715611c4c57611c4c611bfc565b5f81830361010081128015611cab575f80fd5b50611cb4611c29565b8335611cbf81611853565b815260208481013590820152604080850135908201526060808501359082015260807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8083011215611d0e575f80fd5b611d16611c52565b9150608084013560028110611d29575f80fd5b825260a0840135602083015260c084013560ff81168114611d48575f80fd5b604083015260e0840135611d5b81611853565b606083015260808101919091529392505050565b848152602081018490526040810183905260e08101611d916060830184611acb565b95945050505050565b5f82601f830112611da9575f80fd5b813567ffffffffffffffff811115611dc357611dc3611bfc565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff81118282101715611e1057611e10611bfc565b604052818152838201602001851015611e27575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60208284031215611e53575f80fd5b813567ffffffffffffffff811115611e69575f80fd5b820160408185031215611e7a575f80fd5b611e82611c75565b8135611e8d81611853565b8152602082013567ffffffffffffffff811115611ea8575f80fd5b611eb486828501611d9a565b602083015250949350505050565b5f60208284031215611ed2575f80fd5b5051919050565b818103818111156107bb576107bb611b70565b5f805f60608486031215611efe575f80fd5b8335611f0981611853565b95602085013595506040909401359392505050565b602081525f825160038110611f3557611f35611a48565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526112f160a08401826119ea565b5f60208284031215611fa4575f80fd5b813567ffffffffffffffff811115611fba575f80fd5b820160408185031215611fcb575f80fd5b611fd3611c75565b813567ffffffffffffffff811115611fe9575f80fd5b611ff586828501611d9a565b825250602082013567ffffffffffffffff811115611ea8575f80fd5b80820281158282048414176107bb576107bb611b70565b5f8261205b577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea2646970667358221220a054d83b4648d8288f47fd626c174e69093fb97c77e64305e6a84b53711a253064736f6c634300081a0033",l=class l extends I.ERC20VariableIncentive{constructor(){super(...arguments),this.abi=s.d}async getIncentiveCriteria(b){try{return await s.UM(this._config,{...b,address:this.assertValidAddress()})}catch(e){throw new d.IncentiveCriteriaNotFoundError(e)}}async getMaxReward(b){return await s.ZM(this._config,{...b,address:this.assertValidAddress()})}async getIncentiveScalar({chainId:b,hash:e,knownSignatures:r},a){var p;const f=await this.getIncentiveCriteria(a);if(f.criteriaType===u.SignatureType.EVENT){const c=await E.getTransactionReceipt(this._config,{chainId:b,hash:e});if(f.fieldIndex===h.CheatCodes.GAS_REBATE_INCENTIVE)return c.gasUsed*c.effectiveGasPrice+(c.blobGasUsed??0n)*(c.blobGasPrice??0n);const n=c.logs;if(n.length===0)throw new d.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);try{const i=r[f.signature],t=o.parseEventLogs({abi:[i],logs:n});if(t==null||t.length===0)throw new d.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);const y=((p=t[0])==null?void 0:p.args)[f.fieldIndex];if(y===void 0)throw new d.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(y)}catch(i){throw new d.DecodedArgsError(`Failed to decode event log for signature ${f.signature}: ${i.message}`)}}else if(f.criteriaType===u.SignatureType.FUNC){const c=await E.getTransaction(this._config,{chainId:b,hash:e});try{const n=r[f.signature],t=o.decodeFunctionData({abi:[n],data:c.input}).args[f.fieldIndex];if(t==null)throw new d.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(t)}catch(n){throw new d.DecodedArgsError(`Failed to decode function data for signature ${f.signature}: ${n.message}`)}}else throw new d.InvalidCriteriaTypeError(`Invalid criteria type ${f.criteriaType}`)}buildParameters(b,e){const[r,a]=this.validateDeploymentConfig(b,e);return{abi:s.d,bytecode:w,args:[m(r)],...this.optionallyAttachAccount(a.account)}}};l.bases={31337:void 0,...C.ERC20VariableCriteriaIncentive};let g=l;function T(){return{criteriaType:u.SignatureType.EVENT,signature:o.zeroHash,fieldIndex:h.CheatCodes.GAS_REBATE_INCENTIVE,targetContract:o.zeroAddress}}function m({asset:v,reward:b,limit:e,maxReward:r=0n,criteria:a}){return o.encodeAbiParameters([{type:"tuple",name:"initPayloadExtended",components:[{type:"address",name:"asset"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"},{type:"uint256",name:"maxReward"},{type:"tuple",name:"criteria",components:[{type:"uint8",name:"criteriaType"},{type:"bytes32",name:"signature"},{type:"uint8",name:"fieldIndex"},{type:"address",name:"targetContract"}]}]}],[{asset:v,reward:b,limit:e,maxReward:r,criteria:{criteriaType:a.criteriaType,signature:a.signature,fieldIndex:a.fieldIndex,targetContract:a.targetContract}}])}exports.erc20VariableCriteriaIncentiveAbi=s.d;exports.ERC20VariableCriteriaIncentive=g;exports.gasRebateIncentiveCriteria=T;exports.prepareERC20VariableCriteriaIncentivePayload=m;
|
|
2
2
|
//# sourceMappingURL=ERC20VariableCriteriaIncentive.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20VariableCriteriaIncentive.cjs","sources":["../../src/Incentives/ERC20VariableCriteriaIncentive.ts"],"sourcesContent":["import {\n erc20VariableCriteriaIncentiveAbi,\n readErc20VariableCriteriaIncentiveGetIncentiveCriteria,\n readErc20VariableCriteriaIncentiveGetMaxReward,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20VariableCriteriaIncentive.sol/ERC20VariableCriteriaIncentive.json';\nimport { getTransaction, getTransactionReceipt } from '@wagmi/core';\nimport {\n type AbiEvent,\n type AbiFunction,\n type Address,\n type Hex,\n decodeFunctionData,\n encodeAbiParameters,\n parseEventLogs,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20VariableCriteriaIncentive as ERC20VariableCriteriaIncentiveBases } from '../../dist/deployments.json';\nimport { SignatureType } from '../Actions/EventAction';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport {\n DecodedArgsError,\n IncentiveCriteriaNotFoundError,\n InvalidCriteriaTypeError,\n NoMatchingLogsError,\n} from '../errors';\nimport { CheatCodes, type ReadParams } from '../utils';\nimport { ERC20VariableIncentive } from './ERC20VariableIncentive';\n\nexport { erc20VariableCriteriaIncentiveAbi };\n\nexport interface ERC20VariableCriteriaIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The amount of the asset to distribute as reward.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The total spending limit of the asset that will be distributed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The total amount claimable in a single claim or maximum per-action reward.\n *\n * @type {bigint}\n * @optional\n */\n maxReward?: bigint;\n /**\n * The criteria for the incentive that determines how the reward is distributed.\n *\n * @type {IncentiveCriteria}\n */\n criteria: IncentiveCriteria;\n}\n\nexport interface IncentiveCriteria {\n /**\n * The type of criteria used, either function signature or event signature.\n *\n * @type {SignatureType}\n */\n criteriaType: SignatureType;\n /**\n * The function or event signature used for criteria matching.\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * The index of the field from where the scalar value is extracted.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The address of the contract where the event/function is called/emitted.\n *\n * @type {Address}\n */\n targetContract: Address;\n}\n\nexport interface ReadIncentiveCriteriaParams extends ReadParams {}\n\nexport interface GetIncentiveScalarParams {\n chainId: number;\n hash: Hex;\n knownSignatures: Record<Hex, AbiFunction | AbiEvent>;\n}\n\n/**\n * Extended ERC20 Variable Criteria Incentive class that fetches incentive criteria and scalar\n *\n * @export\n * @class ERC20VariableCriteriaIncentive\n * @typedef {ERC20VariableCriteriaIncentive}\n * @extends {ERC20VariableIncentive<ERC20VariableCriteriaIncentivePayload, typeof erc20VariableCriteriaIncentiveAbi>}\n */\nexport class ERC20VariableCriteriaIncentive extends ERC20VariableIncentive<\n ERC20VariableCriteriaIncentivePayload,\n typeof erc20VariableCriteriaIncentiveAbi\n> {\n //@ts-expect-error instantiated correctly\n public override readonly abi = erc20VariableCriteriaIncentiveAbi;\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_VARIABLE_CRITERIA_INCENTIVE_BASE,\n ...(ERC20VariableCriteriaIncentiveBases as Record<number, Address>),\n };\n\n /**\n *Functions from the ERC20VariableIncentive contract\n */\n\n /**\n * Fetches the IncentiveCriteria struct from the contract\n *\n * @param {?ReadParams} [params]\n * @returns {Promise<IncentiveCriteria>} Incentive criteria structure\n * @throws {IncentiveCriteriaNotFoundError}\n */\n public async getIncentiveCriteria(\n params?: ReadParams,\n ): Promise<IncentiveCriteria> {\n try {\n const criteria =\n await readErc20VariableCriteriaIncentiveGetIncentiveCriteria(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return criteria;\n } catch (e) {\n throw new IncentiveCriteriaNotFoundError(e as Error);\n }\n }\n\n /**\n * Fetches the IncentiveCriteria struct from the contract\n *\n * @param {?ReadParams} [params]\n * @returns {Promise<IncentiveCriteria>} Incentive criteria structure\n * @throws {IncentiveCriteriaNotFoundError}\n */\n public async getMaxReward(params?: ReadParams): Promise<bigint> {\n const maxReward = await readErc20VariableCriteriaIncentiveGetMaxReward(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return maxReward;\n }\n\n /**\n * Fetches the incentive scalar from a transaction hash\n *\n * @param {GetIncentiveScalarParams} params\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n * @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}\n */\n public async getIncentiveScalar(\n { chainId, hash, knownSignatures }: GetIncentiveScalarParams,\n params?: ReadParams,\n ): Promise<bigint> {\n const criteria = await this.getIncentiveCriteria(params);\n if (criteria.criteriaType === SignatureType.EVENT) {\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\n if (criteria.fieldIndex === CheatCodes.GAS_REBATE_INCENTIVE) {\n const totalCost =\n transactionReceipt.gasUsed * transactionReceipt.effectiveGasPrice + // Normal gas cost\n (transactionReceipt.blobGasUsed ?? 0n) *\n (transactionReceipt.blobGasPrice ?? 0n); // Blob gas cost - account for potential undefined values\n return totalCost;\n }\n const logs = transactionReceipt.logs;\n\n if (logs.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n\n // Decode the event log\n try {\n // Decode function data\n const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n const decodedEvents = parseEventLogs({\n abi: [eventAbi],\n logs,\n });\n if (decodedEvents == undefined || decodedEvents.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n const scalarValue = (decodedEvents[0]?.args as string[])[\n criteria.fieldIndex\n ];\n\n if (scalarValue === undefined) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode event log for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else if (criteria.criteriaType === SignatureType.FUNC) {\n // Fetch the transaction data\n const transaction = await getTransaction(this._config, {\n chainId,\n hash,\n });\n try {\n // Decode function data\n const func = knownSignatures[criteria.signature] as AbiFunction;\n const decodedFunction = decodeFunctionData({\n abi: [func],\n data: transaction.input,\n });\n const scalarValue = decodedFunction.args[criteria.fieldIndex] as string;\n if (scalarValue === undefined || scalarValue === null) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode function data for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else {\n throw new InvalidCriteriaTypeError(\n `Invalid criteria type ${criteria.criteriaType}`,\n );\n }\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20VariableCriteriaIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20VariableCriteriaIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20VariableCriteriaIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20VariableCriteriaIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Creates an IncentiveCriteria object representing a gas rebate incentive.\n * This object defines a variable incentive criteria where the criteria will be the gas spent.\n *\n * The criteria uses a signatureType of EVENT, with a special `fieldIndex` of 255 (using CheatCodes enum), which indicates\n * that the entire gas cost of the transaction will be used as the scalar value. If you don't want to\n * rebate the entire gas cost, you can use a reward value on the incentive..\n *\n * - `criteriaType`: EVENT, indicating it's based on event logs.\n * - `signature`: A zeroed signature (0x0000...0000), matching any event.\n * - `fieldIndex`: 255, indicating the use of transaction gas cost using CheatCodes enum.\n * - `targetContract`: A zeroed address (0x0000...0000), applicable to any contract.\n *\n * @returns {IncentiveCriteria} Returns an IncentiveCriteria object for a gas rebate.\n *\n * @example\n * const incentive = gasRebateIncentiveCriteria();\n * const actionPayload = {\n * criteria: incentive,\n * asset: \"0xAssetAddress\",\n * reward: 0, // Set to zero to rebate the entire gas cost\n * limit: BigInt(1000) // This is the total spend limit for the incentive\n * };\n * deployIncentive(actionPayload);\n */\nexport function gasRebateIncentiveCriteria(): IncentiveCriteria {\n return {\n criteriaType: SignatureType.EVENT,\n signature: zeroHash,\n fieldIndex: CheatCodes.GAS_REBATE_INCENTIVE,\n targetContract: zeroAddress,\n };\n}\n\n/**\n *\n *\n * @param {InitPayloadExtended} param0\n * @param {Address} param0.asset - The address of the ERC20 asset to incentivize.\n * @param {bigint} param0.reward - The reward amount to distribute per action.\n * @param {bigint} param0.limit - The total limit of the asset distribution.\n * @param {bigint} param0.maxReward - The maximum value claimable from a single completion.\n * @param {IncentiveCriteria} param0.criteria - The incentive criteria for reward distribution.\n * @returns {Hex}\n */\nexport function prepareERC20VariableCriteriaIncentivePayload({\n asset,\n reward,\n limit,\n maxReward = 0n,\n criteria,\n}: ERC20VariableCriteriaIncentivePayload) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayloadExtended',\n components: [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'uint256', name: 'maxReward' },\n {\n type: 'tuple',\n name: 'criteria',\n components: [\n { type: 'uint8', name: 'criteriaType' },\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'address', name: 'targetContract' },\n ],\n },\n ],\n },\n ],\n [\n {\n asset: asset,\n reward: reward,\n limit: limit,\n maxReward: maxReward,\n criteria: {\n criteriaType: criteria.criteriaType,\n signature: criteria.signature,\n fieldIndex: criteria.fieldIndex,\n targetContract: criteria.targetContract,\n },\n },\n ],\n );\n}\n"],"names":["_ERC20VariableCriteriaIncentive","ERC20VariableIncentive","erc20VariableCriteriaIncentiveAbi","params","readErc20VariableCriteriaIncentiveGetIncentiveCriteria","IncentiveCriteriaNotFoundError","readErc20VariableCriteriaIncentiveGetMaxReward","chainId","hash","knownSignatures","criteria","SignatureType","transactionReceipt","getTransactionReceipt","CheatCodes","logs","NoMatchingLogsError","eventAbi","decodedEvents","parseEventLogs","scalarValue","_a","DecodedArgsError","e","transaction","getTransaction","func","decodeFunctionData","InvalidCriteriaTypeError","_payload","_options","payload","options","bytecode","prepareERC20VariableCriteriaIncentivePayload","ERC20VariableCriteriaIncentiveBases","ERC20VariableCriteriaIncentive","gasR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B,EAAA,SACX,WAAYxB,EAAW,WAAA,qBACvB,eAAgByB,EAAA,WAAA,CAEpB,CAaO,SAASL,EAA6C,CAC3D,MAAAM,EACA,OAAAC,EACA,MAAAC,EACA,UAAAC,EAAY,GACZ,SAAAjC,CACF,EAA0C,CACjC,OAAAkC,EAAA,oBACL,CACE,CACE,KAAM,QACN,KAAM,sBACN,WAAY,CACV,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,WAAY,EACrC,CACE,KAAM,QACN,KAAM,WACN,WAAY,CACV,CAAE,KAAM,QAAS,KAAM,cAAe,EACtC,CAAE,KAAM,UAAW,KAAM,WAAY,EACrC,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,UAAW,KAAM,gBAAiB,CAC5C,CACF,CACF,CACF,CACF,EACA,CACE,CACE,MAAAJ,EACA,OAAAC,EACA,MAAAC,EACA,UAAAC,EACA,SAAU,CACR,aAAcjC,EAAS,aACvB,UAAWA,EAAS,UACpB,WAAYA,EAAS,WACrB,eAAgBA,EAAS,cAC3B,CACF,CACF,CAAA,CAEJ"}
|
|
1
|
+
{"version":3,"file":"ERC20VariableCriteriaIncentive.cjs","sources":["../../src/Incentives/ERC20VariableCriteriaIncentive.ts"],"sourcesContent":["import {\n erc20VariableCriteriaIncentiveAbi,\n readErc20VariableCriteriaIncentiveGetIncentiveCriteria,\n readErc20VariableCriteriaIncentiveGetMaxReward,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20VariableCriteriaIncentive.sol/ERC20VariableCriteriaIncentive.json';\nimport { getTransaction, getTransactionReceipt } from '@wagmi/core';\nimport {\n type AbiEvent,\n type AbiFunction,\n type Address,\n type Hex,\n decodeFunctionData,\n encodeAbiParameters,\n parseEventLogs,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20VariableCriteriaIncentive as ERC20VariableCriteriaIncentiveBases } from '../../dist/deployments.json';\nimport { SignatureType } from '../Actions/EventAction';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport {\n DecodedArgsError,\n IncentiveCriteriaNotFoundError,\n InvalidCriteriaTypeError,\n NoMatchingLogsError,\n} from '../errors';\nimport { CheatCodes, type ReadParams } from '../utils';\nimport { ERC20VariableIncentive } from './ERC20VariableIncentive';\n\nexport { erc20VariableCriteriaIncentiveAbi };\n\nexport interface ERC20VariableCriteriaIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The amount of the asset to distribute as reward.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The total spending limit of the asset that will be distributed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The total amount claimable in a single claim or maximum per-action reward.\n *\n * @type {bigint}\n * @optional\n */\n maxReward?: bigint;\n /**\n * The criteria for the incentive that determines how the reward is distributed.\n *\n * @type {IncentiveCriteria}\n */\n criteria: IncentiveCriteria;\n}\n\nexport interface IncentiveCriteria {\n /**\n * The type of criteria used, either function signature or event signature.\n *\n * @type {SignatureType}\n */\n criteriaType: SignatureType;\n /**\n * The function or event signature used for criteria matching.\n *\n * @type {Hex}\n */\n signature: Hex;\n /**\n * The index of the field from where the scalar value is extracted.\n *\n * @type {number}\n */\n fieldIndex: number;\n /**\n * The address of the contract where the event/function is called/emitted.\n *\n * @type {Address}\n */\n targetContract: Address;\n}\n\nexport interface ReadIncentiveCriteriaParams extends ReadParams {}\n\nexport interface GetIncentiveScalarParams {\n chainId: number;\n hash: Hex;\n knownSignatures: Record<Hex, AbiFunction | AbiEvent>;\n}\n\n/**\n * Extended ERC20 Variable Criteria Incentive class that fetches incentive criteria and scalar\n *\n * @export\n * @class ERC20VariableCriteriaIncentive\n * @typedef {ERC20VariableCriteriaIncentive}\n * @extends {ERC20VariableIncentive<ERC20VariableCriteriaIncentivePayload, typeof erc20VariableCriteriaIncentiveAbi>}\n */\nexport class ERC20VariableCriteriaIncentive extends ERC20VariableIncentive<\n ERC20VariableCriteriaIncentivePayload,\n typeof erc20VariableCriteriaIncentiveAbi\n> {\n //@ts-expect-error instantiated correctly\n public override readonly abi = erc20VariableCriteriaIncentiveAbi;\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_VARIABLE_CRITERIA_INCENTIVE_BASE,\n ...(ERC20VariableCriteriaIncentiveBases as Record<number, Address>),\n };\n\n /**\n *Functions from the ERC20VariableIncentive contract\n */\n\n /**\n * Fetches the IncentiveCriteria struct from the contract\n *\n * @param {?ReadParams} [params]\n * @returns {Promise<IncentiveCriteria>} Incentive criteria structure\n * @throws {IncentiveCriteriaNotFoundError}\n */\n public async getIncentiveCriteria(\n params?: ReadParams,\n ): Promise<IncentiveCriteria> {\n try {\n const criteria =\n await readErc20VariableCriteriaIncentiveGetIncentiveCriteria(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return criteria;\n } catch (e) {\n throw new IncentiveCriteriaNotFoundError(e as Error);\n }\n }\n\n /**\n * Fetches the IncentiveCriteria struct from the contract\n *\n * @param {?ReadParams} [params]\n * @returns {Promise<IncentiveCriteria>} Incentive criteria structure\n * @throws {IncentiveCriteriaNotFoundError}\n */\n public async getMaxReward(params?: ReadParams): Promise<bigint> {\n const maxReward = await readErc20VariableCriteriaIncentiveGetMaxReward(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return maxReward;\n }\n\n /**\n * Fetches the incentive scalar from a transaction hash\n *\n * @param {GetIncentiveScalarParams} params\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n * @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}\n */\n public async getIncentiveScalar(\n { chainId, hash, knownSignatures }: GetIncentiveScalarParams,\n params?: ReadParams,\n ): Promise<bigint> {\n const criteria = await this.getIncentiveCriteria(params);\n if (criteria.criteriaType === SignatureType.EVENT) {\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\n if (criteria.fieldIndex === CheatCodes.GAS_REBATE_INCENTIVE) {\n const totalCost =\n transactionReceipt.gasUsed * transactionReceipt.effectiveGasPrice + // Normal gas cost\n (transactionReceipt.blobGasUsed ?? 0n) *\n (transactionReceipt.blobGasPrice ?? 0n); // Blob gas cost - account for potential undefined values\n return totalCost;\n }\n const logs = transactionReceipt.logs;\n\n if (logs.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n\n // Decode the event log\n try {\n // Decode function data\n const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n const decodedEvents = parseEventLogs({\n abi: [eventAbi],\n logs,\n });\n if (decodedEvents == undefined || decodedEvents.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n const scalarValue = (decodedEvents[0]?.args as string[])[\n criteria.fieldIndex\n ];\n\n if (scalarValue === undefined) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode event log for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else if (criteria.criteriaType === SignatureType.FUNC) {\n // Fetch the transaction data\n const transaction = await getTransaction(this._config, {\n chainId,\n hash,\n });\n try {\n // Decode function data\n const func = knownSignatures[criteria.signature] as AbiFunction;\n const decodedFunction = decodeFunctionData({\n abi: [func],\n data: transaction.input,\n });\n const scalarValue = decodedFunction.args[criteria.fieldIndex] as string;\n if (scalarValue === undefined || scalarValue === null) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode function data for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else {\n throw new InvalidCriteriaTypeError(\n `Invalid criteria type ${criteria.criteriaType}`,\n );\n }\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20VariableCriteriaIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20VariableCriteriaIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20VariableCriteriaIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20VariableCriteriaIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Creates an IncentiveCriteria object representing a gas rebate incentive.\n * This object defines a variable incentive criteria where the criteria will be the gas spent.\n *\n * The criteria uses a signatureType of EVENT, with a special `fieldIndex` of 255 (using CheatCodes enum), which indicates\n * that the entire gas cost of the transaction will be used as the scalar value. If you don't want to\n * rebate the entire gas cost, you can use a reward value on the incentive..\n *\n * - `criteriaType`: EVENT, indicating it's based on event logs.\n * - `signature`: A zeroed signature (0x0000...0000), matching any event.\n * - `fieldIndex`: 255, indicating the use of transaction gas cost using CheatCodes enum.\n * - `targetContract`: A zeroed address (0x0000...0000), applicable to any contract.\n *\n * @returns {IncentiveCriteria} Returns an IncentiveCriteria object for a gas rebate.\n *\n * @example\n * const incentive = gasRebateIncentiveCriteria();\n * const actionPayload = {\n * criteria: incentive,\n * asset: \"0xAssetAddress\",\n * reward: 0, // Set to zero to rebate the entire gas cost\n * limit: BigInt(1000) // This is the total spend limit for the incentive\n * };\n * deployIncentive(actionPayload);\n */\nexport function gasRebateIncentiveCriteria(): IncentiveCriteria {\n return {\n criteriaType: SignatureType.EVENT,\n signature: zeroHash,\n fieldIndex: CheatCodes.GAS_REBATE_INCENTIVE,\n targetContract: zeroAddress,\n };\n}\n\n/**\n *\n *\n * @param {InitPayloadExtended} param0\n * @param {Address} param0.asset - The address of the ERC20 asset to incentivize.\n * @param {bigint} param0.reward - The reward amount to distribute per action.\n * @param {bigint} param0.limit - The total limit of the asset distribution.\n * @param {bigint} param0.maxReward - The maximum value claimable from a single completion.\n * @param {IncentiveCriteria} param0.criteria - The incentive criteria for reward distribution.\n * @returns {Hex}\n */\nexport function prepareERC20VariableCriteriaIncentivePayload({\n asset,\n reward,\n limit,\n maxReward = 0n,\n criteria,\n}: ERC20VariableCriteriaIncentivePayload) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayloadExtended',\n components: [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'uint256', name: 'maxReward' },\n {\n type: 'tuple',\n name: 'criteria',\n components: [\n { type: 'uint8', name: 'criteriaType' },\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'address', name: 'targetContract' },\n ],\n },\n ],\n },\n ],\n [\n {\n asset: asset,\n reward: reward,\n limit: limit,\n maxReward: maxReward,\n criteria: {\n criteriaType: criteria.criteriaType,\n signature: criteria.signature,\n fieldIndex: criteria.fieldIndex,\n targetContract: criteria.targetContract,\n },\n },\n ],\n );\n}\n"],"names":["_ERC20VariableCriteriaIncentive","ERC20VariableIncentive","erc20VariableCriteriaIncentiveAbi","params","readErc20VariableCriteriaIncentiveGetIncentiveCriteria","IncentiveCriteriaNotFoundError","readErc20VariableCriteriaIncentiveGetMaxReward","chainId","hash","knownSignatures","criteria","SignatureType","transactionReceipt","getTransactionReceipt","CheatCodes","logs","NoMatchingLogsError","eventAbi","decodedEvents","parseEventLogs","scalarValue","_a","DecodedArgsError","e","transaction","getTransaction","func","decodeFunctionData","InvalidCriteriaTypeError","_payload","_options","payload","options","bytecode","prepareERC20VariableCriteriaIncentivePayload","ERC20VariableCriteriaIncentiveBases","ERC20VariableCriteriaIncentive","gasRebateIncentiveCriteria","zeroHash","zeroAddress","asset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,qBACvB,eAAgByB,EAAA,WAAA,CAEpB,CAaO,SAASL,EAA6C,CAC3D,MAAAM,EACA,OAAAC,EACA,MAAAC,EACA,UAAAC,EAAY,GACZ,SAAAjC,CACF,EAA0C,CACjC,OAAAkC,EAAA,oBACL,CACE,CACE,KAAM,QACN,KAAM,sBACN,WAAY,CACV,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,WAAY,EACrC,CACE,KAAM,QACN,KAAM,WACN,WAAY,CACV,CAAE,KAAM,QAAS,KAAM,cAAe,EACtC,CAAE,KAAM,UAAW,KAAM,WAAY,EACrC,CAAE,KAAM,QAAS,KAAM,YAAa,EACpC,CAAE,KAAM,UAAW,KAAM,gBAAiB,CAC5C,CACF,CACF,CACF,CACF,EACA,CACE,CACE,MAAAJ,EACA,OAAAC,EACA,MAAAC,EACA,UAAAC,EACA,SAAU,CACR,aAAcjC,EAAS,aACvB,UAAWA,EAAS,UACpB,WAAYA,EAAS,WACrB,eAAgBA,EAAS,cAC3B,CACF,CACF,CAAA,CAEJ"}
|
|
@@ -290,6 +290,21 @@ export declare class ERC20VariableCriteriaIncentive extends ERC20VariableIncenti
|
|
|
290
290
|
readonly indexed: true;
|
|
291
291
|
}];
|
|
292
292
|
readonly name: "RolesUpdated";
|
|
293
|
+
}, {
|
|
294
|
+
readonly type: "event";
|
|
295
|
+
readonly anonymous: false;
|
|
296
|
+
readonly inputs: readonly [{
|
|
297
|
+
readonly name: "sender";
|
|
298
|
+
readonly internalType: "address";
|
|
299
|
+
readonly type: "address";
|
|
300
|
+
readonly indexed: false;
|
|
301
|
+
}, {
|
|
302
|
+
readonly name: "amount";
|
|
303
|
+
readonly internalType: "uint256";
|
|
304
|
+
readonly type: "uint256";
|
|
305
|
+
readonly indexed: false;
|
|
306
|
+
}];
|
|
307
|
+
readonly name: "ToppedUp";
|
|
293
308
|
}, {
|
|
294
309
|
readonly type: "function";
|
|
295
310
|
readonly inputs: readonly [];
|
|
@@ -741,6 +756,16 @@ export declare class ERC20VariableCriteriaIncentive extends ERC20VariableIncenti
|
|
|
741
756
|
readonly type: "bool";
|
|
742
757
|
}];
|
|
743
758
|
readonly stateMutability: "view";
|
|
759
|
+
}, {
|
|
760
|
+
readonly type: "function";
|
|
761
|
+
readonly inputs: readonly [{
|
|
762
|
+
readonly name: "amount";
|
|
763
|
+
readonly internalType: "uint256";
|
|
764
|
+
readonly type: "uint256";
|
|
765
|
+
}];
|
|
766
|
+
readonly name: "topup";
|
|
767
|
+
readonly outputs: readonly [];
|
|
768
|
+
readonly stateMutability: "nonpayable";
|
|
744
769
|
}, {
|
|
745
770
|
readonly type: "function";
|
|
746
771
|
readonly inputs: readonly [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20VariableCriteriaIncentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC20VariableCriteriaIncentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EAGlC,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,GAAG,EAMT,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,iCAAiC,EAAE,CAAC;AAE7C,MAAM,WAAW,qCAAqC;IACpD;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,YAAY,EAAE,aAAa,CAAC;IAC5B;;;;OAIG;IACH,SAAS,EAAE,GAAG,CAAC;IACf;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,2BAA4B,SAAQ,UAAU;CAAG;AAElE,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,GAAG,CAAC;IACV,eAAe,EAAE,MAAM,CAAC,GAAG,EAAE,WAAW,GAAG,QAAQ,CAAC,CAAC;CACtD;AAED;;;;;;;GAOG;AACH,qBAAa,8BAA+B,SAAQ,sBAAsB,CACxE,qCAAqC,EACrC,OAAO,iCAAiC,CACzC;IAEC,SAAyB,GAAG
|
|
1
|
+
{"version":3,"file":"ERC20VariableCriteriaIncentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC20VariableCriteriaIncentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EAGlC,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,GAAG,EAMT,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,iCAAiC,EAAE,CAAC;AAE7C,MAAM,WAAW,qCAAqC;IACpD;;;;OAIG;IACH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