@boostxyz/sdk 5.3.1 → 6.0.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 (143) hide show
  1. package/dist/Actions/Action.cjs +1 -1
  2. package/dist/Actions/Action.js +3 -3
  3. package/dist/Actions/EventAction.cjs +1 -1
  4. package/dist/Actions/EventAction.cjs.map +1 -1
  5. package/dist/Actions/EventAction.d.ts +13 -3
  6. package/dist/Actions/EventAction.d.ts.map +1 -1
  7. package/dist/Actions/EventAction.js +216 -193
  8. package/dist/Actions/EventAction.js.map +1 -1
  9. package/dist/AllowLists/AllowList.cjs +1 -1
  10. package/dist/AllowLists/AllowList.js +2 -2
  11. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  12. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
  13. package/dist/AllowLists/SimpleAllowList.js +24 -24
  14. package/dist/AllowLists/SimpleAllowList.js.map +1 -1
  15. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  16. package/dist/AllowLists/SimpleDenyList.js +3 -3
  17. package/dist/Auth/PassthroughAuth.cjs +1 -1
  18. package/dist/Auth/PassthroughAuth.cjs.map +1 -1
  19. package/dist/Auth/PassthroughAuth.js +14 -14
  20. package/dist/Boost.cjs.map +1 -1
  21. package/dist/Boost.js.map +1 -1
  22. package/dist/BoostCore.cjs +2 -2
  23. package/dist/BoostCore.cjs.map +1 -1
  24. package/dist/BoostCore.d.ts +247 -0
  25. package/dist/BoostCore.d.ts.map +1 -1
  26. package/dist/BoostCore.js +421 -259
  27. package/dist/BoostCore.js.map +1 -1
  28. package/dist/BoostRegistry.cjs +1 -1
  29. package/dist/BoostRegistry.cjs.map +1 -1
  30. package/dist/BoostRegistry.js +43 -43
  31. package/dist/BoostRegistry.js.map +1 -1
  32. package/dist/Budget-DMbfdTom.cjs +2 -0
  33. package/dist/{Budget-AoNx7uFd.cjs.map → Budget-DMbfdTom.cjs.map} +1 -1
  34. package/dist/Budget-DO6sGTIR.js +463 -0
  35. package/dist/{Budget-DYIV9iNK.js.map → Budget-DO6sGTIR.js.map} +1 -1
  36. package/dist/Budgets/Budget.cjs +1 -1
  37. package/dist/Budgets/Budget.js +2 -2
  38. package/dist/Budgets/ManagedBudget.cjs +1 -1
  39. package/dist/Budgets/ManagedBudget.cjs.map +1 -1
  40. package/dist/Budgets/ManagedBudget.js +53 -53
  41. package/dist/Budgets/ManagedBudgetWithFees.d.ts +26 -0
  42. package/dist/Budgets/ManagedBudgetWithFees.d.ts.map +1 -1
  43. package/dist/Deployable/DeployableTarget.cjs +1 -1
  44. package/dist/Deployable/DeployableTarget.js +1 -1
  45. package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
  46. package/dist/Deployable/DeployableTargetWithRBAC.js +15 -15
  47. package/dist/Incentive-Boviez4z.js +1036 -0
  48. package/dist/Incentive-Boviez4z.js.map +1 -0
  49. package/dist/Incentive-wM4zizTH.cjs +2 -0
  50. package/dist/Incentive-wM4zizTH.cjs.map +1 -0
  51. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  52. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  53. package/dist/Incentives/AllowListIncentive.d.ts +9 -1
  54. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  55. package/dist/Incentives/AllowListIncentive.js +64 -47
  56. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  57. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  58. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  59. package/dist/Incentives/CGDAIncentive.d.ts +12 -1
  60. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  61. package/dist/Incentives/CGDAIncentive.js +64 -33
  62. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  63. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  64. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  65. package/dist/Incentives/ERC20Incentive.d.ts +37 -1
  66. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  67. package/dist/Incentives/ERC20Incentive.js +73 -49
  68. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  69. package/dist/Incentives/ERC20PeggedIncentive.d.ts +35 -0
  70. package/dist/Incentives/ERC20PeggedIncentive.d.ts.map +1 -1
  71. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +35 -0
  72. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +1 -1
  73. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
  74. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
  75. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +25 -0
  76. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -1
  77. package/dist/Incentives/ERC20VariableCriteriaIncentive.js +24 -24
  78. package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
  79. package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
  80. package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
  81. package/dist/Incentives/ERC20VariableIncentive.d.ts +35 -0
  82. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  83. package/dist/Incentives/ERC20VariableIncentive.js +55 -38
  84. package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
  85. package/dist/Incentives/Incentive.cjs +1 -1
  86. package/dist/Incentives/Incentive.d.ts +25 -0
  87. package/dist/Incentives/Incentive.d.ts.map +1 -1
  88. package/dist/Incentives/Incentive.js +2 -2
  89. package/dist/Incentives/PointsIncentive.cjs +1 -1
  90. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  91. package/dist/Incentives/PointsIncentive.d.ts +8 -0
  92. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  93. package/dist/Incentives/PointsIncentive.js +50 -28
  94. package/dist/Incentives/PointsIncentive.js.map +1 -1
  95. package/dist/SimpleDenyList-CW4RwwRw.js +133 -0
  96. package/dist/{SimpleDenyList-ByAr4X1r.js.map → SimpleDenyList-CW4RwwRw.js.map} +1 -1
  97. package/dist/SimpleDenyList-Cybtz7AK.cjs +2 -0
  98. package/dist/{SimpleDenyList-CsRXJPwm.cjs.map → SimpleDenyList-Cybtz7AK.cjs.map} +1 -1
  99. package/dist/Validators/LimitedSignerValidator.cjs +1 -1
  100. package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
  101. package/dist/Validators/LimitedSignerValidator.js +33 -33
  102. package/dist/Validators/LimitedSignerValidator.js.map +1 -1
  103. package/dist/Validators/SignerValidator.cjs +1 -1
  104. package/dist/Validators/SignerValidator.cjs.map +1 -1
  105. package/dist/Validators/SignerValidator.js +26 -26
  106. package/dist/Validators/SignerValidator.js.map +1 -1
  107. package/dist/Validators/Validator.cjs +1 -1
  108. package/dist/Validators/Validator.js +3 -3
  109. package/dist/deployments-CIXw_WKk.cjs +2 -0
  110. package/dist/deployments-CIXw_WKk.cjs.map +1 -0
  111. package/dist/{deployments-D0fs26TV.js → deployments-DqjtOTUr.js} +47 -47
  112. package/dist/{deployments-D0fs26TV.js.map → deployments-DqjtOTUr.js.map} +1 -1
  113. package/dist/deployments.json +24 -24
  114. package/dist/generated-DgXPUgXl.cjs +3 -0
  115. package/dist/generated-DgXPUgXl.cjs.map +1 -0
  116. package/dist/{generated-Cyvr_Tjx.js → generated-pJZHmRCK.js} +728 -459
  117. package/dist/generated-pJZHmRCK.js.map +1 -0
  118. package/dist/index.cjs +1 -1
  119. package/dist/index.js +137 -136
  120. package/package.json +1 -1
  121. package/src/Actions/EventAction.ts +108 -27
  122. package/src/BoostCore.test.ts +124 -2
  123. package/src/BoostCore.ts +227 -0
  124. package/src/Incentives/AllowListIncentive.ts +17 -0
  125. package/src/Incentives/CGDAIncentive.ts +31 -0
  126. package/src/Incentives/ERC20Incentive.ts +27 -0
  127. package/src/Incentives/ERC20PeggedIncentive.ts +18 -0
  128. package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts +26 -0
  129. package/src/Incentives/ERC20VariableIncentive.ts +18 -0
  130. package/src/Incentives/PointsIncentive.ts +22 -0
  131. package/dist/Budget-AoNx7uFd.cjs +0 -2
  132. package/dist/Budget-DYIV9iNK.js +0 -463
  133. package/dist/Incentive-BbkfwGOb.cjs +0 -2
  134. package/dist/Incentive-BbkfwGOb.cjs.map +0 -1
  135. package/dist/Incentive-qlnv5kQB.js +0 -991
  136. package/dist/Incentive-qlnv5kQB.js.map +0 -1
  137. package/dist/SimpleDenyList-ByAr4X1r.js +0 -133
  138. package/dist/SimpleDenyList-CsRXJPwm.cjs +0 -2
  139. package/dist/deployments-DoIOqxco.cjs +0 -2
  140. package/dist/deployments-DoIOqxco.cjs.map +0 -1
  141. package/dist/generated-Cyvr_Tjx.js.map +0 -1
  142. package/dist/generated-DtYPHhtX.cjs +0 -3
  143. package/dist/generated-DtYPHhtX.cjs.map +0 -1
