@boostxyz/sdk 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/Actions/Action.cjs +1 -1
  2. package/dist/Actions/Action.cjs.map +1 -1
  3. package/dist/Actions/Action.d.ts +2 -1
  4. package/dist/Actions/Action.d.ts.map +1 -1
  5. package/dist/Actions/Action.js +14 -13
  6. package/dist/Actions/Action.js.map +1 -1
  7. package/dist/Actions/EventAction.cjs +1 -1
  8. package/dist/Actions/EventAction.cjs.map +1 -1
  9. package/dist/Actions/EventAction.d.ts.map +1 -1
  10. package/dist/Actions/EventAction.js +33 -33
  11. package/dist/Actions/EventAction.js.map +1 -1
  12. package/dist/AllowLists/AllowList.cjs +1 -1
  13. package/dist/AllowLists/AllowList.cjs.map +1 -1
  14. package/dist/AllowLists/AllowList.d.ts +2 -1
  15. package/dist/AllowLists/AllowList.d.ts.map +1 -1
  16. package/dist/AllowLists/AllowList.js +19 -18
  17. package/dist/AllowLists/AllowList.js.map +1 -1
  18. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  19. package/dist/AllowLists/SimpleAllowList.js +7 -7
  20. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  21. package/dist/AllowLists/SimpleDenyList.js +3 -3
  22. package/dist/Auth/PassthroughAuth.cjs +1 -1
  23. package/dist/Auth/PassthroughAuth.js +1 -1
  24. package/dist/BoostCore.cjs +2 -2
  25. package/dist/BoostCore.cjs.map +1 -1
  26. package/dist/BoostCore.d.ts +13 -4
  27. package/dist/BoostCore.d.ts.map +1 -1
  28. package/dist/BoostCore.js +58 -57
  29. package/dist/BoostCore.js.map +1 -1
  30. package/dist/BoostRegistry.cjs +1 -1
  31. package/dist/BoostRegistry.js +11 -11
  32. package/dist/{Budget-DpQgIZEx.js → Budget-B0q1S08L.js} +33 -32
  33. package/dist/{Budget-DpQgIZEx.js.map → Budget-B0q1S08L.js.map} +1 -1
  34. package/dist/{Budget-BxQMnsdx.cjs → Budget-BA_1sa1e.cjs} +2 -2
  35. package/dist/{Budget-BxQMnsdx.cjs.map → Budget-BA_1sa1e.cjs.map} +1 -1
  36. package/dist/Budgets/Budget.cjs +1 -1
  37. package/dist/Budgets/Budget.d.ts +2 -1
  38. package/dist/Budgets/Budget.d.ts.map +1 -1
  39. package/dist/Budgets/Budget.js +2 -2
  40. package/dist/Budgets/ManagedBudget.cjs +1 -1
  41. package/dist/Budgets/ManagedBudget.js +11 -11
  42. package/dist/Deployable/DeployableTarget.cjs +1 -1
  43. package/dist/Deployable/DeployableTarget.js +1 -1
  44. package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
  45. package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -1
  46. package/dist/Deployable/DeployableTargetWithRBAC.d.ts +158 -0
  47. package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -1
  48. package/dist/Deployable/DeployableTargetWithRBAC.js +268 -31
  49. package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -1
  50. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  51. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  52. package/dist/Incentives/AllowListIncentive.js +27 -27
  53. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  54. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  55. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  56. package/dist/Incentives/CGDAIncentive.js +9 -9
  57. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  58. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  59. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  60. package/dist/Incentives/ERC20Incentive.js +30 -30
  61. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  62. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
  63. package/dist/Incentives/ERC20VariableCriteriaIncentive.js +11 -11
  64. package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
  65. package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
  66. package/dist/Incentives/ERC20VariableIncentive.js +12 -12
  67. package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
  68. package/dist/Incentives/Incentive.cjs +1 -1
  69. package/dist/Incentives/Incentive.cjs.map +1 -1
  70. package/dist/Incentives/Incentive.d.ts +2 -1
  71. package/dist/Incentives/Incentive.d.ts.map +1 -1
  72. package/dist/Incentives/Incentive.js +29 -28
  73. package/dist/Incentives/Incentive.js.map +1 -1
  74. package/dist/Incentives/PointsIncentive.cjs +1 -1
  75. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  76. package/dist/Incentives/PointsIncentive.js +25 -25
  77. package/dist/Incentives/PointsIncentive.js.map +1 -1
  78. package/dist/{SimpleDenyList-CA24drhL.cjs → SimpleDenyList-DrQrJ14i.cjs} +2 -2
  79. package/dist/{SimpleDenyList-CA24drhL.cjs.map → SimpleDenyList-DrQrJ14i.cjs.map} +1 -1
  80. package/dist/{SimpleDenyList-UHgnaOb_.js → SimpleDenyList-DuCoaOlG.js} +9 -9
  81. package/dist/{SimpleDenyList-UHgnaOb_.js.map → SimpleDenyList-DuCoaOlG.js.map} +1 -1
  82. package/dist/Validators/LimitedSignerValidator.cjs +1 -1
  83. package/dist/Validators/LimitedSignerValidator.js +7 -7
  84. package/dist/Validators/SignerValidator.cjs +1 -1
  85. package/dist/Validators/SignerValidator.js +5 -5
  86. package/dist/Validators/Validator.cjs +1 -1
  87. package/dist/Validators/Validator.cjs.map +1 -1
  88. package/dist/Validators/Validator.d.ts +2 -1
  89. package/dist/Validators/Validator.d.ts.map +1 -1
  90. package/dist/Validators/Validator.js +22 -21
  91. package/dist/Validators/Validator.js.map +1 -1
  92. package/dist/deployments-BucJ-gwk.cjs +2 -0
  93. package/dist/deployments-BucJ-gwk.cjs.map +1 -0
  94. package/dist/deployments-CQu0bLhU.js +102 -0
  95. package/dist/deployments-CQu0bLhU.js.map +1 -0
  96. package/dist/deployments.json +77 -74
  97. package/dist/{generated-B0XfMfoq.js → generated-1ZT_mHJx.js} +673 -450
  98. package/dist/generated-1ZT_mHJx.js.map +1 -0
  99. package/dist/generated-CgBgbMNe.cjs +3 -0
  100. package/dist/generated-CgBgbMNe.cjs.map +1 -0
  101. package/dist/index.cjs +1 -1
  102. package/dist/index.js +3 -3
  103. package/package.json +2 -2
  104. package/src/Actions/Action.ts +3 -0
  105. package/src/Actions/EventAction.test.ts +49 -2
  106. package/src/Actions/EventAction.ts +12 -4
  107. package/src/AllowLists/AllowList.ts +3 -0
  108. package/src/BoostCore.ts +16 -11
  109. package/src/Budgets/Budget.ts +3 -0
  110. package/src/Deployable/DeployableTargetWithRBAC.test.ts +175 -0
  111. package/src/Deployable/DeployableTargetWithRBAC.ts +281 -0
  112. package/src/Incentives/AllowListIncentive.test.ts +48 -0
  113. package/src/Incentives/AllowListIncentive.ts +1 -1
  114. package/src/Incentives/CGDAIncentive.test.ts +50 -0
  115. package/src/Incentives/CGDAIncentive.ts +1 -1
  116. package/src/Incentives/ERC1155Incentive.ts +1 -1
  117. package/src/Incentives/ERC20Incentive.test.ts +49 -0
  118. package/src/Incentives/ERC20Incentive.ts +1 -1
  119. package/src/Incentives/ERC20VariableIncentive.test.ts +48 -0
  120. package/src/Incentives/ERC20VariableIncentive.ts +1 -1
  121. package/src/Incentives/Incentive.ts +3 -0
  122. package/src/Incentives/PointsIncentive.test.ts +51 -0
  123. package/src/Incentives/PointsIncentive.ts +1 -1
  124. package/src/Validators/Validator.ts +3 -0
  125. package/dist/deployments-BDumesUK.cjs +0 -2
  126. package/dist/deployments-BDumesUK.cjs.map +0 -1
  127. package/dist/deployments-DvYsMioW.js +0 -99
  128. package/dist/deployments-DvYsMioW.js.map +0 -1
  129. package/dist/generated-B0XfMfoq.js.map +0 -1
  130. package/dist/generated-pNKCp_Ez.cjs +0 -3
  131. package/dist/generated-pNKCp_Ez.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ERC20VariableIncentive.js","sources":["../../src/Incentives/ERC20VariableIncentive.ts"],"sourcesContent":["import {\n erc20VariableIncentiveAbi,\n readErc20VariableIncentiveAsset,\n readErc20VariableIncentiveClaimed,\n readErc20VariableIncentiveClaims,\n readErc20VariableIncentiveCurrentReward,\n readErc20VariableIncentiveIsClaimable,\n readErc20VariableIncentiveLimit,\n readErc20VariableIncentiveOwner,\n readErc20VariableIncentiveReward,\n readErc20VariableIncentiveTotalClaimed,\n simulateErc20VariableIncentiveClaim,\n simulateErc20VariableIncentiveClawback,\n writeErc20VariableIncentiveClaim,\n writeErc20VariableIncentiveClawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20VariableIncentive.sol/ERC20VariableIncentive.json';\nimport {\n type Abi,\n type Address,\n type ContractEventName,\n type Hex,\n decodeAbiParameters,\n encodeAbiParameters,\n} from 'viem';\nimport { ERC20VariableIncentive as ERC20VariableIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20VariableIncentiveAbi };\n/**\n * The object representation of a `ERC20VariableIncentivePayload.InitPayload`\n *\n * @export\n * @interface ERC20VariableIncentivePayload\n * @typedef {ERC20VariableIncentivePayload}\n */\nexport interface ERC20VariableIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The reward multiplier. If 0, the signed amount from the claim payload is used directly. Variable amount (in ETH decimal format) will by multiplied by this value.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The total spending limit of the asset that will be distributed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The 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 `ERC20VariableIncentive` event types.\n *\n * @export\n * @typedef {ERC20VariableIncentiveLog}\n * @template {ContractEventName<typeof erc20VariableIncentiveAbi>} [event=ContractEventName<\n * typeof erc20VariableIncentiveAbi\n * >]\n */\nexport type ERC20VariableIncentiveLog<\n event extends ContractEventName<\n typeof erc20VariableIncentiveAbi\n > = ContractEventName<typeof erc20VariableIncentiveAbi>,\n> = GenericLog<typeof erc20VariableIncentiveAbi, event>;\n\n/**\n * A modified ERC20 incentive implementation that allows claiming of variable token amounts with a spending limit\n *\n * @export\n * @class ERC20VariableIncentive\n * @typedef {ERC20VariableIncentive}\n * @template [Payload=ERC20VariableIncentivePayload | undefined]\n * @template {Abi} [ABI=typeof erc20VariableIncentiveAbi]\n * @extends {DeployableTarget<ERC20VariableIncentivePayload, ABI>}\n */\nexport class ERC20VariableIncentive<\n Payload = ERC20VariableIncentivePayload | undefined,\n ABI extends Abi = typeof erc20VariableIncentiveAbi,\n> extends DeployableTarget<Payload, ABI> {\n //@ts-expect-error it is instantiated correctly\n public override readonly abi = erc20VariableIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_ERC20_VARIABLE_INCENTIVE_BASE,\n ...(ERC20VariableIncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams) {\n return await readErc20VariableIncentiveOwner(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 total amount of rewards claimed\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalClaimed(params?: ReadParams) {\n return await readErc20VariableIncentiveTotalClaimed(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 current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20VariableIncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readErc20VariableIncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readErc20VariableIncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20VariableIncentiveAsset(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 reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20VariableIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max claims, or max entries for raffles)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20VariableIncentiveLimit(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 * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20VariableIncentiveClaim(\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 writeErc20VariableIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20VariableIncentiveClawback(\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 writeErc20VariableIncentiveClawback(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readErc20VariableIncentiveIsClaimable(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 * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.\n */\n public async getTotalBudget(params?: ReadParams) {\n if ((this.payload as ERC20VariableIncentivePayload)?.limit !== undefined) {\n return (this.payload as ERC20VariableIncentivePayload).limit;\n }\n return await this.limit(params);\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claimed amount against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if limit minus total claimed is greater than 0\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how much of the underlying asset remains by comparing the the limit against the total amount claimed. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - Limit minus total claimed\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [totalClaimed, limit] = await Promise.all([\n this.totalClaimed(params),\n this.limit(params),\n ]);\n return limit - totalClaimed;\n }\n\n /**\n * Builds the claim data for the ERC20VariableIncentive.\n *\n * @public\n * @param {bigint} rewardAmount\n * @returns {Hex} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20VariableIncentive.\n */\n public buildClaimData(rewardAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'rewardAmount' }],\n [rewardAmount],\n );\n }\n\n /**\n * Decodes claim data for the ERC20VariableIncentive, returning the encoded claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {BigInt} Returns the reward amount from a claim data payload\n */\n public decodeClaimData(data: Hex) {\n return BigInt(decodeAbiParameters([{ type: 'uint256' }], data)[0]);\n }\n\n /**\n * Encodes an amount to clawback from the incentive\n *\n * @public\n * @param {bigint} amount - How much of the asset to clawback\n * @returns {Hex} - Returns an encoded uint256\n */\n public buildClawbackData(amount: bigint) {\n return encodeAbiParameters([{ type: 'uint256' }], [amount]);\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20VariableIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20VariableIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [\n prepareERC20VariableIncentivePayload(\n payload as ERC20VariableIncentivePayload,\n ),\n ],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link ERC20VariableIncentivePayload}, properly encode a ` ERC20VariableIncentive.InitPayload` for use with {@link ERC20VariableIncentive} initialization.\n *\n * @param {ERC20VariableIncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\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 prepareERC20VariableIncentivePayload({\n asset,\n reward,\n limit,\n}: ERC20VariableIncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [asset, reward, limit],\n );\n}\n"],"names":["_ERC20VariableIncentive","DeployableTarget","erc20VariableIncentiveAbi","params","readErc20VariableIncentiveOwner","readErc20VariableIncentiveTotalClaimed","readErc20VariableIncentiveCurrentReward","readErc20VariableIncentiveClaims","address","readErc20VariableIncentiveClaimed","readErc20VariableIncentiveAsset","readErc20VariableIncentiveReward","readErc20VariableIncentiveLimit","payload","request","result","simulateErc20VariableIncentiveClaim","prepareClaimPayload","writeErc20VariableIncentiveClaim","simulateErc20VariableIncentiveClawback","writeErc20VariableIncentiveClawback","readErc20VariableIncentiveIsClaimable","_a","totalClaimed","limit","rewardAmount","encodeAbiParameters","data","decodeAbiParameters","amount","_payload","_options","options","bytecode","prepareERC20VariableIncentivePayload","ERC20VariableIncentiveBases","RegistryType","ERC20VariableIncentive","asset","reward"],"mappings":";;;;;;0qnBAmGaA,IAAN,MAAMA,UAGHC,EAA+B;AAAA,EAHlC,cAAA;AAAA,UAAA,GAAA,SAAA,GAKL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,MAAMC,GAAqB;AAC/B,WAAA,MAAMC,EAAgC,KAAK,SAAS;AAAA,MACzD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CAC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EzB;"}
1
+ {"version":3,"file":"ERC20VariableIncentive.js","sources":["../../src/Incentives/ERC20VariableIncentive.ts"],"sourcesContent":["import {\n erc20VariableIncentiveAbi,\n readErc20VariableIncentiveAsset,\n readErc20VariableIncentiveClaimed,\n readErc20VariableIncentiveClaims,\n readErc20VariableIncentiveCurrentReward,\n readErc20VariableIncentiveIsClaimable,\n readErc20VariableIncentiveLimit,\n readErc20VariableIncentiveOwner,\n readErc20VariableIncentiveReward,\n readErc20VariableIncentiveTotalClaimed,\n simulateErc20VariableIncentiveClaim,\n simulateErc20VariableIncentiveClawback,\n writeErc20VariableIncentiveClaim,\n writeErc20VariableIncentiveClawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20VariableIncentive.sol/ERC20VariableIncentive.json';\nimport {\n type Abi,\n type Address,\n type ContractEventName,\n type Hex,\n decodeAbiParameters,\n encodeAbiParameters,\n} from 'viem';\nimport { ERC20VariableIncentive as ERC20VariableIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { erc20VariableIncentiveAbi };\n/**\n * The object representation of a `ERC20VariableIncentivePayload.InitPayload`\n *\n * @export\n * @interface ERC20VariableIncentivePayload\n * @typedef {ERC20VariableIncentivePayload}\n */\nexport interface ERC20VariableIncentivePayload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The reward multiplier. If 0, the signed amount from the claim payload is used directly. Variable amount (in ETH decimal format) will by multiplied by this value.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The total spending limit of the asset that will be distributed.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * The 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 `ERC20VariableIncentive` event types.\n *\n * @export\n * @typedef {ERC20VariableIncentiveLog}\n * @template {ContractEventName<typeof erc20VariableIncentiveAbi>} [event=ContractEventName<\n * typeof erc20VariableIncentiveAbi\n * >]\n */\nexport type ERC20VariableIncentiveLog<\n event extends ContractEventName<\n typeof erc20VariableIncentiveAbi\n > = ContractEventName<typeof erc20VariableIncentiveAbi>,\n> = GenericLog<typeof erc20VariableIncentiveAbi, event>;\n\n/**\n * A modified ERC20 incentive implementation that allows claiming of variable token amounts with a spending limit\n *\n * @export\n * @class ERC20VariableIncentive\n * @typedef {ERC20VariableIncentive}\n * @template [Payload=ERC20VariableIncentivePayload | undefined]\n * @template {Abi} [ABI=typeof erc20VariableIncentiveAbi]\n * @extends {DeployableTarget<ERC20VariableIncentivePayload, ABI>}\n */\nexport class ERC20VariableIncentive<\n Payload = ERC20VariableIncentivePayload | undefined,\n ABI extends Abi = typeof erc20VariableIncentiveAbi,\n> extends DeployableTarget<Payload, ABI> {\n //@ts-expect-error it is instantiated correctly\n public override readonly abi = erc20VariableIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env.VITE_ERC20_VARIABLE_INCENTIVE_BASE,\n ...(ERC20VariableIncentiveBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams) {\n return await readErc20VariableIncentiveOwner(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 total amount of rewards claimed\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalClaimed(params?: ReadParams) {\n return await readErc20VariableIncentiveTotalClaimed(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 current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20VariableIncentiveCurrentReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readErc20VariableIncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readErc20VariableIncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20VariableIncentiveAsset(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 reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20VariableIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The limit (max claims, or max entries for raffles)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20VariableIncentiveLimit(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 * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20VariableIncentiveClaim(\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 writeErc20VariableIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulateErc20VariableIncentiveClawback(\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 writeErc20VariableIncentiveClawback(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable. For the POOL strategy, the `bytes data` portion of the payload ignored. The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readErc20VariableIncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.\n */\n public async getTotalBudget(params?: ReadParams) {\n if ((this.payload as ERC20VariableIncentivePayload)?.limit !== undefined) {\n return (this.payload as ERC20VariableIncentivePayload).limit;\n }\n return await this.limit(params);\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claimed amount against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if limit minus total claimed is greater than 0\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how much of the underlying asset remains by comparing the the limit against the total amount claimed. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - Limit minus total claimed\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [totalClaimed, limit] = await Promise.all([\n this.totalClaimed(params),\n this.limit(params),\n ]);\n return limit - totalClaimed;\n }\n\n /**\n * Builds the claim data for the ERC20VariableIncentive.\n *\n * @public\n * @param {bigint} rewardAmount\n * @returns {Hex} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20VariableIncentive.\n */\n public buildClaimData(rewardAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'rewardAmount' }],\n [rewardAmount],\n );\n }\n\n /**\n * Decodes claim data for the ERC20VariableIncentive, returning the encoded claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {BigInt} Returns the reward amount from a claim data payload\n */\n public decodeClaimData(data: Hex) {\n return BigInt(decodeAbiParameters([{ type: 'uint256' }], data)[0]);\n }\n\n /**\n * Encodes an amount to clawback from the incentive\n *\n * @public\n * @param {bigint} amount - How much of the asset to clawback\n * @returns {Hex} - Returns an encoded uint256\n */\n public buildClawbackData(amount: bigint) {\n return encodeAbiParameters([{ type: 'uint256' }], [amount]);\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20VariableIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20VariableIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [\n prepareERC20VariableIncentivePayload(\n payload as ERC20VariableIncentivePayload,\n ),\n ],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link ERC20VariableIncentivePayload}, properly encode a ` ERC20VariableIncentive.InitPayload` for use with {@link ERC20VariableIncentive} initialization.\n *\n * @param {ERC20VariableIncentivePayload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\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 prepareERC20VariableIncentivePayload({\n asset,\n reward,\n limit,\n}: ERC20VariableIncentivePayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'asset' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [asset, reward, limit],\n );\n}\n"],"names":["_ERC20VariableIncentive","DeployableTarget","erc20VariableIncentiveAbi","params","readErc20VariableIncentiveOwner","readErc20VariableIncentiveTotalClaimed","readErc20VariableIncentiveCurrentReward","readErc20VariableIncentiveClaims","address","readErc20VariableIncentiveClaimed","readErc20VariableIncentiveAsset","readErc20VariableIncentiveReward","readErc20VariableIncentiveLimit","payload","request","result","simulateErc20VariableIncentiveClaim","prepareClaimPayload","writeErc20VariableIncentiveClaim","simulateErc20VariableIncentiveClawback","writeErc20VariableIncentiveClawback","readErc20VariableIncentiveIsClaimable","_a","totalClaimed","limit","rewardAmount","encodeAbiParameters","data","decodeAbiParameters","amount","_payload","_options","options","bytecode","prepareERC20VariableIncentivePayload","ERC20VariableIncentiveBases","RegistryType","ERC20VariableIncentive","asset","reward"],"mappings":";;;;;;0qnBAmGaA,IAAN,MAAMA,UAGHC,EAA+B;AAAA,EAHlC,cAAA;AAAA,UAAA,GAAA,SAAA,GAKL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,MAAMC,GAAqB;AAC/B,WAAA,MAAMC,EAAgC,KAAK,SAAS;AAAA,MACzD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;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Y,GAAOC,GAAQf,CAAK;AAAA,EAAA;AAEzB;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../generated-pNKCp_Ez.cjs"),e=require("../componentInterfaces-Bt-4sNB5.cjs"),A=require("@wagmi/core"),u=require("../errors.cjs"),o=require("./AllowListIncentive.cjs"),a=require("./CGDAIncentive.cjs"),I=require("./ERC20Incentive.cjs"),v=require("./ERC20VariableCriteriaIncentive.cjs"),C=require("./ERC20VariableIncentive.cjs"),s=require("./PointsIncentive.cjs"),n={[e.APointsIncentive]:s.PointsIncentive,[e.AERC20Incentive]:I.ERC20Incentive,[e.AAllowListIncentive]:o.AllowListIncentive,[e.ACGDAIncentive]:a.CGDAIncentive,[e.AERC20VariableIncentive]:C.ERC20VariableIncentive,[e.AERC20VariableCriteriaIncentive]:v.ERC20VariableCriteriaIncentive};async function E(t,i){const r=await A.readContract(t.config,{abi:l.Q,functionName:"getComponentInterface",address:i}),c=n[r];if(!c)throw new u.InvalidComponentInterfaceError(Object.keys(n),r);return new c(t,i)}exports.AllowListIncentive=o.AllowListIncentive;exports.CGDAIncentive=a.CGDAIncentive;exports.ERC20Incentive=I.ERC20Incentive;exports.ERC20VariableCriteriaIncentive=v.ERC20VariableCriteriaIncentive;exports.ERC20VariableIncentive=C.ERC20VariableIncentive;exports.PointsIncentive=s.PointsIncentive;exports.IncentiveByComponentInterface=n;exports.incentiveFromAddress=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../generated-CgBgbMNe.cjs"),e=require("../componentInterfaces-Bt-4sNB5.cjs"),u=require("@wagmi/core"),E=require("../errors.cjs"),o=require("./AllowListIncentive.cjs"),a=require("./CGDAIncentive.cjs"),I=require("./ERC20Incentive.cjs"),v=require("./ERC20VariableCriteriaIncentive.cjs"),C=require("./ERC20VariableIncentive.cjs"),s=require("./PointsIncentive.cjs"),n={[e.APointsIncentive]:s.PointsIncentive,[e.AERC20Incentive]:I.ERC20Incentive,[e.AAllowListIncentive]:o.AllowListIncentive,[e.ACGDAIncentive]:a.CGDAIncentive,[e.AERC20VariableIncentive]:C.ERC20VariableIncentive,[e.AERC20VariableCriteriaIncentive]:v.ERC20VariableCriteriaIncentive};async function R(t,i,l){const r=await u.readContract(t.config,{abi:A.Q,functionName:"getComponentInterface",address:i,...l}),c=n[r];if(!c)throw new E.InvalidComponentInterfaceError(Object.keys(n),r);return new c(t,i)}exports.AllowListIncentive=o.AllowListIncentive;exports.CGDAIncentive=a.CGDAIncentive;exports.ERC20Incentive=I.ERC20Incentive;exports.ERC20VariableCriteriaIncentive=v.ERC20VariableCriteriaIncentive;exports.ERC20VariableIncentive=C.ERC20VariableIncentive;exports.PointsIncentive=s.PointsIncentive;exports.IncentiveByComponentInterface=n;exports.incentiveFromAddress=R;
2
2
  //# sourceMappingURL=Incentive.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Incentive.cjs","sources":["../../src/Incentives/Incentive.ts"],"sourcesContent":["import { aIncentiveAbi } from '@boostxyz/evm';\nimport {\n AAllowListIncentive,\n ACGDAIncentive,\n AERC20Incentive,\n AERC20VariableCriteriaIncentive,\n AERC20VariableIncentive,\n // AERC20VariableCriteriaIncentive\n APointsIncentive,\n} from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport type { Address, Hex } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport { AllowListIncentive } from './AllowListIncentive';\nimport { CGDAIncentive } from './CGDAIncentive';\nimport { ERC20Incentive } from './ERC20Incentive';\nimport { ERC20VariableCriteriaIncentive } from './ERC20VariableCriteriaIncentive';\nimport { ERC20VariableIncentive } from './ERC20VariableIncentive';\n// import { ERC1155Incentive } from './ERC1155Incentive';\nimport { PointsIncentive } from './PointsIncentive';\n\nexport {\n AllowListIncentive,\n CGDAIncentive,\n // ERC1155Incentive,\n ERC20Incentive,\n PointsIncentive,\n ERC20VariableIncentive,\n ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A union type representing all valid protocol Incentive implementations\n *\n * @export\n * @typedef {Incentive}\n */\nexport type Incentive =\n | AllowListIncentive\n | CGDAIncentive\n | ERC20Incentive\n // | ERC1155Incentive\n | PointsIncentive\n | ERC20VariableIncentive\n | ERC20VariableCriteriaIncentive;\n\n/**\n * A map of Incentive component interfaces to their constructors.\n *\n * @type {{ \"0xc5b24b8e\": typeof PointsIncentive; \"0x8c901437\": typeof ERC20Incentive; \"0x4414fbb4\": typeof AllowListIncentive; \"0xa39e44d9\": typeof CGDAIncentive; \"0xa8e4af1e\": typeof ERC20VariableIncentive; \"0x90318111\": typeof ERC20VariableCriteriaIncentive }}\n */\nexport const IncentiveByComponentInterface = {\n [APointsIncentive as Hex]: PointsIncentive,\n [AERC20Incentive as Hex]: ERC20Incentive,\n [AAllowListIncentive]: AllowListIncentive,\n // [AERC1155Incentive as Hex]: ERC1155Incentive,\n [ACGDAIncentive as Hex]: CGDAIncentive,\n [AERC20VariableIncentive as Hex]: ERC20VariableIncentive,\n [AERC20VariableCriteriaIncentive as Hex]: ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Incentive}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function incentiveFromAddress(\n options: DeployableOptions,\n address: Address,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aIncentiveAbi,\n functionName: 'getComponentInterface',\n address,\n })) as keyof typeof IncentiveByComponentInterface;\n const Ctor = IncentiveByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(IncentiveByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n"],"names":["IncentiveByComponentInterface","APointsIncentive","PointsIncentive","AERC20Incentive","ERC20Incentive","AAllowListIncentive","AllowListIncentive","ACGDAIncentive","CGDAIncentive","AERC20VariableIncentive","ERC20VariableIncentive","AERC20VariableCriteriaIncentive","ERC20VariableCriteriaIncentive","incentiveFromAddress","options","address","interfaceId","readContract","aIncentiveAbi","Ctor","InvalidComponentInterfaceError"],"mappings":"0cAoDaA,EAAgC,CAC3C,CAACC,EAAuB,gBAAA,EAAGC,EAAA,gBAC3B,CAACC,EAAsB,eAAA,EAAGC,EAAA,eAC1B,CAACC,EAAmB,mBAAA,EAAGC,EAAA,mBAEvB,CAACC,EAAqB,cAAA,EAAGC,EAAA,cACzB,CAACC,EAA8B,uBAAA,EAAGC,EAAA,uBAClC,CAACC,EAAsC,+BAAA,EAAGC,EAAA,8BAC5C,EAYsB,eAAAC,EACpBC,EACAC,EACA,CACA,MAAMC,EAAe,MAAMC,eAAaH,EAAQ,OAAQ,CACtD,IAAKI,EAAA,EACL,aAAc,wBACd,QAAAH,CAAA,CACD,EACKI,EAAOnB,EAA8BgB,CAAW,EACtD,GAAI,CAACG,EACH,MAAM,IAAIC,EAAA,+BACR,OAAO,KAAKpB,CAA6B,EACzCgB,CAAA,EAGG,OAAA,IAAIG,EAAKL,EAASC,CAAO,CAClC"}
1
+ {"version":3,"file":"Incentive.cjs","sources":["../../src/Incentives/Incentive.ts"],"sourcesContent":["import { aIncentiveAbi } from '@boostxyz/evm';\nimport {\n AAllowListIncentive,\n ACGDAIncentive,\n AERC20Incentive,\n AERC20VariableCriteriaIncentive,\n AERC20VariableIncentive,\n // AERC20VariableCriteriaIncentive\n APointsIncentive,\n} from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport type { Address, Hex } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport type { ReadParams } from '../utils';\nimport { AllowListIncentive } from './AllowListIncentive';\nimport { CGDAIncentive } from './CGDAIncentive';\nimport { ERC20Incentive } from './ERC20Incentive';\nimport { ERC20VariableCriteriaIncentive } from './ERC20VariableCriteriaIncentive';\nimport { ERC20VariableIncentive } from './ERC20VariableIncentive';\n// import { ERC1155Incentive } from './ERC1155Incentive';\nimport { PointsIncentive } from './PointsIncentive';\n\nexport {\n AllowListIncentive,\n CGDAIncentive,\n // ERC1155Incentive,\n ERC20Incentive,\n PointsIncentive,\n ERC20VariableIncentive,\n ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A union type representing all valid protocol Incentive implementations\n *\n * @export\n * @typedef {Incentive}\n */\nexport type Incentive =\n | AllowListIncentive\n | CGDAIncentive\n | ERC20Incentive\n // | ERC1155Incentive\n | PointsIncentive\n | ERC20VariableIncentive\n | ERC20VariableCriteriaIncentive;\n\n/**\n * A map of Incentive component interfaces to their constructors.\n *\n * @type {{ \"0xc5b24b8e\": typeof PointsIncentive; \"0x8c901437\": typeof ERC20Incentive; \"0x4414fbb4\": typeof AllowListIncentive; \"0xa39e44d9\": typeof CGDAIncentive; \"0xa8e4af1e\": typeof ERC20VariableIncentive; \"0x90318111\": typeof ERC20VariableCriteriaIncentive }}\n */\nexport const IncentiveByComponentInterface = {\n [APointsIncentive as Hex]: PointsIncentive,\n [AERC20Incentive as Hex]: ERC20Incentive,\n [AAllowListIncentive]: AllowListIncentive,\n // [AERC1155Incentive as Hex]: ERC1155Incentive,\n [ACGDAIncentive as Hex]: CGDAIncentive,\n [AERC20VariableIncentive as Hex]: ERC20VariableIncentive,\n [AERC20VariableCriteriaIncentive as Hex]: ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Incentive}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function incentiveFromAddress(\n options: DeployableOptions,\n address: Address,\n params?: ReadParams,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aIncentiveAbi,\n functionName: 'getComponentInterface',\n address,\n ...params,\n })) as keyof typeof IncentiveByComponentInterface;\n const Ctor = IncentiveByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(IncentiveByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n"],"names":["IncentiveByComponentInterface","APointsIncentive","PointsIncentive","AERC20Incentive","ERC20Incentive","AAllowListIncentive","AllowListIncentive","ACGDAIncentive","CGDAIncentive","AERC20VariableIncentive","ERC20VariableIncentive","AERC20VariableCriteriaIncentive","ERC20VariableCriteriaIncentive","incentiveFromAddress","options","address","params","interfaceId","readContract","aIncentiveAbi","Ctor","InvalidComponentInterfaceError"],"mappings":"0cAqDaA,EAAgC,CAC3C,CAACC,EAAuB,gBAAA,EAAGC,EAAA,gBAC3B,CAACC,EAAsB,eAAA,EAAGC,EAAA,eAC1B,CAACC,EAAmB,mBAAA,EAAGC,EAAA,mBAEvB,CAACC,EAAqB,cAAA,EAAGC,EAAA,cACzB,CAACC,EAA8B,uBAAA,EAAGC,EAAA,uBAClC,CAACC,EAAsC,+BAAA,EAAGC,EAAA,8BAC5C,EAYsB,eAAAC,EACpBC,EACAC,EACAC,EACA,CACA,MAAMC,EAAe,MAAMC,eAAaJ,EAAQ,OAAQ,CACtD,IAAKK,EAAA,EACL,aAAc,wBACd,QAAAJ,EACA,GAAGC,CAAA,CACJ,EACKI,EAAOpB,EAA8BiB,CAAW,EACtD,GAAI,CAACG,EACH,MAAM,IAAIC,EAAA,+BACR,OAAO,KAAKrB,CAA6B,EACzCiB,CAAA,EAGG,OAAA,IAAIG,EAAKN,EAASC,CAAO,CAClC"}
@@ -1,5 +1,6 @@
1
1
  import type { Address } from 'viem';
2
2
  import type { DeployableOptions } from '../Deployable/Deployable';
3
+ import type { ReadParams } from '../utils';
3
4
  import { AllowListIncentive } from './AllowListIncentive';
4
5
  import { CGDAIncentive } from './CGDAIncentive';
5
6
  import { ERC20Incentive } from './ERC20Incentive';
@@ -32,7 +33,7 @@ export declare const IncentiveByComponentInterface: {
32
33
  * @returns {Incentive}
33
34
  * @throws {@link InvalidComponentInterfaceError}
34
35
  */
35
- export declare function incentiveFromAddress(options: DeployableOptions, address: Address): Promise<AllowListIncentive | CGDAIncentive | ERC20Incentive | ERC20VariableCriteriaIncentive | PointsIncentive | ERC20VariableIncentive<`0x${string}`, readonly [{
36
+ export declare function incentiveFromAddress(options: DeployableOptions, address: Address, params?: ReadParams): Promise<AllowListIncentive | CGDAIncentive | ERC20Incentive | ERC20VariableCriteriaIncentive | PointsIncentive | ERC20VariableIncentive<`0x${string}`, readonly [{
36
37
  readonly type: "constructor";
37
38
  readonly inputs: readonly [];
38
39
  readonly stateMutability: "nonpayable";
@@ -1 +1 @@
1
- {"version":3,"file":"Incentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/Incentive.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EACL,kBAAkB,EAClB,aAAa,EAEb,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,8BAA8B,GAC/B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GACjB,kBAAkB,GAClB,aAAa,GACb,cAAc,GAEd,eAAe,GACf,sBAAsB,GACtB,8BAA8B,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;CAQzC,CAAC;AAEF;;;;;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I, f as v } from "../componentInterfaces-dakxtQHf.js";
3
- import { readContract as C } from "@wagmi/core";
4
- import { InvalidComponentInterfaceError as s } from "../errors.js";
5
- import { AllowListIncentive as p } from "./AllowListIncentive.js";
6
- import { CGDAIncentive as A } from "./CGDAIncentive.js";
7
- import { ERC20Incentive as l } from "./ERC20Incentive.js";
8
- import { ERC20VariableCriteriaIncentive as b } from "./ERC20VariableCriteriaIncentive.js";
9
- import { ERC20VariableIncentive as E } from "./ERC20VariableIncentive.js";
10
- import { PointsIncentive as w } from "./PointsIncentive.js";
1
+ import { Q as a } from "../generated-1ZT_mHJx.js";
2
+ import { a as c, b as m, c as f, d as I, e as v, f as C } from "../componentInterfaces-dakxtQHf.js";
3
+ import { readContract as s } from "@wagmi/core";
4
+ import { InvalidComponentInterfaceError as p } from "../errors.js";
5
+ import { AllowListIncentive as A } from "./AllowListIncentive.js";
6
+ import { CGDAIncentive as l } from "./CGDAIncentive.js";
7
+ import { ERC20Incentive as b } from "./ERC20Incentive.js";
8
+ import { ERC20VariableCriteriaIncentive as E } from "./ERC20VariableCriteriaIncentive.js";
9
+ import { ERC20VariableIncentive as w } from "./ERC20VariableIncentive.js";
10
+ import { PointsIncentive as R } from "./PointsIncentive.js";
11
11
  const r = {
12
- [a]: w,
13
- [c]: l,
14
- [m]: p,
15
- // [AERC1155Incentive as Hex]: ERC1155Incentive,
12
+ [c]: R,
13
+ [m]: b,
16
14
  [f]: A,
17
- [I]: E,
18
- [v]: b
15
+ // [AERC1155Incentive as Hex]: ERC1155Incentive,
16
+ [I]: l,
17
+ [v]: w,
18
+ [C]: E
19
19
  };
20
- async function h(e, n) {
21
- const t = await C(e.config, {
22
- abi: o,
20
+ async function j(e, n, o) {
21
+ const t = await s(e.config, {
22
+ abi: a,
23
23
  functionName: "getComponentInterface",
24
- address: n
24
+ address: n,
25
+ ...o
25
26
  }), i = r[t];
26
27
  if (!i)
27
- throw new s(
28
+ throw new p(
28
29
  Object.keys(r),
29
30
  t
30
31
  );
31
32
  return new i(e, n);
32
33
  }
33
34
  export {
34
- p as AllowListIncentive,
35
- A as CGDAIncentive,
36
- l as ERC20Incentive,
37
- b as ERC20VariableCriteriaIncentive,
38
- E as ERC20VariableIncentive,
35
+ A as AllowListIncentive,
36
+ l as CGDAIncentive,
37
+ b as ERC20Incentive,
38
+ E as ERC20VariableCriteriaIncentive,
39
+ w as ERC20VariableIncentive,
39
40
  r as IncentiveByComponentInterface,
40
- w as PointsIncentive,
41
- h as incentiveFromAddress
41
+ R as PointsIncentive,
42
+ j as incentiveFromAddress
42
43
  };
43
44
  //# sourceMappingURL=Incentive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Incentive.js","sources":["../../src/Incentives/Incentive.ts"],"sourcesContent":["import { aIncentiveAbi } from '@boostxyz/evm';\nimport {\n AAllowListIncentive,\n ACGDAIncentive,\n AERC20Incentive,\n AERC20VariableCriteriaIncentive,\n AERC20VariableIncentive,\n // AERC20VariableCriteriaIncentive\n APointsIncentive,\n} from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport type { Address, Hex } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport { AllowListIncentive } from './AllowListIncentive';\nimport { CGDAIncentive } from './CGDAIncentive';\nimport { ERC20Incentive } from './ERC20Incentive';\nimport { ERC20VariableCriteriaIncentive } from './ERC20VariableCriteriaIncentive';\nimport { ERC20VariableIncentive } from './ERC20VariableIncentive';\n// import { ERC1155Incentive } from './ERC1155Incentive';\nimport { PointsIncentive } from './PointsIncentive';\n\nexport {\n AllowListIncentive,\n CGDAIncentive,\n // ERC1155Incentive,\n ERC20Incentive,\n PointsIncentive,\n ERC20VariableIncentive,\n ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A union type representing all valid protocol Incentive implementations\n *\n * @export\n * @typedef {Incentive}\n */\nexport type Incentive =\n | AllowListIncentive\n | CGDAIncentive\n | ERC20Incentive\n // | ERC1155Incentive\n | PointsIncentive\n | ERC20VariableIncentive\n | ERC20VariableCriteriaIncentive;\n\n/**\n * A map of Incentive component interfaces to their constructors.\n *\n * @type {{ \"0xc5b24b8e\": typeof PointsIncentive; \"0x8c901437\": typeof ERC20Incentive; \"0x4414fbb4\": typeof AllowListIncentive; \"0xa39e44d9\": typeof CGDAIncentive; \"0xa8e4af1e\": typeof ERC20VariableIncentive; \"0x90318111\": typeof ERC20VariableCriteriaIncentive }}\n */\nexport const IncentiveByComponentInterface = {\n [APointsIncentive as Hex]: PointsIncentive,\n [AERC20Incentive as Hex]: ERC20Incentive,\n [AAllowListIncentive]: AllowListIncentive,\n // [AERC1155Incentive as Hex]: ERC1155Incentive,\n [ACGDAIncentive as Hex]: CGDAIncentive,\n [AERC20VariableIncentive as Hex]: ERC20VariableIncentive,\n [AERC20VariableCriteriaIncentive as Hex]: ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Incentive}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function incentiveFromAddress(\n options: DeployableOptions,\n address: Address,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aIncentiveAbi,\n functionName: 'getComponentInterface',\n address,\n })) as keyof typeof IncentiveByComponentInterface;\n const Ctor = IncentiveByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(IncentiveByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n"],"names":["IncentiveByComponentInterface","APointsIncentive","PointsIncentive","AERC20Incentive","ERC20Incentive","AAllowListIncentive","AllowListIncentive","ACGDAIncentive","CGDAIncentive","AERC20VariableIncentive","ERC20VariableIncentive","AERC20VariableCriteriaIncentive","ERC20VariableCriteriaIncentive","incentiveFromAddress","options","address","interfaceId","readContract","aIncentiveAbi","Ctor","InvalidComponentInterfaceError"],"mappings":";;;;;;;;;;AAoDO,MAAMA,IAAgC;AAAA,EAC3C,CAACC,CAAuB,GAAGC;AAAA,EAC3B,CAACC,CAAsB,GAAGC;AAAA,EAC1B,CAACC,CAAmB,GAAGC;AAAA;AAAA,EAEvB,CAACC,CAAqB,GAAGC;AAAA,EACzB,CAACC,CAA8B,GAAGC;AAAA,EAClC,CAACC,CAAsC,GAAGC;AAC5C;AAYsB,eAAAC,EACpBC,GACAC,GACA;AACA,QAAMC,IAAe,MAAMC,EAAaH,EAAQ,QAAQ;AAAA,IACtD,KAAKI;AAAAA,IACL,cAAc;AAAA,IACd,SAAAH;AAAA,EAAA,CACD,GACKI,IAAOnB,EAA8BgB,CAAW;AACtD,MAAI,CAACG;AACH,UAAM,IAAIC;AAAA,MACR,OAAO,KAAKpB,CAA6B;AAAA,MACzCgB;AAAA,IAAA;AAGG,SAAA,IAAIG,EAAKL,GAASC,CAAO;AAClC;"}
1
+ {"version":3,"file":"Incentive.js","sources":["../../src/Incentives/Incentive.ts"],"sourcesContent":["import { aIncentiveAbi } from '@boostxyz/evm';\nimport {\n AAllowListIncentive,\n ACGDAIncentive,\n AERC20Incentive,\n AERC20VariableCriteriaIncentive,\n AERC20VariableIncentive,\n // AERC20VariableCriteriaIncentive\n APointsIncentive,\n} from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport type { Address, Hex } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport type { ReadParams } from '../utils';\nimport { AllowListIncentive } from './AllowListIncentive';\nimport { CGDAIncentive } from './CGDAIncentive';\nimport { ERC20Incentive } from './ERC20Incentive';\nimport { ERC20VariableCriteriaIncentive } from './ERC20VariableCriteriaIncentive';\nimport { ERC20VariableIncentive } from './ERC20VariableIncentive';\n// import { ERC1155Incentive } from './ERC1155Incentive';\nimport { PointsIncentive } from './PointsIncentive';\n\nexport {\n AllowListIncentive,\n CGDAIncentive,\n // ERC1155Incentive,\n ERC20Incentive,\n PointsIncentive,\n ERC20VariableIncentive,\n ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A union type representing all valid protocol Incentive implementations\n *\n * @export\n * @typedef {Incentive}\n */\nexport type Incentive =\n | AllowListIncentive\n | CGDAIncentive\n | ERC20Incentive\n // | ERC1155Incentive\n | PointsIncentive\n | ERC20VariableIncentive\n | ERC20VariableCriteriaIncentive;\n\n/**\n * A map of Incentive component interfaces to their constructors.\n *\n * @type {{ \"0xc5b24b8e\": typeof PointsIncentive; \"0x8c901437\": typeof ERC20Incentive; \"0x4414fbb4\": typeof AllowListIncentive; \"0xa39e44d9\": typeof CGDAIncentive; \"0xa8e4af1e\": typeof ERC20VariableIncentive; \"0x90318111\": typeof ERC20VariableCriteriaIncentive }}\n */\nexport const IncentiveByComponentInterface = {\n [APointsIncentive as Hex]: PointsIncentive,\n [AERC20Incentive as Hex]: ERC20Incentive,\n [AAllowListIncentive]: AllowListIncentive,\n // [AERC1155Incentive as Hex]: ERC1155Incentive,\n [ACGDAIncentive as Hex]: CGDAIncentive,\n [AERC20VariableIncentive as Hex]: ERC20VariableIncentive,\n [AERC20VariableCriteriaIncentive as Hex]: ERC20VariableCriteriaIncentive,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Incentive}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function incentiveFromAddress(\n options: DeployableOptions,\n address: Address,\n params?: ReadParams,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aIncentiveAbi,\n functionName: 'getComponentInterface',\n address,\n ...params,\n })) as keyof typeof IncentiveByComponentInterface;\n const Ctor = IncentiveByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(IncentiveByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n"],"names":["IncentiveByComponentInterface","APointsIncentive","PointsIncentive","AERC20Incentive","ERC20Incentive","AAllowListIncentive","AllowListIncentive","ACGDAIncentive","CGDAIncentive","AERC20VariableIncentive","ERC20VariableIncentive","AERC20VariableCriteriaIncentive","ERC20VariableCriteriaIncentive","incentiveFromAddress","options","address","params","interfaceId","readContract","aIncentiveAbi","Ctor","InvalidComponentInterfaceError"],"mappings":";;;;;;;;;;AAqDO,MAAMA,IAAgC;AAAA,EAC3C,CAACC,CAAuB,GAAGC;AAAA,EAC3B,CAACC,CAAsB,GAAGC;AAAA,EAC1B,CAACC,CAAmB,GAAGC;AAAA;AAAA,EAEvB,CAACC,CAAqB,GAAGC;AAAA,EACzB,CAACC,CAA8B,GAAGC;AAAA,EAClC,CAACC,CAAsC,GAAGC;AAC5C;AAYsB,eAAAC,EACpBC,GACAC,GACAC,GACA;AACA,QAAMC,IAAe,MAAMC,EAAaJ,EAAQ,QAAQ;AAAA,IACtD,KAAKK;AAAAA,IACL,cAAc;AAAA,IACd,SAAAJ;AAAA,IACA,GAAGC;AAAA,EAAA,CACJ,GACKI,IAAOpB,EAA8BiB,CAAW;AACtD,MAAI,CAACG;AACH,UAAM,IAAIC;AAAA,MACR,OAAO,KAAKrB,CAA6B;AAAA,MACzCiB;AAAA,IAAA;AAGG,SAAA,IAAIG,EAAKN,GAASC,CAAO;AAClC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../generated-pNKCp_Ez.cjs"),i=require("viem"),l=require("../deployments-BDumesUK.cjs"),o=require("../Deployable/DeployableTarget.cjs"),t=require("../claiming.cjs"),u=require("../utils.cjs"),h="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611b8b806100bd5f395ff3fe6080604052600436106101b6575f3560e01c8063514e62fc116100eb578063c884ef8311610089578063ea3d508a11610063578063ea3d508a146105c1578063f04e283e146105eb578063f2fde38b14610607578063fee81cf414610623576101b6565b8063c884ef831461051f578063db09da121461055b578063dcc59b6f14610597576101b6565b80638da5cb5b116100c55780638da5cb5b14610465578063a270a7371461048f578063a4d66daf146104b9578063bb1757cf146104e3576101b6565b8063514e62fc1461041557806354d1f13d14610451578063715018a61461045b576101b6565b806328d6183b11610158578063439fab9111610132578063439fab9114610358578063474f5a44146103805780634a4ee7b1146103bd5780634e7165a2146103d9576101b6565b806328d6183b146102c85780632de94807146102f257806338d52e0f1461032e576101b6565b80631c10893f116101945780631c10893f1461023c5780631cd64df414610258578063228cb7331461029457806325692962146102be576101b6565b806301ffc9a7146101ba57806307621eca146101f6578063183a4f6e14610220575b5f80fd5b3480156101c5575f80fd5b506101e060048036038101906101db91906113f9565b61065f565b6040516101ed919061143e565b60405180910390f35b348015610201575f80fd5b5061020a6106d8565b604051610217919061146f565b60405180910390f35b61023a600480360381019061023591906114b2565b6106e0565b005b61025660048036038101906102519190611537565b6106ed565b005b348015610263575f80fd5b5061027e60048036038101906102799190611537565b610703565b60405161028b919061143e565b60405180910390f35b34801561029f575f80fd5b506102a8610719565b6040516102b5919061146f565b60405180910390f35b6102c661071e565b005b3480156102d3575f80fd5b506102dc61076f565b6040516102e99190611584565b60405180910390f35b3480156102fd575f80fd5b506103186004803603810190610313919061159d565b610796565b604051610325919061146f565b60405180910390f35b348015610339575f80fd5b506103426107af565b60405161034f91906115d7565b60405180910390f35b348015610363575f80fd5b5061037e60048036038101906103799190611651565b6107ca565b005b34801561038b575f80fd5b506103a660048036038101906103a19190611651565b610921565b6040516103b492919061169c565b60405180910390f35b6103d760048036038101906103d29190611537565b610955565b005b3480156103e4575f80fd5b506103ff60048036038101906103fa9190611651565b61096b565b60405161040c9190611733565b60405180910390f35b348015610420575f80fd5b5061043b60048036038101906104369190611537565b6109c2565b604051610448919061143e565b60405180910390f35b6104596109d9565b005b610463610a12565b005b348015610470575f80fd5b50610479610a25565b60405161048691906115d7565b60405180910390f35b34801561049a575f80fd5b506104a3610a4d565b6040516104b091906115d7565b60405180910390f35b3480156104c4575f80fd5b506104cd610a72565b6040516104da919061146f565b60405180910390f35b3480156104ee575f80fd5b5061050960048036038101906105049190611753565b610a78565b604051610516919061143e565b60405180910390f35b34801561052a575f80fd5b506105456004803603810190610540919061159d565b610e8d565b604051610552919061143e565b60405180910390f35b348015610566575f80fd5b50610581600480360381019061057c9190611753565b610eaa565b60405161058e919061143e565b60405180910390f35b3480156105a2575f80fd5b506105ab610ebd565b6040516105b8919061146f565b60405180910390f35b3480156105cc575f80fd5b506105d5610ec3565b6040516105e29190611584565b60405180910390f35b6106056004803603810190610600919061159d565b610ed5565b005b610621600480360381019061061c919061159d565b610f13565b005b34801561062e575f80fd5b506106496004803603810190610644919061159d565b610f3c565b604051610656919061146f565b60405180910390f35b5f7f0d36a40d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106d157506106d082610f55565b5b9050919050565b5f8054905090565b6106ea3382610fce565b50565b6106f5610fdd565b6106ff8282611014565b5050565b5f818261070f85610796565b1614905092915050565b5f5481565b5f610727611024565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0d36a40d00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f73deaddeaddeaddeaddeaddeaddeaddeaddeaddead905090565b5f6107d361102e565b905080546003825580156108055760018160011c14303b106107fc5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f838381019061081691906118a1565b90505f8160400151148061082d57505f8160600151145b15610864576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f015160025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806020015160045f6101000a81548163ffffffff021916908360e01c021790555080604001515f8190555080606001516003819055506108e633611057565b50801561091c576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61095d610fdd565b6109678282610fce565b5050565b60605f67ffffffffffffffff811115610987576109866117b4565b5b6040519080825280601f01601f1916602001820160405280156109b95781602001600182028036833780820191505090505b50905092915050565b5f80826109ce85610796565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a1a610fdd565b610a235f61112d565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b5f610a81610fdd565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b06573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b2a91906118e0565b73ffffffffffffffffffffffffffffffffffffffff1614158015610bcd5750600115158173ffffffffffffffffffffffffffffffffffffffff1663514e62fc3060026040518363ffffffff1660e01b8152600401610b8992919061194d565b602060405180830381865afa158015610ba4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bc8919061199e565b151514155b15610c04576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c0d856111f3565b610c43576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055f815480929190610c55906119f6565b91905055506001805f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660045f9054906101000a900460e01b875f54604051602401610d0a929190611a3d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610d749190611a9e565b5f604051808303815f865af19150503d805f8114610dad576040519150601f19603f3d011682016040523d82523d5f602084013e610db2565b606091505b5050905080610ded576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16885f54604051602001610e5c93929190611b19565b604051602081830303815290604052604051610e789190611733565b60405180910390a26001925050509392505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b5f610eb4846111f3565b90509392505050565b60055481565b60045f9054906101000a900460e01b81565b610edd610fdd565b63389a75e1600c52805f526020600c208054421115610f0357636f5e88185f526004601cfd5b5f815550610f108161112d565b50565b610f1b610fdd565b8060601b610f3057637448fbae5f526004601cfd5b610f398161112d565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610fc75750610fc682611255565b5b9050919050565b610fd982825f6112ce565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611012576382b429005f526004601cfd5b565b611020828260016112ce565b5050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61105f611326565b156110d7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561109957630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061112a565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611135611326565b1561119a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506111f0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615801561124e5750600354600554105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806112c757506112c68261132a565b5b9050919050565b638b78c6d8600c52825f526020600c208054838117836112f057848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113d8816113a4565b81146113e2575f80fd5b50565b5f813590506113f3816113cf565b92915050565b5f6020828403121561140e5761140d61139c565b5b5f61141b848285016113e5565b91505092915050565b5f8115159050919050565b61143881611424565b82525050565b5f6020820190506114515f83018461142f565b92915050565b5f819050919050565b61146981611457565b82525050565b5f6020820190506114825f830184611460565b92915050565b61149181611457565b811461149b575f80fd5b50565b5f813590506114ac81611488565b92915050565b5f602082840312156114c7576114c661139c565b5b5f6114d48482850161149e565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611506826114dd565b9050919050565b611516816114fc565b8114611520575f80fd5b50565b5f813590506115318161150d565b92915050565b5f806040838503121561154d5761154c61139c565b5b5f61155a85828601611523565b925050602061156b8582860161149e565b9150509250929050565b61157e816113a4565b82525050565b5f6020820190506115975f830184611575565b92915050565b5f602082840312156115b2576115b161139c565b5b5f6115bf84828501611523565b91505092915050565b6115d1816114fc565b82525050565b5f6020820190506115ea5f8301846115c8565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611611576116106115f0565b5b8235905067ffffffffffffffff81111561162e5761162d6115f4565b5b60208301915083600182028301111561164a576116496115f8565b5b9250929050565b5f80602083850312156116675761166661139c565b5b5f83013567ffffffffffffffff811115611684576116836113a0565b5b611690858286016115fc565b92509250509250929050565b5f6040820190506116af5f830185611460565b6116bc60208301846115c8565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611705826116c3565b61170f81856116cd565b935061171f8185602086016116dd565b611728816116eb565b840191505092915050565b5f6020820190508181035f83015261174b81846116fb565b905092915050565b5f805f6040848603121561176a5761176961139c565b5b5f61177786828701611523565b935050602084013567ffffffffffffffff811115611798576117976113a0565b5b6117a4868287016115fc565b92509250509250925092565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6117ea826116eb565b810181811067ffffffffffffffff82111715611809576118086117b4565b5b80604052505050565b5f61181b611393565b905061182782826117e1565b919050565b5f60808284031215611841576118406117b0565b5b61184b6080611812565b90505f61185a84828501611523565b5f83015250602061186d848285016113e5565b60208301525060406118818482850161149e565b60408301525060606118958482850161149e565b60608301525092915050565b5f608082840312156118b6576118b561139c565b5b5f6118c38482850161182c565b91505092915050565b5f815190506118da8161150d565b92915050565b5f602082840312156118f5576118f461139c565b5b5f611902848285016118cc565b91505092915050565b5f819050919050565b5f819050919050565b5f61193761193261192d8461190b565b611914565b611457565b9050919050565b6119478161191d565b82525050565b5f6040820190506119605f8301856115c8565b61196d602083018461193e565b9392505050565b61197d81611424565b8114611987575f80fd5b50565b5f8151905061199881611974565b92915050565b5f602082840312156119b3576119b261139c565b5b5f6119c08482850161198a565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a0082611457565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a3257611a316119c9565b5b600182019050919050565b5f604082019050611a505f8301856115c8565b611a5d6020830184611460565b9392505050565b5f81905092915050565b5f611a78826116c3565b611a828185611a64565b9350611a928185602086016116dd565b80840191505092915050565b5f611aa98284611a6e565b915081905092915050565b5f8160601b9050919050565b5f611aca82611ab4565b9050919050565b5f611adb82611ac0565b9050919050565b611af3611aee826114fc565b611ad1565b82525050565b5f819050919050565b611b13611b0e82611457565b611af9565b82525050565b5f611b248286611ae2565b601482019150611b348285611ae2565b601482019150611b448284611b02565b60208201915081905094935050505056fea2646970667358221220d6b660c45cfb14561fecfab54209da8ea926d96b371bbdb9b93f5ad944e89aad64736f6c634300081a0033",d=class d extends o.DeployableTarget{constructor(){super(...arguments),this.abi=a.h}async claims(f){return await a.dz(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await a.mz(this._config,{address:this.assertValidAddress(),args:[],...f})}async reward(f){return await a.Nz(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,b){return await a.yz(this._config,{address:this.assertValidAddress(),args:[f],...b})}async venue(f){return await a.Oz(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await a.Tz(this._config,{address:this.assertValidAddress(),...f})}async selector(f){return await a.Mz(this._config,{address:this.assertValidAddress(),...f})}async claim(f,b){return await this.awaitResult(this.claimRaw(f,b))}async claimRaw(f,b){const{request:e,result:c}=await a.qz(this._config,{address:this.assertValidAddress(),args:[t.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.zz(this._config,e),result:c}}async isClaimable(f,b){return await a.wz(this._config,{address:this.assertValidAddress(),args:[t.prepareClaimPayload(f)],...b})}async canBeClaimed(f){return await this.getRemainingClaimPotential(f)>0n}async getRemainingClaimPotential(f){const[b,e]=await Promise.all([this.claims(f),this.limit(f)]);return e-b}buildParameters(f,b){const[e,c]=this.validateDeploymentConfig(f,b);return{abi:a.h,bytecode:h,args:[r(e)],...this.optionallyAttachAccount(c.account)}}buildClaimData(){return i.zeroHash}};d.bases={31337:void 0,...l.PointsIncentive},d.registryType=u.RegistryType.INCENTIVE;let s=d;const r=({venue:n,selector:f,reward:b,limit:e})=>i.encodeAbiParameters([{type:"address",name:"venue"},{type:"bytes4",name:"selector"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[n,f,b,e]);exports.pointsIncentiveAbi=a.h;exports.PointsIncentive=s;exports.preparePointsIncentivePayload=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../generated-CgBgbMNe.cjs"),t=require("viem"),n=require("../deployments-BucJ-gwk.cjs"),l=require("../Deployable/DeployableTarget.cjs"),o=require("../claiming.cjs"),u=require("../utils.cjs"),h="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611b8b806100bd5f395ff3fe6080604052600436106101b6575f3560e01c8063514e62fc116100eb578063c884ef8311610089578063ea3d508a11610063578063ea3d508a146105c1578063f04e283e146105eb578063f2fde38b14610607578063fee81cf414610623576101b6565b8063c884ef831461051f578063db09da121461055b578063dcc59b6f14610597576101b6565b80638da5cb5b116100c55780638da5cb5b14610465578063a270a7371461048f578063a4d66daf146104b9578063bb1757cf146104e3576101b6565b8063514e62fc1461041557806354d1f13d14610451578063715018a61461045b576101b6565b806328d6183b11610158578063439fab9111610132578063439fab9114610358578063474f5a44146103805780634a4ee7b1146103bd5780634e7165a2146103d9576101b6565b806328d6183b146102c85780632de94807146102f257806338d52e0f1461032e576101b6565b80631c10893f116101945780631c10893f1461023c5780631cd64df414610258578063228cb7331461029457806325692962146102be576101b6565b806301ffc9a7146101ba57806307621eca146101f6578063183a4f6e14610220575b5f80fd5b3480156101c5575f80fd5b506101e060048036038101906101db91906113f9565b61065f565b6040516101ed919061143e565b60405180910390f35b348015610201575f80fd5b5061020a6106d8565b604051610217919061146f565b60405180910390f35b61023a600480360381019061023591906114b2565b6106e0565b005b61025660048036038101906102519190611537565b6106ed565b005b348015610263575f80fd5b5061027e60048036038101906102799190611537565b610703565b60405161028b919061143e565b60405180910390f35b34801561029f575f80fd5b506102a8610719565b6040516102b5919061146f565b60405180910390f35b6102c661071e565b005b3480156102d3575f80fd5b506102dc61076f565b6040516102e99190611584565b60405180910390f35b3480156102fd575f80fd5b506103186004803603810190610313919061159d565b610796565b604051610325919061146f565b60405180910390f35b348015610339575f80fd5b506103426107af565b60405161034f91906115d7565b60405180910390f35b348015610363575f80fd5b5061037e60048036038101906103799190611651565b6107ca565b005b34801561038b575f80fd5b506103a660048036038101906103a19190611651565b610921565b6040516103b492919061169c565b60405180910390f35b6103d760048036038101906103d29190611537565b610955565b005b3480156103e4575f80fd5b506103ff60048036038101906103fa9190611651565b61096b565b60405161040c9190611733565b60405180910390f35b348015610420575f80fd5b5061043b60048036038101906104369190611537565b6109c2565b604051610448919061143e565b60405180910390f35b6104596109d9565b005b610463610a12565b005b348015610470575f80fd5b50610479610a25565b60405161048691906115d7565b60405180910390f35b34801561049a575f80fd5b506104a3610a4d565b6040516104b091906115d7565b60405180910390f35b3480156104c4575f80fd5b506104cd610a72565b6040516104da919061146f565b60405180910390f35b3480156104ee575f80fd5b5061050960048036038101906105049190611753565b610a78565b604051610516919061143e565b60405180910390f35b34801561052a575f80fd5b506105456004803603810190610540919061159d565b610e8d565b604051610552919061143e565b60405180910390f35b348015610566575f80fd5b50610581600480360381019061057c9190611753565b610eaa565b60405161058e919061143e565b60405180910390f35b3480156105a2575f80fd5b506105ab610ebd565b6040516105b8919061146f565b60405180910390f35b3480156105cc575f80fd5b506105d5610ec3565b6040516105e29190611584565b60405180910390f35b6106056004803603810190610600919061159d565b610ed5565b005b610621600480360381019061061c919061159d565b610f13565b005b34801561062e575f80fd5b506106496004803603810190610644919061159d565b610f3c565b604051610656919061146f565b60405180910390f35b5f7f0d36a40d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106d157506106d082610f55565b5b9050919050565b5f8054905090565b6106ea3382610fce565b50565b6106f5610fdd565b6106ff8282611014565b5050565b5f818261070f85610796565b1614905092915050565b5f5481565b5f610727611024565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0d36a40d00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f73deaddeaddeaddeaddeaddeaddeaddeaddeaddead905090565b5f6107d361102e565b905080546003825580156108055760018160011c14303b106107fc5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f838381019061081691906118a1565b90505f8160400151148061082d57505f8160600151145b15610864576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f015160025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806020015160045f6101000a81548163ffffffff021916908360e01c021790555080604001515f8190555080606001516003819055506108e633611057565b50801561091c576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61095d610fdd565b6109678282610fce565b5050565b60605f67ffffffffffffffff811115610987576109866117b4565b5b6040519080825280601f01601f1916602001820160405280156109b95781602001600182028036833780820191505090505b50905092915050565b5f80826109ce85610796565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a1a610fdd565b610a235f61112d565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b5f610a81610fdd565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b06573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b2a91906118e0565b73ffffffffffffffffffffffffffffffffffffffff1614158015610bcd5750600115158173ffffffffffffffffffffffffffffffffffffffff1663514e62fc3060026040518363ffffffff1660e01b8152600401610b8992919061194d565b602060405180830381865afa158015610ba4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bc8919061199e565b151514155b15610c04576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c0d856111f3565b610c43576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055f815480929190610c55906119f6565b91905055506001805f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660045f9054906101000a900460e01b875f54604051602401610d0a929190611a3d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610d749190611a9e565b5f604051808303815f865af19150503d805f8114610dad576040519150601f19603f3d011682016040523d82523d5f602084013e610db2565b606091505b5050905080610ded576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16885f54604051602001610e5c93929190611b19565b604051602081830303815290604052604051610e789190611733565b60405180910390a26001925050509392505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b5f610eb4846111f3565b90509392505050565b60055481565b60045f9054906101000a900460e01b81565b610edd610fdd565b63389a75e1600c52805f526020600c208054421115610f0357636f5e88185f526004601cfd5b5f815550610f108161112d565b50565b610f1b610fdd565b8060601b610f3057637448fbae5f526004601cfd5b610f398161112d565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610fc75750610fc682611255565b5b9050919050565b610fd982825f6112ce565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611012576382b429005f526004601cfd5b565b611020828260016112ce565b5050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61105f611326565b156110d7577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561109957630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061112a565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611135611326565b1561119a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506111f0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615801561124e5750600354600554105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806112c757506112c68261132a565b5b9050919050565b638b78c6d8600c52825f526020600c208054838117836112f057848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113d8816113a4565b81146113e2575f80fd5b50565b5f813590506113f3816113cf565b92915050565b5f6020828403121561140e5761140d61139c565b5b5f61141b848285016113e5565b91505092915050565b5f8115159050919050565b61143881611424565b82525050565b5f6020820190506114515f83018461142f565b92915050565b5f819050919050565b61146981611457565b82525050565b5f6020820190506114825f830184611460565b92915050565b61149181611457565b811461149b575f80fd5b50565b5f813590506114ac81611488565b92915050565b5f602082840312156114c7576114c661139c565b5b5f6114d48482850161149e565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611506826114dd565b9050919050565b611516816114fc565b8114611520575f80fd5b50565b5f813590506115318161150d565b92915050565b5f806040838503121561154d5761154c61139c565b5b5f61155a85828601611523565b925050602061156b8582860161149e565b9150509250929050565b61157e816113a4565b82525050565b5f6020820190506115975f830184611575565b92915050565b5f602082840312156115b2576115b161139c565b5b5f6115bf84828501611523565b91505092915050565b6115d1816114fc565b82525050565b5f6020820190506115ea5f8301846115c8565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611611576116106115f0565b5b8235905067ffffffffffffffff81111561162e5761162d6115f4565b5b60208301915083600182028301111561164a576116496115f8565b5b9250929050565b5f80602083850312156116675761166661139c565b5b5f83013567ffffffffffffffff811115611684576116836113a0565b5b611690858286016115fc565b92509250509250929050565b5f6040820190506116af5f830185611460565b6116bc60208301846115c8565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f611705826116c3565b61170f81856116cd565b935061171f8185602086016116dd565b611728816116eb565b840191505092915050565b5f6020820190508181035f83015261174b81846116fb565b905092915050565b5f805f6040848603121561176a5761176961139c565b5b5f61177786828701611523565b935050602084013567ffffffffffffffff811115611798576117976113a0565b5b6117a4868287016115fc565b92509250509250925092565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6117ea826116eb565b810181811067ffffffffffffffff82111715611809576118086117b4565b5b80604052505050565b5f61181b611393565b905061182782826117e1565b919050565b5f60808284031215611841576118406117b0565b5b61184b6080611812565b90505f61185a84828501611523565b5f83015250602061186d848285016113e5565b60208301525060406118818482850161149e565b60408301525060606118958482850161149e565b60608301525092915050565b5f608082840312156118b6576118b561139c565b5b5f6118c38482850161182c565b91505092915050565b5f815190506118da8161150d565b92915050565b5f602082840312156118f5576118f461139c565b5b5f611902848285016118cc565b91505092915050565b5f819050919050565b5f819050919050565b5f61193761193261192d8461190b565b611914565b611457565b9050919050565b6119478161191d565b82525050565b5f6040820190506119605f8301856115c8565b61196d602083018461193e565b9392505050565b61197d81611424565b8114611987575f80fd5b50565b5f8151905061199881611974565b92915050565b5f602082840312156119b3576119b261139c565b5b5f6119c08482850161198a565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a0082611457565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a3257611a316119c9565b5b600182019050919050565b5f604082019050611a505f8301856115c8565b611a5d6020830184611460565b9392505050565b5f81905092915050565b5f611a78826116c3565b611a828185611a64565b9350611a928185602086016116dd565b80840191505092915050565b5f611aa98284611a6e565b915081905092915050565b5f8160601b9050919050565b5f611aca82611ab4565b9050919050565b5f611adb82611ac0565b9050919050565b611af3611aee826114fc565b611ad1565b82525050565b5f819050919050565b611b13611b0e82611457565b611af9565b82525050565b5f611b248286611ae2565b601482019150611b348285611ae2565b601482019150611b448284611b02565b60208201915081905094935050505056fea2646970667358221220d6b660c45cfb14561fecfab54209da8ea926d96b371bbdb9b93f5ad944e89aad64736f6c634300081a0033",d=class d extends l.DeployableTarget{constructor(){super(...arguments),this.abi=a.h}async claims(f){return await a.dz(this._config,{address:this.assertValidAddress(),args:[],...f})}async currentReward(f){return await a.mz(this._config,{address:this.assertValidAddress(),args:[],...f})}async reward(f){return await a.Nz(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,b){return await a.yz(this._config,{address:this.assertValidAddress(),args:[f],...b})}async venue(f){return await a.Oz(this._config,{address:this.assertValidAddress(),...f})}async limit(f){return await a.Tz(this._config,{address:this.assertValidAddress(),...f})}async selector(f){return await a.Mz(this._config,{address:this.assertValidAddress(),...f})}async claim(f,b){return await this.awaitResult(this.claimRaw(f,b))}async claimRaw(f,b){const{request:e,result:c}=await a.qz(this._config,{address:this.assertValidAddress(),args:[o.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...b});return{hash:await a.zz(this._config,e),result:c}}async isClaimable(f,b){return await a.wz(this._config,{address:this.assertValidAddress(),args:[f.target,f.data],...b})}async canBeClaimed(f){return await this.getRemainingClaimPotential(f)>0n}async getRemainingClaimPotential(f){const[b,e]=await Promise.all([this.claims(f),this.limit(f)]);return e-b}buildParameters(f,b){const[e,c]=this.validateDeploymentConfig(f,b);return{abi:a.h,bytecode:h,args:[i(e)],...this.optionallyAttachAccount(c.account)}}buildClaimData(){return t.zeroHash}};d.bases={31337:void 0,...n.PointsIncentive},d.registryType=u.RegistryType.INCENTIVE;let s=d;const i=({venue:r,selector:f,reward:b,limit:e})=>t.encodeAbiParameters([{type:"address",name:"venue"},{type:"bytes4",name:"selector"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"}],[r,f,b,e]);exports.pointsIncentiveAbi=a.h;exports.PointsIncentive=s;exports.preparePointsIncentivePayload=i;
2
2
  //# sourceMappingURL=PointsIncentive.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PointsIncentive.cjs","sources":["../../src/Incentives/PointsIncentive.ts"],"sourcesContent":["import {\n pointsIncentiveAbi,\n readPointsIncentiveClaimed,\n readPointsIncentiveClaims,\n readPointsIncentiveCurrentReward,\n readPointsIncentiveIsClaimable,\n readPointsIncentiveLimit,\n readPointsIncentiveReward,\n readPointsIncentiveSelector,\n readPointsIncentiveVenue,\n simulatePointsIncentiveClaim,\n writePointsIncentiveClaim,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/PointsIncentive.sol/PointsIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroHash,\n} from 'viem';\nimport { PointsIncentive as PointsIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { pointsIncentiveAbi };\n\n/**\n * The object representation of a `PointsIncentive.InitPayload`\n *\n * @export\n * @interface PointsIncentivePayload\n * @typedef {PointsIncentivePayload}\n */\nexport interface PointsIncentivePayload {\n /**\n * The address of the points contract\n *\n * @type {Address}\n */\n venue: Address;\n /**\n * The selector for the issuance function on the points contract\n *\n * @type {Hex}\n */\n selector: Hex;\n /**\n * The reward amount issued for each claim\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * A generic `viem.Log` event with support for `PointsIncentive` event types.\n *\n * @export\n * @typedef {PointsIncentiveLog}\n * @template {ContractEventName<\n * typeof pointsIncentiveAbi\n * >} [event=ContractEventName<typeof pointsIncentiveAbi>]\n */\nexport type PointsIncentiveLog<\n event extends ContractEventName<\n typeof pointsIncentiveAbi\n > = ContractEventName<typeof pointsIncentiveAbi>,\n> = GenericLog<typeof pointsIncentiveAbi, event>;\n\n/**\n * A simple on-chain points incentive implementation that allows claiming of soulbound tokens.\n *\n * In order for any claim to be successful:\n * - The claimer must not have already claimed the incentive; and\n * - The maximum number of claims must not have been reached; and\n * - This contract must be authorized to operate the points contract's issuance function\n *\n * @export\n * @class PointsIncentive\n * @typedef {PointsIncentive}\n * @extends {DeployableTarget<PointsIncentivePayload>}\n */\nexport class PointsIncentive extends DeployableTarget<\n PointsIncentivePayload,\n typeof pointsIncentiveAbi\n> {\n public override readonly abi = pointsIncentiveAbi;\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_POINTS_INCENTIVE_BASE,\n ...(PointsIncentiveBases 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 number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readPointsIncentiveClaims(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 current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readPointsIncentiveCurrentReward(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 reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} The reward amount issued for each claim\n */\n public async reward(params?: ReadParams) {\n return await readPointsIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readPointsIncentiveClaimed(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 points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async venue(params?: ReadParams) {\n return await readPointsIncentiveVenue(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 maximum number of claims that can be made (one per address)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readPointsIncentiveLimit(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 selector for the issuance function on the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async selector(params?: ReadParams) {\n return await readPointsIncentiveSelector(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 * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the incentive was successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the incentive was successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulatePointsIncentiveClaim(\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 writePointsIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n * For the POOL strategy, the `bytes data` portion of the payload ignored.\n * The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readPointsIncentiveIsClaimable(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 * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if total claims is less than limit\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - True if total claims is less than limit\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [claims, limit] = await Promise.all([\n this.claims(params),\n this.limit(params),\n ]);\n return limit - claims;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?PointsIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: PointsIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: pointsIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [preparePointsIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Builds the claim data for the PointsIncentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as PointsIncentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because PointsIncentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link PointsIncentivePayload}, properly encode a `PointsIncentive.InitPayload` for use with {@link PointsIncentive} initialization.\n *\n * @param {PointsIncentivePayload} param0\n * @param {Address} param0.venue - The address of the points contract\n * @param {Hex} param0.selector - The selector for the issuance function on the points contract\n * @param {bigint} param0.reward - The reward amount issued for each claim\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @returns {*}\n */\nexport const preparePointsIncentivePayload = ({\n venue,\n selector,\n reward,\n limit,\n}: PointsIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [venue, selector, reward, limit],\n );\n};\n"],"names":["_PointsIncentive","DeployableTarget","pointsIncentiveAbi","params","readPointsIncentiveClaims","readPointsIncentiveCurrentReward","readPointsIncentiveReward","address","readPointsIncentiveClaimed","readPointsIncentiveVenue","readPointsIncentiveLimit","readPointsIncentiveSelector","payload","request","result","simulatePointsIncentiveClaim","prepareClaimPayload","writePointsIncentiveClaim","readPointsIncentiveIsClaimable","claims","limit","_payload","_options","options","bytecode","preparePointsIncentivePayload","zeroHash","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward","encodeAbiParameters"],"mappings":"s7cAmGaA,EAAN,MAAMA,UAAwBC,EAAAA,gBAGnC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA6B/B,MAAa,OAAOC,EAAqB,CAChC,OAAA,MAAMC,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAID,CAAA,CACL,CACH,CAUA,MAAa,cAAcA,EAAqB,CACvC,OAAA,MAAME,EAAAA,GAAiC,KAAK,QAAS,CAC1D,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,OAAOA,EAAqB,CAChC,OAAA,MAAMG,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIH,CAAA,CACL,CACH,CAWA,MAAa,QAAQI,EAAkBJ,EAAqB,CACnD,OAAA,MAAMK,EAAAA,GAA2B,KAAK,QAAS,CACpD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACD,CAAO,EAEd,GAAIJ,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAqB,CAC/B,OAAA,MAAMM,EAAAA,GAAyB,KAAK,QAAS,CAClD,QAAS,KAAK,mBAAmB,EAEjC,GAAIN,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAqB,CAC/B,OAAA,MAAMO,EAAAA,GAAyB,KAAK,QAAS,CAClD,QAAS,KAAK,mBAAmB,EAEjC,GAAIP,CAAA,CACL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B,CACf,OAAAG,UACT,CACF,EAzPE1B,EAAuB,MAAiC,CACtD,MAAO,OACP,GAAI2B,EAAA,eAAA,EASN3B,EAAuB,aAA6B4B,EAAa,aAAA,UAvB5D,IAAMC,EAAN7B,EAiRA,MAAMyB,EAAgC,CAAC,CAC5C,MAAAK,EACA,SAAAC,EACA,OAAAC,EACA,MAAAZ,CACF,IACSa,EAAA,oBACL,CACE,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,SAAU,KAAM,UAAW,EACnC,CAAE,KAAM,UAAW,KAAM,QAAS,EAClC,CAAE,KAAM,UAAW,KAAM,OAAQ,CACnC,EACA,CAACH,EAAOC,EAAUC,EAAQZ,CAAK,CAAA"}
1
+ {"version":3,"file":"PointsIncentive.cjs","sources":["../../src/Incentives/PointsIncentive.ts"],"sourcesContent":["import {\n pointsIncentiveAbi,\n readPointsIncentiveClaimed,\n readPointsIncentiveClaims,\n readPointsIncentiveCurrentReward,\n readPointsIncentiveIsClaimable,\n readPointsIncentiveLimit,\n readPointsIncentiveReward,\n readPointsIncentiveSelector,\n readPointsIncentiveVenue,\n simulatePointsIncentiveClaim,\n writePointsIncentiveClaim,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/PointsIncentive.sol/PointsIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroHash,\n} from 'viem';\nimport { PointsIncentive as PointsIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { pointsIncentiveAbi };\n\n/**\n * The object representation of a `PointsIncentive.InitPayload`\n *\n * @export\n * @interface PointsIncentivePayload\n * @typedef {PointsIncentivePayload}\n */\nexport interface PointsIncentivePayload {\n /**\n * The address of the points contract\n *\n * @type {Address}\n */\n venue: Address;\n /**\n * The selector for the issuance function on the points contract\n *\n * @type {Hex}\n */\n selector: Hex;\n /**\n * The reward amount issued for each claim\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * A generic `viem.Log` event with support for `PointsIncentive` event types.\n *\n * @export\n * @typedef {PointsIncentiveLog}\n * @template {ContractEventName<\n * typeof pointsIncentiveAbi\n * >} [event=ContractEventName<typeof pointsIncentiveAbi>]\n */\nexport type PointsIncentiveLog<\n event extends ContractEventName<\n typeof pointsIncentiveAbi\n > = ContractEventName<typeof pointsIncentiveAbi>,\n> = GenericLog<typeof pointsIncentiveAbi, event>;\n\n/**\n * A simple on-chain points incentive implementation that allows claiming of soulbound tokens.\n *\n * In order for any claim to be successful:\n * - The claimer must not have already claimed the incentive; and\n * - The maximum number of claims must not have been reached; and\n * - This contract must be authorized to operate the points contract's issuance function\n *\n * @export\n * @class PointsIncentive\n * @typedef {PointsIncentive}\n * @extends {DeployableTarget<PointsIncentivePayload>}\n */\nexport class PointsIncentive extends DeployableTarget<\n PointsIncentivePayload,\n typeof pointsIncentiveAbi\n> {\n public override readonly abi = pointsIncentiveAbi;\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_POINTS_INCENTIVE_BASE,\n ...(PointsIncentiveBases 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 number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readPointsIncentiveClaims(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 current reward\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readPointsIncentiveCurrentReward(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 reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} The reward amount issued for each claim\n */\n public async reward(params?: ReadParams) {\n return await readPointsIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readPointsIncentiveClaimed(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 points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async venue(params?: ReadParams) {\n return await readPointsIncentiveVenue(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 maximum number of claims that can be made (one per address)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readPointsIncentiveLimit(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 selector for the issuance function on the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async selector(params?: ReadParams) {\n return await readPointsIncentiveSelector(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 * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the incentive was successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the incentive was successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulatePointsIncentiveClaim(\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 writePointsIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n * For the POOL strategy, the `bytes data` portion of the payload ignored.\n * The recipient must not have already claimed the incentive.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readPointsIncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if total claims is less than limit\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - True if total claims is less than limit\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [claims, limit] = await Promise.all([\n this.claims(params),\n this.limit(params),\n ]);\n return limit - claims;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?PointsIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: PointsIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: pointsIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [preparePointsIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Builds the claim data for the PointsIncentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as PointsIncentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because PointsIncentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link PointsIncentivePayload}, properly encode a `PointsIncentive.InitPayload` for use with {@link PointsIncentive} initialization.\n *\n * @param {PointsIncentivePayload} param0\n * @param {Address} param0.venue - The address of the points contract\n * @param {Hex} param0.selector - The selector for the issuance function on the points contract\n * @param {bigint} param0.reward - The reward amount issued for each claim\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @returns {*}\n */\nexport const preparePointsIncentivePayload = ({\n venue,\n selector,\n reward,\n limit,\n}: PointsIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [venue, selector, reward, limit],\n );\n};\n"],"names":["_PointsIncentive","DeployableTarget","pointsIncentiveAbi","params","readPointsIncentiveClaims","readPointsIncentiveCurrentReward","readPointsIncentiveReward","address","readPointsIncentiveClaimed","readPointsIncentiveVenue","readPointsIncentiveLimit","readPointsIncentiveSelector","payload","request","result","simulatePointsIncentiveClaim","prepareClaimPayload","writePointsIncentiveClaim","readPointsIncentiveIsClaimable","claims","limit","_payload","_options","options","bytecode","preparePointsIncentivePayload","zeroHash","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward","encodeAbiParameters"],"mappings":"s7cAmGaA,EAAN,MAAMA,UAAwBC,EAAAA,gBAGnC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA6B/B,MAAa,OAAOC,EAAqB,CAChC,OAAA,MAAMC,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAID,CAAA,CACL,CACH,CAUA,MAAa,cAAcA,EAAqB,CACvC,OAAA,MAAME,EAAAA,GAAiC,KAAK,QAAS,CAC1D,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,OAAOA,EAAqB,CAChC,OAAA,MAAMG,EAAAA,GAA0B,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIH,CAAA,CACL,CACH,CAWA,MAAa,QAAQI,EAAkBJ,EAAqB,CACnD,OAAA,MAAMK,EAAAA,GAA2B,KAAK,QAAS,CACpD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACD,CAAO,EAEd,GAAIJ,CAAA,CACL,CACH,CAUA,MAAa,MAAMA,EAAqB,CAC/B,O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