@boostxyz/sdk 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/Actions/Action.cjs +1 -1
  2. package/dist/Actions/Action.js +4 -4
  3. package/dist/Actions/EventAction.cjs +1 -1
  4. package/dist/Actions/EventAction.js +17 -17
  5. package/dist/Actions/EventAction.js.map +1 -1
  6. package/dist/AllowLists/AllowList.cjs +1 -1
  7. package/dist/AllowLists/AllowList.js +5 -5
  8. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  9. package/dist/AllowLists/SimpleAllowList.js +19 -19
  10. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  11. package/dist/AllowLists/SimpleDenyList.js +3 -3
  12. package/dist/Auth/PassthroughAuth.cjs +1 -1
  13. package/dist/Auth/PassthroughAuth.js +1 -1
  14. package/dist/BoostCore.cjs +2 -2
  15. package/dist/BoostCore.cjs.map +1 -1
  16. package/dist/BoostCore.d.ts +14 -0
  17. package/dist/BoostCore.d.ts.map +1 -1
  18. package/dist/BoostCore.js +100 -81
  19. package/dist/BoostCore.js.map +1 -1
  20. package/dist/BoostRegistry.cjs +1 -1
  21. package/dist/BoostRegistry.js +31 -31
  22. package/dist/Budget-B0kJsZtZ.cjs +2 -0
  23. package/dist/Budget-B0kJsZtZ.cjs.map +1 -0
  24. package/dist/Budget-NtzY9H7G.js +462 -0
  25. package/dist/Budget-NtzY9H7G.js.map +1 -0
  26. package/dist/Budgets/Budget.cjs +1 -1
  27. package/dist/Budgets/Budget.cjs.map +1 -1
  28. package/dist/Budgets/Budget.d.ts +5 -4
  29. package/dist/Budgets/Budget.d.ts.map +1 -1
  30. package/dist/Budgets/Budget.js +9 -26
  31. package/dist/Budgets/Budget.js.map +1 -1
  32. package/dist/Budgets/ManagedBudget.cjs +1 -1
  33. package/dist/Budgets/ManagedBudget.js +34 -34
  34. package/dist/Budgets/ManagedBudgetWithFees.d.ts +1203 -0
  35. package/dist/Budgets/ManagedBudgetWithFees.d.ts.map +1 -0
  36. package/dist/Deployable/DeployableTarget.cjs +1 -1
  37. package/dist/Deployable/DeployableTarget.js +1 -1
  38. package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
  39. package/dist/Deployable/DeployableTargetWithRBAC.js +23 -23
  40. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  41. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  42. package/dist/Incentives/AllowListIncentive.js +16 -16
  43. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  44. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  45. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  46. package/dist/Incentives/CGDAIncentive.js +28 -28
  47. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  48. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  49. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  50. package/dist/Incentives/ERC20Incentive.js +25 -25
  51. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  52. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
  53. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
  54. package/dist/Incentives/ERC20VariableCriteriaIncentive.js +29 -29
  55. package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
  56. package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
  57. package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
  58. package/dist/Incentives/ERC20VariableIncentive.js +6 -6
  59. package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
  60. package/dist/Incentives/Incentive.cjs +1 -1
  61. package/dist/Incentives/Incentive.js +4 -4
  62. package/dist/Incentives/PointsIncentive.cjs +1 -1
  63. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  64. package/dist/Incentives/PointsIncentive.js +12 -12
  65. package/dist/Incentives/PointsIncentive.js.map +1 -1
  66. package/dist/{SimpleDenyList-wDvsNIuY.cjs → SimpleDenyList-B65fnca2.cjs} +2 -2
  67. package/dist/{SimpleDenyList-wDvsNIuY.cjs.map → SimpleDenyList-B65fnca2.cjs.map} +1 -1
  68. package/dist/{SimpleDenyList-D-rGBaay.js → SimpleDenyList-UvXQl2vm.js} +20 -20
  69. package/dist/{SimpleDenyList-D-rGBaay.js.map → SimpleDenyList-UvXQl2vm.js.map} +1 -1
  70. package/dist/Validators/LimitedSignerValidator.cjs +1 -1
  71. package/dist/Validators/LimitedSignerValidator.js +9 -9
  72. package/dist/Validators/SignerValidator.cjs +1 -1
  73. package/dist/Validators/SignerValidator.js +8 -8
  74. package/dist/Validators/Validator.cjs +1 -1
  75. package/dist/Validators/Validator.cjs.map +1 -1
  76. package/dist/Validators/Validator.js +20 -20
  77. package/dist/componentInterfaces-Bt-4sNB5.cjs +2 -0
  78. package/dist/componentInterfaces-Bt-4sNB5.cjs.map +1 -0
  79. package/dist/componentInterfaces-dakxtQHf.js +16 -0
  80. package/dist/componentInterfaces-dakxtQHf.js.map +1 -0
  81. package/dist/deployments-DxkwtCyu.cjs +2 -0
  82. package/dist/deployments-DxkwtCyu.cjs.map +1 -0
  83. package/dist/{deployments-BdPDIh-i.js → deployments-ZLVwJGZD.js} +33 -30
  84. package/dist/deployments-ZLVwJGZD.js.map +1 -0
  85. package/dist/deployments.json +17 -14
  86. package/dist/{generated-CDEDSOGZ.js → generated-B0XfMfoq.js} +1037 -470
  87. package/dist/generated-B0XfMfoq.js.map +1 -0
  88. package/dist/generated-pNKCp_Ez.cjs +3 -0
  89. package/dist/generated-pNKCp_Ez.cjs.map +1 -0
  90. package/dist/index.cjs +1 -1
  91. package/dist/index.d.ts +1 -0
  92. package/dist/index.d.ts.map +1 -1
  93. package/dist/index.js +148 -145
  94. package/package.json +1 -1
  95. package/src/BoostCore.ts +30 -0
  96. package/src/Budgets/Budget.ts +8 -3
  97. package/src/Budgets/ManagedBudgetWithFees.test.ts +286 -0
  98. package/src/Budgets/ManagedBudgetWithFees.ts +671 -0
  99. package/src/index.ts +1 -0
  100. package/dist/componentInterfaces-BQw7DH-m.cjs +0 -2
  101. package/dist/componentInterfaces-BQw7DH-m.cjs.map +0 -1
  102. package/dist/componentInterfaces-C0vuWQlh.js +0 -15
  103. package/dist/componentInterfaces-C0vuWQlh.js.map +0 -1
  104. package/dist/deployments--f75Pthq.cjs +0 -2
  105. package/dist/deployments--f75Pthq.cjs.map +0 -1
  106. package/dist/deployments-BdPDIh-i.js.map +0 -1
  107. package/dist/generated-CDEDSOGZ.js.map +0 -1
  108. package/dist/generated-D3DE5TfH.cjs +0 -3
  109. package/dist/generated-D3DE5TfH.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: [prepareClaimPayload(payload)],\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":";;;;;;o4tBAiHaA,IAAN,MAAMA,UAAuBC,EAGlC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA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,"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: [prepareClaimPayload(payload)],\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":";;;;;;wttBAiHaA,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,EAAgC,KAAK,SAAS;AAAA,MACzD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIF;AAAA,IAAA,CACL;AAAA,EACH;A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,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,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../generated-D3DE5TfH.cjs"),E=require("@wagmi/core"),o=require("viem"),C=require("../deployments--f75Pthq.cjs"),u=require("../Actions/EventAction.cjs"),a=require("../errors.cjs"),h=require("../utils.cjs"),I=require("./ERC20VariableIncentive.cjs"),w="0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015610062575f80fd5b5061007161007660201b60201c565b61010b565b5f6100856100e260201b60201c565b90508054600181161561009f5763f92ee8a95f526004601cfd5b8160c01c808260011c146100dd578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612ca2806101185f395ff3fe608060405260043610610219575f3560e01c8063715018a611610122578063c884ef83116100aa578063ec87621c1161006e578063ec87621c14610771578063f04e283e1461079b578063f2fde38b146107b7578063fe9fbb80146107d3578063fee81cf41461080f57610219565b8063c884ef831461067d578063d54ad2a1146106b9578063db09da12146106e3578063dcc213611461071f578063dcc59b6f1461074757610219565b8063a4d66daf116100f1578063a4d66daf1461059b578063a871ced2146105c5578063bb1757cf146105ef578063be4994f81461062b578063c213f3f91461065357610219565b8063715018a61461051057806375b238fc1461051a57806377548687146105445780638da5cb5b1461057157610219565b806338d52e0f116101a55780634a4ee7b1116101745780634a4ee7b1146104485780634e7165a214610464578063514e62fc146104a057806354d1f13d146104dc57806366a78e6c146104e657610219565b806338d52e0f146103915780634359d28a146103bb578063439fab91146103e3578063474f5a441461040b57610219565b80631cd64df4116101ec5780631cd64df4146102bb578063228cb733146102f7578063256929621461032157806328d6183b1461032b5780632de948071461035557610219565b806301ffc9a71461021d57806307621eca14610259578063183a4f6e146102835780631c10893f1461029f575b5f80fd5b348015610228575f80fd5b50610243600480360381019061023e9190611c38565b61084b565b6040516102509190611c7d565b60405180910390f35b348015610264575f80fd5b5061026d6108c4565b60405161027a9190611cae565b60405180910390f35b61029d60048036038101906102989190611cf1565b6108cd565b005b6102b960048036038101906102b49190611d76565b6108da565b005b3480156102c6575f80fd5b506102e160048036038101906102dc9190611d76565b6108f0565b6040516102ee9190611c7d565b60405180910390f35b348015610302575f80fd5b5061030b610906565b6040516103189190611cae565b60405180910390f35b61032961090c565b005b348015610336575f80fd5b5061033f61095d565b60405161034c9190611dc3565b60405180910390f35b348015610360575f80fd5b5061037b60048036038101906103769190611ddc565b610984565b6040516103889190611cae565b60405180910390f35b34801561039c575f80fd5b506103a561099d565b6040516103b29190611e16565b60405180910390f35b3480156103c6575f80fd5b506103e160048036038101906103dc9190611ee5565b6109c0565b005b3480156103ee575f80fd5b5061040960048036038101906104049190611fb8565b610ace565b005b348015610416575f80fd5b50610431600480360381019061042c9190611fb8565b610d48565b60405161043f929190612003565b60405180910390f35b610462600480360381019061045d9190611d76565b610eac565b005b34801561046f575f80fd5b5061048a60048036038101906104859190611fb8565b610ec2565b604051610497919061209a565b60405180910390f35b3480156104ab575f80fd5b506104c660048036038101906104c19190611d76565b610f90565b6040516104d39190611c7d565b60405180910390f35b6104e4610fa7565b005b3480156104f1575f80fd5b506104fa610fe0565b6040516105079190611cae565b60405180910390f35b610518610fe6565b005b348015610525575f80fd5b5061052e610ff9565b60405161053b9190611cae565b60405180910390f35b34801561054f575f80fd5b50610558610ffe565b6040516105689493929190612160565b60405180910390f35b34801561057c575f80fd5b50610585611053565b6040516105929190611e16565b60405180910390f35b3480156105a6575f80fd5b506105af61107b565b6040516105bc9190611cae565b60405180910390f35b3480156105d0575f80fd5b506105d9611081565b6040516105e69190612232565b60405180910390f35b3480156105fa575f80fd5b506106156004803603810190610610919061224b565b611150565b6040516106229190611c7d565b60405180910390f35b348015610636575f80fd5b50610651600480360381019061064c91906122fd565b61137a565b005b34801561065e575f80fd5b50610667611430565b6040516106749190611cae565b60405180910390f35b348015610688575f80fd5b506106a3600480360381019061069e9190611ddc565b611439565b6040516106b09190611c7d565b60405180910390f35b3480156106c4575f80fd5b506106cd611456565b6040516106da9190611cae565b60405180910390f35b3480156106ee575f80fd5b506107096004803603810190610704919061224b565b61145c565b6040516107169190611c7d565b60405180910390f35b34801561072a575f80fd5b50610745600480360381019061074091906122fd565b61146f565b005b348015610752575f80fd5b5061075b611525565b6040516107689190611cae565b60405180910390f35b34801561077c575f80fd5b5061078561152b565b6040516107929190611cae565b60405180910390f35b6107b560048036038101906107b09190611ddc565b611530565b005b6107d160048036038101906107cc9190611ddc565b61156e565b005b3480156107de575f80fd5b506107f960048036038101906107f49190611ddc565b611597565b6040516108069190611c7d565b60405180910390f35b34801561081a575f80fd5b5061083560048036038101906108309190611ddc565b6115ea565b6040516108429190611cae565b60405180910390f35b5f7f52b8e45c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108bd57506108bc82611603565b5b9050919050565b5f600254905090565b6108d7338261167c565b50565b6108e261168b565b6108ec82826116c2565b5050565b5f81826108fc85610984565b1614905092915050565b60025481565b5f6109156116d2565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f52b8e45c00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026109cb816116dc565b828290508585905014610a0a576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610ac6575f848483818110610a2b57610a2a61237b565b5b9050602002016020810190610a4091906123d2565b90506001151581151503610a8557610a80878784818110610a6457610a6361237b565b5b9050602002016020810190610a799190611ddc565b60016116c2565b610ab8565b610ab7878784818110610a9b57610a9a61237b565b5b9050602002016020810190610ab09190611ddc565b600161167c565b5b508080600101915050610a0c565b505050505050565b5f610ad7611711565b90508054600382558015610b095760018160011c14303b10610b005763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610b1a91906125f3565b90505f815f015190505f826020015190505f836040015190505f846060015190505f856080015190505f8303610b7c576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ba6308773ffffffffffffffffffffffffffffffffffffffff1661173a90919063ffffffff16565b905083811015610bf457865f015181856040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610beb9392919061261f565b60405180910390fd5b855f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508460028190555083600481905550826006819055505f6005819055508160075f820151815f015f6101000a81548160ff02191690836001811115610c7a57610c796120ba565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050610cfc3361176d565b610d07336001611843565b505050505050508015610d43576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610d5581611884565b5f8585810190610d65919061276d565b90505f8160200151806020019051810190610d8091906127c8565b90508060045f828254610d939190612820565b92505081905550610de7825f0151825f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118ab9092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610e59939291906128b8565b604051602081830303815290604052604051610e75919061209a565b60405180910390a2805f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610eb461168b565b610ebe828261167c565b5050565b60605f808484810190610ed5919061292f565b9250509150604051806080016040528060016002811115610ef957610ef86120ba565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610f5591906129a8565b604051602081830303815290604052815250604051602001610f779190612aaf565b6040516020818303038152906040529250505092915050565b5f8082610f9c85610984565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b60065481565b610fee61168b565b610ff75f6118f4565b565b600281565b6007805f015f9054906101000a900460ff1690806001015490806002015f9054906101000a900460ff16908060020160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60045481565b611089611b80565b60076040518060800160405290815f82015f9054906101000a900460ff1660018111156110b9576110b86120ba565b5b60018111156110cb576110ca6120ba565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f61115961168b565b5f83838101906111699190612b54565b90505f816020015180602001905181019061118491906127c8565b90505f611190876119ba565b6111c6576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600254036111d7578190506111fb565b670de0b6b3a7640000826002546111ee9190612b9b565b6111f89190612c09565b90505b5f6006541415801561120e575060065481115b156112195760065490505b6004548160055461122a9190612c39565b1115611262576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546112739190612c39565b925050819055506001805f82825461128b9190612c39565b925050819055506112dc87825f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118ab9092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff168984604051602001611348939291906128b8565b604051602081830303815290604052604051611364919061209a565b60405180910390a2600193505050509392505050565b6002611385816116dc565b8282905085859050146113c4576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156114285761141b8686838181106113e7576113e661237b565b5b90506020020160208101906113fc9190611ddc565b85858481811061140f5761140e61237b565b5b905060200201356116c2565b80806001019150506113c6565b505050505050565b5f600654905090565b6003602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f611466846119ba565b90509392505050565b600261147a816116dc565b8282905085859050146114b9576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561151d576115108686838181106114dc576114db61237b565b5b90506020020160208101906114f19190611ddc565b8585848181106115045761150361237b565b5b9050602002013561167c565b80806001019150506114bb565b505050505050565b60015481565b600181565b61153861168b565b63389a75e1600c52805f526020600c20805442111561155e57636f5e88185f526004601cfd5b5f81555061156b816118f4565b50565b61157661168b565b8060601b61158b57637448fbae5f526004601cfd5b611594816118f4565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166115b7611053565b73ffffffffffffffffffffffffffffffffffffffff1614806115e357506115e2826002600117610f90565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f90318111000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806116755750611674826119c9565b5b9050919050565b61168782825f611a42565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146116c0576382b429005f526004601cfd5b565b6116ce82826001611a42565b5050565b5f6202a300905090565b638b78c6d81954331461170e57638b78c6d8600c52335f52806020600c20541661170d576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b611775611a9a565b156117ed577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156117af57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611840565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d8600c52335f52806020600c2054166118a8576382b429005f526004601cfd5b50565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166118eb576390b8ec185f526004601cfd5b5f603452505050565b6118fc611a9a565b15611961577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506119b7565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600454600554109050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611a3b5750611a3a82611a9e565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611a6457848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611b105750611b0f82611b17565b5b9050919050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60405180608001604052805f6001811115611b9e57611b9d6120ba565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c1781611be3565b8114611c21575f80fd5b50565b5f81359050611c3281611c0e565b92915050565b5f60208284031215611c4d57611c4c611bdb565b5b5f611c5a84828501611c24565b91505092915050565b5f8115159050919050565b611c7781611c63565b82525050565b5f602082019050611c905f830184611c6e565b92915050565b5f819050919050565b611ca881611c96565b82525050565b5f602082019050611cc15f830184611c9f565b92915050565b611cd081611c96565b8114611cda575f80fd5b50565b5f81359050611ceb81611cc7565b92915050565b5f60208284031215611d0657611d05611bdb565b5b5f611d1384828501611cdd565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611d4582611d1c565b9050919050565b611d5581611d3b565b8114611d5f575f80fd5b50565b5f81359050611d7081611d4c565b92915050565b5f8060408385031215611d8c57611d8b611bdb565b5b5f611d9985828601611d62565b9250506020611daa85828601611cdd565b9150509250929050565b611dbd81611be3565b82525050565b5f602082019050611dd65f830184611db4565b92915050565b5f60208284031215611df157611df0611bdb565b5b5f611dfe84828501611d62565b91505092915050565b611e1081611d3b565b82525050565b5f602082019050611e295f830184611e07565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611e5057611e4f611e2f565b5b8235905067ffffffffffffffff811115611e6d57611e6c611e33565b5b602083019150836020820283011115611e8957611e88611e37565b5b9250929050565b5f8083601f840112611ea557611ea4611e2f565b5b8235905067ffffffffffffffff811115611ec257611ec1611e33565b5b602083019150836020820283011115611ede57611edd611e37565b5b9250929050565b5f805f8060408587031215611efd57611efc611bdb565b5b5f85013567ffffffffffffffff811115611f1a57611f19611bdf565b5b611f2687828801611e3b565b9450945050602085013567ffffffffffffffff811115611f4957611f48611bdf565b5b611f5587828801611e90565b925092505092959194509250565b5f8083601f840112611f7857611f77611e2f565b5b8235905067ffffffffffffffff811115611f9557611f94611e33565b5b602083019150836001820283011115611fb157611fb0611e37565b5b9250929050565b5f8060208385031215611fce57611fcd611bdb565b5b5f83013567ffffffffffffffff811115611feb57611fea611bdf565b5b611ff785828601611f63565b92509250509250929050565b5f6040820190506120165f830185611c9f565b6120236020830184611e07565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61206c8261202a565b6120768185612034565b9350612086818560208601612044565b61208f81612052565b840191505092915050565b5f6020820190508181035f8301526120b28184612062565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b600281106120f8576120f76120ba565b5b50565b5f819050612108826120e7565b919050565b5f612117826120fb565b9050919050565b6121278161210d565b82525050565b5f819050919050565b61213f8161212d565b82525050565b5f60ff82169050919050565b61215a81612145565b82525050565b5f6080820190506121735f83018761211e565b6121806020830186612136565b61218d6040830185612151565b61219a6060830184611e07565b95945050505050565b6121ac8161210d565b82525050565b6121bb8161212d565b82525050565b6121ca81612145565b82525050565b6121d981611d3b565b82525050565b608082015f8201516121f35f8501826121a3565b50602082015161220660208501826121b2565b50604082015161221960408501826121c1565b50606082015161222c60608501826121d0565b50505050565b5f6080820190506122455f8301846121df565b92915050565b5f805f6040848603121561226257612261611bdb565b5b5f61226f86828701611d62565b935050602084013567ffffffffffffffff8111156122905761228f611bdf565b5b61229c86828701611f63565b92509250509250925092565b5f8083601f8401126122bd576122bc611e2f565b5b8235905067ffffffffffffffff8111156122da576122d9611e33565b5b6020830191508360208202830111156122f6576122f5611e37565b5b9250929050565b5f805f806040858703121561231557612314611bdb565b5b5f85013567ffffffffffffffff81111561233257612331611bdf565b5b61233e87828801611e3b565b9450945050602085013567ffffffffffffffff81111561236157612360611bdf565b5b61236d878288016122a8565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6123b181611c63565b81146123bb575f80fd5b50565b5f813590506123cc816123a8565b92915050565b5f602082840312156123e7576123e6611bdb565b5b5f6123f4848285016123be565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61243782612052565b810181811067ffffffffffffffff8211171561245657612455612401565b5b80604052505050565b5f612468611bd2565b9050612474828261242e565b919050565b5f80fd5b60028110612489575f80fd5b50565b5f8135905061249a8161247d565b92915050565b6124a98161212d565b81146124b3575f80fd5b50565b5f813590506124c4816124a0565b92915050565b6124d381612145565b81146124dd575f80fd5b50565b5f813590506124ee816124ca565b92915050565b5f60808284031215612509576125086123fd565b5b612513608061245f565b90505f6125228482850161248c565b5f830152506020612535848285016124b6565b6020830152506040612549848285016124e0565b604083015250606061255d84828501611d62565b60608301525092915050565b5f610100828403121561257f5761257e6123fd565b5b61258960a061245f565b90505f61259884828501611d62565b5f8301525060206125ab84828501611cdd565b60208301525060406125bf84828501611cdd565b60408301525060606125d384828501611cdd565b60608301525060806125e7848285016124f4565b60808301525092915050565b5f610100828403121561260957612608611bdb565b5b5f61261684828501612569565b91505092915050565b5f6060820190506126325f830186611e07565b61263f6020830185611c9f565b61264c6040830184611c9f565b949350505050565b5f80fd5b5f67ffffffffffffffff82111561267257612671612401565b5b61267b82612052565b9050602081019050919050565b828183375f83830152505050565b5f6126a86126a384612658565b61245f565b9050828152602081018484840111156126c4576126c3612654565b5b6126cf848285612688565b509392505050565b5f82601f8301126126eb576126ea611e2f565b5b81356126fb848260208601612696565b91505092915050565b5f60408284031215612719576127186123fd565b5b612723604061245f565b90505f61273284828501611d62565b5f83015250602082013567ffffffffffffffff81111561275557612754612479565b5b612761848285016126d7565b60208301525092915050565b5f6020828403121561278257612781611bdb565b5b5f82013567ffffffffffffffff81111561279f5761279e611bdf565b5b6127ab84828501612704565b91505092915050565b5f815190506127c281611cc7565b92915050565b5f602082840312156127dd576127dc611bdb565b5b5f6127ea848285016127b4565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61282a82611c96565b915061283583611c96565b925082820390508181111561284d5761284c6127f3565b5b92915050565b5f8160601b9050919050565b5f61286982612853565b9050919050565b5f61287a8261285f565b9050919050565b61289261288d82611d3b565b612870565b82525050565b5f819050919050565b6128b26128ad82611c96565b612898565b82525050565b5f6128c38286612881565b6014820191506128d38285612881565b6014820191506128e382846128a1565b602082019150819050949350505050565b5f6128fe82611d1c565b9050919050565b61290e816128f4565b8114612918575f80fd5b50565b5f8135905061292981612905565b92915050565b5f805f6060848603121561294657612945611bdb565b5b5f6129538682870161291b565b935050602061296486828701611cdd565b925050604061297586828701611cdd565b9150509250925092565b61298881611c96565b82525050565b602082015f8201516129a25f85018261297f565b50505050565b5f6020820190506129bb5f83018461298e565b92915050565b600381106129d2576129d16120ba565b5b50565b5f8190506129e2826129c1565b919050565b5f6129f1826129d5565b9050919050565b612a01816129e7565b82525050565b5f82825260208201905092915050565b5f612a218261202a565b612a2b8185612a07565b9350612a3b818560208601612044565b612a4481612052565b840191505092915050565b5f608083015f830151612a645f8601826129f8565b506020830151612a7760208601826121d0565b506040830151612a8a60408601826121d0565b5060608301518482036060860152612aa28282612a17565b9150508091505092915050565b5f6020820190508181035f830152612ac78184612a4f565b905092915050565b5f60408284031215612ae457612ae36123fd565b5b612aee604061245f565b90505f82013567ffffffffffffffff811115612b0d57612b0c612479565b5b612b19848285016126d7565b5f83015250602082013567ffffffffffffffff811115612b3c57612b3b612479565b5b612b48848285016126d7565b60208301525092915050565b5f60208284031215612b6957612b68611bdb565b5b5f82013567ffffffffffffffff811115612b8657612b85611bdf565b5b612b9284828501612acf565b91505092915050565b5f612ba582611c96565b9150612bb083611c96565b9250828202612bbe81611c96565b91508282048414831517612bd557612bd46127f3565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612c1382611c96565b9150612c1e83611c96565b925082612c2e57612c2d612bdc565b5b828204905092915050565b5f612c4382611c96565b9150612c4e83611c96565b9250828201905080821115612c6657612c656127f3565b5b9291505056fea26469706673582212209c47e7904d457f54d04df161fc92cb1b6758da1c7f38c6f8ac60698daab25b7264736f6c634300081a0033",l=class l extends I.ERC20VariableIncentive{constructor(){super(...arguments),this.abi=s.c}async getIncentiveCriteria(b){try{return await s._A(this._config,{...b,address:this.assertValidAddress()})}catch(e){throw new a.IncentiveCriteriaNotFoundError(e)}}async getMaxReward(b){return await s.DA(this._config,{...b,address:this.assertValidAddress()})}async getIncentiveScalar({chainId:b,hash:e,knownSignatures:r},d){var p;const f=await this.getIncentiveCriteria(d);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 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 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 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,d]=this.validateDeploymentConfig(b,e);return{abi:s.c,bytecode:w,args:[m(r)],...this.optionallyAttachAccount(d.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:d}){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:d.criteriaType,signature:d.signature,fieldIndex:d.fieldIndex,targetContract:d.targetContract}}])}exports.erc20VariableCriteriaIncentiveAbi=s.c;exports.ERC20VariableCriteriaIncentive=g;exports.gasRebateIncentiveCriteria=T;exports.prepareERC20VariableCriteriaIncentivePayload=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../generated-pNKCp_Ez.cjs"),m=require("@wagmi/core"),o=require("viem"),C=require("../deployments-DxkwtCyu.cjs"),u=require("../Actions/EventAction.cjs"),c=require("../errors.cjs"),E=require("../utils.cjs"),I=require("./ERC20VariableIncentive.cjs"),w="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612cab806100bd5f395ff3fe608060405260043610610219575f3560e01c8063715018a611610122578063c884ef83116100aa578063ec87621c1161006e578063ec87621c14610771578063f04e283e1461079b578063f2fde38b146107b7578063fe9fbb80146107d3578063fee81cf41461080f57610219565b8063c884ef831461067d578063d54ad2a1146106b9578063db09da12146106e3578063dcc213611461071f578063dcc59b6f1461074757610219565b8063a4d66daf116100f1578063a4d66daf1461059b578063a871ced2146105c5578063bb1757cf146105ef578063be4994f81461062b578063c213f3f91461065357610219565b8063715018a61461051057806375b238fc1461051a57806377548687146105445780638da5cb5b1461057157610219565b806338d52e0f116101a55780634a4ee7b1116101745780634a4ee7b1146104485780634e7165a214610464578063514e62fc146104a057806354d1f13d146104dc57806366a78e6c146104e657610219565b806338d52e0f146103915780634359d28a146103bb578063439fab91146103e3578063474f5a441461040b57610219565b80631cd64df4116101ec5780631cd64df4146102bb578063228cb733146102f7578063256929621461032157806328d6183b1461032b5780632de948071461035557610219565b806301ffc9a71461021d57806307621eca14610259578063183a4f6e146102835780631c10893f1461029f575b5f80fd5b348015610228575f80fd5b50610243600480360381019061023e9190611c41565b61084b565b6040516102509190611c86565b60405180910390f35b348015610264575f80fd5b5061026d6108c4565b60405161027a9190611cb7565b60405180910390f35b61029d60048036038101906102989190611cfa565b6108cc565b005b6102b960048036038101906102b49190611d7f565b6108d9565b005b3480156102c6575f80fd5b506102e160048036038101906102dc9190611d7f565b6108ef565b6040516102ee9190611c86565b60405180910390f35b348015610302575f80fd5b5061030b610905565b6040516103189190611cb7565b60405180910390f35b61032961090a565b005b348015610336575f80fd5b5061033f61095b565b60405161034c9190611dcc565b60405180910390f35b348015610360575f80fd5b5061037b60048036038101906103769190611de5565b610982565b6040516103889190611cb7565b60405180910390f35b34801561039c575f80fd5b506103a561099b565b6040516103b29190611e1f565b60405180910390f35b3480156103c6575f80fd5b506103e160048036038101906103dc9190611eee565b6109c0565b005b3480156103ee575f80fd5b5061040960048036038101906104049190611fc1565b610ace565b005b348015610416575f80fd5b50610431600480360381019061042c9190611fc1565b610d48565b60405161043f92919061200c565b60405180910390f35b610462600480360381019061045d9190611d7f565b610eb2565b005b34801561046f575f80fd5b5061048a60048036038101906104859190611fc1565b610ec8565b60405161049791906120a3565b60405180910390f35b3480156104ab575f80fd5b506104c660048036038101906104c19190611d7f565b610f96565b6040516104d39190611c86565b60405180910390f35b6104e4610fad565b005b3480156104f1575f80fd5b506104fa610fe6565b6040516105079190611cb7565b60405180910390f35b610518610fec565b005b348015610525575f80fd5b5061052e610fff565b60405161053b9190611cb7565b60405180910390f35b34801561054f575f80fd5b50610558611004565b6040516105689493929190612169565b60405180910390f35b34801561057c575f80fd5b50610585611059565b6040516105929190611e1f565b60405180910390f35b3480156105a6575f80fd5b506105af611081565b6040516105bc9190611cb7565b60405180910390f35b3480156105d0575f80fd5b506105d9611087565b6040516105e6919061223b565b60405180910390f35b3480156105fa575f80fd5b5061061560048036038101906106109190612254565b611156565b6040516106229190611c86565b60405180910390f35b348015610636575f80fd5b50610651600480360381019061064c9190612306565b611383565b005b34801561065e575f80fd5b50610667611439565b6040516106749190611cb7565b60405180910390f35b348015610688575f80fd5b506106a3600480360381019061069e9190611de5565b611442565b6040516106b09190611c86565b60405180910390f35b3480156106c4575f80fd5b506106cd61145f565b6040516106da9190611cb7565b60405180910390f35b3480156106ee575f80fd5b5061070960048036038101906107049190612254565b611465565b6040516107169190611c86565b60405180910390f35b34801561072a575f80fd5b5061074560048036038101906107409190612306565b611478565b005b348015610752575f80fd5b5061075b61152e565b6040516107689190611cb7565b60405180910390f35b34801561077c575f80fd5b50610785611534565b6040516107929190611cb7565b60405180910390f35b6107b560048036038101906107b09190611de5565b611539565b005b6107d160048036038101906107cc9190611de5565b611577565b005b3480156107de575f80fd5b506107f960048036038101906107f49190611de5565b6115a0565b6040516108069190611c86565b60405180910390f35b34801561081a575f80fd5b5061083560048036038101906108309190611de5565b6115f3565b6040516108429190611cb7565b60405180910390f35b5f7f52b8e45c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108bd57506108bc8261160c565b5b9050919050565b5f8054905090565b6108d63382611685565b50565b6108e1611694565b6108eb82826116cb565b5050565b5f81826108fb85610982565b1614905092915050565b5f5481565b5f6109136116db565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f52b8e45c00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026109cb816116e5565b828290508585905014610a0a576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610ac6575f848483818110610a2b57610a2a612384565b5b9050602002016020810190610a4091906123db565b90506001151581151503610a8557610a80878784818110610a6457610a63612384565b5b9050602002016020810190610a799190611de5565b60016116cb565b610ab8565b610ab7878784818110610a9b57610a9a612384565b5b9050602002016020810190610ab09190611de5565b6001611685565b5b508080600101915050610a0c565b505050505050565b5f610ad761171a565b90508054600382558015610b095760018160011c14303b10610b005763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610b1a91906125fc565b90505f815f015190505f826020015190505f836040015190505f846060015190505f856080015190505f8303610b7c576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ba6308773ffffffffffffffffffffffffffffffffffffffff1661174390919063ffffffff16565b905083811015610bf457865f015181856040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610beb93929190612628565b60405180910390fd5b8560035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550845f8190555083600281905550826006819055505f6005819055508160075f820151815f015f6101000a81548160ff02191690836001811115610c7a57610c796120c3565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050610cfc33611776565b610d0733600161184c565b505050505050508015610d43576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610d558161188d565b5f8585810190610d659190612776565b90505f8160200151806020019051810190610d8091906127d1565b90508060025f828254610d939190612829565b92505081905550610de9825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118b49092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610e5d939291906128c1565b604051602081830303815290604052604051610e7991906120a3565b60405180910390a28060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610eba611694565b610ec48282611685565b5050565b60605f808484810190610edb9190612938565b9250509150604051806080016040528060016002811115610eff57610efe6120c3565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610f5b91906129b1565b604051602081830303815290604052815250604051602001610f7d9190612ab8565b6040516020818303038152906040529250505092915050565b5f8082610fa285610982565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b60065481565b610ff4611694565b610ffd5f6118fd565b565b600281565b6007805f015f9054906101000a900460ff1690806001015490806002015f9054906101000a900460ff16908060020160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025481565b61108f611b89565b60076040518060800160405290815f82015f9054906101000a900460ff1660018111156110bf576110be6120c3565b5b60018111156110d1576110d06120c3565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f61115f611694565b5f838381019061116f9190612b5d565b90505f816020015180602001905181019061118a91906127d1565b90505f611196876119c3565b6111cc576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8054036111dc578190506111ff565b670de0b6b3a7640000825f546111f29190612ba4565b6111fc9190612c12565b90505b5f60065414158015611212575060065481115b1561121d5760065490505b6002548160055461122e9190612c42565b1115611266576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546112779190612c42565b92505081905550600160045f8282546112909190612c42565b925050819055506112e3878260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118b49092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168984604051602001611351939291906128c1565b60405160208183030381529060405260405161136d91906120a3565b60405180910390a2600193505050509392505050565b600261138e816116e5565b8282905085859050146113cd576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015611431576114248686838181106113f0576113ef612384565b5b90506020020160208101906114059190611de5565b85858481811061141857611417612384565b5b905060200201356116cb565b80806001019150506113cf565b505050505050565b5f600654905090565b6001602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f61146f846119c3565b90509392505050565b6002611483816116e5565b8282905085859050146114c2576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015611526576115198686838181106114e5576114e4612384565b5b90506020020160208101906114fa9190611de5565b85858481811061150d5761150c612384565b5b90506020020135611685565b80806001019150506114c4565b505050505050565b60045481565b600181565b611541611694565b63389a75e1600c52805f526020600c20805442111561156757636f5e88185f526004601cfd5b5f815550611574816118fd565b50565b61157f611694565b8060601b61159457637448fbae5f526004601cfd5b61159d816118fd565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166115c0611059565b73ffffffffffffffffffffffffffffffffffffffff1614806115ec57506115eb826002600117610f96565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f90318111000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061167e575061167d826119d2565b5b9050919050565b61169082825f611a4b565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146116c9576382b429005f526004601cfd5b565b6116d782826001611a4b565b5050565b5f6202a300905090565b638b78c6d81954331461171757638b78c6d8600c52335f52806020600c205416611716576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b61177e611aa3565b156117f6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156117b857630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611849565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d8600c52335f52806020600c2054166118b1576382b429005f526004601cfd5b50565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166118f4576390b8ec185f526004601cfd5b5f603452505050565b611905611aa3565b1561196a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506119c0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600254600554109050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611a445750611a4382611aa7565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611a6d57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611b195750611b1882611b20565b5b9050919050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60405180608001604052805f6001811115611ba757611ba66120c3565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c2081611bec565b8114611c2a575f80fd5b50565b5f81359050611c3b81611c17565b92915050565b5f60208284031215611c5657611c55611be4565b5b5f611c6384828501611c2d565b91505092915050565b5f8115159050919050565b611c8081611c6c565b82525050565b5f602082019050611c995f830184611c77565b92915050565b5f819050919050565b611cb181611c9f565b82525050565b5f602082019050611cca5f830184611ca8565b92915050565b611cd981611c9f565b8114611ce3575f80fd5b50565b5f81359050611cf481611cd0565b92915050565b5f60208284031215611d0f57611d0e611be4565b5b5f611d1c84828501611ce6565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611d4e82611d25565b9050919050565b611d5e81611d44565b8114611d68575f80fd5b50565b5f81359050611d7981611d55565b92915050565b5f8060408385031215611d9557611d94611be4565b5b5f611da285828601611d6b565b9250506020611db385828601611ce6565b9150509250929050565b611dc681611bec565b82525050565b5f602082019050611ddf5f830184611dbd565b92915050565b5f60208284031215611dfa57611df9611be4565b5b5f611e0784828501611d6b565b91505092915050565b611e1981611d44565b82525050565b5f602082019050611e325f830184611e10565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611e5957611e58611e38565b5b8235905067ffffffffffffffff811115611e7657611e75611e3c565b5b602083019150836020820283011115611e9257611e91611e40565b5b9250929050565b5f8083601f840112611eae57611ead611e38565b5b8235905067ffffffffffffffff811115611ecb57611eca611e3c565b5b602083019150836020820283011115611ee757611ee6611e40565b5b9250929050565b5f805f8060408587031215611f0657611f05611be4565b5b5f85013567ffffffffffffffff811115611f2357611f22611be8565b5b611f2f87828801611e44565b9450945050602085013567ffffffffffffffff811115611f5257611f51611be8565b5b611f5e87828801611e99565b925092505092959194509250565b5f8083601f840112611f8157611f80611e38565b5b8235905067ffffffffffffffff811115611f9e57611f9d611e3c565b5b602083019150836001820283011115611fba57611fb9611e40565b5b9250929050565b5f8060208385031215611fd757611fd6611be4565b5b5f83013567ffffffffffffffff811115611ff457611ff3611be8565b5b61200085828601611f6c565b92509250509250929050565b5f60408201905061201f5f830185611ca8565b61202c6020830184611e10565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61207582612033565b61207f818561203d565b935061208f81856020860161204d565b6120988161205b565b840191505092915050565b5f6020820190508181035f8301526120bb818461206b565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110612101576121006120c3565b5b50565b5f819050612111826120f0565b919050565b5f61212082612104565b9050919050565b61213081612116565b82525050565b5f819050919050565b61214881612136565b82525050565b5f60ff82169050919050565b6121638161214e565b82525050565b5f60808201905061217c5f830187612127565b612189602083018661213f565b612196604083018561215a565b6121a36060830184611e10565b95945050505050565b6121b581612116565b82525050565b6121c481612136565b82525050565b6121d38161214e565b82525050565b6121e281611d44565b82525050565b608082015f8201516121fc5f8501826121ac565b50602082015161220f60208501826121bb565b50604082015161222260408501826121ca565b50606082015161223560608501826121d9565b50505050565b5f60808201905061224e5f8301846121e8565b92915050565b5f805f6040848603121561226b5761226a611be4565b5b5f61227886828701611d6b565b935050602084013567ffffffffffffffff81111561229957612298611be8565b5b6122a586828701611f6c565b92509250509250925092565b5f8083601f8401126122c6576122c5611e38565b5b8235905067ffffffffffffffff8111156122e3576122e2611e3c565b5b6020830191508360208202830111156122ff576122fe611e40565b5b9250929050565b5f805f806040858703121561231e5761231d611be4565b5b5f85013567ffffffffffffffff81111561233b5761233a611be8565b5b61234787828801611e44565b9450945050602085013567ffffffffffffffff81111561236a57612369611be8565b5b612376878288016122b1565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6123ba81611c6c565b81146123c4575f80fd5b50565b5f813590506123d5816123b1565b92915050565b5f602082840312156123f0576123ef611be4565b5b5f6123fd848285016123c7565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6124408261205b565b810181811067ffffffffffffffff8211171561245f5761245e61240a565b5b80604052505050565b5f612471611bdb565b905061247d8282612437565b919050565b5f80fd5b60028110612492575f80fd5b50565b5f813590506124a381612486565b92915050565b6124b281612136565b81146124bc575f80fd5b50565b5f813590506124cd816124a9565b92915050565b6124dc8161214e565b81146124e6575f80fd5b50565b5f813590506124f7816124d3565b92915050565b5f6080828403121561251257612511612406565b5b61251c6080612468565b90505f61252b84828501612495565b5f83015250602061253e848285016124bf565b6020830152506040612552848285016124e9565b604083015250606061256684828501611d6b565b60608301525092915050565b5f610100828403121561258857612587612406565b5b61259260a0612468565b90505f6125a184828501611d6b565b5f8301525060206125b484828501611ce6565b60208301525060406125c884828501611ce6565b60408301525060606125dc84828501611ce6565b60608301525060806125f0848285016124fd565b60808301525092915050565b5f610100828403121561261257612611611be4565b5b5f61261f84828501612572565b91505092915050565b5f60608201905061263b5f830186611e10565b6126486020830185611ca8565b6126556040830184611ca8565b949350505050565b5f80fd5b5f67ffffffffffffffff82111561267b5761267a61240a565b5b6126848261205b565b9050602081019050919050565b828183375f83830152505050565b5f6126b16126ac84612661565b612468565b9050828152602081018484840111156126cd576126cc61265d565b5b6126d8848285612691565b509392505050565b5f82601f8301126126f4576126f3611e38565b5b813561270484826020860161269f565b91505092915050565b5f6040828403121561272257612721612406565b5b61272c6040612468565b90505f61273b84828501611d6b565b5f83015250602082013567ffffffffffffffff81111561275e5761275d612482565b5b61276a848285016126e0565b60208301525092915050565b5f6020828403121561278b5761278a611be4565b5b5f82013567ffffffffffffffff8111156127a8576127a7611be8565b5b6127b48482850161270d565b91505092915050565b5f815190506127cb81611cd0565b92915050565b5f602082840312156127e6576127e5611be4565b5b5f6127f3848285016127bd565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61283382611c9f565b915061283e83611c9f565b9250828203905081811115612856576128556127fc565b5b92915050565b5f8160601b9050919050565b5f6128728261285c565b9050919050565b5f61288382612868565b9050919050565b61289b61289682611d44565b612879565b82525050565b5f819050919050565b6128bb6128b682611c9f565b6128a1565b82525050565b5f6128cc828661288a565b6014820191506128dc828561288a565b6014820191506128ec82846128aa565b602082019150819050949350505050565b5f61290782611d25565b9050919050565b612917816128fd565b8114612921575f80fd5b50565b5f813590506129328161290e565b92915050565b5f805f6060848603121561294f5761294e611be4565b5b5f61295c86828701612924565b935050602061296d86828701611ce6565b925050604061297e86828701611ce6565b9150509250925092565b61299181611c9f565b82525050565b602082015f8201516129ab5f850182612988565b50505050565b5f6020820190506129c45f830184612997565b92915050565b600381106129db576129da6120c3565b5b50565b5f8190506129eb826129ca565b919050565b5f6129fa826129de565b9050919050565b612a0a816129f0565b82525050565b5f82825260208201905092915050565b5f612a2a82612033565b612a348185612a10565b9350612a4481856020860161204d565b612a4d8161205b565b840191505092915050565b5f608083015f830151612a6d5f860182612a01565b506020830151612a8060208601826121d9565b506040830151612a9360408601826121d9565b5060608301518482036060860152612aab8282612a20565b9150508091505092915050565b5f6020820190508181035f830152612ad08184612a58565b905092915050565b5f60408284031215612aed57612aec612406565b5b612af76040612468565b90505f82013567ffffffffffffffff811115612b1657612b15612482565b5b612b22848285016126e0565b5f83015250602082013567ffffffffffffffff811115612b4557612b44612482565b5b612b51848285016126e0565b60208301525092915050565b5f60208284031215612b7257612b71611be4565b5b5f82013567ffffffffffffffff811115612b8f57612b8e611be8565b5b612b9b84828501612ad8565b91505092915050565b5f612bae82611c9f565b9150612bb983611c9f565b9250828202612bc781611c9f565b91508282048414831517612bde57612bdd6127fc565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612c1c82611c9f565b9150612c2783611c9f565b925082612c3757612c36612be5565b5b828204905092915050565b5f612c4c82611c9f565b9150612c5783611c9f565b9250828201905080821115612c6f57612c6e6127fc565b5b9291505056fea26469706673582212206fc3fa5b6aa31318292541af8c0fe58ca66ae2f228656b14246c0a3d17700dcc64736f6c634300081a0033",l=class l extends I.ERC20VariableIncentive{constructor(){super(...arguments),this.abi=s.b}async getIncentiveCriteria(b){try{return await s.m2(this._config,{...b,address:this.assertValidAddress()})}catch(e){throw new c.IncentiveCriteriaNotFoundError(e)}}async getMaxReward(b){return await s.b2(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 d=await m.getTransactionReceipt(this._config,{chainId:b,hash:e});if(f.fieldIndex===E.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 c.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 c.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 c.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(y)}catch(i){throw new c.DecodedArgsError(`Failed to decode event log for signature ${f.signature}: ${i.message}`)}}else if(f.criteriaType===u.SignatureType.FUNC){const d=await m.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 c.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(t)}catch(n){throw new c.DecodedArgsError(`Failed to decode function data for signature ${f.signature}: ${n.message}`)}}else throw new c.InvalidCriteriaTypeError(`Invalid criteria type ${f.criteriaType}`)}buildParameters(b,e){const[r,a]=this.validateDeploymentConfig(b,e);return{abi:s.b,bytecode:w,args:[h(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:E.CheatCodes.GAS_REBATE_INCENTIVE,targetContract:o.zeroAddress}}function h({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.b;exports.ERC20VariableCriteriaIncentive=g;exports.gasRebateIncentiveCriteria=T;exports.prepareERC20VariableCriteriaIncentivePayload=h;
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","gasRebateIncentiveCriteria","zeroHash","zeroAddress","asset","reward","limit","maxReward","encodeAbiParameters"],"mappings":"mtuBAgHaA,EAAN,MAAMA,UAAuCC,EAAAA,sBAGlD,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAKL,KAAyB,IAAMC,GAAA,CAwB/B,MAAa,qBACXC,EAC4B,CACxB,GAAA,CAUK,OARL,MAAMC,E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,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","reward","limit","maxReward","encodeAbiParameters"],"mappings":"+iuBAgHaA,EAAN,MAAMA,UAAuCC,EAAAA,sBAGlD,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAKL,KAAyB,IAAMC,GAAA,CAwB/B,MAAa,qBACXC,EAC4B,CACxB,GAAA,CAUK,OARL,MAAMC,EAAA,GACJ,KAAK,QACL,CACE,GAAGD,EACH,Q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AAE,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,12 +1,12 @@
1
- import { c as l, aO as w, aP as I } from "../generated-CDEDSOGZ.js";
1
+ import { b as l, aO as w, aP as I } from "../generated-B0XfMfoq.js";
2
2
  import { getTransactionReceipt as v, getTransaction as E } from "@wagmi/core";