@@ -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: [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":"kudAmGaA,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,Q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I,CACxC,KAAK,OAAOjB,CAAM,EAClB,KAAK,MAAMA,CAAM,CAAA,CAClB,EACD,OAAOiB,EAAQD,CACjB,CAUgB,gBACdE,EACAC,EACyB,CACzB,KAAM,CAACV,EAASW,CAAO,EAAI,KAAK,yBAC9BF,EACAC,CAAA,EAEK,MAAA,CACL,IAAKpB,EAAA,EACL,SAAAsB,EACA,KAAM,CAACC,EAA8Bb,CAAO,CAAC,EAC7C,GAAG,KAAK,wBAAwBW,EAAQ,OAAO,CAAA,CAEnD,CASO,gBAAiB,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 * Generates a top-up payload for the PointsIncentive contract.\n *\n * @public\n * @param {bigint} netAmount The net reward amount to be added to the incentive.\n * @returns {Hex} The ABI-encoded top-up payload.\n */\n public getTopupPayload(netAmount: bigint): Hex {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'amount' },\n ],\n [\n this.payload?.venue ?? zeroHash,\n this.payload?.selector ?? zeroHash,\n netAmount,\n ],\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","netAmount","encodeAbiParameters","_a","zeroHash","_b","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward"],"mappings":"o8UAmGaA,EAAN,MAAMA,UAAwBC,EAAAA,gBAGnC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB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GAAI+B,EAAA,eAAA,EASN/B,EAAuB,aAA6BgC,EAAa,aAAA,UAvB5D,IAAMC,EAANjC,EAuSA,MAAMyB,EAAgC,CAAC,CAC5C,MAAAS,EACA,SAAAC,EACA,OAAAC,EACA,MAAAhB,CACF,IACSO,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,CAACO,EAAOC,EAAUC,EAAQhB,CAAK,CAAA"}
@@ -701,6 +701,14 @@ export declare class PointsIncentive extends DeployableTarget<PointsIncentivePay
701
701
  * @returns {GenericDeployableParams}
702
702
  */
703
703
  buildParameters(_payload?: PointsIncentivePayload, _options?: DeployableOptions): GenericDeployableParams;
