@boostxyz/sdk 1.1.0-alpha.22 → 1.1.0-alpha.23

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 (150) hide show
  1. package/dist/Actions/Action.cjs +1 -1
  2. package/dist/Actions/Action.cjs.map +1 -1
  3. package/dist/Actions/Action.js +6 -6
  4. package/dist/Actions/EventAction.cjs +1 -1
  5. package/dist/Actions/EventAction.cjs.map +1 -1
  6. package/dist/Actions/EventAction.d.ts +9 -6
  7. package/dist/Actions/EventAction.d.ts.map +1 -1
  8. package/dist/Actions/EventAction.js +820 -15
  9. package/dist/Actions/EventAction.js.map +1 -1
  10. package/dist/AllowLists/AllowList.cjs +1 -1
  11. package/dist/AllowLists/AllowList.js +2 -2
  12. package/dist/AllowLists/OpenAllowList.d.ts +28 -28
  13. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  14. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
  15. package/dist/AllowLists/SimpleAllowList.d.ts +28 -28
  16. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
  17. package/dist/AllowLists/SimpleAllowList.js +11 -10
  18. package/dist/AllowLists/SimpleAllowList.js.map +1 -1
  19. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  20. package/dist/AllowLists/SimpleDenyList.d.ts +28 -28
  21. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
  22. package/dist/AllowLists/SimpleDenyList.js +3 -3
  23. package/dist/Auth/PassthroughAuth.cjs +1 -1
  24. package/dist/Auth/PassthroughAuth.js +1 -1
  25. package/dist/BoostCore-Btl5BdAs.cjs +3 -0
  26. package/dist/BoostCore-Btl5BdAs.cjs.map +1 -0
  27. package/dist/{BoostCore-BVZExPPu.js → BoostCore-CD56zbYX.js} +1678 -499
  28. package/dist/BoostCore-CD56zbYX.js.map +1 -0
  29. package/dist/BoostCore.cjs +1 -1
  30. package/dist/BoostCore.d.ts +7 -7
  31. package/dist/BoostCore.d.ts.map +1 -1
  32. package/dist/BoostCore.js +6 -6
  33. package/dist/BoostRegistry.cjs +1 -1
  34. package/dist/BoostRegistry.cjs.map +1 -1
  35. package/dist/BoostRegistry.d.ts +6 -6
  36. package/dist/BoostRegistry.d.ts.map +1 -1
  37. package/dist/BoostRegistry.js +50 -50
  38. package/dist/BoostRegistry.js.map +1 -1
  39. package/dist/Budgets/Budget.cjs +1 -1
  40. package/dist/Budgets/Budget.js +1 -1
  41. package/dist/Budgets/ManagedBudget.cjs +1 -1
  42. package/dist/Budgets/ManagedBudget.cjs.map +1 -1
  43. package/dist/Budgets/ManagedBudget.d.ts +28 -28
  44. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  45. package/dist/Budgets/ManagedBudget.js +30 -29
  46. package/dist/Budgets/ManagedBudget.js.map +1 -1
  47. package/dist/Budgets/VestingBudget.d.ts +28 -28
  48. package/dist/Budgets/VestingBudget.d.ts.map +1 -1
  49. package/dist/Deployable/DeployableTarget.cjs +1 -1
  50. package/dist/Deployable/DeployableTarget.js +1 -1
  51. package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
  52. package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -1
  53. package/dist/Deployable/DeployableTargetWithRBAC.d.ts +92 -23
  54. package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -1
  55. package/dist/Deployable/DeployableTargetWithRBAC.js +145 -47
  56. package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -1
  57. package/dist/{Incentive-BhHaK3PZ.cjs → Incentive-CcnOIc8L.cjs} +2 -2
  58. package/dist/{Incentive-BhHaK3PZ.cjs.map → Incentive-CcnOIc8L.cjs.map} +1 -1
  59. package/dist/{Incentive-Cqg1w6wD.js → Incentive-rM5nKznp.js} +30 -29
  60. package/dist/{Incentive-Cqg1w6wD.js.map → Incentive-rM5nKznp.js.map} +1 -1
  61. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  62. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  63. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  64. package/dist/Incentives/AllowListIncentive.js +11 -10
  65. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  66. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  67. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  68. package/dist/Incentives/CGDAIncentive.d.ts +28 -28
  69. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  70. package/dist/Incentives/CGDAIncentive.js +12 -11
  71. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  72. package/dist/Incentives/ERC1155Incentive.d.ts +28 -28
  73. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
  74. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  75. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  76. package/dist/Incentives/ERC20Incentive.d.ts +34 -31
  77. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  78. package/dist/Incentives/ERC20Incentive.js +30 -27
  79. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  80. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +28 -28
  81. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -1
  82. package/dist/Incentives/ERC20VariableIncentive.d.ts +28 -28
  83. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  84. package/dist/Incentives/Incentive.cjs +1 -1
  85. package/dist/Incentives/Incentive.js +2 -2
  86. package/dist/Incentives/PointsIncentive.cjs +1 -1
  87. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  88. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  89. package/dist/Incentives/PointsIncentive.js +12 -11
  90. package/dist/Incentives/PointsIncentive.js.map +1 -1
  91. package/dist/{SimpleDenyList-CGaWjuld.js → SimpleDenyList-BDXpY74P.js} +18 -17
  92. package/dist/SimpleDenyList-BDXpY74P.js.map +1 -0
  93. package/dist/{SimpleDenyList-BUR17Tt1.cjs → SimpleDenyList-DNj5qDWM.cjs} +2 -2
  94. package/dist/SimpleDenyList-DNj5qDWM.cjs.map +1 -0
  95. package/dist/Validators/SignerValidator.cjs +1 -1
  96. package/dist/Validators/SignerValidator.cjs.map +1 -1
  97. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  98. package/dist/Validators/SignerValidator.js +13 -12
  99. package/dist/Validators/SignerValidator.js.map +1 -1
  100. package/dist/Validators/Validator.cjs +1 -1
  101. package/dist/Validators/Validator.js +1 -1
  102. package/dist/deployments-DF_6-7hH.cjs +2 -0
  103. package/dist/deployments-DF_6-7hH.cjs.map +1 -0
  104. package/dist/deployments-fJsWblwS.js +56 -0
  105. package/dist/deployments-fJsWblwS.js.map +1 -0
  106. package/dist/deployments.json +26 -12
  107. package/dist/{generated-CKt2yCQd.js → generated-CsNyWPKA.js} +458 -443
  108. package/dist/generated-CsNyWPKA.js.map +1 -0
  109. package/dist/generated-DHerxf1y.cjs +3 -0
  110. package/dist/generated-DHerxf1y.cjs.map +1 -0
  111. package/dist/index.cjs +1 -1
  112. package/dist/index.js +33 -33
  113. package/package.json +4 -4
  114. package/src/Actions/EventAction.test.ts +19 -13
  115. package/src/Actions/EventAction.ts +16 -35
  116. package/src/AllowLists/SimpleAllowList.ts +1 -0
  117. package/src/AllowLists/SimpleDenyList.ts +1 -0
  118. package/src/BoostCore.test.ts +78 -78
  119. package/src/BoostCore.ts +19 -13
  120. package/src/BoostRegistry.ts +10 -10
  121. package/src/Budgets/ManagedBudget.test.ts +41 -17
  122. package/src/Budgets/ManagedBudget.ts +1 -11
  123. package/src/Budgets/VestingBudget.ts +3 -1
  124. package/src/Deployable/DeployableTargetWithRBAC.test.ts +103 -0
  125. package/src/Deployable/DeployableTargetWithRBAC.ts +160 -36
  126. package/src/Incentives/AllowListIncentive.test.ts +7 -7
  127. package/src/Incentives/AllowListIncentive.ts +1 -0
  128. package/src/Incentives/CGDAIncentive.ts +1 -0
  129. package/src/Incentives/ERC1155Incentive.ts +3 -1
  130. package/src/Incentives/ERC20Incentive.ts +10 -3
  131. package/src/Incentives/ERC20VariableCriteriaIncentive.ts +1 -0
  132. package/src/Incentives/ERC20VariableIncentive.ts +1 -0
  133. package/src/Incentives/PointsIncentive.ts +1 -0
  134. package/src/Validators/SignerValidator.ts +1 -0
  135. package/dist/BoostCore-BVZExPPu.js.map +0 -1
  136. package/dist/BoostCore-D-E-cnGI.cjs +0 -3
  137. package/dist/BoostCore-D-E-cnGI.cjs.map +0 -1
  138. package/dist/EventAction-BZt5cjbe.cjs +0 -2
  139. package/dist/EventAction-BZt5cjbe.cjs.map +0 -1
  140. package/dist/EventAction-C_-hJXWm.js +0 -1541
  141. package/dist/EventAction-C_-hJXWm.js.map +0 -1
  142. package/dist/SimpleDenyList-BUR17Tt1.cjs.map +0 -1
  143. package/dist/SimpleDenyList-CGaWjuld.js.map +0 -1
  144. package/dist/deployments-DVXioW2i.cjs +0 -2
  145. package/dist/deployments-DVXioW2i.cjs.map +0 -1
  146. package/dist/deployments-oykLv3_Z.js +0 -43
  147. package/dist/deployments-oykLv3_Z.js.map +0 -1
  148. package/dist/generated-CKt2yCQd.js.map +0 -1
  149. package/dist/generated-CyTNlOwM.cjs +0 -3
  150. package/dist/generated-CyTNlOwM.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ERC20Incentive.cjs","sources":["../../src/Incentives/ERC20Incentive.ts"],"sourcesContent":["import {\n erc20IncentiveAbi,\n readErc20IncentiveAsset,\n readErc20IncentiveClaimed,\n readErc20IncentiveClaims,\n readErc20IncentiveCurrentReward,\n readErc20IncentiveEntries,\n readErc20IncentiveIsClaimable,\n readErc20IncentiveLimit,\n readErc20IncentiveOwner,\n readErc20IncentiveReward,\n readErc20IncentiveStrategy,\n simulateErc20IncentiveClaim,\n simulateErc20IncentiveClawback,\n simulateErc20IncentiveDrawRaffle,\n writeErc20IncentiveClaim,\n writeErc20IncentiveClawback,\n writeErc20IncentiveDrawRaffle,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20Incentive.sol/ERC20Incentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroHash,\n} from 'viem';\nimport { ERC20Incentive as ERC20IncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n type ClaimPayload,\n type StrategyType,\n prepareClaimPayload,\n} from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20IncentiveAbi };\n\n/**\n * The object representation of a `ERC20Incentive.InitPayload`\n *\n * @export\n * @interface ERC20IncentivePayload\n * @typedef {ERC20IncentivePayload}\n */\nexport interface ERC20IncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n *\n * @type {StrategyType}\n */\n strategy: StrategyType;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The entity that can `clawback` funds\n *\n * @type {Address}\n */\n manager: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20Incentive` event types.\n *\n * @export\n * @typedef {ERC20IncentiveLog}\n * @template {ContractEventName<typeof erc20IncentiveAbi>} [event=ContractEventName<\n * typeof erc20IncentiveAbi\n * >]\n */\nexport type ERC20IncentiveLog<\n event extends ContractEventName<typeof erc20IncentiveAbi> = ContractEventName<\n typeof erc20IncentiveAbi\n >,\n> = GenericLog<typeof erc20IncentiveAbi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class ERC20Incentive\n * @typedef {ERC20Incentive}\n * @extends {DeployableTarget<ERC20IncentivePayload>}\n */\nexport class ERC20Incentive extends DeployableTarget<\n ERC20IncentivePayload,\n typeof erc20IncentiveAbi\n> {\n public override readonly abi = erc20IncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n ...(ERC20IncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams<typeof erc20IncentiveAbi, 'owner'>) {\n return await readErc20IncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(\n params?: ReadParams<typeof erc20IncentiveAbi, 'currentReward'>,\n ) {\n return await readErc20IncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams<typeof erc20IncentiveAbi, 'claims'>) {\n return await readErc20IncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(\n address: Address,\n params?: ReadParams<typeof erc20IncentiveAbi, 'claimed'>,\n ) {\n return await readErc20IncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams<typeof erc20IncentiveAbi, 'asset'>) {\n return await readErc20IncentiveAsset(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The strategy for the incentive (MINT or POOL)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<StrategyType>}\n */\n public strategy(\n params?: ReadParams<typeof erc20IncentiveAbi, 'strategy'>,\n ): Promise<StrategyType> {\n return readErc20IncentiveStrategy(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n }) as Promise<StrategyType>;\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams<typeof erc20IncentiveAbi, 'reward'>) {\n return await readErc20IncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max claims, or max entries for raffles)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams<typeof erc20IncentiveAbi, 'limit'>) {\n return await readErc20IncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The set of addresses that have claimed a slot in the incentive raffle, accessed by bigint index.\n *\n * @public\n * @async\n * @param {bigint} i - Index of address\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async entries(\n i: bigint,\n params?: ReadParams<typeof erc20IncentiveAbi, 'entries'>,\n ) {\n return await readErc20IncentiveEntries(this._config, {\n address: this.assertValidAddress(),\n args: [i],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'claim'>,\n ) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'claim'>,\n ) {\n const { request, result } = await simulateErc20IncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'clawback'>,\n ) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'clawback'>,\n ) {\n const { request, result } = await simulateErc20IncentiveClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(\n payload: ClaimPayload,\n params?: ReadParams<typeof erc20IncentiveAbi, 'isClaimable'>,\n ) {\n return await readErc20IncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async drawRaffle(\n params?: WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>,\n ) {\n return await this.awaitResult(this.drawRaffleRaw(params));\n }\n\n /**\n * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async drawRaffleRaw(\n params?: WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>,\n ) {\n const { request, result } = await simulateErc20IncentiveDrawRaffle(\n this._config,\n {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveDrawRaffle(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20IncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20IncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20IncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20IncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Builds the claim data for the ERC20Incentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as ERC20Incentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because ERC20Incentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link ERC20IncentivePayload}, properly encode a `ERC20Incentive.InitPayload` for use with {@link ERC20Incentive} initialization.\n *\n * @param {ERC20IncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @returns {Hex}\n */\nexport function prepareERC20IncentivePayload({\n asset,\n strategy,\n reward,\n limit,\n}: ERC20IncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint8', name: 'strategy' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [asset, strategy, reward, limit],\n );\n}\n"],"names":["_ERC20Incentive","DeployableTarget","erc20IncentiveAbi","params","readErc20IncentiveOwner","readErc20IncentiveCurrentReward","readErc20IncentiveClaims","address","readErc20IncentiveClaimed","readErc20IncentiveAsset","readErc20IncentiveStrategy","readErc20IncentiveReward","readErc20IncentiveLimit","i","readErc20IncentiveEntries","payload","request","result","simulateErc20IncentiveClaim","prepareClaimPayload","writeErc20IncentiveClaim","simulateErc20IncentiveClawback","writeErc20IncentiveClawback","readErc20IncentiveIsClaimable","simulateErc20IncentiveDrawRaffle","writeErc20IncentiveDrawRaffle","_payload","_options","options","bytecode","prepareERC20IncentivePayload","zeroHash","ERC20IncentiveBases","RegistryType","ERC20Incentive","asset","strategy","reward","limit","encodeAbiParameters"],"mappings":"0muBA8GaA,EAAN,MAAMA,UAAuBC,EAAAA,gBAGlC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA4B/B,MAAa,MAAMC,EAAwD,CAClE,OAAA,MAAMC,EAAAA,GAAwB,KAAK,QAAS,CACjD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAID,CAAA,CACL,CACH,CAUA,MAAa,cACXA,EACA,CACO,OAAA,MAAME,EAAAA,GAAgC,KAAK,QAAS,CACzD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,OAAOA,EAAyD,CACpE,OAAA,MAAMG,EAAAA,GAAyB,KAAK,QAAS,CAClD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIH,CAAA,CACL,CACH,CAWA,MAAa,QACXI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AA6BiC,EAAa,aAAA,UAtB5D,IAAMC,EAANlC,EAwXA,SAAS8B,EAA6B,CAC3C,MAAAK,EACA,SAAAC,EACA,OAAAC,EACA,MAAAC,CACF,EAA0B,CACjB,OAAAC,EAAA,oBACL,CACE,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,QAAS,KAAM,UAAW,EAClC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,UAAW,KAAM,OAAQ,CACnC,EACA,CAACJ,EAAOC,EAAUC,EAAQC,CAAK,CAAA,CAEnC"}
1
+ {"version":3,"file":"ERC20Incentive.cjs","sources":["../../src/Incentives/ERC20Incentive.ts"],"sourcesContent":["import {\n erc20IncentiveAbi,\n readErc20IncentiveAsset,\n readErc20IncentiveClaimed,\n readErc20IncentiveClaims,\n readErc20IncentiveCurrentReward,\n readErc20IncentiveEntries,\n readErc20IncentiveIsClaimable,\n readErc20IncentiveLimit,\n readErc20IncentiveOwner,\n readErc20IncentiveReward,\n readErc20IncentiveStrategy,\n simulateErc20IncentiveClaim,\n simulateErc20IncentiveClawback,\n simulateErc20IncentiveDrawRaffle,\n writeErc20IncentiveClaim,\n writeErc20IncentiveClawback,\n writeErc20IncentiveDrawRaffle,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20Incentive.sol/ERC20Incentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20Incentive as ERC20IncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n type ClaimPayload,\n type StrategyType,\n prepareClaimPayload,\n} from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20IncentiveAbi };\n\n/**\n * The object representation of a `ERC20Incentive.InitPayload`\n *\n * @export\n * @interface ERC20IncentivePayload\n * @typedef {ERC20IncentivePayload}\n */\nexport interface ERC20IncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n *\n * @type {StrategyType}\n */\n strategy: StrategyType;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * (Optional) The address of the entity that can trigger a raffle.\n * If omitted, the incentive will have no manager with permissions to draw the raffle.\n *\n * @type {Address}\n * @optional\n */\n manager?: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20Incentive` event types.\n *\n * @export\n * @typedef {ERC20IncentiveLog}\n * @template {ContractEventName<typeof erc20IncentiveAbi>} [event=ContractEventName<\n * typeof erc20IncentiveAbi\n * >]\n */\nexport type ERC20IncentiveLog<\n event extends ContractEventName<typeof erc20IncentiveAbi> = ContractEventName<\n typeof erc20IncentiveAbi\n >,\n> = GenericLog<typeof erc20IncentiveAbi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class ERC20Incentive\n * @typedef {ERC20Incentive}\n * @extends {DeployableTarget<ERC20IncentivePayload>}\n */\nexport class ERC20Incentive extends DeployableTarget<\n ERC20IncentivePayload,\n typeof erc20IncentiveAbi\n> {\n public override readonly abi = erc20IncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_ERC20_INCENTIVE_BASE,\n ...(ERC20IncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams<typeof erc20IncentiveAbi, 'owner'>) {\n return await readErc20IncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(\n params?: ReadParams<typeof erc20IncentiveAbi, 'currentReward'>,\n ) {\n return await readErc20IncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams<typeof erc20IncentiveAbi, 'claims'>) {\n return await readErc20IncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(\n address: Address,\n params?: ReadParams<typeof erc20IncentiveAbi, 'claimed'>,\n ) {\n return await readErc20IncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams<typeof erc20IncentiveAbi, 'asset'>) {\n return await readErc20IncentiveAsset(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The strategy for the incentive (MINT or POOL)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<StrategyType>}\n */\n public strategy(\n params?: ReadParams<typeof erc20IncentiveAbi, 'strategy'>,\n ): Promise<StrategyType> {\n return readErc20IncentiveStrategy(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n }) as Promise<StrategyType>;\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams<typeof erc20IncentiveAbi, 'reward'>) {\n return await readErc20IncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max claims, or max entries for raffles)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams<typeof erc20IncentiveAbi, 'limit'>) {\n return await readErc20IncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The set of addresses that have claimed a slot in the incentive raffle, accessed by bigint index.\n *\n * @public\n * @async\n * @param {bigint} i - Index of address\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async entries(\n i: bigint,\n params?: ReadParams<typeof erc20IncentiveAbi, 'entries'>,\n ) {\n return await readErc20IncentiveEntries(this._config, {\n address: this.assertValidAddress(),\n args: [i],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'claim'>,\n ) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'claim'>,\n ) {\n const { request, result } = await simulateErc20IncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'clawback'>,\n ) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'clawback'>,\n ) {\n const { request, result } = await simulateErc20IncentiveClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(\n payload: ClaimPayload,\n params?: ReadParams<typeof erc20IncentiveAbi, 'isClaimable'>,\n ) {\n return await readErc20IncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async drawRaffle(\n params?: WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>,\n ) {\n return await this.awaitResult(this.drawRaffleRaw(params));\n }\n\n /**\n * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async drawRaffleRaw(\n params?: WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>,\n ) {\n const { request, result } = await simulateErc20IncentiveDrawRaffle(\n this._config,\n {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveDrawRaffle(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20IncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20IncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20IncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20IncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Builds the claim data for the ERC20Incentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as ERC20Incentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because ERC20Incentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link ERC20IncentivePayload}, properly encode a `ERC20Incentive.InitPayload` for use with {@link ERC20Incentive} initialization.\n *\n * @param {ERC20IncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @param {Address} [param0.manager=zeroAddress] - The entity that can draw raffles - defaults to unset\n * @returns {Hex}\n */\nexport function prepareERC20IncentivePayload({\n asset,\n strategy,\n reward,\n limit,\n manager = zeroAddress,\n}: ERC20IncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint8', name: 'strategy' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n ],\n [asset, strategy, reward, limit, manager],\n );\n}\n"],"names":["_ERC20Incentive","DeployableTarget","erc20IncentiveAbi","params","readErc20IncentiveOwner","readErc20IncentiveCurrentReward","readErc20IncentiveClaims","address","readErc20IncentiveClaimed","readErc20IncentiveAsset","readErc20IncentiveStrategy","readErc20IncentiveReward","readErc20IncentiveLimit","i","readErc20IncentiveEntries","payload","request","result","simulateErc20IncentiveClaim","prepareClaimPayload","writeErc20IncentiveClaim","simulateErc20IncentiveClawback","writeErc20IncentiveClawback","readErc20IncentiveIsClaimable","simulateErc20IncentiveDrawRaffle","writeErc20IncentiveDrawRaffle","_payload","_options","options","bytecode","prepareERC20IncentivePayload","zeroHash","ERC20IncentiveBases","RegistryType","ERC20Incentive","asset","strategy","reward","limit","manager","zeroAddress","encodeAbiParameters"],"mappings":"0puBAiHaA,EAAN,MAAMA,UAAuBC,EAAAA,gBAGlC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA6B/B,MAAa,MAAMC,EAAwD,CAClE,OAAA,MAAMC,EAAAA,GAAwB,KAAK,QAAS,CACjD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAID,CAAA,CACL,CACH,CAUA,MAAa,cACXA,EACA,CACO,OAAA,MAAME,EAAAA,GAAgC,KAAK,QAAS,CACzD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,OAAOA,EAAyD,CACpE,OAAA,MAAMG,EAAAA,GAAyB,KAAK,QAAS,CAClD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIH,CAAA,CACL,CACH,CAWA,MAAa,QACXI,EACAJ,EACA,CACO,OAAA,MAAMK,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACD,CAAO,EAEd,GAAIJ,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAwD,CAClE,OAAA,MAAMM,EAAAA,GAAwB,KAAK,QAAS,CACjD,QAAS,KAAK,mBAAm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AAE,KAAM,QAAS,KAAM,UAAW,EAClC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,UAAW,KAAM,SAAU,CACrC,EACA,CAACN,EAAOC,EAAUC,EAAQC,EAAOC,CAAO,CAAA,CAE5C"}
@@ -38,11 +38,13 @@ export interface ERC20IncentivePayload {
38
38
  */
39
39
  limit: bigint;
40
40
  /**
41
- * The entity that can `clawback` funds
41
+ * (Optional) The address of the entity that can trigger a raffle.
42
+ * If omitted, the incentive will have no manager with permissions to draw the raffle.
42
43
  *
43
44
  * @type {Address}
45
+ * @optional
44
46
  */
45
- manager: Address;
47
+ manager?: Address;
46
48
  }
47
49
  /**
48
50
  * A generic `viem.Log` event with support for `ERC20Incentive` event types.
@@ -382,6 +384,20 @@ export declare class ERC20Incentive extends DeployableTarget<ERC20IncentivePaylo
382
384
  readonly type: "bytes4";
383
385
  }];
384
386
  readonly stateMutability: "pure";
387
+ }, {
388
+ readonly type: "function";
389
+ readonly inputs: readonly [{
390
+ readonly name: "accounts_";
391
+ readonly internalType: "address[]";
392
+ readonly type: "address[]";
393
+ }, {
394
+ readonly name: "roles_";
395
+ readonly internalType: "uint256[]";
396
+ readonly type: "uint256[]";
397
+ }];
398
+ readonly name: "grantManyRoles";
399
+ readonly outputs: readonly [];
400
+ readonly stateMutability: "nonpayable";
385
401
  }, {
386
402
  readonly type: "function";
387
403
  readonly inputs: readonly [{
@@ -396,20 +412,6 @@ export declare class ERC20Incentive extends DeployableTarget<ERC20IncentivePaylo
396
412
  readonly name: "grantRoles";
397
413
  readonly outputs: readonly [];
398
414
  readonly stateMutability: "payable";
399
- }, {
400
- readonly type: "function";
401
- readonly inputs: readonly [{
402
- readonly name: "accounts_";
403
- readonly internalType: "address[]";
404
- readonly type: "address[]";
405
- }, {
406
- readonly name: "roles_";
407
- readonly internalType: "uint256[]";
408
- readonly type: "uint256[]";
409
- }];
410
- readonly name: "grantRoles";
411
- readonly outputs: readonly [];
412
- readonly stateMutability: "nonpayable";
413
415
  }, {
414
416
  readonly type: "function";
415
417
  readonly inputs: readonly [{
@@ -558,6 +560,20 @@ export declare class ERC20Incentive extends DeployableTarget<ERC20IncentivePaylo
558
560
  readonly name: "requestOwnershipHandover";
559
561
  readonly outputs: readonly [];
560
562
  readonly stateMutability: "payable";
563
+ }, {
564
+ readonly type: "function";
565
+ readonly inputs: readonly [{
566
+ readonly name: "accounts_";
567
+ readonly internalType: "address[]";
568
+ readonly type: "address[]";
569
+ }, {
570
+ readonly name: "roles_";
571
+ readonly internalType: "uint256[]";
572
+ readonly type: "uint256[]";
573
+ }];
574
+ readonly name: "revokeManyRoles";
575
+ readonly outputs: readonly [];
576
+ readonly stateMutability: "nonpayable";
561
577
  }, {
562
578
  readonly type: "function";
563
579
  readonly inputs: readonly [{
@@ -572,20 +588,6 @@ export declare class ERC20Incentive extends DeployableTarget<ERC20IncentivePaylo
572
588
  readonly name: "revokeRoles";
573
589
  readonly outputs: readonly [];
574
590
  readonly stateMutability: "payable";
575
- }, {
576
- readonly type: "function";
577
- readonly inputs: readonly [{
578
- readonly name: "accounts_";
579
- readonly internalType: "address[]";
580
- readonly type: "address[]";
581
- }, {
582
- readonly name: "roles_";
583
- readonly internalType: "uint256[]";
584
- readonly type: "uint256[]";
585
- }];
586
- readonly name: "revokeRoles";
587
- readonly outputs: readonly [];
588
- readonly stateMutability: "nonpayable";
589
591
  }, {
590
592
  readonly type: "function";
591
593
  readonly inputs: readonly [];
@@ -861,7 +863,8 @@ export declare class ERC20Incentive extends DeployableTarget<ERC20IncentivePaylo
861
863
  * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`
862
864
  * @param {bigint} param0.reward - The amount of the asset to distribute.
863
865
  * @param {bigint} param0.limit - How many times can this incentive be claimed.
866
+ * @param {Address} [param0.manager=zeroAddress] - The entity that can draw raffles - defaults to unset
864
867
  * @returns {Hex}
865
868
  */
866
- export declare function prepareERC20IncentivePayload({ asset, strategy, reward, limit, }: ERC20IncentivePayload): `0x${string}`;
869
+ export declare function prepareERC20IncentivePayload({ asset, strategy, reward, limit, manager, }: ERC20IncentivePayload): `0x${string}`;
867
870
  //# sourceMappingURL=ERC20Incentive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ERC20Incentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/ERC20Incentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAiBlB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAIvB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,YAAY,EAElB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,CAC3B,KAAK,SAAS,iBAAiB,CAAC,OAAO,iBAAiB,CAAC,GAAG,iBAAiB,CAC3E,OAAO,iBAAiB,CACzB,IACC,UAAU,CAAC,OAAO,iBAAiB,EAAE,KAAK,CAAC,CAAC;AAEhD;;;;;;;GA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;IAKzD;;;;;;;;OAQG;cACa,QAAQ,CACtB,OAAO,EAAE,YAAY,EACrB,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,iBAAiB,EAAE,OAAO,CAAC;;;;IAgBzD;;;;;;;;OAQG;IACU,QAAQ,CACnB,OAAO,EAAE,YAAY,EACrB,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,iBAAiB,EAAE,UAAU,CAAC;IAK5D;;;;;;;;OAQG;IACU,WAAW,CACtB,OAAO,EAAE,YAAY,EACrB,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,iBAAiB,EAAE,UAAU,CAAC;;;;IAgB5D;;;;;;;;OAQG;IACU,WAAW,CACtB,OAAO,EAAE,YAAY,EACrB,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,iBAAiB,EAAE,aAAa,CAAC;IAU9D;;;;;;;OAOG;IACU,UAAU,CACrB,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,iBAAiB,EAAE,YAAY,CAAC;IAK9D;;;;;;;OAOG;IACU,aAAa,CACxB,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,iBAAiB,EAAE,YAAY,CAAC;;;;IAe9D;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,qBAAqB,EAChC,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;IAa1B;;;;;;OAMG;IACI,cAAc;CAGtB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,KAAK,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,OAAqB,GACtB,EAAE,qBAAqB,iBAWvB"}
@@ -1,10 +1,10 @@
1
- import { y as s, ap as n, aq as o, ar as h, as as l, at as u, au as w, av as y, aw as g, ax as m, ay as p, az as A, aA as v, aB as V, aC as _, aD as R, aE as C } from "../generated-CKt2yCQd.js";
2
- import { zeroHash as P, encodeAbiParameters as q } from "viem";
3
- import { E as x } from "../deployments-oykLv3_Z.js";
4
- import { DeployableTarget as D } from "../Deployable/DeployableTarget.js";
1
+ import { y as s, at as n, au as o, av as h, aw as l, ax as w, ay as u, az as y, aA as g, aB as m, aC as p, aD as A, aE as V, aF as _, aG as R, aH as C, aI as T } from "../generated-CsNyWPKA.js";
2
+ import { zeroHash as v, encodeAbiParameters as x, zeroAddress as D } from "viem";
3
+ import { E as I } from "../deployments-fJsWblwS.js";
4
+ import { DeployableTarget as P } from "../Deployable/DeployableTarget.js";
5
5
  import { prepareClaimPayload as c } from "../claiming.js";
6
- import { RegistryType as T } from "../utils.js";
7
- const k = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015610062575f80fd5b5061007161007660201b60201c565b61010b565b5f6100856100e260201b60201c565b90508054600181161561009f5763f92ee8a95f526004601cfd5b8160c01c808260011c146100dd578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612c8a806101185f395ff3fe608060405260043610610203575f3560e01c806354d1f13d11610117578063c884ef831161009f578063ec87621c1161006e578063ec87621c14610702578063f04e283e1461072c578063f2fde38b14610748578063fe9fbb8014610764578063fee81cf4146107a057610203565b8063c884ef8314610638578063db09da1214610674578063dcc59b6f146106b0578063e6670829146106da57610203565b80638da5cb5b116100e65780638da5cb5b14610542578063a4d66daf1461056c578063a8c62e7614610596578063b30906d4146105c0578063bb1757cf146105fc57610203565b806354d1f13d146104dc578063715018a6146104e657806375b238fc146104f057806380fd60051461051a57610203565b806328d6183b1161019a578063439fab9111610169578063439fab91146103e3578063474f5a441461040b5780634a4ee7b1146104485780634e7165a214610464578063514e62fc146104a057610203565b806328d6183b1461032b5780632de948071461035557806338d52e0f146103915780634359d28a146103bb57610203565b80631cd64df4116101d65780631cd64df4146102a55780632275aea9146102e1578063228cb733146102f7578063256929621461032157610203565b806301ffc9a71461020757806307621eca14610243578063183a4f6e1461026d5780631c10893f14610289575b5f80fd5b348015610212575f80fd5b5061022d60048036038101906102289190611e4d565b6107dc565b60405161023a9190611e92565b60405180910390f35b34801561024e575f80fd5b50610257610855565b6040516102649190611ec3565b60405180910390f35b61028760048036038101906102829190611f06565b61085e565b005b6102a3600480360381019061029e9190611f8b565b61086b565b005b3480156102b0575f80fd5b506102cb60048036038101906102c69190611f8b565b610881565b6040516102d89190611e92565b60405180910390f35b3480156102ec575f80fd5b506102f5610897565b005b348015610302575f80fd5b5061030b610a5f565b6040516103189190611ec3565b60405180910390f35b610329610a65565b005b348015610336575f80fd5b5061033f610ab6565b60405161034c9190611fd8565b60405180910390f35b348015610360575f80fd5b5061037b60048036038101906103769190611ff1565b610add565b6040516103889190611ec3565b60405180910390f35b34801561039c575f80fd5b506103a5610af6565b6040516103b2919061202b565b60405180910390f35b3480156103c6575f80fd5b506103e160048036038101906103dc91906120fa565b610b19565b005b3480156103ee575f80fd5b50610409600480360381019061040491906121cd565b610c27565b005b348015610416575f80fd5b50610431600480360381019061042c91906121cd565b610e63565b60405161043f929190612218565b60405180910390f35b610462600480360381019061045d9190611f8b565b611101565b005b34801561046f575f80fd5b5061048a600480360381019061048591906121cd565b611117565b60405161049791906122af565b60405180910390f35b3480156104ab575f80fd5b506104c660048036038101906104c19190611f8b565b611235565b6040516104d39190611e92565b60405180910390f35b6104e461124c565b005b6104ee611285565b005b3480156104fb575f80fd5b50610504611298565b6040516105119190611ec3565b60405180910390f35b348015610525575f80fd5b50610540600480360381019061053b9190612324565b61129d565b005b34801561054d575f80fd5b50610556611353565b604051610563919061202b565b60405180910390f35b348015610577575f80fd5b5061058061137b565b60405161058d9190611ec3565b60405180910390f35b3480156105a1575f80fd5b506105aa611381565b6040516105b79190612415565b60405180910390f35b3480156105cb575f80fd5b506105e660048036038101906105e19190611f06565b611393565b6040516105f3919061202b565b60405180910390f35b348015610607575f80fd5b50610622600480360381019061061d919061242e565b6113ce565b60405161062f9190611e92565b60405180910390f35b348015610643575f80fd5b5061065e60048036038101906106599190611ff1565b6116bd565b60405161066b9190611e92565b60405180910390f35b34801561067f575f80fd5b5061069a6004803603810190610695919061242e565b6116da565b6040516106a79190611e92565b60405180910390f35b3480156106bb575f80fd5b506106c46116ed565b6040516106d19190611ec3565b60405180910390f35b3480156106e5575f80fd5b5061070060048036038101906106fb9190612324565b6116f3565b005b34801561070d575f80fd5b506107166117a9565b6040516107239190611ec3565b60405180910390f35b61074660048036038101906107419190611ff1565b6117ae565b005b610762600480360381019061075d9190611ff1565b6117ec565b005b34801561076f575f80fd5b5061078a60048036038101906107859190611ff1565b611815565b6040516107979190611e92565b60405180910390f35b3480156107ab575f80fd5b506107c660048036038101906107c19190611ff1565b611868565b6040516107d39190611ec3565b60405180910390f35b5f7f7cc1d5bb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061084e575061084d82611881565b5b9050919050565b5f600254905090565b61086833826118fa565b50565b610873611909565b61087d8282611940565b5050565b5f818261088d85610add565b1614905092915050565b61089f611909565b6001808111156108b2576108b16123a2565b5b60045f9054906101000a900460ff1660018111156108d3576108d26123a2565b5b1461090a576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6040518060200160405280424461092291906124b8565b81525090505f6006808054905061093884611950565b6109429190612518565b8154811061095357610952612548565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506109c9816002545f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661195f9092919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600254604051602001610a37939291906125da565b604051602081830303815290604052604051610a5391906122af565b60405180910390a25050565b60025481565b5f610a6e6119a8565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f7cc1d5bb00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6002610b24816119b2565b828290508585905014610b63576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610c1f575f848483818110610b8457610b83612548565b5b9050602002016020810190610b999190612640565b90506001151581151503610bde57610bd9878784818110610bbd57610bbc612548565b5b9050602002016020810190610bd29190611ff1565b6001611940565b610c11565b610c10878784818110610bf457610bf3612548565b5b9050602002016020810190610c099190611ff1565b60016118fa565b5b508080600101915050610b65565b505050505050565b5f610c306119e7565b90508054600382558015610c625760018160011c14303b10610c595763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610c739190612783565b90505f81604001511480610c8a57505f8160600151145b15610cc1576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600180811115610cd557610cd46123a2565b5b82602001516001811115610cec57610ceb6123a2565b5b03610cfb578160400151610d10565b81606001518260400151610d0f91906127ae565b5b90505f610d3f30845f015173ffffffffffffffffffffffffffffffffffffffff16611a1090919063ffffffff16565b905081811015610d8d57825f015181836040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610d84939291906127ef565b60405180910390fd5b825f01515f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550826020015160045f6101000a81548160ff02191690836001811115610df757610df66123a2565b5b021790555082604001516002819055508260600151600581905550610e1b33611a43565b610e26336001611b19565b5050508015610e5e576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610e7081611b5a565b5f8585810190610e80919061293d565b90505f8160200151806020019051810190610e9b9190612998565b9050600180811115610eb057610eaf6123a2565b5b60045f9054906101000a900460ff166001811115610ed157610ed06123a2565b5b03610f575760025481141580610ee857505f600154115b15610f4b573382604051602001610eff9190612a54565b6040516020818303038152906040526040517f4139d81d000000000000000000000000000000000000000000000000000000008152600401610f42929190612a74565b60405180910390fd5b5f600581905550610fef565b5f60025482610f669190612518565b14610fc9573382604051602001610f7d9190612a54565b6040516020818303038152906040526040517f4139d81d000000000000000000000000000000000000000000000000000000008152600401610fc0929190612a74565b60405180910390fd5b60025481610fd79190612aa2565b60055f828254610fe79190612ad2565b925050819055505b61103c825f0151825f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661195f9092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f0151846040516020016110ae939291906125da565b6040516020818303038152906040526040516110ca91906122af565b60405180910390a2805f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff16945094505050509250929050565b611109611909565b61111382826118fa565b5050565b60605f83838101906111299190612783565b90505f60018081111561113f5761113e6123a2565b5b82602001516001811115611156576111556123a2565b5b0361116557816040015161117a565b8160600151826040015161117991906127ae565b5b905060405180608001604052806001600281111561119b5761119a6123a2565b5b8152602001835f015173ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff1681526020016040518060200160405280848152506040516020016111fa9190612b2e565b60405160208183030381529060405281525060405160200161121c9190612bed565b6040516020818303038152906040529250505092915050565b5f808261124185610add565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61128d611909565b6112965f611b81565b565b600281565b60026112a8816119b2565b8282905085859050146112e7576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561134b5761133e86868381811061130a57611309612548565b5b905060200201602081019061131f9190611ff1565b85858481811061133257611331612548565b5b905060200201356118fa565b80806001019150506112e9565b505050505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60055481565b60045f9054906101000a900460ff1681565b600681815481106113a2575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f6113d7611909565b6113e084611c47565b611416576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6001811115611429576114286123a2565b5b60045f9054906101000a900460ff16600181111561144a576114496123a2565b5b036115a25760015f81548092919061146190612c0d565b9190505550600160035f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550611507846002545f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661195f9092919063ffffffff16565b8373ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686600254604051602001611575939291906125da565b60405160208183030381529060405260405161159191906122af565b60405180910390a2600190506116b6565b60015f8154809291906115b490612c0d565b9190505550600160035f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550600684908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff167ff0abe0f5c6f02112a9a4332e7b091bf49040ffddeedb73785a9b9a0a3ca7f15360405160405180910390a2600190505b9392505050565b6003602052805f5260405f205f915054906101000a900460ff1681565b5f6116e484611c47565b90509392505050565b60015481565b60026116fe816119b2565b82829050858590501461173d576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156117a1576117948686838181106117605761175f612548565b5b90506020020160208101906117759190611ff1565b85858481811061178857611787612548565b5b90506020020135611940565b808060010191505061173f565b505050505050565b600181565b6117b6611909565b63389a75e1600c52805f526020600c2080544211156117dc57636f5e88185f526004601cfd5b5f8155506117e981611b81565b50565b6117f4611909565b8060601b61180957637448fbae5f526004601cfd5b61181281611b81565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff16611835611353565b73ffffffffffffffffffffffffffffffffffffffff1614806118615750611860826002600117611235565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806118f357506118f282611ca9565b5b9050919050565b61190582825f611d22565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754331461193e576382b429005f526004601cfd5b565b61194c82826001611d22565b5050565b5f602082209050808252919050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f5114171661199f576390b8ec185f526004601cfd5b5f603452505050565b5f6202a300905090565b638b78c6d8195433146119e457638b78c6d8600c52335f52806020600c2054166119e3576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b611a4b611d7a565b15611ac3577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415611a8557630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611b16565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b638b78c6d8600c52335f52806020600c205416611b7e576382b429005f526004601cfd5b50565b611b89611d7a565b15611bee577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550611c44565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60035f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16158015611ca25750600554600154105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611d1b5750611d1a82611d7e565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611d4457848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611e2c81611df8565b8114611e36575f80fd5b50565b5f81359050611e4781611e23565b92915050565b5f60208284031215611e6257611e61611df0565b5b5f611e6f84828501611e39565b91505092915050565b5f8115159050919050565b611e8c81611e78565b82525050565b5f602082019050611ea55f830184611e83565b92915050565b5f819050919050565b611ebd81611eab565b82525050565b5f602082019050611ed65f830184611eb4565b92915050565b611ee581611eab565b8114611eef575f80fd5b50565b5f81359050611f0081611edc565b92915050565b5f60208284031215611f1b57611f1a611df0565b5b5f611f2884828501611ef2565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611f5a82611f31565b9050919050565b611f6a81611f50565b8114611f74575f80fd5b50565b5f81359050611f8581611f61565b92915050565b5f8060408385031215611fa157611fa0611df0565b5b5f611fae85828601611f77565b9250506020611fbf85828601611ef2565b9150509250929050565b611fd281611df8565b82525050565b5f602082019050611feb5f830184611fc9565b92915050565b5f6020828403121561200657612005611df0565b5b5f61201384828501611f77565b91505092915050565b61202581611f50565b82525050565b5f60208201905061203e5f83018461201c565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261206557612064612044565b5b8235905067ffffffffffffffff81111561208257612081612048565b5b60208301915083602082028301111561209e5761209d61204c565b5b9250929050565b5f8083601f8401126120ba576120b9612044565b5b8235905067ffffffffffffffff8111156120d7576120d6612048565b5b6020830191508360208202830111156120f3576120f261204c565b5b9250929050565b5f805f806040858703121561211257612111611df0565b5b5f85013567ffffffffffffffff81111561212f5761212e611df4565b5b61213b87828801612050565b9450945050602085013567ffffffffffffffff81111561215e5761215d611df4565b5b61216a878288016120a5565b925092505092959194509250565b5f8083601f84011261218d5761218c612044565b5b8235905067ffffffffffffffff8111156121aa576121a9612048565b5b6020830191508360018202830111156121c6576121c561204c565b5b9250929050565b5f80602083850312156121e3576121e2611df0565b5b5f83013567ffffffffffffffff811115612200576121ff611df4565b5b61220c85828601612178565b92509250509250929050565b5f60408201905061222b5f830185611eb4565b612238602083018461201c565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6122818261223f565b61228b8185612249565b935061229b818560208601612259565b6122a481612267565b840191505092915050565b5f6020820190508181035f8301526122c78184612277565b905092915050565b5f8083601f8401126122e4576122e3612044565b5b8235905067ffffffffffffffff81111561230157612300612048565b5b60208301915083602082028301111561231d5761231c61204c565b5b9250929050565b5f805f806040858703121561233c5761233b611df0565b5b5f85013567ffffffffffffffff81111561235957612358611df4565b5b61236587828801612050565b9450945050602085013567ffffffffffffffff81111561238857612387611df4565b5b612394878288016122cf565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b600281106123e0576123df6123a2565b5b50565b5f8190506123f0826123cf565b919050565b5f6123ff826123e3565b9050919050565b61240f816123f5565b82525050565b5f6020820190506124285f830184612406565b92915050565b5f805f6040848603121561244557612444611df0565b5b5f61245286828701611f77565b935050602084013567ffffffffffffffff81111561247357612472611df4565b5b61247f86828701612178565b92509250509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6124c282611eab565b91506124cd83611eab565b92508282019050808211156124e5576124e461248b565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61252282611eab565b915061252d83611eab565b92508261253d5761253c6124eb565b5b828206905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f8160601b9050919050565b5f61258b82612575565b9050919050565b5f61259c82612581565b9050919050565b6125b46125af82611f50565b612592565b82525050565b5f819050919050565b6125d46125cf82611eab565b6125ba565b82525050565b5f6125e582866125a3565b6014820191506125f582856125a3565b60148201915061260582846125c3565b602082019150819050949350505050565b61261f81611e78565b8114612629575f80fd5b50565b5f8135905061263a81612616565b92915050565b5f6020828403121561265557612654611df0565b5b5f6126628482850161262c565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6126a582612267565b810181811067ffffffffffffffff821117156126c4576126c361266f565b5b80604052505050565b5f6126d6611de7565b90506126e2828261269c565b919050565b5f80fd5b600281106126f7575f80fd5b50565b5f81359050612708816126eb565b92915050565b5f608082840312156127235761272261266b565b5b61272d60806126cd565b90505f61273c84828501611f77565b5f83015250602061274f848285016126fa565b602083015250604061276384828501611ef2565b604083015250606061277784828501611ef2565b60608301525092915050565b5f6080828403121561279857612797611df0565b5b5f6127a58482850161270e565b91505092915050565b5f6127b882611eab565b91506127c383611eab565b92508282026127d181611eab565b915082820484148315176127e8576127e761248b565b5b5092915050565b5f6060820190506128025f83018661201c565b61280f6020830185611eb4565b61281c6040830184611eb4565b949350505050565b5f80fd5b5f67ffffffffffffffff8211156128425761284161266f565b5b61284b82612267565b9050602081019050919050565b828183375f83830152505050565b5f61287861287384612828565b6126cd565b90508281526020810184848401111561289457612893612824565b5b61289f848285612858565b509392505050565b5f82601f8301126128bb576128ba612044565b5b81356128cb848260208601612866565b91505092915050565b5f604082840312156128e9576128e861266b565b5b6128f360406126cd565b90505f61290284828501611f77565b5f83015250602082013567ffffffffffffffff811115612925576129246126e7565b5b612931848285016128a7565b60208301525092915050565b5f6020828403121561295257612951611df0565b5b5f82013567ffffffffffffffff81111561296f5761296e611df4565b5b61297b848285016128d4565b91505092915050565b5f8151905061299281611edc565b92915050565b5f602082840312156129ad576129ac611df0565b5b5f6129ba84828501612984565b91505092915050565b6129cc81611f50565b82525050565b5f82825260208201905092915050565b5f6129ec8261223f565b6129f681856129d2565b9350612a06818560208601612259565b612a0f81612267565b840191505092915050565b5f604083015f830151612a2f5f8601826129c3565b5060208301518482036020860152612a4782826129e2565b9150508091505092915050565b5f6020820190508181035f830152612a6c8184612a1a565b905092915050565b5f604082019050612a875f83018561201c565b8181036020830152612a998184612277565b90509392505050565b5f612aac82611eab565b9150612ab783611eab565b925082612ac757612ac66124eb565b5b828204905092915050565b5f612adc82611eab565b9150612ae783611eab565b9250828203905081811115612aff57612afe61248b565b5b92915050565b612b0e81611eab565b82525050565b602082015f820151612b285f850182612b05565b50505050565b5f602082019050612b415f830184612b14565b92915050565b60038110612b5857612b576123a2565b5b50565b5f819050612b6882612b47565b919050565b5f612b7782612b5b565b9050919050565b612b8781612b6d565b82525050565b5f608083015f830151612ba25f860182612b7e565b506020830151612bb560208601826129c3565b506040830151612bc860408601826129c3565b5060608301518482036060860152612be082826129e2565b9150508091505092915050565b5f6020820190508181035f830152612c058184612b8d565b905092915050565b5f612c1782611eab565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612c4957612c4861248b565b5b60018201905091905056fea26469706673582212208c46c6faf76af1e2a9ff05e0b762a9271735084c117bb819a1b9c34488024f5164736f6c634300081a0033", d = class d extends D {
6
+ import { RegistryType as k } from "../utils.js";
7
+ const q = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550348015610062575f80fd5b5061007161007660201b60201c565b61010b565b5f6100856100e260201b60201c565b90508054600181161561009f5763f92ee8a95f526004601cfd5b8160c01c808260011c146100dd578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b612ca2806101185f395ff3fe608060405260043610610203575f3560e01c806354d1f13d11610117578063c884ef831161009f578063ec87621c1161006e578063ec87621c14610702578063f04e283e1461072c578063f2fde38b14610748578063fe9fbb8014610764578063fee81cf4146107a057610203565b8063c884ef8314610638578063db09da1214610674578063dcc21361146106b0578063dcc59b6f146106d857610203565b8063a4d66daf116100e6578063a4d66daf14610544578063a8c62e761461056e578063b30906d414610598578063bb1757cf146105d4578063be4994f81461061057610203565b806354d1f13d146104dc578063715018a6146104e657806375b238fc146104f05780638da5cb5b1461051a57610203565b806328d6183b1161019a578063439fab9111610169578063439fab91146103e3578063474f5a441461040b5780634a4ee7b1146104485780634e7165a214610464578063514e62fc146104a057610203565b806328d6183b1461032b5780632de948071461035557806338d52e0f146103915780634359d28a146103bb57610203565b80631cd64df4116101d65780631cd64df4146102a55780632275aea9146102e1578063228cb733146102f7578063256929621461032157610203565b806301ffc9a71461020757806307621eca14610243578063183a4f6e1461026d5780631c10893f14610289575b5f80fd5b348015610212575f80fd5b5061022d60048036038101906102289190611e51565b6107dc565b60405161023a9190611e96565b60405180910390f35b34801561024e575f80fd5b50610257610855565b6040516102649190611ec7565b60405180910390f35b61028760048036038101906102829190611f0a565b61085e565b005b6102a3600480360381019061029e9190611f8f565b61086b565b005b3480156102b0575f80fd5b506102cb60048036038101906102c69190611f8f565b610881565b6040516102d89190611e96565b60405180910390f35b3480156102ec575f80fd5b506102f5610897565b005b348015610302575f80fd5b5061030b610a63565b6040516103189190611ec7565b60405180910390f35b610329610a69565b005b348015610336575f80fd5b5061033f610aba565b60405161034c9190611fdc565b60405180910390f35b348015610360575f80fd5b5061037b60048036038101906103769190611ff5565b610ae1565b6040516103889190611ec7565b60405180910390f35b34801561039c575f80fd5b506103a5610afa565b6040516103b2919061202f565b60405180910390f35b3480156103c6575f80fd5b506103e160048036038101906103dc91906120fe565b610b1d565b005b3480156103ee575f80fd5b50610409600480360381019061040491906121d1565b610c2b565b005b348015610416575f80fd5b50610431600480360381019061042c91906121d1565b610e6b565b60405161043f92919061221c565b60405180910390f35b610462600480360381019061045d9190611f8f565b611105565b005b34801561046f575f80fd5b5061048a600480360381019061048591906121d1565b61111b565b60405161049791906122b3565b60405180910390f35b3480156104ab575f80fd5b506104c660048036038101906104c19190611f8f565b611239565b6040516104d39190611e96565b60405180910390f35b6104e4611250565b005b6104ee611289565b005b3480156104fb575f80fd5b5061050461129c565b6040516105119190611ec7565b60405180910390f35b348015610525575f80fd5b5061052e6112a1565b60405161053b919061202f565b60405180910390f35b34801561054f575f80fd5b506105586112c9565b6040516105659190611ec7565b60405180910390f35b348015610579575f80fd5b506105826112cf565b60405161058f9190612346565b60405180910390f35b3480156105a3575f80fd5b506105be60048036038101906105b99190611f0a565b6112e1565b6040516105cb919061202f565b60405180910390f35b3480156105df575f80fd5b506105fa60048036038101906105f5919061235f565b61131c565b6040516106079190611e96565b60405180910390f35b34801561061b575f80fd5b5061063660048036038101906106319190612411565b61160b565b005b348015610643575f80fd5b5061065e60048036038101906106599190611ff5565b6116c1565b60405161066b9190611e96565b60405180910390f35b34801561067f575f80fd5b5061069a6004803603810190610695919061235f565b6116de565b6040516106a79190611e96565b60405180910390f35b3480156106bb575f80fd5b506106d660048036038101906106d19190612411565b6116f1565b005b3480156106e3575f80fd5b506106ec6117a7565b6040516106f99190611ec7565b60405180910390f35b34801561070d575f80fd5b506107166117ad565b6040516107239190611ec7565b60405180910390f35b61074660048036038101906107419190611ff5565b6117b2565b005b610762600480360381019061075d9190611ff5565b6117f0565b005b34801561076f575f80fd5b5061078a60048036038101906107859190611ff5565b611819565b6040516107979190611e96565b60405180910390f35b3480156107ab575f80fd5b506107c660048036038101906107c19190611ff5565b61186c565b6040516107d39190611ec7565b60405180910390f35b5f7f7cc1d5bb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061084e575061084d82611885565b5b9050919050565b5f600254905090565b61086833826118fe565b50565b61087361190d565b61087d8282611944565b5050565b5f818261088d85610ae1565b1614905092915050565b60016108a281611954565b6001808111156108b5576108b46122d3565b5b60045f9054906101000a900460ff1660018111156108d6576108d56122d3565b5b1461090d576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6040518060200160405280424461092591906124bc565b81525090505f6006808054905061093b8461197b565b610945919061251c565b815481106109565761095561254c565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506109cc816002545f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661198a9092919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600254604051602001610a3a939291906125de565b604051602081830303815290604052604051610a5691906122b3565b60405180910390a2505050565b60025481565b5f610a726119d3565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f7cc1d5bb00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6002610b28816119dd565b828290508585905014610b67576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610c23575f848483818110610b8857610b8761254c565b5b9050602002016020810190610b9d9190612644565b90506001151581151503610be257610bdd878784818110610bc157610bc061254c565b5b9050602002016020810190610bd69190611ff5565b6001611944565b610c15565b610c14878784818110610bf857610bf761254c565b5b9050602002016020810190610c0d9190611ff5565b60016118fe565b5b508080600101915050610b69565b505050505050565b5f610c34611a12565b90508054600382558015610c665760018160011c14303b10610c5d5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610c77919061279b565b90505f81604001511480610c8e57505f8160600151145b15610cc5576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600180811115610cd957610cd86122d3565b5b82602001516001811115610cf057610cef6122d3565b5b03610cff578160400151610d14565b81606001518260400151610d1391906127c6565b5b90505f610d4330845f015173ffffffffffffffffffffffffffffffffffffffff16611a3b90919063ffffffff16565b905081811015610d9157825f015181836040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401610d8893929190612807565b60405180910390fd5b825f01515f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550826020015160045f6101000a81548160ff02191690836001811115610dfb57610dfa6122d3565b5b021790555082604001516002819055508260600151600581905550610e1f33611a6e565b610e2e83608001516001611b44565b5050508015610e66576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f80610e7561190d565b5f8484810190610e859190612955565b90505f8160200151806020019051810190610ea091906129b0565b9050600180811115610eb557610eb46122d3565b5b60045f9054906101000a900460ff166001811115610ed657610ed56122d3565b5b03610f5c5760025481141580610eed57505f600154115b15610f50573382604051602001610f049190612a6c565b6040516020818303038152906040526040517f4139d81d000000000000000000000000000000000000000000000000000000008152600401610f47929190612a8c565b60405180910390fd5b5f600581905550610ff4565b5f60025482610f6b919061251c565b14610fce573382604051602001610f829190612a6c565b6040516020818303038152906040526040517f4139d81d000000000000000000000000000000000000000000000000000000008152600401610fc5929190612a8c565b60405180910390fd5b60025481610fdc9190612aba565b60055f828254610fec9190612aea565b925050819055505b611041825f0151825f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661198a9092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f0151846040516020016110b3939291906125de565b6040516020818303038152906040526040516110cf91906122b3565b60405180910390a2805f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff169350935050509250929050565b61110d61190d565b61111782826118fe565b5050565b60605f838381019061112d919061279b565b90505f600180811115611143576111426122d3565b5b8260200151600181111561115a576111596122d3565b5b0361116957816040015161117e565b8160600151826040015161117d91906127c6565b5b905060405180608001604052806001600281111561119f5761119e6122d3565b5b8152602001835f015173ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff1681526020016040518060200160405280848152506040516020016111fe9190612b46565b6040516020818303038152906040528152506040516020016112209190612c05565b6040516020818303038152906040529250505092915050565b5f808261124585610ae1565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61129161190d565b61129a5f611b85565b565b600281565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60055481565b60045f9054906101000a900460ff1681565b600681815481106112f0575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f61132561190d565b61132e84611c4b565b611364576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6001811115611377576113766122d3565b5b60045f9054906101000a900460ff166001811115611398576113976122d3565b5b036114f05760015f8154809291906113af90612c25565b9190505550600160035f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550611455846002545f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661198a9092919063ffffffff16565b8373ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866002546040516020016114c3939291906125de565b6040516020818303038152906040526040516114df91906122b3565b60405180910390a260019050611604565b60015f81548092919061150290612c25565b9190505550600160035f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550600684908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff167ff0abe0f5c6f02112a9a4332e7b091bf49040ffddeedb73785a9b9a0a3ca7f15360405160405180910390a2600190505b9392505050565b6002611616816119dd565b828290508585905014611655576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156116b9576116ac8686838181106116785761167761254c565b5b905060200201602081019061168d9190611ff5565b8585848181106116a05761169f61254c565b5b90506020020135611944565b8080600101915050611657565b505050505050565b6003602052805f5260405f205f915054906101000a900460ff1681565b5f6116e884611c4b565b90509392505050565b60026116fc816119dd565b82829050858590501461173b576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561179f5761179286868381811061175e5761175d61254c565b5b90506020020160208101906117739190611ff5565b8585848181106117865761178561254c565b5b905060200201356118fe565b808060010191505061173d565b505050505050565b60015481565b600181565b6117ba61190d565b63389a75e1600c52805f526020600c2080544211156117e057636f5e88185f526004601cfd5b5f8155506117ed81611b85565b50565b6117f861190d565b8060601b61180d57637448fbae5f526004601cfd5b61181681611b85565b50565b5f8173ffffffffffffffffffffffffffffffffffffffff166118396112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806118655750611864826002600117611239565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806118f757506118f682611cad565b5b9050919050565b61190982825f611d26565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611942576382b429005f526004601cfd5b565b61195082826001611d26565b5050565b638b78c6d8600c52335f52806020600c205416611978576382b429005f526004601cfd5b50565b5f602082209050808252919050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166119ca576390b8ec185f526004601cfd5b5f603452505050565b5f6202a300905090565b638b78c6d819543314611a0f57638b78c6d8600c52335f52806020600c205416611a0e576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b611a76611d7e565b15611aee577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415611ab057630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611b41565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b611b8d611d7e565b15611bf2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550611c48565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60035f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16158015611ca65750600554600154105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611d1f5750611d1e82611d82565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783611d4857848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611e3081611dfc565b8114611e3a575f80fd5b50565b5f81359050611e4b81611e27565b92915050565b5f60208284031215611e6657611e65611df4565b5b5f611e7384828501611e3d565b91505092915050565b5f8115159050919050565b611e9081611e7c565b82525050565b5f602082019050611ea95f830184611e87565b92915050565b5f819050919050565b611ec181611eaf565b82525050565b5f602082019050611eda5f830184611eb8565b92915050565b611ee981611eaf565b8114611ef3575f80fd5b50565b5f81359050611f0481611ee0565b92915050565b5f60208284031215611f1f57611f1e611df4565b5b5f611f2c84828501611ef6565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611f5e82611f35565b9050919050565b611f6e81611f54565b8114611f78575f80fd5b50565b5f81359050611f8981611f65565b92915050565b5f8060408385031215611fa557611fa4611df4565b5b5f611fb285828601611f7b565b9250506020611fc385828601611ef6565b9150509250929050565b611fd681611dfc565b82525050565b5f602082019050611fef5f830184611fcd565b92915050565b5f6020828403121561200a57612009611df4565b5b5f61201784828501611f7b565b91505092915050565b61202981611f54565b82525050565b5f6020820190506120425f830184612020565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261206957612068612048565b5b8235905067ffffffffffffffff8111156120865761208561204c565b5b6020830191508360208202830111156120a2576120a1612050565b5b9250929050565b5f8083601f8401126120be576120bd612048565b5b8235905067ffffffffffffffff8111156120db576120da61204c565b5b6020830191508360208202830111156120f7576120f6612050565b5b9250929050565b5f805f806040858703121561211657612115611df4565b5b5f85013567ffffffffffffffff81111561213357612132611df8565b5b61213f87828801612054565b9450945050602085013567ffffffffffffffff81111561216257612161611df8565b5b61216e878288016120a9565b925092505092959194509250565b5f8083601f84011261219157612190612048565b5b8235905067ffffffffffffffff8111156121ae576121ad61204c565b5b6020830191508360018202830111156121ca576121c9612050565b5b9250929050565b5f80602083850312156121e7576121e6611df4565b5b5f83013567ffffffffffffffff81111561220457612203611df8565b5b6122108582860161217c565b92509250509250929050565b5f60408201905061222f5f830185611eb8565b61223c6020830184612020565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61228582612243565b61228f818561224d565b935061229f81856020860161225d565b6122a88161226b565b840191505092915050565b5f6020820190508181035f8301526122cb818461227b565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110612311576123106122d3565b5b50565b5f81905061232182612300565b919050565b5f61233082612314565b9050919050565b61234081612326565b82525050565b5f6020820190506123595f830184612337565b92915050565b5f805f6040848603121561237657612375611df4565b5b5f61238386828701611f7b565b935050602084013567ffffffffffffffff8111156123a4576123a3611df8565b5b6123b08682870161217c565b92509250509250925092565b5f8083601f8401126123d1576123d0612048565b5b8235905067ffffffffffffffff8111156123ee576123ed61204c565b5b60208301915083602082028301111561240a57612409612050565b5b9250929050565b5f805f806040858703121561242957612428611df4565b5b5f85013567ffffffffffffffff81111561244657612445611df8565b5b61245287828801612054565b9450945050602085013567ffffffffffffffff81111561247557612474611df8565b5b612481878288016123bc565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6124c682611eaf565b91506124d183611eaf565b92508282019050808211156124e9576124e861248f565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61252682611eaf565b915061253183611eaf565b925082612541576125406124ef565b5b828206905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f8160601b9050919050565b5f61258f82612579565b9050919050565b5f6125a082612585565b9050919050565b6125b86125b382611f54565b612596565b82525050565b5f819050919050565b6125d86125d382611eaf565b6125be565b82525050565b5f6125e982866125a7565b6014820191506125f982856125a7565b60148201915061260982846125c7565b602082019150819050949350505050565b61262381611e7c565b811461262d575f80fd5b50565b5f8135905061263e8161261a565b92915050565b5f6020828403121561265957612658611df4565b5b5f61266684828501612630565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6126a98261226b565b810181811067ffffffffffffffff821117156126c8576126c7612673565b5b80604052505050565b5f6126da611deb565b90506126e682826126a0565b919050565b5f80fd5b600281106126fb575f80fd5b50565b5f8135905061270c816126ef565b92915050565b5f60a082840312156127275761272661266f565b5b61273160a06126d1565b90505f61274084828501611f7b565b5f830152506020612753848285016126fe565b602083015250604061276784828501611ef6565b604083015250606061277b84828501611ef6565b606083015250608061278f84828501611f7b565b60808301525092915050565b5f60a082840312156127b0576127af611df4565b5b5f6127bd84828501612712565b91505092915050565b5f6127d082611eaf565b91506127db83611eaf565b92508282026127e981611eaf565b91508282048414831517612800576127ff61248f565b5b5092915050565b5f60608201905061281a5f830186612020565b6128276020830185611eb8565b6128346040830184611eb8565b949350505050565b5f80fd5b5f67ffffffffffffffff82111561285a57612859612673565b5b6128638261226b565b9050602081019050919050565b828183375f83830152505050565b5f61289061288b84612840565b6126d1565b9050828152602081018484840111156128ac576128ab61283c565b5b6128b7848285612870565b509392505050565b5f82601f8301126128d3576128d2612048565b5b81356128e384826020860161287e565b91505092915050565b5f604082840312156129015761290061266f565b5b61290b60406126d1565b90505f61291a84828501611f7b565b5f83015250602082013567ffffffffffffffff81111561293d5761293c6126eb565b5b612949848285016128bf565b60208301525092915050565b5f6020828403121561296a57612969611df4565b5b5f82013567ffffffffffffffff81111561298757612986611df8565b5b612993848285016128ec565b91505092915050565b5f815190506129aa81611ee0565b92915050565b5f602082840312156129c5576129c4611df4565b5b5f6129d28482850161299c565b91505092915050565b6129e481611f54565b82525050565b5f82825260208201905092915050565b5f612a0482612243565b612a0e81856129ea565b9350612a1e81856020860161225d565b612a278161226b565b840191505092915050565b5f604083015f830151612a475f8601826129db565b5060208301518482036020860152612a5f82826129fa565b9150508091505092915050565b5f6020820190508181035f830152612a848184612a32565b905092915050565b5f604082019050612a9f5f830185612020565b8181036020830152612ab1818461227b565b90509392505050565b5f612ac482611eaf565b9150612acf83611eaf565b925082612adf57612ade6124ef565b5b828204905092915050565b5f612af482611eaf565b9150612aff83611eaf565b9250828203905081811115612b1757612b1661248f565b5b92915050565b612b2681611eaf565b82525050565b602082015f820151612b405f850182612b1d565b50505050565b5f602082019050612b595f830184612b2c565b92915050565b60038110612b7057612b6f6122d3565b5b50565b5f819050612b8082612b5f565b919050565b5f612b8f82612b73565b9050919050565b612b9f81612b85565b82525050565b5f608083015f830151612bba5f860182612b96565b506020830151612bcd60208601826129db565b506040830151612be060408601826129db565b5060608301518482036060860152612bf882826129fa565b9150508091505092915050565b5f6020820190508181035f830152612c1d8184612ba5565b905092915050565b5f612c2f82611eaf565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612c6157612c6061248f565b5b60018201905091905056fea2646970667358221220b4c1fa481dabe5a71ce658ff946e8493da9177a42da213f5ea0798d3963cfb3064736f6c634300081a0033", e = class e extends P {
8
8
  constructor() {
9
9
  super(...arguments), this.abi = s;
10
10
  }
@@ -82,7 +82,7 @@ const k = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
82
82
  * @returns {Promise<Address>}
83
83
  */
84
84
  async asset(f) {
85
- return await u(this._config, {
85
+ return await w(this._config, {
86
86
  address: this.assertValidAddress(),
87
87
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
88
88
  ...f
@@ -97,7 +97,7 @@ const k = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
97
97
  * @returns {Promise<StrategyType>}
98
98
  */
99
99
  strategy(f) {
100
- return w(this._config, {
100
+ return u(this._config, {
101
101
  address: this.assertValidAddress(),
102
102
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
103
103
  ...f
@@ -172,7 +172,7 @@ const k = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
172
172
  * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed
173
173
  */
174
174
  async claimRaw(f, b) {
175
- const { request: a, result: e } = await p(
175
+ const { request: a, result: d } = await p(
176
176
  this._config,
177
177
  {
178
178
  address: this.assertValidAddress(),
@@ -182,7 +182,7 @@ const k = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
182
182
  ...b
183
183
  }
184
184
  );
185
- return { hash: await A(this._config, a), result: e };
185
+ return { hash: await A(this._config, a), result: d };
186
186
  }
187
187
  /**
188
188
  * Clawback assets from the incentive
@@ -206,7 +206,7 @@ const k = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
206
206
  * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
207
207
  */
208
208
  async clawbackRaw(f, b) {
209
- const { request: a, result: e } = await v(
209
+ const { request: a, result: d } = await V(
210
210
  this._config,
211
211
  {
212
212
  address: this.assertValidAddress(),
@@ -216,7 +216,7 @@ const k = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
216
216
  ...b
217
217
  }
218
218
  );
219
- return { hash: await V(this._config, a), result: e };
219
+ return { hash: await _(this._config, a), result: d };
220
220
  }
221
221
  /**
222
222
  * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.
@@ -228,7 +228,7 @@ const k = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
228
228
  * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
229
229
  */
230
230
  async isClaimable(f, b) {
231
- return await _(this._config, {
231
+ return await R(this._config, {
232
232
  address: this.assertValidAddress(),
233
233
  args: [c(f)],
234
234
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -255,7 +255,7 @@ const k = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
255
255
  * @returns {Promise<{ hash: `0x${string}`; result: void; }>}
256
256
  */
257
257
  async drawRaffleRaw(f) {
258
- const { request: b, result: a } = await R(
258
+ const { request: b, result: a } = await C(
259
259
  this._config,
260
260
  {
261
261
  address: this.assertValidAddress(),
@@ -264,7 +264,7 @@ const k = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
264
264
  ...f
265
265
  }
266
266
  );
267
- return { hash: await C(this._config, b), result: a };
267
+ return { hash: await T(this._config, b), result: a };
268
268
  }
269
269
  /**
270
270
  * @inheritdoc
@@ -275,15 +275,15 @@ const k = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
275
275
  * @returns {GenericDeployableParams}
276
276
  */
277
277
  buildParameters(f, b) {
278
- const [a, e] = this.validateDeploymentConfig(
278
+ const [a, d] = this.validateDeploymentConfig(
279
279
  f,
280
280
  b
281
281
  );
282
282
  return {
283
283
  abi: s,
284
- bytecode: k,
284
+ bytecode: q,
285
285
  args: [z(a)],
286
- ...this.optionallyAttachAccount(e.account)
286
+ ...this.optionallyAttachAccount(d.account)
287
287
  };
288
288
  }
289
289
  /**
@@ -294,27 +294,30 @@ const k = "0x608060405273deaddeaddeaddeaddeaddeaddeaddeaddeaddead5f806101000a815
294
294
  * @description This function returns `zeroHash` because ERC20Incentive doesn't use any specific claim data.
295
295
  */
296
296
  buildClaimData() {
297
- return P;
297
+ return v;
298
298
  }
299
299
  };
300
- d.bases = {
301
- ...x
302
- }, d.registryType = T.INCENTIVE;
303
- let t = d;
300
+ e.bases = {
301
+ 31337: void 0,
302
+ ...I
303
+ }, e.registryType = k.INCENTIVE;
304
+ let t = e;
304
305
  function z({
305
306
  asset: r,
306
307
  strategy: f,
307
308
  reward: b,
308
- limit: a
309
+ limit: a,
310
+ manager: d = D
309
311
  }) {
310
- return q(
312
+ return x(
311
313
  [
312
314
  { type: "address", name: "asset" },
313
315
  { type: "uint8", name: "strategy" },
314
316
  { type: "uint256", name: "reward" },
315
- { type: "uint256", name: "limit" }
317
+ { type: "uint256", name: "limit" },
318
+ { type: "address", name: "manager" }
316
319
  ],
317
- [r, f, b, a]
320
+ [r, f, b, a, d]
318
321
  );
319
322
  }
320
323
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"ERC20Incentive.js","sources":["../../src/Incentives/ERC20Incentive.ts"],"sourcesContent":["import {\n erc20IncentiveAbi,\n readErc20IncentiveAsset,\n readErc20IncentiveClaimed,\n readErc20IncentiveClaims,\n readErc20IncentiveCurrentReward,\n readErc20IncentiveEntries,\n readErc20IncentiveIsClaimable,\n readErc20IncentiveLimit,\n readErc20IncentiveOwner,\n readErc20IncentiveReward,\n readErc20IncentiveStrategy,\n simulateErc20IncentiveClaim,\n simulateErc20IncentiveClawback,\n simulateErc20IncentiveDrawRaffle,\n writeErc20IncentiveClaim,\n writeErc20IncentiveClawback,\n writeErc20IncentiveDrawRaffle,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20Incentive.sol/ERC20Incentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroHash,\n} from 'viem';\nimport { ERC20Incentive as ERC20IncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n type ClaimPayload,\n type StrategyType,\n prepareClaimPayload,\n} from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20IncentiveAbi };\n\n/**\n * The object representation of a `ERC20Incentive.InitPayload`\n *\n * @export\n * @interface ERC20IncentivePayload\n * @typedef {ERC20IncentivePayload}\n */\nexport interface ERC20IncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n *\n * @type {StrategyType}\n */\n strategy: StrategyType;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The entity that can `clawback` funds\n *\n * @type {Address}\n */\n manager: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20Incentive` event types.\n *\n * @export\n * @typedef {ERC20IncentiveLog}\n * @template {ContractEventName<typeof erc20IncentiveAbi>} [event=ContractEventName<\n * typeof erc20IncentiveAbi\n * >]\n */\nexport type ERC20IncentiveLog<\n event extends ContractEventName<typeof erc20IncentiveAbi> = ContractEventName<\n typeof erc20IncentiveAbi\n >,\n> = GenericLog<typeof erc20IncentiveAbi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class ERC20Incentive\n * @typedef {ERC20Incentive}\n * @extends {DeployableTarget<ERC20IncentivePayload>}\n */\nexport class ERC20Incentive extends DeployableTarget<\n ERC20IncentivePayload,\n typeof erc20IncentiveAbi\n> {\n public override readonly abi = erc20IncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n ...(ERC20IncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams<typeof erc20IncentiveAbi, 'owner'>) {\n return await readErc20IncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(\n params?: ReadParams<typeof erc20IncentiveAbi, 'currentReward'>,\n ) {\n return await readErc20IncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams<typeof erc20IncentiveAbi, 'claims'>) {\n return await readErc20IncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(\n address: Address,\n params?: ReadParams<typeof erc20IncentiveAbi, 'claimed'>,\n ) {\n return await readErc20IncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams<typeof erc20IncentiveAbi, 'asset'>) {\n return await readErc20IncentiveAsset(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The strategy for the incentive (MINT or POOL)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<StrategyType>}\n */\n public strategy(\n params?: ReadParams<typeof erc20IncentiveAbi, 'strategy'>,\n ): Promise<StrategyType> {\n return readErc20IncentiveStrategy(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n }) as Promise<StrategyType>;\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams<typeof erc20IncentiveAbi, 'reward'>) {\n return await readErc20IncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max claims, or max entries for raffles)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams<typeof erc20IncentiveAbi, 'limit'>) {\n return await readErc20IncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The set of addresses that have claimed a slot in the incentive raffle, accessed by bigint index.\n *\n * @public\n * @async\n * @param {bigint} i - Index of address\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async entries(\n i: bigint,\n params?: ReadParams<typeof erc20IncentiveAbi, 'entries'>,\n ) {\n return await readErc20IncentiveEntries(this._config, {\n address: this.assertValidAddress(),\n args: [i],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'claim'>,\n ) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'claim'>,\n ) {\n const { request, result } = await simulateErc20IncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'clawback'>,\n ) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'clawback'>,\n ) {\n const { request, result } = await simulateErc20IncentiveClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(\n payload: ClaimPayload,\n params?: ReadParams<typeof erc20IncentiveAbi, 'isClaimable'>,\n ) {\n return await readErc20IncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async drawRaffle(\n params?: WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>,\n ) {\n return await this.awaitResult(this.drawRaffleRaw(params));\n }\n\n /**\n * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async drawRaffleRaw(\n params?: WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>,\n ) {\n const { request, result } = await simulateErc20IncentiveDrawRaffle(\n this._config,\n {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveDrawRaffle(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20IncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20IncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20IncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20IncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Builds the claim data for the ERC20Incentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as ERC20Incentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because ERC20Incentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link ERC20IncentivePayload}, properly encode a `ERC20Incentive.InitPayload` for use with {@link ERC20Incentive} initialization.\n *\n * @param {ERC20IncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @returns {Hex}\n */\nexport function prepareERC20IncentivePayload({\n asset,\n strategy,\n reward,\n limit,\n}: ERC20IncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint8', name: 'strategy' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [asset, strategy, reward, limit],\n );\n}\n"],"names":["_ERC20Incentive","DeployableTarget","erc20IncentiveAbi","params","readErc20IncentiveOwner","readErc20IncentiveCurrentReward","readErc20IncentiveClaims","address","readErc20IncentiveClaimed","readErc20IncentiveAsset","readErc20IncentiveStrategy","readErc20IncentiveReward","readErc20IncentiveLimit","i","readErc20IncentiveEntries","payload","request","result","simulateErc20IncentiveClaim","prepareClaimPayload","writeErc20IncentiveClaim","simulateErc20IncentiveClawback","writeErc20IncentiveClawback","readErc20IncentiveIsClaimable","simulateErc20IncentiveDrawRaffle","writeErc20IncentiveDrawRaffle","_payload","_options","options","bytecode","prepareERC20IncentivePayload","zeroHash","ERC20IncentiveBases","RegistryType","ERC20Incentive","asset","strategy","reward","limit","encodeAbiParameters"],"mappings":";;;;;;o1tBA8GaA,IAAN,MAAMA,UAAuBC,EAGlC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4B/B,MAAa,MAAMC,GAAwD;AAClE,WAAA,MAAMC,EAAwB,KAAK,SAAS;AAAA,MACjD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,cACXA,GACA;AACO,WAAA,MAAME,EAAgC,KAAK,SAAS;AAAA,MACzD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIF;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,OAAOA,GAAyD;AACpE,WAAA,MAAMG,EAAyB,KAA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AA;AAAA;AAAA,EASO,iBAAiB;AACf,WAAAG;AAAA,EACT;AACF;AAhWE/B,EAAuB,QAAiC;AAAA,EACtD,GAAIgC;AAAA,GASNhC,EAAuB,eAA6BiC,EAAa;AAtB5D,IAAMC,IAANlC;AAwXA,SAAS8B,EAA6B;AAAA,EAC3C,OAAAK;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AACF,GAA0B;AACjB,SAAAC;AAAA,IACL;AAAA,MACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,SAAS,MAAM,WAAW;AAAA,MAClC,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,MAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,IACnC;AAAA,IACA,CAACJ,GAAOC,GAAUC,GAAQC,CAAK;AAAA,EAAA;AAEnC;"}
1
+ {"version":3,"file":"ERC20Incentive.js","sources":["../../src/Incentives/ERC20Incentive.ts"],"sourcesContent":["import {\n erc20IncentiveAbi,\n readErc20IncentiveAsset,\n readErc20IncentiveClaimed,\n readErc20IncentiveClaims,\n readErc20IncentiveCurrentReward,\n readErc20IncentiveEntries,\n readErc20IncentiveIsClaimable,\n readErc20IncentiveLimit,\n readErc20IncentiveOwner,\n readErc20IncentiveReward,\n readErc20IncentiveStrategy,\n simulateErc20IncentiveClaim,\n simulateErc20IncentiveClawback,\n simulateErc20IncentiveDrawRaffle,\n writeErc20IncentiveClaim,\n writeErc20IncentiveClawback,\n writeErc20IncentiveDrawRaffle,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20Incentive.sol/ERC20Incentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20Incentive as ERC20IncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n type ClaimPayload,\n type StrategyType,\n prepareClaimPayload,\n} from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20IncentiveAbi };\n\n/**\n * The object representation of a `ERC20Incentive.InitPayload`\n *\n * @export\n * @interface ERC20IncentivePayload\n * @typedef {ERC20IncentivePayload}\n */\nexport interface ERC20IncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n *\n * @type {StrategyType}\n */\n strategy: StrategyType;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * How many times can this incentive be claimed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * (Optional) The address of the entity that can trigger a raffle.\n * If omitted, the incentive will have no manager with permissions to draw the raffle.\n *\n * @type {Address}\n * @optional\n */\n manager?: Address;\n}\n\n/**\n * A generic `viem.Log` event with support for `ERC20Incentive` event types.\n *\n * @export\n * @typedef {ERC20IncentiveLog}\n * @template {ContractEventName<typeof erc20IncentiveAbi>} [event=ContractEventName<\n * typeof erc20IncentiveAbi\n * >]\n */\nexport type ERC20IncentiveLog<\n event extends ContractEventName<typeof erc20IncentiveAbi> = ContractEventName<\n typeof erc20IncentiveAbi\n >,\n> = GenericLog<typeof erc20IncentiveAbi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class ERC20Incentive\n * @typedef {ERC20Incentive}\n * @extends {DeployableTarget<ERC20IncentivePayload>}\n */\nexport class ERC20Incentive extends DeployableTarget<\n ERC20IncentivePayload,\n typeof erc20IncentiveAbi\n> {\n public override readonly abi = erc20IncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_ERC20_INCENTIVE_BASE,\n ...(ERC20IncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams<typeof erc20IncentiveAbi, 'owner'>) {\n return await readErc20IncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(\n params?: ReadParams<typeof erc20IncentiveAbi, 'currentReward'>,\n ) {\n return await readErc20IncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams<typeof erc20IncentiveAbi, 'claims'>) {\n return await readErc20IncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(\n address: Address,\n params?: ReadParams<typeof erc20IncentiveAbi, 'claimed'>,\n ) {\n return await readErc20IncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams<typeof erc20IncentiveAbi, 'asset'>) {\n return await readErc20IncentiveAsset(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The strategy for the incentive (MINT or POOL)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<StrategyType>}\n */\n public strategy(\n params?: ReadParams<typeof erc20IncentiveAbi, 'strategy'>,\n ): Promise<StrategyType> {\n return readErc20IncentiveStrategy(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n }) as Promise<StrategyType>;\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams<typeof erc20IncentiveAbi, 'reward'>) {\n return await readErc20IncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max claims, or max entries for raffles)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams<typeof erc20IncentiveAbi, 'limit'>) {\n return await readErc20IncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The set of addresses that have claimed a slot in the incentive raffle, accessed by bigint index.\n *\n * @public\n * @async\n * @param {bigint} i - Index of address\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async entries(\n i: bigint,\n params?: ReadParams<typeof erc20IncentiveAbi, 'entries'>,\n ) {\n return await readErc20IncentiveEntries(this._config, {\n address: this.assertValidAddress(),\n args: [i],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'claim'>,\n ) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'claim'>,\n ) {\n const { request, result } = await simulateErc20IncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'clawback'>,\n ) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(\n payload: ClaimPayload,\n params?: WriteParams<typeof erc20IncentiveAbi, 'clawback'>,\n ) {\n const { request, result } = await simulateErc20IncentiveClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(\n payload: ClaimPayload,\n params?: ReadParams<typeof erc20IncentiveAbi, 'isClaimable'>,\n ) {\n return await readErc20IncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async drawRaffle(\n params?: WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>,\n ) {\n return await this.awaitResult(this.drawRaffleRaw(params));\n }\n\n /**\n * Draw a winner from the raffle. Only callable by owner. Only valid when the strategy is set to `Strategy.RAFFLE`\n *\n * @public\n * @async\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async drawRaffleRaw(\n params?: WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>,\n ) {\n const { request, result } = await simulateErc20IncentiveDrawRaffle(\n this._config,\n {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20IncentiveDrawRaffle(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20IncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20IncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20IncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareERC20IncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Builds the claim data for the ERC20Incentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as ERC20Incentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because ERC20Incentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link ERC20IncentivePayload}, properly encode a `ERC20Incentive.InitPayload` for use with {@link ERC20Incentive} initialization.\n *\n * @param {ERC20IncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @param {Address} [param0.manager=zeroAddress] - The entity that can draw raffles - defaults to unset\n * @returns {Hex}\n */\nexport function prepareERC20IncentivePayload({\n asset,\n strategy,\n reward,\n limit,\n manager = zeroAddress,\n}: ERC20IncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint8', name: 'strategy' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n ],\n [asset, strategy, reward, limit, manager],\n );\n}\n"],"names":["_ERC20Incentive","DeployableTarget","erc20IncentiveAbi","params","readErc20IncentiveOwner","readErc20IncentiveCurrentReward","readErc20IncentiveClaims","address","readErc20IncentiveClaimed","readErc20IncentiveAsset","readErc20IncentiveStrategy","readErc20IncentiveReward","readErc20IncentiveLimit","i","readErc20IncentiveEntries","payload","request","result","simulateErc20IncentiveClaim","prepareClaimPayload","writeErc20IncentiveClaim","simulateErc20IncentiveClawback","writeErc20IncentiveClawback","readErc20IncentiveIsClaimable","simulateErc20IncentiveDrawRaffle","writeErc20IncentiveDrawRaffle","_payload","_options","options","bytecode","prepareERC20IncentivePayload","zeroHash","ERC20IncentiveBases","RegistryType","ERC20Incentive","asset","strategy","reward","limit","manager","zeroAddress","encodeAbiParameters"],"mappings":";;;;;;o4tBAiHaA,IAAN,MAAMA,UAAuBC,EAGlC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,MAAMC,GAAwD;AAClE,WAAA,MAAMC,EAAwB,KAAK,SAAS;AAAA,MACjD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,cACXA,GACA;AACO,WAAA,MAAME,EAAgC,KAAK,SAAS;AAAA,MACzD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIF;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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