3
3
  import { parseEventLogs as x, decodeFunctionData as C, encodeAbiParameters as T, zeroHash as A, zeroAddress as N } from "viem";
4
- import { b as R } from "../deployments-BdPDIh-i.js";
4
+ import { b as R } from "../deployments-ZLVwJGZD.js";
5
5
  import { SignatureType as o } from "../Actions/EventAction.js";
6
6
  import { IncentiveCriteriaNotFoundError as V, NoMatchingLogsError as p, DecodedArgsError as i, InvalidCriteriaTypeError as $ } from "../errors.js";
7
7
  import { CheatCodes as y } from "../utils.js";
8
- import { ERC20VariableIncentive as _ } from "./ERC20VariableIncentive.js";
9
- const F = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015610062575f80fd5b5061007161007660201b60201c565b61010b565b5f6100856100e260201b60201c565b90508054600181161561009f5763f92ee8a95f526004601cfd5b8160c01c808260011c146100dd578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612ca2806101185f395ff3fe608060405260043610610219575f3560e01c8063715018a611610122578063c884ef83116100aa578063ec87621c1161006e578063ec87621c14610771578063f04e283e1461079b578063f2fde38b146107b7578063fe9fbb80146107d3578063fee81cf41461080f57610219565b8063c884ef831461067d578063d54ad2a1146106b9578063db09da12146106e3578063dcc213611461071f578063dcc59b6f1461074757610219565b8063a4d66daf116100f1578063a4d66daf1461059b578063a871ced2146105c5578063bb1757cf146105ef578063be4994f81461062b578063c213f3f91461065357610219565b8063715018a61461051057806375b238fc1461051a57806377548687146105445780638da5cb5b1461057157610219565b806338d52e0f116101a55780634a4ee7b1116101745780634a4ee7b1146104485780634e7165a214610464578063514e62fc146104a057806354d1f13d146104dc57806366a78e6c146104e657610219565b806338d52e0f146103915780634359d28a146103bb578063439fab91146103e3578063474f5a441461040b57610219565b80631cd64df4116101ec5780631cd64df4146102bb578063228cb733146102f7578063256929621461032157806328d6183b1461032b5780632de948071461035557610219565b806301ffc9a71461021d57806307621eca14610259578063183a4f6e146102835780631c10893f1461029f575b5f80fd5b348015610228575f80fd5b50610243600480360381019061023e9190611c38565b61084b565b6040516102509190611c7d565b60405180910390f35b348015610264575f80fd5b5061026d6108c4565b60405161027a9190611cae565b60405180910390f35b61029d60048036038101906102989190611cf1565b6108cd565b005b6102b960048036038101906102b49190611d76565b6108da565b005b3480156102c6575f80fd5b506102e160048036038101906102dc9190611d76565b6108f0565b6040516102ee9190611c7d565b60405180910390f35b348015610302575f80fd5b5061030b610906565b6040516103189190611cae565b60405180910390f35b61032961090c565b005b348015610336575f80fd5b5061033f61095d565b60405161034c9190611dc3565b60405180910390f35b348015610360575f80fd5b5061037b60048036038101906103769190611ddc565b610984565b6040516103889190611cae565b60405180910390f35b34801561039c575f80fd5b506103a561099d565b6040516103b29190611e16565b60405180910390f35b3480156103c6575f80fd5b506103e160048036038101906103dc9190611ee5565b6109c0565b005b3480156103ee575f80fd5b5061040960048036038101906104049190611fb8565b610ace565b005b348015610416575f80fd5b50610431600480360381019061042c9190611fb8565b610d48565b60405161043f929190612003565b60405180910390f35b610462600480360381019061045d9190611d76565b610eac565b005b34801561046f575f80fd5b5061048a60048036038101906104859190611fb8565b610ec2565b604051610497919061209a565b60405180910390f35b3480156104ab575f80fd5b506104c660048036038101906104c19190611d76565b610f90565b6040516104d39190611c7d565b60405180910390f35b6104e4610fa7565b005b3480156104f1575f80fd5b506104fa610fe0565b6040516105079190611cae565b60405180910390f35b610518610fe6565b005b348015610525575f80fd5b5061052e610ff9565b60405161053b9190611cae565b60405180910390f35b34801561054f575f80fd5b50610558610ffe565b6040516105689493929190612160565b60405180910390f35b34801561057c575f80fd5b50610585611053565b6040516105929190611e16565b60405180910390f35b3480156105a6575f80fd5b506105af61107b565b6040516105bc9190611cae565b60405180910390f35b3480156105d0575f80fd5b506105d9611081565b6040516105e69190612232565b60405180910390f35b3480156105fa575f80fd5b506106156004803603810190610610919061224b565b611150565b6040516106229190611c7d565b60405180910390f35b348015610636575f80fd5b50610651600480360381019061064c91906122fd565b61137a565b005b34801561065e575f80fd5b50610667611430565b6040516106749190611cae565b60405180910390f35b348015610688575f80fd5b506106a3600480360381019061069e9190611ddc565b611439565b6040516106b09190611c7d565b60405180910390f35b3480156106c4575f80fd5b506106cd611456565b6040516106da9190611cae565b60405180910390f35b3480156106ee575f80fd5b506107096004803603810190610704919061224b565b61145c565b6040516107169190611c7d565b60405180910390f35b34801561072a575f80fd5b50610745600480360381019061074091906122fd565b61146f565b005b348015610752575f80fd5b5061075b611525565b6040516107689190611cae565b60405180910390f35b34801561077c575f80fd5b5061078561152b565b6040516107929190611cae565b60405180910390f35b6107b560048036038101906107b09190611ddc565b611530565b005b6107d160048036038101906107cc9190611ddc565b61156e565b005b3480156107de575f80fd5b506107f960048036038101906107f49190611ddc565b611597565b6040516108069190611c7d565b60405180910390f35b34801561081a575f80fd5b5061083560048036038101906108309190611ddc565b6115ea565b6040516108429190611cae565b60405180910390f35b5f7f52b8e45c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108bd57506108bc82611603565b5b9050919050565b5f600254905090565b6108d7338261167c565b50565b6108e261168b565b6108ec82826116c2565b5050565b5f81826108fc85610984565b1614905092915050565b60025481565b5f6109156116d2565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f52b8e45c00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026109cb816116dc565b828290508585905014610a0a576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610ac6575f848483818110610a2b57610a2a61237b565b5b9050602002016020810190610a4091906123d2565b90506001151581151503610a8557610a80878784818110610a6457610a6361237b565b5b9050602002016020810190610a799190611ddc565b60016116c2565b610ab8565b610ab7878784818110610a9b57610a9a61237b565b5b9050602002016020810190610ab09190611ddc565b600161167c565b5b508080600101915050610a0c565b505050505050565b5f610ad7611711565b90508054600382558015610b095760018160011c14303b10610b005763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610b1a91906125f3565b90505f815f015190505f826020015190505f836040015190505f846060015190505f856080015190505f8303610b7c576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ba6308773ffffffffffffffffffffffffffffffffffffffff1661173a90919063ffffffff16565b905083811015610bf457865f015181856040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610beb9392919061261f565b60405180910390fd5b855f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508460028190555083600481905550826006819055505f6005819055508160075f820151815f015f6101000a81548160ff02191690836001811115610c7a57610c796120ba565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050610cfc3361176d565b610d07336001611843565b505050505050508015610d43576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610d5581611884565b5f8585810190610d65919061276d565b90505f8160200151806020019051810190610d8091906127c8565b90508060045f828254610d939190612820565b92505081905550610de7825f0151825f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118ab9092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610e59939291906128b8565b604051602081830303815290604052604051610e75919061209a565b60405180910390a2805f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610eb461168b565b610ebe828261167c565b5050565b60605f808484810190610ed5919061292f565b9250509150604051806080016040528060016002811115610ef957610ef86120ba565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610f5591906129a8565b604051602081830303815290604052815250604051602001610f779190612aaf565b6040516020818303038152906040529250505092915050565b5f8082610f9c85610984565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b60065481565b610fee61168b565b610ff75f6118f4565b565b600281565b6007805f015f9054906101000a900460ff1690806001015490806002015f9054906101000a900460ff16908060020160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60045481565b611089611b80565b60076040518060800160405290815f82015f9054906101000a900460ff1660018111156110b9576110b86120ba565b5b60018111156110cb576110ca6120ba565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f61115961168b565b5f83838101906111699190612b54565b90505f816020015180602001905181019061118491906127c8565b90505f611190876119ba565b6111c6576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600254036111d7578190506111fb565b670de0b6b3a7640000826002546111ee9190612b9b565b6111f89190612c09565b90505b5f6006541415801561120e575060065481115b156112195760065490505b6004548160055461122a9190612c39565b1115611262576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546112739190612c39565b925050819055506001805f82825461128b9190612c39565b925050819055506112dc87825f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118ab9092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff168984604051602001611348939291906128b8565b604051602081830303815290604052604051611364919061209a565b60405180910390a2600193505050509392505050565b6002611385816116dc565b8282905085859050146113c4576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156114285761141b8686838181106113e7576113e661237b565b5b90506020020160208101906113fc9190611ddc565b85858481811061140f5761140e61237b565b5b905060200201356116c2565b80806001019150506113c6565b505050505050565b5f600654905090565b6003602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f611466846119ba565b90509392505050565b600261147a816116dc565b8282905085859050146114b9576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561151d576115108686838181106114dc576114db61237b565b5b90506020020160208101906114f19190611ddc565b8585848181106115045761150361237b565b5b9050602002013561167c565b80806001019150506114bb565b505050505050565b60015481565b600181565b61153861168b565b63389a75e1600c52805f526020600c20805442111561155e57636f5e88185f526004601cfd5b5f81555061156b816118f4565b50565b61157661168b565b8060601b61158b57637448fbae5f526004601cfd5b611594816118f4565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166115b7611053565b73ffffffffffffffffffffffffffffffffffffffff1614806115e357506115e2826002600117610f90565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f90318111000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806116755750611674826119c9565b5b9050919050565b61168782825f611a42565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146116c0576382b429005f526004601cfd5b565b6116ce82826001611a42565b5050565b5f6202a300905090565b638b78c6d81954331461170e57638b78c6d8600c52335f52806020600c20541661170d576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b611775611a9a565b156117ed577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156117af57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611840565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d8600c52335f52806020600c2054166118a8576382b429005f526004601cfd5b50565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166118eb576390b8ec185f526004601cfd5b5f603452505050565b6118fc611a9a565b15611961577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506119b7565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600454600554109050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611a3b5750611a3a82611a9e565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611a6457848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611b105750611b0f82611b17565b5b9050919050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60405180608001604052805f6001811115611b9e57611b9d6120ba565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c1781611be3565b8114611c21575f80fd5b50565b5f81359050611c3281611c0e565b92915050565b5f60208284031215611c4d57611c4c611bdb565b5b5f611c5a84828501611c24565b91505092915050565b5f8115159050919050565b611c7781611c63565b82525050565b5f602082019050611c905f830184611c6e565b92915050565b5f819050919050565b611ca881611c96565b82525050565b5f602082019050611cc15f830184611c9f565b92915050565b611cd081611c96565b8114611cda575f80fd5b50565b5f81359050611ceb81611cc7565b92915050565b5f60208284031215611d0657611d05611bdb565b5b5f611d1384828501611cdd565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611d4582611d1c565b9050919050565b611d5581611d3b565b8114611d5f575f80fd5b50565b5f81359050611d7081611d4c565b92915050565b5f8060408385031215611d8c57611d8b611bdb565b5b5f611d9985828601611d62565b9250506020611daa85828601611cdd565b9150509250929050565b611dbd81611be3565b82525050565b5f602082019050611dd65f830184611db4565b92915050565b5f60208284031215611df157611df0611bdb565b5b5f611dfe84828501611d62565b91505092915050565b611e1081611d3b565b82525050565b5f602082019050611e295f830184611e07565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611e5057611e4f611e2f565b5b8235905067ffffffffffffffff811115611e6d57611e6c611e33565b5b602083019150836020820283011115611e8957611e88611e37565b5b9250929050565b5f8083601f840112611ea557611ea4611e2f565b5b8235905067ffffffffffffffff811115611ec257611ec1611e33565b5b602083019150836020820283011115611ede57611edd611e37565b5b9250929050565b5f805f8060408587031215611efd57611efc611bdb565b5b5f85013567ffffffffffffffff811115611f1a57611f19611bdf565b5b611f2687828801611e3b565b9450945050602085013567ffffffffffffffff811115611f4957611f48611bdf565b5b611f5587828801611e90565b925092505092959194509250565b5f8083601f840112611f7857611f77611e2f565b5b8235905067ffffffffffffffff811115611f9557611f94611e33565b5b602083019150836001820283011115611fb157611fb0611e37565b5b9250929050565b5f8060208385031215611fce57611fcd611bdb565b5b5f83013567ffffffffffffffff811115611feb57611fea611bdf565b5b611ff785828601611f63565b92509250509250929050565b5f6040820190506120165f830185611c9f565b6120236020830184611e07565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61206c8261202a565b6120768185612034565b9350612086818560208601612044565b61208f81612052565b840191505092915050565b5f6020820190508181035f8301526120b28184612062565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b600281106120f8576120f76120ba565b5b50565b5f819050612108826120e7565b919050565b5f612117826120fb565b9050919050565b6121278161210d565b82525050565b5f819050919050565b61213f8161212d565b82525050565b5f60ff82169050919050565b61215a81612145565b82525050565b5f6080820190506121735f83018761211e565b6121806020830186612136565b61218d6040830185612151565b61219a6060830184611e07565b95945050505050565b6121ac8161210d565b82525050565b6121bb8161212d565b82525050565b6121ca81612145565b82525050565b6121d981611d3b565b82525050565b608082015f8201516121f35f8501826121a3565b50602082015161220660208501826121b2565b50604082015161221960408501826121c1565b50606082015161222c60608501826121d0565b50505050565b5f6080820190506122455f8301846121df565b92915050565b5f805f6040848603121561226257612261611bdb565b5b5f61226f86828701611d62565b935050602084013567ffffffffffffffff8111156122905761228f611bdf565b5b61229c86828701611f63565b92509250509250925092565b5f8083601f8401126122bd576122bc611e2f565b5b8235905067ffffffffffffffff8111156122da576122d9611e33565b5b6020830191508360208202830111156122f6576122f5611e37565b5b9250929050565b5f805f806040858703121561231557612314611bdb565b5b5f85013567ffffffffffffffff81111561233257612331611bdf565b5b61233e87828801611e3b565b9450945050602085013567ffffffffffffffff81111561236157612360611bdf565b5b61236d878288016122a8565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6123b181611c63565b81146123bb575f80fd5b50565b5f813590506123cc816123a8565b92915050565b5f602082840312156123e7576123e6611bdb565b5b5f6123f4848285016123be565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61243782612052565b810181811067ffffffffffffffff8211171561245657612455612401565b5b80604052505050565b5f612468611bd2565b9050612474828261242e565b919050565b5f80fd5b60028110612489575f80fd5b50565b5f8135905061249a8161247d565b92915050565b6124a98161212d565b81146124b3575f80fd5b50565b5f813590506124c4816124a0565b92915050565b6124d381612145565b81146124dd575f80fd5b50565b5f813590506124ee816124ca565b92915050565b5f60808284031215612509576125086123fd565b5b612513608061245f565b90505f6125228482850161248c565b5f830152506020612535848285016124b6565b6020830152506040612549848285016124e0565b604083015250606061255d84828501611d62565b60608301525092915050565b5f610100828403121561257f5761257e6123fd565b5b61258960a061245f565b90505f61259884828501611d62565b5f8301525060206125ab84828501611cdd565b60208301525060406125bf84828501611cdd565b60408301525060606125d384828501611cdd565b60608301525060806125e7848285016124f4565b60808301525092915050565b5f610100828403121561260957612608611bdb565b5b5f61261684828501612569565b91505092915050565b5f6060820190506126325f830186611e07565b61263f6020830185611c9f565b61264c6040830184611c9f565b949350505050565b5f80fd5b5f67ffffffffffffffff82111561267257612671612401565b5b61267b82612052565b9050602081019050919050565b828183375f83830152505050565b5f6126a86126a384612658565b61245f565b9050828152602081018484840111156126c4576126c3612654565b5b6126cf848285612688565b509392505050565b5f82601f8301126126eb576126ea611e2f565b5b81356126fb848260208601612696565b91505092915050565b5f60408284031215612719576127186123fd565b5b612723604061245f565b90505f61273284828501611d62565b5f83015250602082013567ffffffffffffffff81111561275557612754612479565b5b612761848285016126d7565b60208301525092915050565b5f6020828403121561278257612781611bdb565b5b5f82013567ffffffffffffffff81111561279f5761279e611bdf565b5b6127ab84828501612704565b91505092915050565b5f815190506127c281611cc7565b92915050565b5f602082840312156127dd576127dc611bdb565b5b5f6127ea848285016127b4565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61282a82611c96565b915061283583611c96565b925082820390508181111561284d5761284c6127f3565b5b92915050565b5f8160601b9050919050565b5f61286982612853565b9050919050565b5f61287a8261285f565b9050919050565b61289261288d82611d3b565b612870565b82525050565b5f819050919050565b6128b26128ad82611c96565b612898565b82525050565b5f6128c38286612881565b6014820191506128d38285612881565b6014820191506128e382846128a1565b602082019150819050949350505050565b5f6128fe82611d1c565b9050919050565b61290e816128f4565b8114612918575f80fd5b50565b5f8135905061292981612905565b92915050565b5f805f6060848603121561294657612945611bdb565b5b5f6129538682870161291b565b935050602061296486828701611cdd565b925050604061297586828701611cdd565b9150509250925092565b61298881611c96565b82525050565b602082015f8201516129a25f85018261297f565b50505050565b5f6020820190506129bb5f83018461298e565b92915050565b600381106129d2576129d16120ba565b5b50565b5f8190506129e2826129c1565b919050565b5f6129f1826129d5565b9050919050565b612a01816129e7565b82525050565b5f82825260208201905092915050565b5f612a218261202a565b612a2b8185612a07565b9350612a3b818560208601612044565b612a4481612052565b840191505092915050565b5f608083015f830151612a645f8601826129f8565b506020830151612a7760208601826121d0565b506040830151612a8a60408601826121d0565b5060608301518482036060860152612aa28282612a17565b9150508091505092915050565b5f6020820190508181035f830152612ac78184612a4f565b905092915050565b5f60408284031215612ae457612ae36123fd565b5b612aee604061245f565b90505f82013567ffffffffffffffff811115612b0d57612b0c612479565b5b612b19848285016126d7565b5f83015250602082013567ffffffffffffffff811115612b3c57612b3b612479565b5b612b48848285016126d7565b60208301525092915050565b5f60208284031215612b6957612b68611bdb565b5b5f82013567ffffffffffffffff811115612b8657612b85611bdf565b5b612b9284828501612acf565b91505092915050565b5f612ba582611c96565b9150612bb083611c96565b9250828202612bbe81611c96565b91508282048414831517612bd557612bd46127f3565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612c1382611c96565b9150612c1e83611c96565b925082612c2e57612c2d612bdc565b5b828204905092915050565b5f612c4382611c96565b9150612c4e83611c96565b9250828201905080821115612c6657612c656127f3565b5b9291505056fea26469706673582212209c47e7904d457f54d04df161fc92cb1b6758da1c7f38c6f8ac60698daab25b7264736f6c634300081a0033", s = class s extends _ {
8
+ import { ERC20VariableIncentive as F } from "./ERC20VariableIncentive.js";
9
+ const P = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612cab806100bd5f395ff3fe608060405260043610610219575f3560e01c8063715018a611610122578063c884ef83116100aa578063ec87621c1161006e578063ec87621c14610771578063f04e283e1461079b578063f2fde38b146107b7578063fe9fbb80146107d3578063fee81cf41461080f57610219565b8063c884ef831461067d578063d54ad2a1146106b9578063db09da12146106e3578063dcc213611461071f578063dcc59b6f1461074757610219565b8063a4d66daf116100f1578063a4d66daf1461059b578063a871ced2146105c5578063bb1757cf146105ef578063be4994f81461062b578063c213f3f91461065357610219565b8063715018a61461051057806375b238fc1461051a57806377548687146105445780638da5cb5b1461057157610219565b806338d52e0f116101a55780634a4ee7b1116101745780634a4ee7b1146104485780634e7165a214610464578063514e62fc146104a057806354d1f13d146104dc57806366a78e6c146104e657610219565b806338d52e0f146103915780634359d28a146103bb578063439fab91146103e3578063474f5a441461040b57610219565b80631cd64df4116101ec5780631cd64df4146102bb578063228cb733146102f7578063256929621461032157806328d6183b1461032b5780632de948071461035557610219565b806301ffc9a71461021d57806307621eca14610259578063183a4f6e146102835780631c10893f1461029f575b5f80fd5b348015610228575f80fd5b50610243600480360381019061023e9190611c41565b61084b565b6040516102509190611c86565b60405180910390f35b348015610264575f80fd5b5061026d6108c4565b60405161027a9190611cb7565b60405180910390f35b61029d60048036038101906102989190611cfa565b6108cc565b005b6102b960048036038101906102b49190611d7f565b6108d9565b005b3480156102c6575f80fd5b506102e160048036038101906102dc9190611d7f565b6108ef565b6040516102ee9190611c86565b60405180910390f35b348015610302575f80fd5b5061030b610905565b6040516103189190611cb7565b60405180910390f35b61032961090a565b005b348015610336575f80fd5b5061033f61095b565b60405161034c9190611dcc565b60405180910390f35b348015610360575f80fd5b5061037b60048036038101906103769190611de5565b610982565b6040516103889190611cb7565b60405180910390f35b34801561039c575f80fd5b506103a561099b565b6040516103b29190611e1f565b60405180910390f35b3480156103c6575f80fd5b506103e160048036038101906103dc9190611eee565b6109c0565b005b3480156103ee575f80fd5b5061040960048036038101906104049190611fc1565b610ace565b005b348015610416575f80fd5b50610431600480360381019061042c9190611fc1565b610d48565b60405161043f92919061200c565b60405180910390f35b610462600480360381019061045d9190611d7f565b610eb2565b005b34801561046f575f80fd5b5061048a60048036038101906104859190611fc1565b610ec8565b60405161049791906120a3565b60405180910390f35b3480156104ab575f80fd5b506104c660048036038101906104c19190611d7f565b610f96565b6040516104d39190611c86565b60405180910390f35b6104e4610fad565b005b3480156104f1575f80fd5b506104fa610fe6565b6040516105079190611cb7565b60405180910390f35b610518610fec565b005b348015610525575f80fd5b5061052e610fff565b60405161053b9190611cb7565b60405180910390f35b34801561054f575f80fd5b50610558611004565b6040516105689493929190612169565b60405180910390f35b34801561057c575f80fd5b50610585611059565b6040516105929190611e1f565b60405180910390f35b3480156105a6575f80fd5b506105af611081565b6040516105bc9190611cb7565b60405180910390f35b3480156105d0575f80fd5b506105d9611087565b6040516105e6919061223b565b60405180910390f35b3480156105fa575f80fd5b5061061560048036038101906106109190612254565b611156565b6040516106229190611c86565b60405180910390f35b348015610636575f80fd5b50610651600480360381019061064c9190612306565b611383565b005b34801561065e575f80fd5b50610667611439565b6040516106749190611cb7565b60405180910390f35b348015610688575f80fd5b506106a3600480360381019061069e9190611de5565b611442565b6040516106b09190611c86565b60405180910390f35b3480156106c4575f80fd5b506106cd61145f565b6040516106da9190611cb7565b60405180910390f35b3480156106ee575f80fd5b5061070960048036038101906107049190612254565b611465565b6040516107169190611c86565b60405180910390f35b34801561072a575f80fd5b5061074560048036038101906107409190612306565b611478565b005b348015610752575f80fd5b5061075b61152e565b6040516107689190611cb7565b60405180910390f35b34801561077c575f80fd5b50610785611534565b6040516107929190611cb7565b60405180910390f35b6107b560048036038101906107b09190611de5565b611539565b005b6107d160048036038101906107cc9190611de5565b611577565b005b3480156107de575f80fd5b506107f960048036038101906107f49190611de5565b6115a0565b6040516108069190611c86565b60405180910390f35b34801561081a575f80fd5b5061083560048036038101906108309190611de5565b6115f3565b6040516108429190611cb7565b60405180910390f35b5f7f52b8e45c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108bd57506108bc8261160c565b5b9050919050565b5f8054905090565b6108d63382611685565b50565b6108e1611694565b6108eb82826116cb565b5050565b5f81826108fb85610982565b1614905092915050565b5f5481565b5f6109136116db565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f52b8e45c00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026109cb816116e5565b828290508585905014610a0a576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610ac6575f848483818110610a2b57610a2a612384565b5b9050602002016020810190610a4091906123db565b90506001151581151503610a8557610a80878784818110610a6457610a63612384565b5b9050602002016020810190610a799190611de5565b60016116cb565b610ab8565b610ab7878784818110610a9b57610a9a612384565b5b9050602002016020810190610ab09190611de5565b6001611685565b5b508080600101915050610a0c565b505050505050565b5f610ad761171a565b90508054600382558015610b095760018160011c14303b10610b005763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610b1a91906125fc565b90505f815f015190505f826020015190505f836040015190505f846060015190505f856080015190505f8303610b7c576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610ba6308773ffffffffffffffffffffffffffffffffffffffff1661174390919063ffffffff16565b905083811015610bf457865f015181856040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610beb93929190612628565b60405180910390fd5b8560035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550845f8190555083600281905550826006819055505f6005819055508160075f820151815f015f6101000a81548160ff02191690836001811115610c7a57610c796120c3565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050610cfc33611776565b610d0733600161184c565b505050505050508015610d43576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610d558161188d565b5f8585810190610d659190612776565b90505f8160200151806020019051810190610d8091906127d1565b90508060025f828254610d939190612829565b92505081905550610de9825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118b49092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610e5d939291906128c1565b604051602081830303815290604052604051610e7991906120a3565b60405180910390a28060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610eba611694565b610ec48282611685565b5050565b60605f808484810190610edb9190612938565b9250509150604051806080016040528060016002811115610eff57610efe6120c3565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610f5b91906129b1565b604051602081830303815290604052815250604051602001610f7d9190612ab8565b6040516020818303038152906040529250505092915050565b5f8082610fa285610982565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b60065481565b610ff4611694565b610ffd5f6118fd565b565b600281565b6007805f015f9054906101000a900460ff1690806001015490806002015f9054906101000a900460ff16908060020160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025481565b61108f611b89565b60076040518060800160405290815f82015f9054906101000a900460ff1660018111156110bf576110be6120c3565b5b60018111156110d1576110d06120c3565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f61115f611694565b5f838381019061116f9190612b5d565b90505f816020015180602001905181019061118a91906127d1565b90505f611196876119c3565b6111cc576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8054036111dc578190506111ff565b670de0b6b3a7640000825f546111f29190612ba4565b6111fc9190612c12565b90505b5f60065414158015611212575060065481115b1561121d5760065490505b6002548160055461122e9190612c42565b1115611266576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8282546112779190612c42565b92505081905550600160045f8282546112909190612c42565b925050819055506112e3878260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118b49092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168984604051602001611351939291906128c1565b60405160208183030381529060405260405161136d91906120a3565b60405180910390a2600193505050509392505050565b600261138e816116e5565b8282905085859050146113cd576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015611431576114248686838181106113f0576113ef612384565b5b90506020020160208101906114059190611de5565b85858481811061141857611417612384565b5b905060200201356116cb565b80806001019150506113cf565b505050505050565b5f600654905090565b6001602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f61146f846119c3565b90509392505050565b6002611483816116e5565b8282905085859050146114c2576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015611526576115198686838181106114e5576114e4612384565b5b90506020020160208101906114fa9190611de5565b85858481811061150d5761150c612384565b5b90506020020135611685565b80806001019150506114c4565b505050505050565b60045481565b600181565b611541611694565b63389a75e1600c52805f526020600c20805442111561156757636f5e88185f526004601cfd5b5f815550611574816118fd565b50565b61157f611694565b8060601b61159457637448fbae5f526004601cfd5b61159d816118fd565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166115c0611059565b73ffffffffffffffffffffffffffffffffffffffff1614806115ec57506115eb826002600117610f96565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f90318111000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061167e575061167d826119d2565b5b9050919050565b61169082825f611a4b565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146116c9576382b429005f526004601cfd5b565b6116d782826001611a4b565b5050565b5f6202a300905090565b638b78c6d81954331461171757638b78c6d8600c52335f52806020600c205416611716576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b61177e611aa3565b156117f6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156117b857630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611849565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d8600c52335f52806020600c2054166118b1576382b429005f526004601cfd5b50565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166118f4576390b8ec185f526004601cfd5b5f603452505050565b611905611aa3565b1561196a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506119c0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600254600554109050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611a445750611a4382611aa7565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611a6d57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611b195750611b1882611b20565b5b9050919050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60405180608001604052805f6001811115611ba757611ba66120c3565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c2081611bec565b8114611c2a575f80fd5b50565b5f81359050611c3b81611c17565b92915050565b5f60208284031215611c5657611c55611be4565b5b5f611c6384828501611c2d565b91505092915050565b5f8115159050919050565b611c8081611c6c565b82525050565b5f602082019050611c995f830184611c77565b92915050565b5f819050919050565b611cb181611c9f565b82525050565b5f602082019050611cca5f830184611ca8565b92915050565b611cd981611c9f565b8114611ce3575f80fd5b50565b5f81359050611cf481611cd0565b92915050565b5f60208284031215611d0f57611d0e611be4565b5b5f611d1c84828501611ce6565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611d4e82611d25565b9050919050565b611d5e81611d44565b8114611d68575f80fd5b50565b5f81359050611d7981611d55565b92915050565b5f8060408385031215611d9557611d94611be4565b5b5f611da285828601611d6b565b9250506020611db385828601611ce6565b9150509250929050565b611dc681611bec565b82525050565b5f602082019050611ddf5f830184611dbd565b92915050565b5f60208284031215611dfa57611df9611be4565b5b5f611e0784828501611d6b565b91505092915050565b611e1981611d44565b82525050565b5f602082019050611e325f830184611e10565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611e5957611e58611e38565b5b8235905067ffffffffffffffff811115611e7657611e75611e3c565b5b602083019150836020820283011115611e9257611e91611e40565b5b9250929050565b5f8083601f840112611eae57611ead611e38565b5b8235905067ffffffffffffffff811115611ecb57611eca611e3c565b5b602083019150836020820283011115611ee757611ee6611e40565b5b9250929050565b5f805f8060408587031215611f0657611f05611be4565b5b5f85013567ffffffffffffffff811115611f2357611f22611be8565b5b611f2f87828801611e44565b9450945050602085013567ffffffffffffffff811115611f5257611f51611be8565b5b611f5e87828801611e99565b925092505092959194509250565b5f8083601f840112611f8157611f80611e38565b5b8235905067ffffffffffffffff811115611f9e57611f9d611e3c565b5b602083019150836001820283011115611fba57611fb9611e40565b5b9250929050565b5f8060208385031215611fd757611fd6611be4565b5b5f83013567ffffffffffffffff811115611ff457611ff3611be8565b5b61200085828601611f6c565b92509250509250929050565b5f60408201905061201f5f830185611ca8565b61202c6020830184611e10565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61207582612033565b61207f818561203d565b935061208f81856020860161204d565b6120988161205b565b840191505092915050565b5f6020820190508181035f8301526120bb818461206b565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110612101576121006120c3565b5b50565b5f819050612111826120f0565b919050565b5f61212082612104565b9050919050565b61213081612116565b82525050565b5f819050919050565b61214881612136565b82525050565b5f60ff82169050919050565b6121638161214e565b82525050565b5f60808201905061217c5f830187612127565b612189602083018661213f565b612196604083018561215a565b6121a36060830184611e10565b95945050505050565b6121b581612116565b82525050565b6121c481612136565b82525050565b6121d38161214e565b82525050565b6121e281611d44565b82525050565b608082015f8201516121fc5f8501826121ac565b50602082015161220f60208501826121bb565b50604082015161222260408501826121ca565b50606082015161223560608501826121d9565b50505050565b5f60808201905061224e5f8301846121e8565b92915050565b5f805f6040848603121561226b5761226a611be4565b5b5f61227886828701611d6b565b935050602084013567ffffffffffffffff81111561229957612298611be8565b5b6122a586828701611f6c565b92509250509250925092565b5f8083601f8401126122c6576122c5611e38565b5b8235905067ffffffffffffffff8111156122e3576122e2611e3c565b5b6020830191508360208202830111156122ff576122fe611e40565b5b9250929050565b5f805f806040858703121561231e5761231d611be4565b5b5f85013567ffffffffffffffff81111561233b5761233a611be8565b5b61234787828801611e44565b9450945050602085013567ffffffffffffffff81111561236a57612369611be8565b5b612376878288016122b1565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6123ba81611c6c565b81146123c4575f80fd5b50565b5f813590506123d5816123b1565b92915050565b5f602082840312156123f0576123ef611be4565b5b5f6123fd848285016123c7565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6124408261205b565b810181811067ffffffffffffffff8211171561245f5761245e61240a565b5b80604052505050565b5f612471611bdb565b905061247d8282612437565b919050565b5f80fd5b60028110612492575f80fd5b50565b5f813590506124a381612486565b92915050565b6124b281612136565b81146124bc575f80fd5b50565b5f813590506124cd816124a9565b92915050565b6124dc8161214e565b81146124e6575f80fd5b50565b5f813590506124f7816124d3565b92915050565b5f6080828403121561251257612511612406565b5b61251c6080612468565b90505f61252b84828501612495565b5f83015250602061253e848285016124bf565b6020830152506040612552848285016124e9565b604083015250606061256684828501611d6b565b60608301525092915050565b5f610100828403121561258857612587612406565b5b61259260a0612468565b90505f6125a184828501611d6b565b5f8301525060206125b484828501611ce6565b60208301525060406125c884828501611ce6565b60408301525060606125dc84828501611ce6565b60608301525060806125f0848285016124fd565b60808301525092915050565b5f610100828403121561261257612611611be4565b5b5f61261f84828501612572565b91505092915050565b5f60608201905061263b5f830186611e10565b6126486020830185611ca8565b6126556040830184611ca8565b949350505050565b5f80fd5b5f67ffffffffffffffff82111561267b5761267a61240a565b5b6126848261205b565b9050602081019050919050565b828183375f83830152505050565b5f6126b16126ac84612661565b612468565b9050828152602081018484840111156126cd576126cc61265d565b5b6126d8848285612691565b509392505050565b5f82601f8301126126f4576126f3611e38565b5b813561270484826020860161269f565b91505092915050565b5f6040828403121561272257612721612406565b5b61272c6040612468565b90505f61273b84828501611d6b565b5f83015250602082013567ffffffffffffffff81111561275e5761275d612482565b5b61276a848285016126e0565b60208301525092915050565b5f6020828403121561278b5761278a611be4565b5b5f82013567ffffffffffffffff8111156127a8576127a7611be8565b5b6127b48482850161270d565b91505092915050565b5f815190506127cb81611cd0565b92915050565b5f602082840312156127e6576127e5611be4565b5b5f6127f3848285016127bd565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61283382611c9f565b915061283e83611c9f565b9250828203905081811115612856576128556127fc565b5b92915050565b5f8160601b9050919050565b5f6128728261285c565b9050919050565b5f61288382612868565b9050919050565b61289b61289682611d44565b612879565b82525050565b5f819050919050565b6128bb6128b682611c9f565b6128a1565b82525050565b5f6128cc828661288a565b6014820191506128dc828561288a565b6014820191506128ec82846128aa565b602082019150819050949350505050565b5f61290782611d25565b9050919050565b612917816128fd565b8114612921575f80fd5b50565b5f813590506129328161290e565b92915050565b5f805f6060848603121561294f5761294e611be4565b5b5f61295c86828701612924565b935050602061296d86828701611ce6565b925050604061297e86828701611ce6565b9150509250925092565b61299181611c9f565b82525050565b602082015f8201516129ab5f850182612988565b50505050565b5f6020820190506129c45f830184612997565b92915050565b600381106129db576129da6120c3565b5b50565b5f8190506129eb826129ca565b919050565b5f6129fa826129de565b9050919050565b612a0a816129f0565b82525050565b5f82825260208201905092915050565b5f612a2a82612033565b612a348185612a10565b9350612a4481856020860161204d565b612a4d8161205b565b840191505092915050565b5f608083015f830151612a6d5f860182612a01565b506020830151612a8060208601826121d9565b506040830151612a9360408601826121d9565b5060608301518482036060860152612aab8282612a20565b9150508091505092915050565b5f6020820190508181035f830152612ad08184612a58565b905092915050565b5f60408284031215612aed57612aec612406565b5b612af76040612468565b90505f82013567ffffffffffffffff811115612b1657612b15612482565b5b612b22848285016126e0565b5f83015250602082013567ffffffffffffffff811115612b4557612b44612482565b5b612b51848285016126e0565b60208301525092915050565b5f60208284031215612b7257612b71611be4565b5b5f82013567ffffffffffffffff811115612b8f57612b8e611be8565b5b612b9b84828501612ad8565b91505092915050565b5f612bae82611c9f565b9150612bb983611c9f565b9250828202612bc781611c9f565b91508282048414831517612bde57612bdd6127fc565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612c1c82611c9f565b9150612c2783611c9f565b925082612c3757612c36612be5565b5b828204905092915050565b5f612c4c82611c9f565b9150612c5783611c9f565b9250828201905080821115612c6f57612c6e6127fc565b5b9291505056fea26469706673582212206fc3fa5b6aa31318292541af8c0fe58ca66ae2f228656b14246c0a3d17700dcc64736f6c634300081a0033", s = class s extends F {
10
10
  constructor() {
11
11
  super(...arguments), this.abi = l;
12
12
  }