704
+ /**
705
+ * Generates a top-up payload for the PointsIncentive contract.
706
+ *
707
+ * @public
708
+ * @param {bigint} netAmount The net reward amount to be added to the incentive.
709
+ * @returns {Hex} The ABI-encoded top-up payload.
710
+ */
711
+ getTopupPayload(netAmount: bigint): Hex;
704
712
  /**
705
713
  * Builds the claim data for the PointsIncentive.
706
714
  *
@@ -1 +1 @@
1
- {"version":3,"file":"PointsIncentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/PointsIncentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAWnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,GAAG,EAGT,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ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UG;IACU,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,UAAU;IASnE;;;;;;;OAOG;IACU,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU;IAI7C;;;;;;;OAOG;IACU,0BAA0B,CAAC,MAAM,CAAC,EAAE,UAAU;IAQ3D;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,sBAAsB,EACjC,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;IAa1B;;;;;;OAMG;IACI,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG;IAe9C;;;;;;OAMG;IACI,cAAc;CAGtB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,wCAKvC,sBAAsB,kBAUxB,CAAC"}
@@ -1,12 +1,12 @@
1
- import { N as c, bf as i, bg as r, bh as n, bi as o, bj as l, bk as m, bl as h, bm as u, bn as g, bo as y } from "../generated-Cyvr_Tjx.js";
2
- import { zeroHash as p, encodeAbiParameters as w } from "viem";
3
- import { P as A } from "../deployments-D0fs26TV.js";
1
+ import { R as s, bf as n, bg as o, bh as l, bi as m, bj as h, bk as u, bl as y, bm as p, bn as g, bo as w } from "../generated-pJZHmRCK.js";
2
+ import { encodeAbiParameters as i, zeroHash as c } from "viem";
3
+ import { P as A } from "../deployments-DqjtOTUr.js";
4
4
  import { DeployableTarget as V } from "../Deployable/DeployableTarget.js";
5
5
  import { prepareClaimPayload as C } from "../claiming.js";
6
- import { RegistryType as R } from "../utils.js";
7
- const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611c21806100bd5f395ff3fe6080604052600436106101b6575f3560e01c8063514e62fc116100eb578063c884ef8311610089578063ea3d508a11610063578063ea3d508a146105c1578063f04e283e146105eb578063f2fde38b14610607578063fee81cf414610623576101b6565b8063c884ef831461051f578063db09da121461055b578063dcc59b6f14610597576101b6565b80638da5cb5b116100c55780638da5cb5b14610465578063a270a7371461048f578063a4d66daf146104b9578063bb1757cf146104e3576101b6565b8063514e62fc1461041557806354d1f13d14610451578063715018a61461045b576101b6565b806328d6183b11610158578063439fab9111610132578063439fab9114610358578063474f5a44146103805780634a4ee7b1146103bd5780634e7165a2146103d9576101b6565b806328d6183b146102c85780632de94807146102f257806338d52e0f1461032e576101b6565b80631c10893f116101945780631c10893f1461023c5780631cd64df414610258578063228cb7331461029457806325692962146102be576101b6565b806301ffc9a7146101ba57806307621eca146101f6578063183a4f6e14610220575b5f80fd5b3480156101c5575f80fd5b506101e060048036038101906101db919061145a565b61065f565b6040516101ed919061149f565b60405180910390f35b348015610201575f80fd5b5061020a6106d8565b60405161021791906114d0565b60405180910390f35b61023a60048036038101906102359190611513565b6106e0565b005b61025660048036038101906102519190611598565b6106ed565b005b348015610263575f80fd5b5061027e60048036038101906102799190611598565b610703565b60405161028b919061149f565b60405180910390f35b34801561029f575f80fd5b506102a8610719565b6040516102b591906114d0565b60405180910390f35b6102c661071e565b005b3480156102d3575f80fd5b506102dc61076f565b6040516102e991906115e5565b60405180910390f35b3480156102fd575f80fd5b50610318600480360381019061031391906115fe565b610796565b60405161032591906114d0565b60405180910390f35b348015610339575f80fd5b506103426107af565b60405161034f9190611638565b60405180910390f35b348015610363575f80fd5b5061037e600480360381019061037991906116b2565b6107ca565b005b34801561038b575f80fd5b506103a660048036038101906103a191906116b2565b610982565b6040516103b49291906116fd565b60405180910390f35b6103d760048036038101906103d29190611598565b6109b6565b005b3480156103e4575f80fd5b506103ff60048036038101906103fa91906116b2565b6109cc565b60405161040c9190611794565b60405180910390f35b348015610420575f80fd5b5061043b60048036038101906104369190611598565b610a23565b604051610448919061149f565b60405180910390f35b610459610a3a565b005b610463610a73565b005b348015610470575f80fd5b50610479610a86565b6040516104869190611638565b60405180910390f35b34801561049a575f80fd5b506104a3610aae565b6040516104b09190611638565b60405180910390f35b3480156104c4575f80fd5b506104cd610ad3565b6040516104da91906114d0565b60405180910390f35b3480156104ee575f80fd5b50610509600480360381019061050491906117b4565b610ad9565b604051610516919061149f565b60405180910390f35b34801561052a575f80fd5b50610545600480360381019061054091906115fe565b610eee565b604051610552919061149f565b60405180910390f35b348015610566575f80fd5b50610581600480360381019061057c91906117b4565b610f0b565b60405161058e919061149f565b60405180910390f35b3480156105a2575f80fd5b506105ab610f1e565b6040516105b891906114d0565b60405180910390f35b3480156105cc575f80fd5b506105d5610f24565b6040516105e291906115e5565b60405180910390f35b610605600480360381019061060091906115fe565b610f36565b005b610621600480360381019061061c91906115fe565b610f74565b005b34801561062e575f80fd5b50610649600480360381019061064491906115fe565b610f9d565b60405161065691906114d0565b60405180910390f35b5f7f0d36a40d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106d157506106d082610fb6565b5b9050919050565b5f8054905090565b6106ea338261102f565b50565b6106f561103e565b6106ff8282611075565b5050565b5f818261070f85610796565b1614905092915050565b5f5481565b5f610727611085565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0d36a40d00000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b5f73deaddeaddeaddeaddeaddeaddeaddeaddeaddead905090565b5f6107d361108f565b905080546003825580156108055760018160011c14303b106107fc5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f83838101906108169190611902565b90505f8160400151148061082d57505f8160600151145b15610864576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f015160025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806020015160045f6101000a81548163ffffffff021916908360e01c021790555080604001515f8190555080606001516003819055506108e6336110b8565b805f015173ffffffffffffffffffffffffffffffffffffffff167fef49c8fd80435c15980f0f55660ffaac9417e5843768f7f21566cfad2d19bfe782602001518360400151846060015160405161093f9392919061192d565b60405180910390a250801561097d576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109be61103e565b6109c8828261102f565b5050565b60605f67ffffffffffffffff8111156109e8576109e7611815565b5b6040519080825280601f01601f191660200182016040528015610a1a5781602001600182028036833780820191505090505b50905092915050565b5f8082610a2f85610796565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610a7b61103e565b610a845f61118e565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b5f610ae261103e565b5f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b67573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8b9190611976565b73ffffffffffffffffffffffffffffffffffffffff1614158015610c2e5750600115158173ffffffffffffffffffffffffffffffffffffffff1663514e62fc3060026040518363ffffffff1660e01b8152600401610bea9291906119e3565b602060405180830381865afa158015610c05573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c299190611a34565b151514155b15610c65576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c6e85611254565b610ca4576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055f815480929190610cb690611a8c565b91905055506001805f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660045f9054906101000a900460e01b875f54604051602401610d6b929190611ad3565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610dd59190611b34565b5f604051808303815f865af19150503d805f8114610e0e576040519150601f19603f3d011682016040523d82523d5f602084013e610e13565b606091505b5050905080610e4e576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16885f54604051602001610ebd93929190611baf565b604051602081830303815290604052604051610ed99190611794565b60405180910390a26001925050509392505050565b6001602052805f5260405f205f915054906101000a900460ff1681565b5f610f1584611254565b90509392505050565b60055481565b60045f9054906101000a900460e01b81565b610f3e61103e565b63389a75e1600c52805f526020600c208054421115610f6457636f5e88185f526004601cfd5b5f815550610f718161118e565b50565b610f7c61103e565b8060601b610f9157637448fbae5f526004601cfd5b610f9a8161118e565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fa9216705000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806110285750611027826112b6565b5b9050919050565b61103a82825f61132f565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611073576382b429005f526004601cfd5b565b6110818282600161132f565b5050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6110c0611387565b15611138577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156110fa57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061118b565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b611196611387565b156111fb577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550611251565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161580156112af5750600354600554105b9050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061132857506113278261138b565b5b9050919050565b638b78c6d8600c52825f526020600c2080548381178361135157848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61143981611405565b8114611443575f80fd5b50565b5f8135905061145481611430565b92915050565b5f6020828403121561146f5761146e6113fd565b5b5f61147c84828501611446565b91505092915050565b5f8115159050919050565b61149981611485565b82525050565b5f6020820190506114b25f830184611490565b92915050565b5f819050919050565b6114ca816114b8565b82525050565b5f6020820190506114e35f8301846114c1565b92915050565b6114f2816114b8565b81146114fc575f80fd5b50565b5f8135905061150d816114e9565b92915050565b5f60208284031215611528576115276113fd565b5b5f611535848285016114ff565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6115678261153e565b9050919050565b6115778161155d565b8114611581575f80fd5b50565b5f813590506115928161156e565b92915050565b5f80604083850312156115ae576115ad6113fd565b5b5f6115bb85828601611584565b92505060206115cc858286016114ff565b9150509250929050565b6115df81611405565b82525050565b5f6020820190506115f85f8301846115d6565b92915050565b5f60208284031215611613576116126113fd565b5b5f61162084828501611584565b91505092915050565b6116328161155d565b82525050565b5f60208201905061164b5f830184611629565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261167257611671611651565b5b8235905067ffffffffffffffff81111561168f5761168e611655565b5b6020830191508360018202830111156116ab576116aa611659565b5b9250929050565b5f80602083850312156116c8576116c76113fd565b5b5f83013567ffffffffffffffff8111156116e5576116e4611401565b5b6116f18582860161165d565b92509250509250929050565b5f6040820190506117105f8301856114c1565b61171d6020830184611629565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61176682611724565b611770818561172e565b935061178081856020860161173e565b6117898161174c565b840191505092915050565b5f6020820190508181035f8301526117ac818461175c565b905092915050565b5f805f604084860312156117cb576117ca6113fd565b5b5f6117d886828701611584565b935050602084013567ffffffffffffffff8111156117f9576117f8611401565b5b6118058682870161165d565b92509250509250925092565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61184b8261174c565b810181811067ffffffffffffffff8211171561186a57611869611815565b5b80604052505050565b5f61187c6113f4565b90506118888282611842565b919050565b5f608082840312156118a2576118a1611811565b5b6118ac6080611873565b90505f6118bb84828501611584565b5f8301525060206118ce84828501611446565b60208301525060406118e2848285016114ff565b60408301525060606118f6848285016114ff565b60608301525092915050565b5f60808284031215611917576119166113fd565b5b5f6119248482850161188d565b91505092915050565b5f6060820190506119405f8301866115d6565b61194d60208301856114c1565b61195a60408301846114c1565b949350505050565b5f815190506119708161156e565b92915050565b5f6020828403121561198b5761198a6113fd565b5b5f61199884828501611962565b91505092915050565b5f819050919050565b5f819050919050565b5f6119cd6119c86119c3846119a1565b6119aa565b6114b8565b9050919050565b6119dd816119b3565b82525050565b5f6040820190506119f65f830185611629565b611a0360208301846119d4565b9392505050565b611a1381611485565b8114611a1d575f80fd5b50565b5f81519050611a2e81611a0a565b92915050565b5f60208284031215611a4957611a486113fd565b5b5f611a5684828501611a20565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a96826114b8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611ac857611ac7611a5f565b5b600182019050919050565b5f604082019050611ae65f830185611629565b611af360208301846114c1565b9392505050565b5f81905092915050565b5f611b0e82611724565b611b188185611afa565b9350611b2881856020860161173e565b80840191505092915050565b5f611b3f8284611b04565b915081905092915050565b5f8160601b9050919050565b5f611b6082611b4a565b9050919050565b5f611b7182611b56565b9050919050565b611b89611b848261155d565b611b67565b82525050565b5f819050919050565b611ba9611ba4826114b8565b611b8f565b82525050565b5f611bba8286611b78565b601482019150611bca8285611b78565b601482019150611bda8284611b98565b60208201915081905094935050505056fea264697066735822122082d6437e7160694ebcc6f5718c4ee30e3efa64dceafb1a566026f6dd8b9107f164736f6c634300081a0033", e = class e extends V {
6
+ import { RegistryType as P } from "../utils.js";
7
+ const R = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b8160c01c808260011c146073578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6113ca806100855f395ff3fe6080604052600436106101af575f3560e01c8063514e62fc116100e7578063c884ef8311610087578063ea3d508a11610062578063ea3d508a14610543578063f04e283e1461055c578063f2fde38b1461056f578063fee81cf414610582575f80fd5b8063c884ef83146104e1578063db09da121461050f578063dcc59b6f1461052e575f80fd5b80638da5cb5b116100c25780638da5cb5b1461044e578063a270a73714610481578063a4d66daf146104ad578063bb1757cf146104c2575f80fd5b8063514e62fc1461040957806354d1f13d1461043e578063715018a614610446575f80fd5b806328d6183b11610152578063439fab911161012d578063439fab9114610354578063474f5a44146103735780634a4ee7b1146103bc5780634e7165a2146103cf575f80fd5b806328d6183b1461027d5780632de94807146102dc57806338d52e0f1461030d575f80fd5b80631c10893f1161018d5780631c10893f146102195780631cd64df41461022c578063228cb733146102615780632569296214610275575f80fd5b806301ffc9a7146101b357806307621eca146101e7578063183a4f6e14610204575b5f80fd5b3480156101be575f80fd5b506101d26101cd36600461108b565b6105b3565b60405190151581526020015b60405180910390f35b3480156101f2575f80fd5b505f545b6040519081526020016101de565b6102176102123660046110ab565b61060e565b005b6102176102273660046110e3565b61061b565b348015610237575f80fd5b506101d26102463660046110e3565b638b78c6d8600c9081525f9290925260209091205481161490565b34801561026c575f80fd5b506101f65f5481565b610217610631565b348015610288575f80fd5b507f0d36a40d000000000000000000000000000000000000000000000000000000005b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101de565b3480156102e7575f80fd5b506101f66102f636600461110d565b638b78c6d8600c9081525f91909152602090205490565b348015610318575f80fd5b5073deaddeaddeaddeaddeaddeaddeaddeaddeaddead5b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101de565b34801561035f575f80fd5b5061021761036e36600461116d565b61067e565b34801561037e575f80fd5b5061039261038d36600461116d565b610890565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016101de565b6102176103ca3660046110e3565b6108c4565b3480156103da575f80fd5b506103fc6103e936600461116d565b5050604080515f81526020810190915290565b6040516101de91906111ac565b348015610414575f80fd5b506101d26104233660046110e3565b638b78c6d8600c9081525f9290925260209091205416151590565b6102176108d6565b61021761090f565b348015610459575f80fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275461032f565b34801561048c575f80fd5b5060025461032f9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156104b8575f80fd5b506101f660035481565b3480156104cd575f80fd5b506101d26104dc3660046111ff565b610922565b3480156104ec575f80fd5b506101d26104fb36600461110d565b60016020525f908152604090205460ff1681565b34801561051a575f80fd5b506101d26105293660046111ff565b610d52565b348015610539575f80fd5b506101f660055481565b34801561054e575f80fd5b506004546102ab9060e01b81565b61021761056a36600461110d565b610d64565b61021761057d36600461110d565b610d9e565b34801561058d575f80fd5b506101f661059c36600461110d565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f0d36a40d000000000000000000000000000000000000000000000000000000001480610608575061060882610dc4565b92915050565b6106183382610e19565b50565b610623610e24565b61062d8282610e59565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60113280546003825580156106cf5760018160011c14303b106106c65763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f6106dd83850185611250565b905080604001515f14806106f357506060810151155b1561072a576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911790556020810151600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001660e09290921c91909117905560408101515f5560608101516003556107bf33610e65565b805f015173ffffffffffffffffffffffffffffffffffffffff167fef49c8fd80435c15980f0f55660ffaac9417e5843768f7f21566cfad2d19bfe782602001518360400151846060015160405161084d939291907fffffffff000000000000000000000000000000000000000000000000000000009390931683526020830191909152604082015260600190565b60405180910390a250801561088b576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108cc610e24565b61062d8282610e19565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610917610e24565b6109205f610ec8565b565b5f61092b610e24565b600254604080517f8da5cb5b000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169130918391638da5cb5b916004808201926020929091908290030181865afa15801561099d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109c191906112e8565b73ffffffffffffffffffffffffffffffffffffffff1614158015610a7a57506040517f514e62fc0000000000000000000000000000000000000000000000000000000081523060048201526002602482015273ffffffffffffffffffffffffffffffffffffffff82169063514e62fc90604401602060405180830381865afa158015610a4f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a739190611303565b1515600114155b15610ab1576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610aba85610f2d565b610af0576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60058054905f610aff83611322565b909155505073ffffffffffffffffffffffffffffffffffffffff8581165f81815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690921790915560025460045483549251602481019590955260448501929092529193919091169160e09190911b90606401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051610c0a919061137e565b5f604051808303815f865af19150503d805f8114610c43576040519150601f19603f3d011682016040523d82523d5f602084013e610c48565b606091505b5050905080610c83576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002545f546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606093841b811660208301529289901b9092166034830152604882015273ffffffffffffffffffffffffffffffffffffffff8716907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610d3e916111ac565b60405180910390a250600195945050505050565b5f610d5c84610f2d565b949350505050565b610d6c610e24565b63389a75e1600c52805f526020600c208054421115610d9257636f5e88185f526004601cfd5b5f905561061881610ec8565b610da6610e24565b8060601b610dbb57637448fbae5f526004601cfd5b61061881610ec8565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa9216705000000000000000000000000000000000000000000000000000000001480610608575061060882610f6a565b61062d82825f611000565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610920576382b429005f526004601cfd5b61062d82826001611000565b73ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526001602052604081205460ff1615801561060857506003546005541092915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061060857507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610608565b638b78c6d8600c52825f526020600c20805483811783611021575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b80357fffffffff0000000000000000000000000000000000000000000000000000000081168114611086575f80fd5b919050565b5f6020828403121561109b575f80fd5b6110a482611057565b9392505050565b5f602082840312156110bb575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610618575f80fd5b5f80604083850312156110f4575f80fd5b82356110ff816110c2565b946020939093013593505050565b5f6020828403121561111d575f80fd5b81356110a4816110c2565b5f8083601f840112611138575f80fd5b50813567ffffffffffffffff81111561114f575f80fd5b602083019150836020828501011115611166575f80fd5b9250929050565b5f806020838503121561117e575f80fd5b823567ffffffffffffffff811115611194575f80fd5b6111a085828601611128565b90969095509350505050565b602081525f82518060208401528060208501604085015e5f6040828501015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505092915050565b5f805f60408486031215611211575f80fd5b833561121c816110c2565b9250602084013567ffffffffffffffff811115611237575f80fd5b61124386828701611128565b9497909650939450505050565b5f6080828403128015611261575f80fd5b506040516080810167ffffffffffffffff811182821017156112aa577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405282356112b8816110c2565b81526112c660208401611057565b6020820152604083810135908201526060928301359281019290925250919050565b5f602082840312156112f8575f80fd5b81516110a4816110c2565b5f60208284031215611313575f80fd5b815180151581146110a4575f80fd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611377577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5060010190565b5f82518060208501845e5f92019182525091905056fea264697066735822122079bb08e80a9bd9117e174b7d6f5a63383597f9fcb4a121e18bc1685a513d4f3f64736f6c634300081a0033", e = class e extends V {
8
8
  constructor() {
9
- super(...arguments), this.abi = c;
9
+ super(...arguments), this.abi = s;
10
10
  }
11
11
  /**
12
12
  * The number of claims that have been made
@@ -17,7 +17,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
17
17
  * @returns {Promise<bigint>}
18
18
  */
