@boostxyz/sdk 2.0.0-alpha.35 → 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 (136) 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.d.ts +18 -0
  43. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  44. package/dist/Incentives/AllowListIncentive.js +48 -22
  45. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  46. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  47. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  48. package/dist/Incentives/CGDAIncentive.d.ts +18 -0
  49. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  50. package/dist/Incentives/CGDAIncentive.js +47 -16
  51. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  52. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  53. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  54. package/dist/Incentives/ERC20Incentive.d.ts +18 -0
  55. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  56. package/dist/Incentives/ERC20Incentive.js +58 -32
  57. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  58. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
  59. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
  60. package/dist/Incentives/ERC20VariableCriteriaIncentive.js +29 -29
  61. package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
  62. package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
  63. package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
  64. package/dist/Incentives/ERC20VariableIncentive.d.ts +18 -0
  65. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  66. package/dist/Incentives/ERC20VariableIncentive.js +37 -11
  67. package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
  68. package/dist/Incentives/Incentive.cjs +1 -1
  69. package/dist/Incentives/Incentive.js +4 -4
  70. package/dist/Incentives/PointsIncentive.cjs +1 -1
  71. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  72. package/dist/Incentives/PointsIncentive.d.ts +18 -0
  73. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  74. package/dist/Incentives/PointsIncentive.js +49 -23
  75. package/dist/Incentives/PointsIncentive.js.map +1 -1
  76. package/dist/{SimpleDenyList-wDvsNIuY.cjs → SimpleDenyList-B65fnca2.cjs} +2 -2
  77. package/dist/{SimpleDenyList-wDvsNIuY.cjs.map → SimpleDenyList-B65fnca2.cjs.map} +1 -1
  78. package/dist/{SimpleDenyList-D-rGBaay.js → SimpleDenyList-UvXQl2vm.js} +20 -20
  79. package/dist/{SimpleDenyList-D-rGBaay.js.map → SimpleDenyList-UvXQl2vm.js.map} +1 -1
  80. package/dist/Validators/LimitedSignerValidator.cjs +1 -1
  81. package/dist/Validators/LimitedSignerValidator.js +9 -9
  82. package/dist/Validators/SignerValidator.cjs +1 -1
  83. package/dist/Validators/SignerValidator.js +8 -8
  84. package/dist/Validators/Validator.cjs +1 -1
  85. package/dist/Validators/Validator.cjs.map +1 -1
  86. package/dist/Validators/Validator.js +20 -20
  87. package/dist/componentInterfaces-Bt-4sNB5.cjs +2 -0
  88. package/dist/componentInterfaces-Bt-4sNB5.cjs.map +1 -0
  89. package/dist/componentInterfaces-dakxtQHf.js +16 -0
  90. package/dist/componentInterfaces-dakxtQHf.js.map +1 -0
  91. package/dist/deployments-DxkwtCyu.cjs +2 -0
  92. package/dist/deployments-DxkwtCyu.cjs.map +1 -0
  93. package/dist/{deployments-BdPDIh-i.js → deployments-ZLVwJGZD.js} +33 -30
  94. package/dist/deployments-ZLVwJGZD.js.map +1 -0
  95. package/dist/deployments.json +17 -14
  96. package/dist/{generated-CDEDSOGZ.js → generated-B0XfMfoq.js} +1037 -470
  97. package/dist/generated-B0XfMfoq.js.map +1 -0
  98. package/dist/generated-pNKCp_Ez.cjs +3 -0
  99. package/dist/generated-pNKCp_Ez.cjs.map +1 -0
  100. package/dist/index.cjs +1 -1
  101. package/dist/index.d.ts +1 -0
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.js +148 -144
  104. package/dist/utils.cjs +1 -1
  105. package/dist/utils.cjs.map +1 -1
  106. package/dist/utils.d.ts +12 -0
  107. package/dist/utils.d.ts.map +1 -1
  108. package/dist/utils.js +64 -35
  109. package/dist/utils.js.map +1 -1
  110. package/package.json +1 -1
  111. package/src/BoostCore.ts +30 -0
  112. package/src/Budgets/Budget.ts +8 -3
  113. package/src/Budgets/ManagedBudgetWithFees.test.ts +286 -0
  114. package/src/Budgets/ManagedBudgetWithFees.ts +671 -0
  115. package/src/Incentives/AllowListIncentive.test.ts +52 -4
  116. package/src/Incentives/AllowListIncentive.ts +28 -0
  117. package/src/Incentives/CGDAIncentive.test.ts +48 -3
  118. package/src/Incentives/CGDAIncentive.ts +34 -0
  119. package/src/Incentives/ERC20Incentive.test.ts +42 -0
  120. package/src/Incentives/ERC20Incentive.ts +28 -0
  121. package/src/Incentives/ERC20VariableIncentive.test.ts +41 -1
  122. package/src/Incentives/ERC20VariableIncentive.ts +28 -0
  123. package/src/Incentives/PointsIncentive.test.ts +47 -3
  124. package/src/Incentives/PointsIncentive.ts +28 -0
  125. package/src/index.ts +1 -0
  126. package/src/utils.ts +46 -0
  127. package/dist/componentInterfaces-BQw7DH-m.cjs +0 -2
  128. package/dist/componentInterfaces-BQw7DH-m.cjs.map +0 -1
  129. package/dist/componentInterfaces-C0vuWQlh.js +0 -15
  130. package/dist/componentInterfaces-C0vuWQlh.js.map +0 -1
  131. package/dist/deployments--f75Pthq.cjs +0 -2
  132. package/dist/deployments--f75Pthq.cjs.map +0 -1
  133. package/dist/deployments-BdPDIh-i.js.map +0 -1
  134. package/dist/generated-CDEDSOGZ.js.map +0 -1
  135. package/dist/generated-D3DE5TfH.cjs +0 -3
  136. package/dist/generated-D3DE5TfH.cjs.map +0 -1