@@ -57,32 +57,32 @@ const F = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
57
57
  * @returns {Promise<bigint>}
58
58
  * @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}
59
59
  */
60
- async getIncentiveScalar({ chainId: b, hash: e, knownSignatures: t }, d) {
60
+ async getIncentiveScalar({ chainId: b, hash: e, knownSignatures: t }, a) {
61
61
  var u;
62
- const f = await this.getIncentiveCriteria(d);
62
+ const f = await this.getIncentiveCriteria(a);
63
63
  if (f.criteriaType === o.EVENT) {
64
- const a = await v(this._config, {
64
+ const c = await v(this._config, {
65
65
  chainId: b,
66
66
  hash: e
67
67
  });
68
68
  if (f.fieldIndex === y.GAS_REBATE_INCENTIVE)
69
- return a.gasUsed * a.effectiveGasPrice + // Normal gas cost
70
- (a.blobGasUsed ?? 0n) * (a.blobGasPrice ?? 0n);
71
- const r = a.logs;
69
+ return c.gasUsed * c.effectiveGasPrice + // Normal gas cost
70
+ (c.blobGasUsed ?? 0n) * (c.blobGasPrice ?? 0n);
71
+ const r = c.logs;
72
72
  if (r.length === 0)
73
73
  throw new p(
74
74
  `No logs found for event signature ${f.signature}`
75
75
  );
76
76
  try {
77
- const n = t[f.signature], c = x({
77
+ const n = t[f.signature], d = x({
78
78
  abi: [n],
79
79
  logs: r
80
80
  });
81
- if (c == null || c.length === 0)
81
+ if (d == null || d.length === 0)
82
82
  throw new p(
83
83
  `No logs found for event signature ${f.signature}`
84
84
  );
85
- const g = ((u = c[0]) == null ? void 0 : u.args)[f.fieldIndex];
85
+ const g = ((u = d[0]) == null ? void 0 : u.args)[f.fieldIndex];
86
86
  if (g === void 0)
87
87
  throw new i(
88
88
  `Decoded argument at index ${f.fieldIndex} is undefined`
@@ -94,20 +94,20 @@ const F = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
94
94
  );
95
95
  }
96
96
  } else if (f.criteriaType === o.FUNC) {
97
- const a = await E(this._config, {
97
+ const c = await E(this._config, {
98
98
  chainId: b,
99
99
  hash: e
100
100
  });
101
101
  try {
102
- const r = t[f.signature], c = C({
102
+ const r = t[f.signature], d = C({
103
103
  abi: [r],
104
- data: a.input
104
+ data: c.input
105
105
  }).args[f.fieldIndex];
106
- if (c == null)
106
+ if (d == null)
107
107
  throw new i(
108
108
  `Decoded argument at index ${f.fieldIndex} is undefined`
109
109
  );
110
- return BigInt(c);
110
+ return BigInt(d);
111
111
  } catch (r) {
112
112
  throw new i(
113
113
  `Failed to decode function data for signature ${f.signature}: ${r.message}`
@@ -127,15 +127,15 @@ const F = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
127
127
  * @returns {GenericDeployableParams}
128
128
  */
129
129
  buildParameters(b, e) {
130
- const [t, d] = this.validateDeploymentConfig(
130
+ const [t, a] = this.validateDeploymentConfig(
131
131
  b,
132
132
  e
133
133
  );
134
134
  return {
135
135
  abi: l,
136
- bytecode: F,
137
- args: [P(t)],
138
- ...this.optionallyAttachAccount(d.account)
136
+ bytecode: P,
137
+ args: [_(t)],
138
+ ...this.optionallyAttachAccount(a.account)
139
139
  };
140
140
  }
141
141
  };
@@ -152,12 +152,12 @@ function H() {
152
152
  targetContract: N
153
153
  };
154
154
  }
155
- function P({
155
+ function _({
156
156
  asset: h,
157
157
  reward: b,
158
158
  limit: e,
159
159
  maxReward: t = 0n,
160
- criteria: d
160
+ criteria: a
161
161
  }) {
162
162
  return T(
163
163
  [
@@ -189,10 +189,10 @@ function P({
189
189
  limit: e,
190
190
  maxReward: t,
191
191
  criteria: {
192
- criteriaType: d.criteriaType,
193
- signature: d.signature,
194
- fieldIndex: d.fieldIndex,
195
- targetContract: d.targetContract
192
+ criteriaType: a.criteriaType,
193
+ signature: a.signature,
194
+ fieldIndex: a.fieldIndex,
195
+ targetContract: a.targetContract
196
196
  }
197
197
  }
198
198
  ]
@@ -202,6 +202,6 @@ export {
202
202
  m as ERC20VariableCriteriaIncentive,
203
203
  l as erc20VariableCriteriaIncentiveAbi,
204
204
  H as gasRebateIncentiveCriteria,
205
- P as prepareERC20VariableCriteriaIncentivePayload
205
+ _ as prepareERC20VariableCriteriaIncentivePayload
206
206
  };
207
207
  //# sourceMappingURL=ERC20VariableCriteriaIncentive.js.map