19
19
  async claims(f) {
20
- return await i(this._config, {
20
+ return await n(this._config, {
21
21
  address: this.assertValidAddress(),
22
22
  args: [],
23
23
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -33,7 +33,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
33
33
  * @returns {Promise<bigint>} - The current reward
34
34
  */
35
35
  async currentReward(f) {
36
- return await r(this._config, {
36
+ return await o(this._config, {
37
37
  address: this.assertValidAddress(),
38
38
  args: [],
39
39
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -49,7 +49,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
49
49
  * @returns {Promise<bigint>} The reward amount issued for each claim
50
50
  */
51
51
  async reward(f) {
52
- return await n(this._config, {
52
+ return await l(this._config, {
53
53
  address: this.assertValidAddress(),
54
54
  args: [],
55
55
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -66,7 +66,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
66
66
  * @returns {Promise<boolean>}
67
67
  */
68
68
  async claimed(f, b) {
69
- return await o(this._config, {
69
+ return await m(this._config, {
70
70
  address: this.assertValidAddress(),
71
71
  args: [f],
72
72
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -82,7 +82,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
82
82
  * @returns {Promise<Address>}
83
83
  */
84
84
  async venue(f) {
85
- return await l(this._config, {
85
+ return await h(this._config, {
86
86
  address: this.assertValidAddress(),
87
87
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
88
88
  ...f
@@ -97,7 +97,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
97
97
  * @returns {Promise<bigint>}
98
98
  */
99
99
  async limit(f) {
100
- return await m(this._config, {
100
+ return await u(this._config, {
101
101
  address: this.assertValidAddress(),
102
102
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
103
103
  ...f
@@ -112,7 +112,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
112
112
  * @returns {Promise<Hex>}
113
113
  */
114
114
  async selector(f) {
115
- return await h(this._config, {
115
+ return await y(this._config, {
116
116
  address: this.assertValidAddress(),
117
117
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
118
118
  ...f
@@ -140,7 +140,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
140
140
  * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the incentive was successfully claimed
141
141
  */
142
142
  async claimRaw(f, b) {
143
- const { request: a, result: d } = await u(
143
+ const { request: a, result: d } = await p(
144
144
  this._config,
145
145
  {
146
146
  address: this.assertValidAddress(),
@@ -164,7 +164,7 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
164
164
  * @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload
165
165
  */
166
166
  async isClaimable(f, b) {
167
- return await y(this._config, {
167
+ return await w(this._config, {
168
168
  address: this.assertValidAddress(),
169
169
  args: [f.target, f.data],
170
170
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -211,12 +211,34 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
211
211
  b
212
212
  );
213
213
  return {
214
- abi: c,
215
- bytecode: _,
216
- args: [P(a)],
214
+ abi: s,
215
+ bytecode: R,
216
+ args: [_(a)],
217
217
  ...this.optionallyAttachAccount(d.account)
218
218
  };
219
219
  }
220
+ /**
221
+ * Generates a top-up payload for the PointsIncentive contract.
222
+ *
223
+ * @public
224
+ * @param {bigint} netAmount The net reward amount to be added to the incentive.
225
+ * @returns {Hex} The ABI-encoded top-up payload.
226
+ */
227
+ getTopupPayload(f) {
228
+ var b, a;
229
+ return i(
230
+ [
231
+ { type: "address", name: "venue" },
232
+ { type: "bytes4", name: "selector" },
233
+ { type: "uint256", name: "amount" }
234
+ ],
235
+ [
236
+ ((b = this.payload) == null ? void 0 : b.venue) ?? c,
237
+ ((a = this.payload) == null ? void 0 : a.selector) ?? c,
238
+ f
239
+ ]
240
+ );
241
+ }
220
242
  /**
221
243
  * Builds the claim data for the PointsIncentive.
222
244
  *
@@ -225,31 +247,31 @@ const _ = "0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f6
225
247
  * @description This function returns `zeroHash` because PointsIncentive doesn't use any specific claim data.
226
248
  */
227
249
  buildClaimData() {
228
- return p;
250
+ return c;
229
251
  }
230
252
  };
231
253
  e.bases = {
232
254
  31337: void 0,
233
255
  ...A
234
- }, e.registryType = R.INCENTIVE;
235
- let s = e;
236
- const P = ({
237
- venue: t,
256
+ }, e.registryType = P.INCENTIVE;
257
+ let t = e;
258
+ const _ = ({
259
+ venue: r,
238
260
  selector: f,
239
261
  reward: b,
240
262
  limit: a
241
- }) => w(
263
+ }) => i(
242
264
  [
243
265
  { type: "address", name: "venue" },
244
266
  { type: "bytes4", name: "selector" },
245
267
  { type: "uint256", name: "reward" },
246
268
  { type: "uint256", name: "limit" }
247
269
  ],
248
- [t, f, b, a]
270
+ [r, f, b, a]
249
271
  );
250
272
  export {
251
- s as PointsIncentive,
252
- c as pointsIncentiveAbi,
253
- P as preparePointsIncentivePayload
273
+ t as PointsIncentive,
274
+ s as pointsIncentiveAbi,
275
+ _ as preparePointsIncentivePayload
254
276
  };
255
277
  //# sourceMappingURL=PointsIncentive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PointsIncentive.js","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":";;;;;;48cAmGaA,IAAN,MAAMA,UAAwBC,EAGnC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,OAAOC,GAAqB;AAChC,WAAA,MAAMC,EAA0B,KAAK,SAAS;AAAA,MACnD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AAM;AAAA,MAClB,KAAK,MAAMA,CAAM;AAAA,IAAA,CAClB;AACD,WAAOiB,IAAQD;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUgB,gBACdE,GACAC,GACyB;AACzB,UAAM,CAACV,GAASW,CAAO,IAAI,KAAK;AAAA,MAC9BF;AAAA,MACAC;AAAA,IAAA;AAEK,WAAA;AAAA,MACL,KAAKpB;AAAAA,MACL,UAAAsB;AAAA,MACA,MAAM,CAACC,EAA8Bb,CAAO,CAAC;AAAA,MAC7C,GAAG,KAAK,wBAAwBW,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,iBAAiB;AACf,WAAAG;AAAA,EACT;AACF;AAzPE1B,EAAuB,QAAiC;AAAA,EACtD,OAAO;AAAA,EACP,GAAI2B;AAAA,GASN3B,EAAuB,eAA6B4B,EAAa;AAvB5D,IAAMC,IAAN7B;AAiRA,MAAMyB,IAAgC,CAAC;AAAA,EAC5C,OAAAK;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAZ;AACF,MACSa;AAAA,EACL;AAAA,IACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,IACjC,EAAE,MAAM,UAAU,MAAM,WAAW;AAAA,IACnC,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,IAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,EACnC;AAAA,EACA,CAACH,GAAOC,GAAUC,GAAQZ,CAAK;AAAA;"}
1
+ {"version":3,"file":"PointsIncentive.js","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 * Generates a top-up payload for the PointsIncentive contract.\n *\n * @public\n * @param {bigint} netAmount The net reward amount to be added to the incentive.\n * @returns {Hex} The ABI-encoded top-up payload.\n */\n public getTopupPayload(netAmount: bigint): Hex {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'amount' },\n ],\n [\n this.payload?.venue ?? zeroHash,\n this.payload?.selector ?? zeroHash,\n netAmount,\n ],\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","netAmount","encodeAbiParameters","_a","zeroHash","_b","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward"],"mappings":";;;;;;8qUAmGaA,IAAN,MAAMA,UAAwBC,EAGnC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,OAAOC,GAAqB;AAChC,WAAA,MAAMC,EAA0B,KAAK,SAAS;AAAA,MACnD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,cAAcA,GAAqB;AACvC,WAAA,MAAME,EAAiC,KAAK,SAAS;AAAA,MAC1D,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIF;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,OAAOA,GAAqB;AAChC,WAAA,MAAMG,EAA0B,KAAK,SAAS;AAAA,MACnD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAIH;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAa,QAAQI,GAAkBJ,GAAqB;AACnD,WAAA,MAAMK,EAA2B,KAAK,SAAS;AAAA,MACpD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACD,CAAO;AAAA;AAAA,MAEd,GAAIJ;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,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vBC,IAAA,KAAK,YAAL,gBAAAA,EAAc,aAAYD;AAAA,QAC1BH;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,iBAAiB;AACf,WAAAG;AAAA,EACT;AACF;AA/QE7B,EAAuB,QAAiC;AAAA,EACtD,OAAO;AAAA,EACP,GAAI+B;AAAA,GASN/B,EAAuB,eAA6BgC,EAAa;AAvB5D,IAAMC,IAANjC;AAuSA,MAAMyB,IAAgC,CAAC;AAAA,EAC5C,OAAAS;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAhB;AACF,MACSO;AAAA,EACL;AAAA,IACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,IACjC,EAAE,MAAM,UAAU,MAAM,WAAW;AAAA,IACnC,EAAE,MAAM,WAAW,MAAM,SAAS;AAAA,IAClC,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,EACnC;AAAA,EACA,CAACO,GAAOC,GAAUC,GAAQhB,CAAK;AAAA;"}
@@ -0,0 +1,133 @@
1
+ import { B as r, as as n, aw as h, ax as l, ay as p } from "./generated-pJZHmRCK.js";
2
+ import { getAccount as u } from "@wagmi/core";
3
+ import { zeroHash as w, zeroAddress as y, encodeAbiParameters as m } from "viem";
4
+ import { a as A } from "./deployments-DqjtOTUr.js";
5
+ import { DeployableTargetWithRBAC as g } from "./Deployable/DeployableTargetWithRBAC.js";
6
+ import { DeployableUnknownOwnerProvidedError as _ } from "./errors.js";
7
+ import { RegistryType as D } from "./utils.js";
8
+ const P = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b8160c01c808260011c146073578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b611161806100855f395ff3fe608060405260043610610183575f3560e01c806354d1f13d116100d1578063e3f756de1161007c578063f2fde38b11610057578063f2fde38b14610446578063fe9fbb8014610459578063fee81cf414610478575f80fd5b8063e3f756de146103d8578063ec87621c1461041f578063f04e283e14610433575f80fd5b80638da5cb5b116100ac5780638da5cb5b14610362578063be4994f81461039a578063dcc21361146103b9575f80fd5b806354d1f13d1461033e578063715018a61461034657806375b238fc1461034e575f80fd5b806328d6183b11610131578063439fab911161010c578063439fab91146102d75780634a4ee7b1146102f6578063514e62fc14610309575f80fd5b806328d6183b1461023f5780632de94807146102795780634359d28a146102b8575f80fd5b80631c10893f116101615780631c10893f146101ef5780631cd64df4146102025780632569296214610237575f80fd5b806301ffc9a714610187578063141973b0146101bb578063183a4f6e146101dc575b5f80fd5b348015610192575f80fd5b506101a66101a1366004610d5f565b6104a9565b60405190151581526020015b60405180910390f35b3480156101c6575f80fd5b506101da6101d5366004610ded565b610504565b005b6101da6101ea366004610e59565b610637565b6101da6101fd366004610ea1565b610644565b34801561020d575f80fd5b506101a661021c366004610ea1565b638b78c6d8600c9081525f9290925260209091205481161490565b6101da61065a565b34801561024a575f80fd5b506040517f3d30a22c0000000000000000000000000000000000000000000000000000000081526020016101b2565b348015610284575f80fd5b506102aa610293366004610ecb565b638b78c6d8600c9081525f91909152602090205490565b6040519081526020016101b2565b3480156102c3575f80fd5b506101da6102d2366004610ded565b6106a7565b3480156102e2575f80fd5b506101da6102f1366004610f24565b6107a1565b6101da610304366004610ea1565b6108d0565b348015610314575f80fd5b506101a6610323366004610ea1565b638b78c6d8600c9081525f9290925260209091205416151590565b6101da6108e2565b6101da61091b565b348015610359575f80fd5b506102aa600281565b34801561036d575f80fd5b50638b78c6d8195460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b2565b3480156103a5575f80fd5b506101da6103b4366004610ded565b61092e565b3480156103c4575f80fd5b506101da6103d3366004610ded565b6109cc565b3480156103e3575f80fd5b506101a66103f2366004610f63565b505073ffffffffffffffffffffffffffffffffffffffff165f9081526020819052604090205460ff161590565b34801561042a575f80fd5b506102aa600181565b6101da610441366004610ecb565b610a6a565b6101da610454366004610ecb565b610aa4565b348015610464575f80fd5b506101a6610473366004610ecb565b610aca565b348015610483575f80fd5b506102aa610492366004610ecb565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f3d30a22c0000000000000000000000000000000000000000000000000000000014806104fe57506104fe82610b29565b92915050565b61050d33610aca565b610543576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82811461057c576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b838110156106305782828281811061059857610598610fb4565b90506020020160208101906105ad9190610fe1565b5f808787858181106105c1576105c1610fb4565b90506020020160208101906105d69190610ecb565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905560010161057e565b5050505050565b6106413382610b7e565b50565b61064c610b89565b6106568282610ba3565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b60026106b281610baf565b8382146106eb576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610799575f84848381811061070857610708610fb4565b905060200201602081019061071d9190610fe1565b905080151560010361075f5761075a87878481811061073e5761073e610fb4565b90506020020160208101906107539190610ecb565b6001610ba3565b610790565b61079087878481811061077457610774610fb4565b90506020020160208101906107899190610ecb565b6001610b7e565b506001016106ed565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60113280546003825580156107f25760018160011c14303b106107e95763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f806108018486018661102d565b9150915061080e82610be0565b5f5b81518110156108935760015f8084848151811061082f5761082f610fb4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101610810565b50505080156108cb576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6108d8610b89565b6106568282610b7e565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610923610b89565b61092c5f610c28565b565b600261093981610baf565b838214610972576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610799576109c486868381811061099157610991610fb4565b90506020020160208101906109a69190610ecb565b8585848181106109b8576109b8610fb4565b90506020020135610ba3565b600101610974565b60026109d781610baf565b838214610a10576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8481101561079957610a62868683818110610a2f57610a2f610fb4565b9050602002016020810190610a449190610ecb565b858584818110610a5657610a56610fb4565b90506020020135610b7e565b600101610a12565b610a72610b89565b63389a75e1600c52805f526020600c208054421115610a9857636f5e88185f526004601cfd5b5f905561064181610c28565b610aac610b89565b8060601b610ac157637448fbae5f526004601cfd5b61064181610c28565b5f8173ffffffffffffffffffffffffffffffffffffffff16610aef638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806104fe5750638b78c6d8600c9081525f839052602090205460031615156104fe565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fe2089f790000000000000000000000000000000000000000000000000000000014806104fe57506104fe82610c72565b61065682825f610d08565b638b78c6d81954331461092c576382b429005f526004601cfd5b61065682826001610d08565b638b78c6d81954331461064157638b78c6d8600c52335f52806020600c205416610641576382b429005f526004601cfd5b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806104fe57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146104fe565b638b78c6d8600c52825f526020600c20805483811783610d29575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f60208284031215610d6f575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610d9e575f80fd5b9392505050565b5f8083601f840112610db5575f80fd5b50813567ffffffffffffffff811115610dcc575f80fd5b6020830191508360208260051b8501011115610de6575f80fd5b9250929050565b5f805f8060408587031215610e00575f80fd5b843567ffffffffffffffff811115610e16575f80fd5b610e2287828801610da5565b909550935050602085013567ffffffffffffffff811115610e41575f80fd5b610e4d87828801610da5565b95989497509550505050565b5f60208284031215610e69575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610641575f80fd5b8035610e9c81610e70565b919050565b5f8060408385031215610eb2575f80fd5b8235610ebd81610e70565b946020939093013593505050565b5f60208284031215610edb575f80fd5b8135610d9e81610e70565b5f8083601f840112610ef6575f80fd5b50813567ffffffffffffffff811115610f0d575f80fd5b602083019150836020828501011115610de6575f80fd5b5f8060208385031215610f35575f80fd5b823567ffffffffffffffff811115610f4b575f80fd5b610f5785828601610ee6565b90969095509350505050565b5f805f60408486031215610f75575f80fd5b8335610f8081610e70565b9250602084013567ffffffffffffffff811115610f9b575f80fd5b610fa786828701610ee6565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215610ff1575f80fd5b81358015158114610d9e575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f806040838503121561103e575f80fd5b823561104981610e70565b9150602083013567ffffffffffffffff811115611064575f80fd5b8301601f81018513611074575f80fd5b803567ffffffffffffffff81111561108e5761108e611000565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811067ffffffffffffffff821117156110d9576110d9611000565b6040529182526020818401810192908101888411156110f6575f80fd5b6020850194505b8385101561111c5761110e85610e91565b8152602094850194016110fd565b5080945050505050925092905056fea2646970667358221220693fef5ebd345c6186dd2eca2c237bba8f7f63fbc241dc656400c725c22ef67f64736f6c634300081a0033", c = class c extends g {
9
+ constructor() {
10
+ super(...arguments), this.abi = r;
11
+ }
12
+ /**
13
+ * Retrieves the owner
14
+ *
15
+ * @public
16
+ * @async
17
+ * @param {?ReadParams} [params]
18
+ * @returns {Promise<Address>} - The address of the owner
19
+ */
20
+ async owner(f) {
21
+ return await n(this._config, {
22
+ ...this.optionallyAttachAccount(),
23
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
24
+ ...f,
25
+ address: this.assertValidAddress(),
26
+ args: []
27
+ });
28
+ }
29
+ /**
30
+ * Check if a user is authorized (i.e. not denied)
31
+ *
32
+ * @public
33
+ * @async
34
+ * @param {Address} address - The address of the user
35
+ * @param {?ReadParams} [params]
36
+ * @returns {Promise<boolean>} - True if the user is authorized
37
+ */
38
+ async isAllowed(f, b) {
39
+ return await h(this._config, {
40
+ address: this.assertValidAddress(),
41
+ args: [f, w],
42
+ ...this.optionallyAttachAccount(),
43
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
44
+ ...b
45
+ });
46
+ }
47
+ /**
48
+ * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner
49
+ *
50
+ * @public
51
+ * @async
52
+ * @param {Address[]} addresses - The list of users to update
53
+ * @param {boolean[]} allowed - The denied status of each user
54
+ * @param {?WriteParams} [params]
55
+ * @returns {Promise<void>}
56
+ */
57
+ async setDenied(f, b, d) {
58
+ return await this.awaitResult(
59
+ this.setDeniedRaw(f, b, d)
60
+ );
61
+ }
62
+ /**
63
+ * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner
64
+ *
65
+ * @public
66
+ * @async
67
+ * @param {Address[]} addresses - The list of users to update
68
+ * @param {boolean[]} allowed - The denied status of each user
69
+ * @param {?WriteParams} [params]
70
+ * @returns {Promise<{ hash: `0x${string}`; result: void; }>}
71
+ */
72
+ async setDeniedRaw(f, b, d) {
73
+ const { request: e, result: a } = await l(
74
+ this._config,
75
+ {
76
+ address: this.assertValidAddress(),
77
+ args: [f, b],
78
+ ...this.optionallyAttachAccount(),
79
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
80
+ ...d
81
+ }
82
+ );
83
+ return { hash: await p(this._config, e), result: a };
84
+ }
85
+ /**
86
+ * @inheritdoc
87
+ *
88
+ * @public
89
+ * @param {?SimpleDenyListPayload} [_payload]
90
+ * @param {?DeployableOptions} [_options]
91
+ * @returns {GenericDeployableParams}
92
+ */
93
+ buildParameters(f, b) {
94
+ var s;
95
+ const [d, e] = this.validateDeploymentConfig(f, b), a = d;
96
+ if (!a.owner || a.owner === y) {
97
+ const t = e.account ? e.account.address : e.config ? u(e.config).address : (s = this._account) == null ? void 0 : s.address;
98
+ if (t)
99
+ a.owner = t;
100
+ else
101
+ throw new _();
102
+ }
103
+ return {
104
+ abi: r,
105
+ bytecode: P,
106
+ args: [R(a)],
107
+ ...this.optionallyAttachAccount(e.account)
108
+ };
109
+ }
110
+ };
111
+ c.bases = {
112
+ 31337: void 0,
113
+ ...A
114
+ }, c.registryType = D.ALLOW_LIST;
115
+ let o = c;
116
+ function R({
117
+ owner: i,
118
+ denied: f
119
+ }) {
120
+ return m(
121
+ [
122
+ { type: "address", name: "owner" },
123
+ { type: "address[]", name: "denied" }
124
+ ],
125
+ [i, f]
126
+ );
127
+ }
128
+ export {
129
+ o as S,
130
+ P as b,
131
+ R as p
132
+ };
133
+ //# sourceMappingURL=SimpleDenyList-CW4RwwRw.js.map