@@ -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":"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"}
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":"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"}
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"ERC20VariableCriteriaIncentive.js","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":"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"}
1
+ {"version":3,"file":"ERC20VariableCriteriaIncentive.js","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":"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"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../generated-D3DE5TfH.cjs"),c=require("viem"),o=require("../deployments--f75Pthq.cjs"),u=require("../Deployable/DeployableTarget.cjs"),t=require("../claiming.cjs"),h=require("../utils.cjs"),y="0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015610062575f80fd5b5061007161007660201b60201c565b61010b565b5f6100856100e260201b60201c565b90508054600181161561009f5763f92ee8a95f526004601cfd5b8160c01c808260011c146100dd578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612687806101185f395ff3fe6080604052600436106101ed575f3560e01c806354d1f13d1161010c578063d54ad2a11161009f578063ec87621c1161006e578063ec87621c1461069a578063f04e283e146106c4578063f2fde38b146106e0578063fe9fbb80146106fc578063fee81cf414610738576101ed565b8063d54ad2a1146105e2578063db09da121461060c578063dcc2136114610648578063dcc59b6f14610670576101ed565b8063a4d66daf116100db578063a4d66daf14610518578063bb1757cf14610542578063be4994f81461057e578063c884ef83146105a6576101ed565b806354d1f13d146104b0578063715018a6146104ba57806375b238fc146104c45780638da5cb5b146104ee576101ed565b80632de9480711610184578063474f5a4411610153578063474f5a44146103df5780634a4ee7b11461041c5780634e7165a214610438578063514e62fc14610474576101ed565b80632de948071461032957806338d52e0f146103655780634359d28a1461038f578063439fab91146103b7576101ed565b80631cd64df4116101c05780631cd64df41461028f578063228cb733146102cb57806325692962146102f557806328d6183b146102ff576101ed565b806301ffc9a7146101f157806307621eca1461022d578063183a4f6e146102575780631c10893f14610273575b5f80fd5b3480156101fc575f80fd5b5061021760048036038101906102129190611888565b610774565b60405161022491906118cd565b60405180910390f35b348015610238575f80fd5b506102416107ed565b60405161024e91906118fe565b60405180910390f35b610271600480360381019061026c9190611941565b6107f6565b005b61028d600480360381019061028891906119c6565b610803565b005b34801561029a575f80fd5b506102b560048036038101906102b091906119c6565b610819565b6040516102c291906118cd565b60405180910390f35b3480156102d6575f80fd5b506102df61082f565b6040516102ec91906118fe565b60405180910390f35b6102fd610835565b005b34801561030a575f80fd5b50610313610886565b6040516103209190611a13565b60405180910390f35b348015610334575f80fd5b5061034f600480360381019061034a9190611a2c565b6108ad565b60405161035c91906118fe565b60405180910390f35b348015610370575f80fd5b506103796108c6565b6040516103869190611a66565b60405180910390f35b34801561039a575f80fd5b506103b560048036038101906103b09190611b35565b6108e9565b005b3480156103c2575f80fd5b506103dd60048036038101906103d89190611c08565b6109f7565b005b3480156103ea575f80fd5b5061040560048036038101906104009190611c08565b610bb4565b604051610413929190611c53565b60405180910390f35b610436600480360381019061043191906119c6565b610d18565b005b348015610443575f80fd5b5061045e60048036038101906104599190611c08565b610d2e565b60405161046b9190611cea565b60405180910390f35b34801561047f575f80fd5b5061049a600480360381019061049591906119c6565b610dfc565b6040516104a791906118cd565b60405180910390f35b6104b8610e13565b005b6104c2610e4c565b005b3480156104cf575f80fd5b506104d8610e5f565b6040516104e591906118fe565b60405180910390f35b3480156104f9575f80fd5b50610502610e64565b60405161050f9190611a66565b60405180910390f35b348015610523575f80fd5b5061052c610e8c565b60405161053991906118fe565b60405180910390f35b34801561054d575f80fd5b5061056860048036038101906105639190611d0a565b610e92565b60405161057591906118cd565b60405180910390f35b348015610589575f80fd5b506105a4600480360381019061059f9190611dbc565b61109e565b005b3480156105b1575f80fd5b506105cc60048036038101906105c79190611a2c565b611154565b6040516105d991906118cd565b60405180910390f35b3480156105ed575f80fd5b506105f6611171565b60405161060391906118fe565b60405180910390f35b348015610617575f80fd5b50610632600480360381019061062d9190611d0a565b611177565b60405161063f91906118cd565b60405180910390f35b348015610653575f80fd5b5061066e60048036038101906106699190611dbc565b61118a565b005b34801561067b575f80fd5b50610684611240565b60405161069191906118fe565b60405180910390f35b3480156106a5575f80fd5b506106ae611246565b6040516106bb91906118fe565b60405180910390f35b6106de60048036038101906106d99190611a2c565b61124b565b005b6106fa60048036038101906106f59190611a2c565b611289565b005b348015610707575f80fd5b50610722600480360381019061071d9190611a2c565b6112b2565b60405161072f91906118cd565b60405180910390f35b348015610743575f80fd5b5061075e60048036038101906107599190611a2c565b611305565b60405161076b91906118fe565b60405180910390f35b5f7f90318111000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806107e657506107e58261131e565b5b9050919050565b5f600254905090565b6108003382611397565b50565b61080b6113a6565b61081582826113dd565b5050565b5f8182610825856108ad565b1614905092915050565b60025481565b5f61083e6113ed565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f9031811100000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026108f4816113f7565b828290508585905014610933576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156109ef575f84848381811061095457610953611e3a565b5b90506020020160208101906109699190611e91565b905060011515811515036109ae576109a987878481811061098d5761098c611e3a565b5b90506020020160208101906109a29190611a2c565b60016113dd565b6109e1565b6109e08787848181106109c4576109c3611e3a565b5b90506020020160208101906109d99190611a2c565b6001611397565b5b508080600101915050610935565b505050505050565b5f610a0061142c565b90508054600382558015610a325760018160011c14303b10610a295763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610a439190611f9d565b90505f815f015190505f826020015190505f836040015190505f8103610a95576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610abf308573ffffffffffffffffffffffffffffffffffffffff1661145590919063ffffffff16565b905081811015610b0d57845f015181836040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610b0493929190611fc8565b60405180910390fd5b835f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600281905550816004819055505f600581905550610b6a33611488565b610b7533600161155e565b50505050508015610baf576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610bc18161159f565b5f8585810190610bd19190612116565b90505f8160200151806020019051810190610bec9190612171565b90508060045f828254610bff91906121c9565b92505081905550610c53825f0151825f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115c69092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610cc593929190612261565b604051602081830303815290604052604051610ce19190611cea565b60405180910390a2805f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610d206113a6565b610d2a8282611397565b5050565b60605f808484810190610d4191906122d8565b9250509150604051806080016040528060016002811115610d6557610d64612328565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610dc1919061237e565b604051602081830303815290604052815250604051602001610de39190612494565b6040516020818303038152906040529250505092915050565b5f8082610e08856108ad565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610e546113a6565b610e5d5f61160f565b565b600281565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60045481565b5f610e9b6113a6565b5f8383810190610eab9190612539565b90505f8160200151806020019051810190610ec69190612171565b90505f610ed2876116d5565b610f08576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60025403610f1957819050610f3d565b670de0b6b3a764000082600254610f309190612580565b610f3a91906125ee565b90505b60045481600554610f4e919061261e565b1115610f86576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f828254610f97919061261e565b925050819055506001805f828254610faf919061261e565b9250508190555061100087825f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115c69092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff16898460405160200161106c93929190612261565b6040516020818303038152906040526040516110889190611cea565b60405180910390a2600193505050509392505050565b60026110a9816113f7565b8282905085859050146110e8576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561114c5761113f86868381811061110b5761110a611e3a565b5b90506020020160208101906111209190611a2c565b85858481811061113357611132611e3a565b5b905060200201356113dd565b80806001019150506110ea565b505050505050565b6003602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f611181846116d5565b90509392505050565b6002611195816113f7565b8282905085859050146111d4576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156112385761122b8686838181106111f7576111f6611e3a565b5b905060200201602081019061120c9190611a2c565b85858481811061121f5761121e611e3a565b5b90506020020135611397565b80806001019150506111d6565b505050505050565b60015481565b600181565b6112536113a6565b63389a75e1600c52805f526020600c20805442111561127957636f5e88185f526004601cfd5b5f8155506112868161160f565b50565b6112916113a6565b8060601b6112a657637448fbae5f526004601cfd5b6112af8161160f565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166112d2610e64565b73ffffffffffffffffffffffffffffffffffffffff1614806112fe57506112fd826002600117610dfc565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611390575061138f826116e4565b5b9050919050565b6113a282825f61175d565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146113db576382b429005f526004601cfd5b565b6113e98282600161175d565b5050565b5f6202a300905090565b638b78c6d81954331461142957638b78c6d8600c52335f52806020600c205416611428576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b6114906117b5565b15611508577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156114ca57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061155b565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d8600c52335f52806020600c2054166115c3576382b429005f526004601cfd5b50565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611606576390b8ec185f526004601cfd5b5f603452505050565b6116176117b5565b1561167c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506116d2565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600454600554109050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806117565750611755826117b9565b5b9050919050565b638b78c6d8600c52825f526020600c2080548381178361177f57848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61186781611833565b8114611871575f80fd5b50565b5f813590506118828161185e565b92915050565b5f6020828403121561189d5761189c61182b565b5b5f6118aa84828501611874565b91505092915050565b5f8115159050919050565b6118c7816118b3565b82525050565b5f6020820190506118e05f8301846118be565b92915050565b5f819050919050565b6118f8816118e6565b82525050565b5f6020820190506119115f8301846118ef565b92915050565b611920816118e6565b811461192a575f80fd5b50565b5f8135905061193b81611917565b92915050565b5f602082840312156119565761195561182b565b5b5f6119638482850161192d565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6119958261196c565b9050919050565b6119a58161198b565b81146119af575f80fd5b50565b5f813590506119c08161199c565b92915050565b5f80604083850312156119dc576119db61182b565b5b5f6119e9858286016119b2565b92505060206119fa8582860161192d565b9150509250929050565b611a0d81611833565b82525050565b5f602082019050611a265f830184611a04565b92915050565b5f60208284031215611a4157611a4061182b565b5b5f611a4e848285016119b2565b91505092915050565b611a608161198b565b82525050565b5f602082019050611a795f830184611a57565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611aa057611a9f611a7f565b5b8235905067ffffffffffffffff811115611abd57611abc611a83565b5b602083019150836020820283011115611ad957611ad8611a87565b5b9250929050565b5f8083601f840112611af557611af4611a7f565b5b8235905067ffffffffffffffff811115611b1257611b11611a83565b5b602083019150836020820283011115611b2e57611b2d611a87565b5b9250929050565b5f805f8060408587031215611b4d57611b4c61182b565b5b5f85013567ffffffffffffffff811115611b6a57611b6961182f565b5b611b7687828801611a8b565b9450945050602085013567ffffffffffffffff811115611b9957611b9861182f565b5b611ba587828801611ae0565b925092505092959194509250565b5f8083601f840112611bc857611bc7611a7f565b5b8235905067ffffffffffffffff811115611be557611be4611a83565b5b602083019150836001820283011115611c0157611c00611a87565b5b9250929050565b5f8060208385031215611c1e57611c1d61182b565b5b5f83013567ffffffffffffffff811115611c3b57611c3a61182f565b5b611c4785828601611bb3565b92509250509250929050565b5f604082019050611c665f8301856118ef565b611c736020830184611a57565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611cbc82611c7a565b611cc68185611c84565b9350611cd6818560208601611c94565b611cdf81611ca2565b840191505092915050565b5f6020820190508181035f830152611d028184611cb2565b905092915050565b5f805f60408486031215611d2157611d2061182b565b5b5f611d2e868287016119b2565b935050602084013567ffffffffffffffff811115611d4f57611d4e61182f565b5b611d5b86828701611bb3565b92509250509250925092565b5f8083601f840112611d7c57611d7b611a7f565b5b8235905067ffffffffffffffff811115611d9957611d98611a83565b5b602083019150836020820283011115611db557611db4611a87565b5b9250929050565b5f805f8060408587031215611dd457611dd361182b565b5b5f85013567ffffffffffffffff811115611df157611df061182f565b5b611dfd87828801611a8b565b9450945050602085013567ffffffffffffffff811115611e2057611e1f61182f565b5b611e2c87828801611d67565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b611e70816118b3565b8114611e7a575f80fd5b50565b5f81359050611e8b81611e67565b92915050565b5f60208284031215611ea657611ea561182b565b5b5f611eb384828501611e7d565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611ef682611ca2565b810181811067ffffffffffffffff82111715611f1557611f14611ec0565b5b80604052505050565b5f611f27611822565b9050611f338282611eed565b919050565b5f80fd5b5f60608284031215611f5157611f50611ebc565b5b611f5b6060611f1e565b90505f611f6a848285016119b2565b5f830152506020611f7d8482850161192d565b6020830152506040611f918482850161192d565b60408301525092915050565b5f60608284031215611fb257611fb161182b565b5b5f611fbf84828501611f3c565b91505092915050565b5f606082019050611fdb5f830186611a57565b611fe860208301856118ef565b611ff560408301846118ef565b949350505050565b5f80fd5b5f67ffffffffffffffff82111561201b5761201a611ec0565b5b61202482611ca2565b9050602081019050919050565b828183375f83830152505050565b5f61205161204c84612001565b611f1e565b90508281526020810184848401111561206d5761206c611ffd565b5b612078848285612031565b509392505050565b5f82601f83011261209457612093611a7f565b5b81356120a484826020860161203f565b91505092915050565b5f604082840312156120c2576120c1611ebc565b5b6120cc6040611f1e565b90505f6120db848285016119b2565b5f83015250602082013567ffffffffffffffff8111156120fe576120fd611f38565b5b61210a84828501612080565b60208301525092915050565b5f6020828403121561212b5761212a61182b565b5b5f82013567ffffffffffffffff8111156121485761214761182f565b5b612154848285016120ad565b91505092915050565b5f8151905061216b81611917565b92915050565b5f602082840312156121865761218561182b565b5b5f6121938482850161215d565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6121d3826118e6565b91506121de836118e6565b92508282039050818111156121f6576121f561219c565b5b92915050565b5f8160601b9050919050565b5f612212826121fc565b9050919050565b5f61222382612208565b9050919050565b61223b6122368261198b565b612219565b82525050565b5f819050919050565b61225b612256826118e6565b612241565b82525050565b5f61226c828661222a565b60148201915061227c828561222a565b60148201915061228c828461224a565b602082019150819050949350505050565b5f6122a78261196c565b9050919050565b6122b78161229d565b81146122c1575f80fd5b50565b5f813590506122d2816122ae565b92915050565b5f805f606084860312156122ef576122ee61182b565b5b5f6122fc868287016122c4565b935050602061230d8682870161192d565b925050604061231e8682870161192d565b9150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b61235e816118e6565b82525050565b602082015f8201516123785f850182612355565b50505050565b5f6020820190506123915f830184612364565b92915050565b600381106123a8576123a7612328565b5b50565b5f8190506123b882612397565b919050565b5f6123c7826123ab565b9050919050565b6123d7816123bd565b82525050565b6123e68161198b565b82525050565b5f82825260208201905092915050565b5f61240682611c7a565b61241081856123ec565b9350612420818560208601611c94565b61242981611ca2565b840191505092915050565b5f608083015f8301516124495f8601826123ce565b50602083015161245c60208601826123dd565b50604083015161246f60408601826123dd565b506060830151848203606086015261248782826123fc565b9150508091505092915050565b5f6020820190508181035f8301526124ac8184612434565b905092915050565b5f604082840312156124c9576124c8611ebc565b5b6124d36040611f1e565b90505f82013567ffffffffffffffff8111156124f2576124f1611f38565b5b6124fe84828501612080565b5f83015250602082013567ffffffffffffffff81111561252157612520611f38565b5b61252d84828501612080565b60208301525092915050565b5f6020828403121561254e5761254d61182b565b5b5f82013567ffffffffffffffff81111561256b5761256a61182f565b5b612577848285016124b4565b91505092915050565b5f61258a826118e6565b9150612595836118e6565b92508282026125a3816118e6565b915082820484148315176125ba576125b961219c565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6125f8826118e6565b9150612603836118e6565b925082612613576126126125c1565b5b828204905092915050565b5f612628826118e6565b9150612633836118e6565b925082820190508082111561264b5761264a61219c565b5b9291505056fea264697066735822122009cb726c4381a097b229659e760f31c3e30f527494c6a6cc77256a569c67e7e164736f6c634300081a0033",s=class s extends u.DeployableTarget{constructor(){super(...arguments),this.abi=a.v}async owner(f){return await a.JI(this._config,{address:this.assertValidAddress(),args:[],...f})}async totalClaimed(f){return await a.n2(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await a.GI(this._config,{address:this.assertValidAddress(),args:[],...f})}async claims(f){return await a.PI(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,b){return await a.qI(this._config,{address:this.assertValidAddress(),args:[f],...b})}async asset(f){return await a.FI(this._config,{address:this.assertValidAddress(),...f})}async reward(f){return await a.YI(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await a.WI(this._config,{address:this.assertValidAddress(),...f})}async claim(f,b){return await this.awaitResult(this.claimRaw(f,b))}async claimRaw(f,b){const{request:e,result:d}=await a.A2(this._config,{address:this.assertValidAddress(),args:[t.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.s2(this._config,e),result:d}}async clawback(f,b){return await this.awaitResult(this.clawbackRaw(f,b))}async clawbackRaw(f,b){const{request:e,result:d}=await a.I2(this._config,{address:this.assertValidAddress(),args:[t.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.r2(this._config,e),result:d}}async isClaimable(f,b){return await a.QI(this._config,{address:this.assertValidAddress(),args:[t.prepareClaimPayload(f)],...b})}async getTotalBudget(f){var b;return((b=this.payload)==null?void 0:b.limit)!==void 0?this.payload.limit:await this.limit(f)}buildClaimData(f){return c.encodeAbiParameters([{type:"uint256",name:"rewardAmount"}],[f])}decodeClaimData(f){return BigInt(c.decodeAbiParameters([{type:"uint256"}],f)[0])}buildClawbackData(f){return c.encodeAbiParameters([{type:"uint256"}],[f])}buildParameters(f,b){const[e,d]=this.validateDeploymentConfig(f,b);return{abi:a.v,bytecode:y,args:[r(e)],...this.optionallyAttachAccount(d.account)}}};s.bases={31337:void 0,...o.ERC20VariableIncentive},s.registryType=h.RegistryType.INCENTIVE;let i=s;function r({asset:n,reward:f,limit:b}){return c.encodeAbiParameters([{type:"address",name:"asset"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[n,f,b])}exports.erc20VariableIncentiveAbi=a.v;exports.ERC20VariableIncentive=i;exports.prepareERC20VariableIncentivePayload=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../generated-pNKCp_Ez.cjs"),c=require("viem"),o=require("../deployments-DxkwtCyu.cjs"),u=require("../Deployable/DeployableTarget.cjs"),s=require("../claiming.cjs"),h=require("../utils.cjs"),y="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612690806100bd5f395ff3fe6080604052600436106101ed575f3560e01c806354d1f13d1161010c578063d54ad2a11161009f578063ec87621c1161006e578063ec87621c1461069a578063f04e283e146106c4578063f2fde38b146106e0578063fe9fbb80146106fc578063fee81cf414610738576101ed565b8063d54ad2a1146105e2578063db09da121461060c578063dcc2136114610648578063dcc59b6f14610670576101ed565b8063a4d66daf116100db578063a4d66daf14610518578063bb1757cf14610542578063be4994f81461057e578063c884ef83146105a6576101ed565b806354d1f13d146104b0578063715018a6146104ba57806375b238fc146104c45780638da5cb5b146104ee576101ed565b80632de9480711610184578063474f5a4411610153578063474f5a44146103df5780634a4ee7b11461041c5780634e7165a214610438578063514e62fc14610474576101ed565b80632de948071461032957806338d52e0f146103655780634359d28a1461038f578063439fab91146103b7576101ed565b80631cd64df4116101c05780631cd64df41461028f578063228cb733146102cb57806325692962146102f557806328d6183b146102ff576101ed565b806301ffc9a7146101f157806307621eca1461022d578063183a4f6e146102575780631c10893f14610273575b5f80fd5b3480156101fc575f80fd5b5061021760048036038101906102129190611891565b610774565b60405161022491906118d6565b60405180910390f35b348015610238575f80fd5b506102416107ed565b60405161024e9190611907565b60405180910390f35b610271600480360381019061026c919061194a565b6107f5565b005b61028d600480360381019061028891906119cf565b610802565b005b34801561029a575f80fd5b506102b560048036038101906102b091906119cf565b610818565b6040516102c291906118d6565b60405180910390f35b3480156102d6575f80fd5b506102df61082e565b6040516102ec9190611907565b60405180910390f35b6102fd610833565b005b34801561030a575f80fd5b50610313610884565b6040516103209190611a1c565b60405180910390f35b348015610334575f80fd5b5061034f600480360381019061034a9190611a35565b6108ab565b60405161035c9190611907565b60405180910390f35b348015610370575f80fd5b506103796108c4565b6040516103869190611a6f565b60405180910390f35b34801561039a575f80fd5b506103b560048036038101906103b09190611b3e565b6108e9565b005b3480156103c2575f80fd5b506103dd60048036038101906103d89190611c11565b6109f7565b005b3480156103ea575f80fd5b5061040560048036038101906104009190611c11565b610bb4565b604051610413929190611c5c565b60405180910390f35b610436600480360381019061043191906119cf565b610d1e565b005b348015610443575f80fd5b5061045e60048036038101906104599190611c11565b610d34565b60405161046b9190611cf3565b60405180910390f35b34801561047f575f80fd5b5061049a600480360381019061049591906119cf565b610e02565b6040516104a791906118d6565b60405180910390f35b6104b8610e19565b005b6104c2610e52565b005b3480156104cf575f80fd5b506104d8610e65565b6040516104e59190611907565b60405180910390f35b3480156104f9575f80fd5b50610502610e6a565b60405161050f9190611a6f565b60405180910390f35b348015610523575f80fd5b5061052c610e92565b6040516105399190611907565b60405180910390f35b34801561054d575f80fd5b5061056860048036038101906105639190611d13565b610e98565b60405161057591906118d6565b60405180910390f35b348015610589575f80fd5b506105a4600480360381019061059f9190611dc5565b6110a7565b005b3480156105b1575f80fd5b506105cc60048036038101906105c79190611a35565b61115d565b6040516105d991906118d6565b60405180910390f35b3480156105ed575f80fd5b506105f661117a565b6040516106039190611907565b60405180910390f35b348015610617575f80fd5b50610632600480360381019061062d9190611d13565b611180565b60405161063f91906118d6565b60405180910390f35b348015610653575f80fd5b5061066e60048036038101906106699190611dc5565b611193565b005b34801561067b575f80fd5b50610684611249565b6040516106919190611907565b60405180910390f35b3480156106a5575f80fd5b506106ae61124f565b6040516106bb9190611907565b60405180910390f35b6106de60048036038101906106d99190611a35565b611254565b005b6106fa60048036038101906106f59190611a35565b611292565b005b348015610707575f80fd5b50610722600480360381019061071d9190611a35565b6112bb565b60405161072f91906118d6565b60405180910390f35b348015610743575f80fd5b5061075e60048036038101906107599190611a35565b61130e565b60405161076b9190611907565b60405180910390f35b5f7f90318111000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806107e657506107e582611327565b5b9050919050565b5f8054905090565b6107ff33826113a0565b50565b61080a6113af565b61081482826113e6565b5050565b5f8182610824856108ab565b1614905092915050565b5f5481565b5f61083c6113f6565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f9031811100000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026108f481611400565b828290508585905014610933576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156109ef575f84848381811061095457610953611e43565b5b90506020020160208101906109699190611e9a565b905060011515811515036109ae576109a987878481811061098d5761098c611e43565b5b90506020020160208101906109a29190611a35565b60016113e6565b6109e1565b6109e08787848181106109c4576109c3611e43565b5b90506020020160208101906109d99190611a35565b60016113a0565b5b508080600101915050610935565b505050505050565b5f610a00611435565b90508054600382558015610a325760018160011c14303b10610a295763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610a439190611fa6565b90505f815f015190505f826020015190505f836040015190505f8103610a95576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610abf308573ffffffffffffffffffffffffffffffffffffffff1661145e90919063ffffffff16565b905081811015610b0d57845f015181836040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610b0493929190611fd1565b60405180910390fd5b8360035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550825f81905550816002819055505f600581905550610b6a33611491565b610b75336001611567565b50505050508015610baf576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610bc1816115a8565b5f8585810190610bd1919061211f565b90505f8160200151806020019051810190610bec919061217a565b90508060025f828254610bff91906121d2565b92505081905550610c55825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115cf9092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f015184604051602001610cc99392919061226a565b604051602081830303815290604052604051610ce59190611cf3565b60405180910390a28060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b610d266113af565b610d3082826113a0565b5050565b60605f808484810190610d4791906122e1565b9250509150604051806080016040528060016002811115610d6b57610d6a612331565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610dc79190612387565b604051602081830303815290604052815250604051602001610de9919061249d565b6040516020818303038152906040529250505092915050565b5f8082610e0e856108ab565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610e5a6113af565b610e635f611618565b565b600281565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025481565b5f610ea16113af565b5f8383810190610eb19190612542565b90505f8160200151806020019051810190610ecc919061217a565b90505f610ed8876116de565b610f0e576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f805403610f1e57819050610f41565b670de0b6b3a7640000825f54610f349190612589565b610f3e91906125f7565b90505b60025481600554610f529190612627565b1115610f8a576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f828254610f9b9190612627565b92505081905550600160045f828254610fb49190612627565b92505081905550611007878260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115cf9092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689846040516020016110759392919061226a565b6040516020818303038152906040526040516110919190611cf3565b60405180910390a2600193505050509392505050565b60026110b281611400565b8282905085859050146110f1576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156111555761114886868381811061111457611113611e43565b5b90506020020160208101906111299190611a35565b85858481811061113c5761113b611e43565b5b905060200201356113e6565b80806001019150506110f3565b505050505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f61118a846116de565b90509392505050565b600261119e81611400565b8282905085859050146111dd576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561124157611234868683818110611200576111ff611e43565b5b90506020020160208101906112159190611a35565b85858481811061122857611227611e43565b5b905060200201356113a0565b80806001019150506111df565b505050505050565b60045481565b600181565b61125c6113af565b63389a75e1600c52805f526020600c20805442111561128257636f5e88185f526004601cfd5b5f81555061128f81611618565b50565b61129a6113af565b8060601b6112af57637448fbae5f526004601cfd5b6112b881611618565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166112db610e6a565b73ffffffffffffffffffffffffffffffffffffffff1614806113075750611306826002600117610e02565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806113995750611398826116ed565b5b9050919050565b6113ab82825f611766565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146113e4576382b429005f526004601cfd5b565b6113f282826001611766565b5050565b5f6202a300905090565b638b78c6d81954331461143257638b78c6d8600c52335f52806020600c205416611431576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b6114996117be565b15611511577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156114d357630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611564565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d8600c52335f52806020600c2054166115cc576382b429005f526004601cfd5b50565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f5114171661160f576390b8ec185f526004601cfd5b5f603452505050565b6116206117be565b15611685577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506116db565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600254600554109050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061175f575061175e826117c2565b5b9050919050565b638b78c6d8600c52825f526020600c2080548381178361178857848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6118708161183c565b811461187a575f80fd5b50565b5f8135905061188b81611867565b92915050565b5f602082840312156118a6576118a5611834565b5b5f6118b38482850161187d565b91505092915050565b5f8115159050919050565b6118d0816118bc565b82525050565b5f6020820190506118e95f8301846118c7565b92915050565b5f819050919050565b611901816118ef565b82525050565b5f60208201905061191a5f8301846118f8565b92915050565b611929816118ef565b8114611933575f80fd5b50565b5f8135905061194481611920565b92915050565b5f6020828403121561195f5761195e611834565b5b5f61196c84828501611936565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61199e82611975565b9050919050565b6119ae81611994565b81146119b8575f80fd5b50565b5f813590506119c9816119a5565b92915050565b5f80604083850312156119e5576119e4611834565b5b5f6119f2858286016119bb565b9250506020611a0385828601611936565b9150509250929050565b611a168161183c565b82525050565b5f602082019050611a2f5f830184611a0d565b92915050565b5f60208284031215611a4a57611a49611834565b5b5f611a57848285016119bb565b91505092915050565b611a6981611994565b82525050565b5f602082019050611a825f830184611a60565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611aa957611aa8611a88565b5b8235905067ffffffffffffffff811115611ac657611ac5611a8c565b5b602083019150836020820283011115611ae257611ae1611a90565b5b9250929050565b5f8083601f840112611afe57611afd611a88565b5b8235905067ffffffffffffffff811115611b1b57611b1a611a8c565b5b602083019150836020820283011115611b3757611b36611a90565b5b9250929050565b5f805f8060408587031215611b5657611b55611834565b5b5f85013567ffffffffffffffff811115611b7357611b72611838565b5b611b7f87828801611a94565b9450945050602085013567ffffffffffffffff811115611ba257611ba1611838565b5b611bae87828801611ae9565b925092505092959194509250565b5f8083601f840112611bd157611bd0611a88565b5b8235905067ffffffffffffffff811115611bee57611bed611a8c565b5b602083019150836001820283011115611c0a57611c09611a90565b5b9250929050565b5f8060208385031215611c2757611c26611834565b5b5f83013567ffffffffffffffff811115611c4457611c43611838565b5b611c5085828601611bbc565b92509250509250929050565b5f604082019050611c6f5f8301856118f8565b611c7c6020830184611a60565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611cc582611c83565b611ccf8185611c8d565b9350611cdf818560208601611c9d565b611ce881611cab565b840191505092915050565b5f6020820190508181035f830152611d0b8184611cbb565b905092915050565b5f805f60408486031215611d2a57611d29611834565b5b5f611d37868287016119bb565b935050602084013567ffffffffffffffff811115611d5857611d57611838565b5b611d6486828701611bbc565b92509250509250925092565b5f8083601f840112611d8557611d84611a88565b5b8235905067ffffffffffffffff811115611da257611da1611a8c565b5b602083019150836020820283011115611dbe57611dbd611a90565b5b9250929050565b5f805f8060408587031215611ddd57611ddc611834565b5b5f85013567ffffffffffffffff811115611dfa57611df9611838565b5b611e0687828801611a94565b9450945050602085013567ffffffffffffffff811115611e2957611e28611838565b5b611e3587828801611d70565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b611e79816118bc565b8114611e83575f80fd5b50565b5f81359050611e9481611e70565b92915050565b5f60208284031215611eaf57611eae611834565b5b5f611ebc84828501611e86565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611eff82611cab565b810181811067ffffffffffffffff82111715611f1e57611f1d611ec9565b5b80604052505050565b5f611f3061182b565b9050611f3c8282611ef6565b919050565b5f80fd5b5f60608284031215611f5a57611f59611ec5565b5b611f646060611f27565b90505f611f73848285016119bb565b5f830152506020611f8684828501611936565b6020830152506040611f9a84828501611936565b60408301525092915050565b5f60608284031215611fbb57611fba611834565b5b5f611fc884828501611f45565b91505092915050565b5f606082019050611fe45f830186611a60565b611ff160208301856118f8565b611ffe60408301846118f8565b949350505050565b5f80fd5b5f67ffffffffffffffff82111561202457612023611ec9565b5b61202d82611cab565b9050602081019050919050565b828183375f83830152505050565b5f61205a6120558461200a565b611f27565b90508281526020810184848401111561207657612075612006565b5b61208184828561203a565b509392505050565b5f82601f83011261209d5761209c611a88565b5b81356120ad848260208601612048565b91505092915050565b5f604082840312156120cb576120ca611ec5565b5b6120d56040611f27565b90505f6120e4848285016119bb565b5f83015250602082013567ffffffffffffffff81111561210757612106611f41565b5b61211384828501612089565b60208301525092915050565b5f6020828403121561213457612133611834565b5b5f82013567ffffffffffffffff81111561215157612150611838565b5b61215d848285016120b6565b91505092915050565b5f8151905061217481611920565b92915050565b5f6020828403121561218f5761218e611834565b5b5f61219c84828501612166565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6121dc826118ef565b91506121e7836118ef565b92508282039050818111156121ff576121fe6121a5565b5b92915050565b5f8160601b9050919050565b5f61221b82612205565b9050919050565b5f61222c82612211565b9050919050565b61224461223f82611994565b612222565b82525050565b5f819050919050565b61226461225f826118ef565b61224a565b82525050565b5f6122758286612233565b6014820191506122858285612233565b6014820191506122958284612253565b602082019150819050949350505050565b5f6122b082611975565b9050919050565b6122c0816122a6565b81146122ca575f80fd5b50565b5f813590506122db816122b7565b92915050565b5f805f606084860312156122f8576122f7611834565b5b5f612305868287016122cd565b935050602061231686828701611936565b925050604061232786828701611936565b9150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b612367816118ef565b82525050565b602082015f8201516123815f85018261235e565b50505050565b5f60208201905061239a5f83018461236d565b92915050565b600381106123b1576123b0612331565b5b50565b5f8190506123c1826123a0565b919050565b5f6123d0826123b4565b9050919050565b6123e0816123c6565b82525050565b6123ef81611994565b82525050565b5f82825260208201905092915050565b5f61240f82611c83565b61241981856123f5565b9350612429818560208601611c9d565b61243281611cab565b840191505092915050565b5f608083015f8301516124525f8601826123d7565b50602083015161246560208601826123e6565b50604083015161247860408601826123e6565b50606083015184820360608601526124908282612405565b9150508091505092915050565b5f6020820190508181035f8301526124b5818461243d565b905092915050565b5f604082840312156124d2576124d1611ec5565b5b6124dc6040611f27565b90505f82013567ffffffffffffffff8111156124fb576124fa611f41565b5b61250784828501612089565b5f83015250602082013567ffffffffffffffff81111561252a57612529611f41565b5b61253684828501612089565b60208301525092915050565b5f6020828403121561255757612556611834565b5b5f82013567ffffffffffffffff81111561257457612573611838565b5b612580848285016124bd565b91505092915050565b5f612593826118ef565b915061259e836118ef565b92508282026125ac816118ef565b915082820484148315176125c3576125c26121a5565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612601826118ef565b915061260c836118ef565b92508261261c5761261b6125ca565b5b828204905092915050565b5f612631826118ef565b915061263c836118ef565b9250828201905080821115612654576126536121a5565b5b9291505056fea2646970667358221220e0a05e959762110896c996ee249bba62b8cb954dbaa9a610a5039fd5f9b3e46464736f6c634300081a0033",t=class t extends u.DeployableTarget{constructor(){super(...arguments),this.abi=a.T}async owner(f){return await a.RI(this._config,{address:this.assertValidAddress(),args:[],...f})}async totalClaimed(f){return await a.HI(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await a.TI(this._config,{address:this.assertValidAddress(),args:[],...f})}async claims(f){return await a.wI(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,b){return await a.vI(this._config,{address:this.assertValidAddress(),args:[f],...b})}async asset(f){return await a.fI(this._config,{address:this.assertValidAddress(),...f})}async reward(f){return await a.EI(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await a.MI(this._config,{address:this.assertValidAddress(),...f})}async claim(f,b){return await this.awaitResult(this.claimRaw(f,b))}async claimRaw(f,b){const{request:e,result:d}=await a.JI(this._config,{address:this.assertValidAddress(),args:[s.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.VI(this._config,e),result:d}}async clawback(f,b){return await this.awaitResult(this.clawbackRaw(f,b))}async clawbackRaw(f,b){const{request:e,result:d}=await a.KI(this._config,{address:this.assertValidAddress(),args:[s.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.FI(this._config,e),result:d}}async isClaimable(f,b){return await a.gI(this._config,{address:this.assertValidAddress(),args:[s.prepareClaimPayload(f)],...b})}async getTotalBudget(f){var b;return((b=this.payload)==null?void 0:b.limit)!==void 0?this.payload.limit:await this.limit(f)}async canBeClaimed(f){return await this.getRemainingClaimPotential(f)>0n}async getRemainingClaimPotential(f){const[b,e]=await Promise.all([this.totalClaimed(f),this.limit(f)]);return e-b}buildClaimData(f){return c.encodeAbiParameters([{type:"uint256",name:"rewardAmount"}],[f])}decodeClaimData(f){return BigInt(c.decodeAbiParameters([{type:"uint256"}],f)[0])}buildClawbackData(f){return c.encodeAbiParameters([{type:"uint256"}],[f])}buildParameters(f,b){const[e,d]=this.validateDeploymentConfig(f,b);return{abi:a.T,bytecode:y,args:[r(e)],...this.optionallyAttachAccount(d.account)}}};t.bases={31337:void 0,...o.ERC20VariableIncentive},t.registryType=h.RegistryType.INCENTIVE;let i=t;function r({asset:n,reward:f,limit:b}){return c.encodeAbiParameters([{type:"address",name:"asset"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[n,f,b])}exports.erc20VariableIncentiveAbi=a.T;exports.ERC20VariableIncentive=i;exports.prepareERC20VariableIncentivePayload=r;
2
2
  //# sourceMappingURL=ERC20VariableIncentive.cjs.map