@boostxyz/sdk 7.3.0 → 7.5.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 (193) hide show
  1. package/dist/Actions/Action.cjs +1 -1
  2. package/dist/Actions/Action.js +2 -2
  3. package/dist/Actions/EventAction.cjs +1 -1
  4. package/dist/Actions/EventAction.cjs.map +1 -1
  5. package/dist/Actions/EventAction.d.ts.map +1 -1
  6. package/dist/Actions/EventAction.js +160 -159
  7. package/dist/Actions/EventAction.js.map +1 -1
  8. package/dist/AllowLists/AllowList.cjs +1 -1
  9. package/dist/AllowLists/AllowList.js +3 -3
  10. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  11. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
  12. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
  13. package/dist/AllowLists/SimpleAllowList.js +30 -30
  14. package/dist/AllowLists/SimpleAllowList.js.map +1 -1
  15. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  16. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
  17. package/dist/AllowLists/SimpleDenyList.js +3 -3
  18. package/dist/Auth/PassthroughAuth.cjs +1 -1
  19. package/dist/Auth/PassthroughAuth.js +1 -1
  20. package/dist/BoostCore.cjs +2 -2
  21. package/dist/BoostCore.cjs.map +1 -1
  22. package/dist/BoostCore.d.ts +14 -0
  23. package/dist/BoostCore.d.ts.map +1 -1
  24. package/dist/BoostCore.js +199 -180
  25. package/dist/BoostCore.js.map +1 -1
  26. package/dist/BoostRegistry.cjs +1 -1
  27. package/dist/BoostRegistry.cjs.map +1 -1
  28. package/dist/BoostRegistry.d.ts.map +1 -1
  29. package/dist/BoostRegistry.js +31 -31
  30. package/dist/BoostRegistry.js.map +1 -1
  31. package/dist/Budget-DGg1wCa6.cjs +2 -0
  32. package/dist/Budget-DGg1wCa6.cjs.map +1 -0
  33. package/dist/{Budget-B-grnRq9.js → Budget-ZnzzZsjK.js} +102 -102
  34. package/dist/Budget-ZnzzZsjK.js.map +1 -0
  35. package/dist/Budgets/Budget.cjs +1 -1
  36. package/dist/Budgets/Budget.js +3 -3
  37. package/dist/Budgets/ManagedBudget.cjs +1 -1
  38. package/dist/Budgets/ManagedBudget.cjs.map +1 -1
  39. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  40. package/dist/Budgets/ManagedBudget.js +48 -48
  41. package/dist/Budgets/ManagedBudget.js.map +1 -1
  42. package/dist/Budgets/ManagedBudgetWithFees.d.ts.map +1 -1
  43. package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts.map +1 -1
  44. package/dist/Budgets/TransparentBudget.d.ts.map +1 -1
  45. package/dist/Budgets/VestingBudget.d.ts.map +1 -1
  46. package/dist/Deployable/DeployableTarget.cjs +1 -1
  47. package/dist/Deployable/DeployableTarget.cjs.map +1 -1
  48. package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
  49. package/dist/Deployable/DeployableTarget.js +5 -8
  50. package/dist/Deployable/DeployableTarget.js.map +1 -1
  51. package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
  52. package/dist/Deployable/DeployableTargetWithRBAC.js +19 -19
  53. package/dist/{Incentive-Bz_g-nID.js → Incentive-CYj6lbM5.js} +64 -64
  54. package/dist/Incentive-CYj6lbM5.js.map +1 -0
  55. package/dist/{Incentive-Dufx0ZjH.cjs → Incentive-Ckxpw7EN.cjs} +2 -2
  56. package/dist/Incentive-Ckxpw7EN.cjs.map +1 -0
  57. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  58. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  59. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  60. package/dist/Incentives/AllowListIncentive.js +36 -36
  61. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  62. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  63. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  64. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  65. package/dist/Incentives/CGDAIncentive.js +37 -37
  66. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  67. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
  68. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  69. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  70. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  71. package/dist/Incentives/ERC20Incentive.js +44 -44
  72. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  73. package/dist/Incentives/ERC20PeggedIncentive.d.ts.map +1 -1
  74. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.cjs +1 -1
  75. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.cjs.map +1 -1
  76. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +1 -1
  77. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.js +63 -63
  78. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.js.map +1 -1
  79. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs +1 -1
  80. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs.map +1 -1
  81. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts.map +1 -1
  82. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js +55 -53
  83. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js.map +1 -1
  84. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
  85. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
  86. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -1
  87. package/dist/Incentives/ERC20VariableCriteriaIncentive.js +45 -45
  88. package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
  89. package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs +1 -1
  90. package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs.map +1 -1
  91. package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts.map +1 -1
  92. package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js +51 -49
  93. package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js.map +1 -1
  94. package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
  95. package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
  96. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  97. package/dist/Incentives/ERC20VariableIncentive.js +38 -38
  98. package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
  99. package/dist/Incentives/Incentive.cjs +1 -1
  100. package/dist/Incentives/Incentive.js +3 -3
  101. package/dist/Incentives/PointsIncentive.cjs +1 -1
  102. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  103. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  104. package/dist/Incentives/PointsIncentive.js +35 -35
  105. package/dist/Incentives/PointsIncentive.js.map +1 -1
  106. package/dist/{SimpleDenyList-BlLgvhjE.js → SimpleDenyList-DUO4ex__.js} +32 -32
  107. package/dist/SimpleDenyList-DUO4ex__.js.map +1 -0
  108. package/dist/{SimpleDenyList-B2YDJ_gk.cjs → SimpleDenyList-v5G-fPfm.cjs} +2 -2
  109. package/dist/SimpleDenyList-v5G-fPfm.cjs.map +1 -0
  110. package/dist/Validator-BA8RC2J6.cjs +2 -0
  111. package/dist/Validator-BA8RC2J6.cjs.map +1 -0
  112. package/dist/Validator-D4CzwdB9.js +409 -0
  113. package/dist/Validator-D4CzwdB9.js.map +1 -0
  114. package/dist/Validators/LimitedSignerValidator.cjs +1 -1
  115. package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
  116. package/dist/Validators/LimitedSignerValidator.d.ts.map +1 -1
  117. package/dist/Validators/LimitedSignerValidator.js +39 -39
  118. package/dist/Validators/LimitedSignerValidator.js.map +1 -1
  119. package/dist/Validators/PayableLimitedSignerValidator.d.ts +829 -0
  120. package/dist/Validators/PayableLimitedSignerValidator.d.ts.map +1 -0
  121. package/dist/Validators/SignerValidator.cjs +1 -1
  122. package/dist/Validators/SignerValidator.cjs.map +1 -1
  123. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  124. package/dist/Validators/SignerValidator.js +48 -48
  125. package/dist/Validators/SignerValidator.js.map +1 -1
  126. package/dist/Validators/Validator.cjs +1 -1
  127. package/dist/Validators/Validator.cjs.map +1 -1
  128. package/dist/Validators/Validator.d.ts +4 -3
  129. package/dist/Validators/Validator.d.ts.map +1 -1
  130. package/dist/Validators/Validator.js +14 -50
  131. package/dist/Validators/Validator.js.map +1 -1
  132. package/dist/componentInterfaces-D4QdH2Qz.cjs +2 -0
  133. package/dist/componentInterfaces-D4QdH2Qz.cjs.map +1 -0
  134. package/dist/componentInterfaces-DCTot4_O.js +24 -0
  135. package/dist/componentInterfaces-DCTot4_O.js.map +1 -0
  136. package/dist/{deployments-DKtAq6BT.js → deployments-B-ZU0zVY.js} +61 -34
  137. package/dist/{deployments-DKtAq6BT.js.map → deployments-B-ZU0zVY.js.map} +1 -1
  138. package/dist/deployments-CaacquP1.cjs +2 -0
  139. package/dist/deployments-CaacquP1.cjs.map +1 -0
  140. package/dist/deployments.json +32 -4
  141. package/dist/generated-BOBQ2ut4.cjs +3 -0
  142. package/dist/generated-BOBQ2ut4.cjs.map +1 -0
  143. package/dist/{generated-CINzoGbl.js → generated-ffteMTHN.js} +1157 -776
  144. package/dist/generated-ffteMTHN.js.map +1 -0
  145. package/dist/index.cjs +1 -1
  146. package/dist/index.d.ts +1 -0
  147. package/dist/index.d.ts.map +1 -1
  148. package/dist/index.js +123 -118
  149. package/package.json +1 -1
  150. package/src/Actions/EventAction.ts +3 -1
  151. package/src/AllowLists/SimpleAllowList.ts +3 -1
  152. package/src/AllowLists/SimpleDenyList.ts +3 -1
  153. package/src/BoostCore.ts +30 -1
  154. package/src/BoostRegistry.ts +3 -1
  155. package/src/Budgets/ManagedBudget.ts +3 -1
  156. package/src/Budgets/ManagedBudgetWithFees.ts +3 -1
  157. package/src/Budgets/ManagedBudgetWithFeesV2.ts +3 -1
  158. package/src/Budgets/TransparentBudget.ts +3 -1
  159. package/src/Budgets/VestingBudget.ts +3 -1
  160. package/src/Deployable/DeployableTarget.ts +2 -3
  161. package/src/Incentives/AllowListIncentive.ts +3 -1
  162. package/src/Incentives/CGDAIncentive.ts +3 -1
  163. package/src/Incentives/ERC1155Incentive.ts +3 -1
  164. package/src/Incentives/ERC20Incentive.ts +3 -1
  165. package/src/Incentives/ERC20PeggedIncentive.ts +3 -1
  166. package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts +3 -1
  167. package/src/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.ts +6 -2
  168. package/src/Incentives/ERC20VariableCriteriaIncentive.ts +3 -1
  169. package/src/Incentives/ERC20VariableCriteriaIncentiveV2.ts +5 -1
  170. package/src/Incentives/ERC20VariableIncentive.ts +3 -1
  171. package/src/Incentives/PointsIncentive.ts +3 -1
  172. package/src/Validators/LimitedSignerValidator.ts +3 -1
  173. package/src/Validators/PayableLimitedSignerValidator.test.ts +202 -0
  174. package/src/Validators/PayableLimitedSignerValidator.ts +667 -0
  175. package/src/Validators/SignerValidator.ts +3 -1
  176. package/src/Validators/Validator.ts +7 -1
  177. package/src/index.ts +1 -0
  178. package/dist/Budget-B-grnRq9.js.map +0 -1
  179. package/dist/Budget-uGKa2qzz.cjs +0 -2
  180. package/dist/Budget-uGKa2qzz.cjs.map +0 -1
  181. package/dist/Incentive-Bz_g-nID.js.map +0 -1
  182. package/dist/Incentive-Dufx0ZjH.cjs.map +0 -1
  183. package/dist/SimpleDenyList-B2YDJ_gk.cjs.map +0 -1
  184. package/dist/SimpleDenyList-BlLgvhjE.js.map +0 -1
  185. package/dist/componentInterfaces-C5ig8mCK.cjs +0 -2
  186. package/dist/componentInterfaces-C5ig8mCK.cjs.map +0 -1
  187. package/dist/componentInterfaces-Ddus5rIA.js +0 -23
  188. package/dist/componentInterfaces-Ddus5rIA.js.map +0 -1
  189. package/dist/deployments-Dk-Z1L2X.cjs +0 -2
  190. package/dist/deployments-Dk-Z1L2X.cjs.map +0 -1
  191. package/dist/generated-CINzoGbl.js.map +0 -1
  192. package/dist/generated-C_JEoLDO.cjs +0 -3
  193. package/dist/generated-C_JEoLDO.cjs.map +0 -1
@@ -1,15 +1,15 @@
1
- import { d as C, bC as _, bD as E, bE as P, bF as $, bG as N, bH as O, bI as B, bJ as F, bK as L, bL as G, bM as M, bN as U, bO as H, bP as S, bQ as k, bR as q, bS as z } from "../generated-CINzoGbl.js";
2
- import { getTransactionReceipt as A, getTransaction as J } from "@wagmi/core";
3
- import { parseEventLogs as K, decodeFunctionData as j, zeroAddress as o, zeroHash as Q, encodeAbiParameters as y, decodeAbiParameters as g, parseEther as v } from "viem";
4
- import { f as W } from "../deployments-DKtAq6BT.js";
5
- import { SignatureType as x, decodeAndReorderLogArgs as X, isCriteriaFieldIndexTuple as p, getScalarValueFromTuple as h } from "../Actions/EventAction.js";
1
+ import { d as E, bC as _, bD as O, bE as B, bF as N, bG as P, bH as S, bI as F, bJ as $, bK as G, bL as L, bM as M, bN as U, bO as z, bP as H, bQ as k, bR as q, bS as J } from "../generated-ffteMTHN.js";
2
+ import { getTransactionReceipt as I, getTransaction as K } from "@wagmi/core";
3
+ import { parseEventLogs as Q, decodeFunctionData as W, zeroAddress as o, zeroHash as j, encodeAbiParameters as w, decodeAbiParameters as g, parseEther as C } from "viem";
4
+ import { f as X } from "../deployments-B-ZU0zVY.js";
5
+ import { SignatureType as T, decodeAndReorderLogArgs as Y, isCriteriaFieldIndexTuple as p, getScalarValueFromTuple as h } from "../Actions/EventAction.js";
6
6
  import { DeployableTarget as Z } from "../Deployable/DeployableTarget.js";
7
- import { prepareClaimPayload as I } from "../claiming.js";
8
- import { DecodedArgsError as n, NoMatchingLogsError as T, InvalidCriteriaTypeError as Y, IncentiveCriteriaNotFoundError as f0 } from "../errors.js";
9
- import { RegistryType as a0, CheatCodes as e0 } from "../utils.js";
10
- const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6122ba806100895f395ff3fe6080604052600436106102ab575f3560e01c8063715018a611610165578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b146107a9578063fe9fbb80146107bc578063fee81cf4146107db575f80fd5b8063ec87621c14610782578063f04e283e14610796575f80fd5b8063db09da12116100ac578063db09da121461072f578063dcc213611461074e578063dcc59b6f1461076d575f80fd5b8063c884ef83146106ec578063d54ad2a11461071a575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf1461069a578063be4994f8146106b9578063c213f3f9146106d8575f80fd5b8063a4d66daf14610664578063a871ced214610679575f80fd5b8063775486871161014b57806377548687146105b45780638da5cb5b146106225780639214fa4d1461063a575f80fd5b8063715018a61461059857806375b238fc146105a0575f80fd5b806330db555f1161020f5780634a4ee7b1116101c5578063514e62fc116101ab578063514e62fc14610546578063547d18641461057b57806354d1f13d14610590575f80fd5b80634a4ee7b1146105075780634e7165a21461051a575f80fd5b80634359d28a116101f55780634359d28a14610480578063439fab911461049f578063474f5a44146104be575f80fd5b806330db555f1461043557806338d52e0f14610454575f80fd5b80631f1cb62b11610264578063256929621161024a57806325692962146103c257806328d6183b146103ca5780632de9480714610404575f80fd5b80631f1cb62b1461035d578063228cb733146103ae575f80fd5b8063183a4f6e11610294578063183a4f6e146103005780631c10893f146103155780631cd64df414610328575f80fd5b806301ffc9a7146102af57806307621eca146102e3575b5f80fd5b3480156102ba575f80fd5b506102ce6102c93660046119c5565b61080c565b60405190151581526020015b60405180910390f35b3480156102ee575f80fd5b505f545b6040519081526020016102da565b61031361030e366004611a0b565b610867565b005b610313610323366004611a4a565b610874565b348015610333575f80fd5b506102ce610342366004611a4a565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610368575f80fd5b50600a546103899073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102da565b3480156103b9575f80fd5b506102f25f5481565b61031361088a565b3480156103d5575f80fd5b506040517ff60c99c90000000000000000000000000000000000000000000000000000000081526020016102da565b34801561040f575f80fd5b506102f261041e366004611a72565b638b78c6d8600c9081525f91909152602090205490565b348015610440575f80fd5b5061031361044f366004611a0b565b6108d7565b34801561045f575f80fd5b506006546103899073ffffffffffffffffffffffffffffffffffffffff1681565b34801561048b575f80fd5b5061031361049a366004611ad3565b610993565b3480156104aa575f80fd5b506103136104b9366004611b7d565b610a8d565b3480156104c9575f80fd5b506104dd6104d8366004611b7d565b610e1c565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102da565b610313610515366004611a4a565b610f7e565b348015610525575f80fd5b50610539610534366004611b7d565b610f90565b6040516102da9190611c08565b348015610551575f80fd5b506102ce610560366004611a4a565b638b78c6d8600c9081525f9290925260209091205416151590565b348015610586575f80fd5b506102f260025481565b61031361102a565b610313611063565b3480156105ab575f80fd5b506102f2600281565b3480156105bf575f80fd5b506003546004546005546106119260ff90811692918082169173ffffffffffffffffffffffffffffffffffffffff61010083041691750100000000000000000000000000000000000000000090041685565b6040516102da959493929190611c57565b34801561062d575f80fd5b50638b78c6d81954610389565b348015610645575f80fd5b50600a5473ffffffffffffffffffffffffffffffffffffffff16610389565b34801561066f575f80fd5b506102f260085481565b348015610684575f80fd5b5061068d611076565b6040516102da9190611d0a565b3480156106a5575f80fd5b506102ce6106b4366004611d18565b61115c565b3480156106c4575f80fd5b506103136106d3366004611ad3565b611389565b3480156106e3575f80fd5b50600b546102f2565b3480156106f7575f80fd5b506102ce610706366004611a72565b60016020525f908152604090205460ff1681565b348015610725575f80fd5b506102f260095481565b34801561073a575f80fd5b506102ce610749366004611d18565b611427565b348015610759575f80fd5b50610313610768366004611ad3565b61149a565b348015610778575f80fd5b506102f260075481565b34801561078d575f80fd5b506102f2600181565b6103136107a4366004611a72565b611538565b6103136107b7366004611a72565b611572565b3480156107c7575f80fd5b506102ce6107d6366004611a72565b611598565b3480156107e6575f80fd5b506102f26107f5366004611a72565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167ff60c99c90000000000000000000000000000000000000000000000000000000014806108615750610861826115f7565b92915050565b610871338261164c565b50565b61087c611657565b6108868282611671565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b60016108e28161167d565b815f0361091b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006546109409073ffffffffffffffffffffffffffffffffffffffff163330856116ae565b8160085f8282546109519190611d94565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b600261099e8161167d565b8382146109d7576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a85575f8484838181106109f4576109f4611da7565b9050602002016020810190610a099190611dd4565b9050801515600103610a4b57610a46878784818110610a2a57610a2a611da7565b9050602002016020810190610a3f9190611a72565b6001611671565b610a7c565b610a7c878784818110610a6057610a60611da7565b9050602002016020810190610a759190611a72565b600161164c565b506001016109d9565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610ade5760018160011c14303b10610ad55763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610aec83850185611e9b565b905080606001515f03610b2b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015181515f90610b549073ffffffffffffffffffffffffffffffffffffffff1630611710565b905081811015610bbd5782516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810183905260640160405180910390fd5b60c083015183516006805473ffffffffffffffffffffffffffffffffffffffff9283167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556020860151600a805491909316911617905560408401515f55606084015160085560a0840151600b5580516003805483929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610c7157610c71611c1a565b021790555060208201516001808301919091556040830151600283018054606086015173ffffffffffffffffffffffffffffffffffffffff16610100027fffffffffffffffffffffff00000000000000000000000000000000000000000090911660ff90931692909217919091178082556080850151927fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909116907501000000000000000000000000000000000000000000908490811115610d3657610d36611c1a565b0217905550905050610d4733611743565b610d568460800151600161178b565b836020015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff167f2610f3b22dbb1fc9e125919ede742dad90b4f3dd49ce0c10118c6ef34410e3c98660400151876060015188608001518960a001518a60c00151604051610dd6959493929190611fa1565b60405180910390a3505050508015610e17576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610e298161167d565b5f610e3685870187612093565b90505f8160200151806020019051810190610e519190612110565b90508060085f828254610e649190612127565b90915550508151600654610e919173ffffffffffffffffffffffffffffffffffffffff90911690836117cc565b81516006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610f4f91611c08565b60405180910390a260065490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610f86611657565b610886828261164c565b60605f610f9f83850185611e9b565b6060818101516040805160808101825260018152845173ffffffffffffffffffffffffffffffffffffffff16602080830191909152308284015282518082018452849052825180820185905283518082038301815290840184529482019490945290519394509092611011920161213a565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61106b611657565b6110745f61181f565b565b6040805160a0810182525f808252602082018190529181018290526060810182905260808101919091526040805160a0810190915260038054829060ff1660018111156110c5576110c5611c1a565b60018111156110d6576110d6611c1a565b81526001828101546020830152600283015460ff808216604085015273ffffffffffffffffffffffffffffffffffffffff61010083041660608501526080909301927501000000000000000000000000000000000000000000909104169081111561114357611143611c1a565b600181111561115457611154611c1a565b905250919050565b5f611165611657565b5f611172838501856121b8565b90505f816020015180602001905181019061118d9190612110565b90505f80545f0361119f5750806111c2565b670de0b6b3a7640000825f546111b59190612235565b6111bf919061224c565b90505b600b54158015906111d45750600b5481115b156111de5750600b545b6111e781611869565b61121d576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6008548160095461122e9190611d94565b1115611266576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060095f8282546112779190611d94565b92505081905550600160075f8282546112909190611d94565b90915550506006546112b99073ffffffffffffffffffffffffffffffffffffffff1688836117cc565b6006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261137491611c08565b60405180910390a25060019695505050505050565b60026113948161167d565b8382146113cd576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a855761141f8686838181106113ec576113ec611da7565b90506020020160208101906114019190611a72565b85858481811061141357611413611da7565b90506020020135611671565b6001016113cf565b5f8080611436848601866121b8565b90505f81602001518060200190518101906114519190612110565b90505f545f0361146357809250611486565b670de0b6b3a7640000815f546114799190612235565b611483919061224c565b92505b61148f83611869565b979650505050505050565b60026114a58161167d565b8382146114de576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a85576115308686838181106114fd576114fd611da7565b90506020020160208101906115129190611a72565b85858481811061152457611524611da7565b9050602002013561164c565b6001016114e0565b611540611657565b63389a75e1600c52805f526020600c20805442111561156657636f5e88185f526004601cfd5b5f90556108718161181f565b61157a611657565b8060601b61158f57637448fbae5f526004601cfd5b6108718161181f565b5f8173ffffffffffffffffffffffffffffffffffffffff166115bd638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806108615750638b78c6d8600c9081525f83905260209020546003161515610861565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f56586338000000000000000000000000000000000000000000000000000000001480610861575061086182611883565b61088682825f6118d8565b638b78c6d819543314611074576382b429005f526004601cfd5b610886828260016118d8565b638b78c6d81954331461087157638b78c6d8600c52335f52806020600c205416610871576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f51141661170257803d873b15171061170257637939f4245f526004601cfd5b505f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f51141661181557803d853b151710611815576390b8ec185f526004601cfd5b505f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f6008548260095461187b9190611d94565b111592915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa921670500000000000000000000000000000000000000000000000000000000148061086157506108618261192f565b638b78c6d8600c52825f526020600c208054838117836118f9575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061086157507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610861565b5f602082840312156119d5575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611a04575f80fd5b9392505050565b5f60208284031215611a1b575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611a45575f80fd5b919050565b5f8060408385031215611a5b575f80fd5b611a6483611a22565b946020939093013593505050565b5f60208284031215611a82575f80fd5b611a0482611a22565b5f8083601f840112611a9b575f80fd5b50813567ffffffffffffffff811115611ab2575f80fd5b6020830191508360208260051b8501011115611acc575f80fd5b9250929050565b5f805f8060408587031215611ae6575f80fd5b843567ffffffffffffffff811115611afc575f80fd5b611b0887828801611a8b565b909550935050602085013567ffffffffffffffff811115611b27575f80fd5b611b3387828801611a8b565b95989497509550505050565b5f8083601f840112611b4f575f80fd5b50813567ffffffffffffffff811115611b66575f80fd5b602083019150836020828501011115611acc575f80fd5b5f8060208385031215611b8e575f80fd5b823567ffffffffffffffff811115611ba4575f80fd5b611bb085828601611b3f565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f611a046020830184611bbc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061087157610871611c1a565b60a08101611c6487611c47565b86825285602083015260ff8516604083015273ffffffffffffffffffffffffffffffffffffffff84166060830152611c9b83611c47565b8260808301529695505050505050565b8051611cb681611c47565b808352506020810151602083015260ff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301526080810151611cff81611c47565b806080840152505050565b60a081016108618284611cab565b5f805f60408486031215611d2a575f80fd5b611d3384611a22565b9250602084013567ffffffffffffffff811115611d4e575f80fd5b611d5a86828701611b3f565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561086157610861611d67565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611de4575f80fd5b81358015158114611a04575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160e0810167ffffffffffffffff81118282101715611e4357611e43611df3565b60405290565b60405160a0810167ffffffffffffffff81118282101715611e4357611e43611df3565b6040805190810167ffffffffffffffff81118282101715611e4357611e43611df3565b60028110610871575f80fd5b5f81830361016081128015611eae575f80fd5b50611eb7611e20565b611ec084611a22565b8152611ece60208501611a22565b60208201526040848101359082015260608085013590820152611ef360808501611a22565b608082015260a084810135818301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4083011215611f2f575f80fd5b611f37611e49565b915060c0840135611f4781611e8f565b825260e0840135602083015261010084013560ff81168114611f67575f80fd5b6040830152611f796101208501611a22565b6060830152610140840135611f8d81611e8f565b608083015260c08101919091529392505050565b8581526020810185905273ffffffffffffffffffffffffffffffffffffffff84166040820152606081018390526101208101611fe06080830184611cab565b9695505050505050565b5f82601f830112611ff9575f80fd5b813567ffffffffffffffff81111561201357612013611df3565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff8111828210171561206057612060611df3565b604052818152838201602001851015612077575f80fd5b816020850160208301375f918101602001919091529392505050565b5f602082840312156120a3575f80fd5b813567ffffffffffffffff8111156120b9575f80fd5b8201604081850312156120ca575f80fd5b6120d2611e6c565b6120db82611a22565b8152602082013567ffffffffffffffff8111156120f6575f80fd5b61210286828501611fea565b602083015250949350505050565b5f60208284031215612120575f80fd5b5051919050565b8181038181111561086157610861611d67565b602081525f82516003811061215157612151611c1a565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526121b060a0840182611bbc565b949350505050565b5f602082840312156121c8575f80fd5b813567ffffffffffffffff8111156121de575f80fd5b8201604081850312156121ef575f80fd5b6121f7611e6c565b813567ffffffffffffffff81111561220d575f80fd5b61221986828501611fea565b825250602082013567ffffffffffffffff8111156120f6575f80fd5b808202811582820484141761086157610861611d67565b5f8261227f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea26469706673582212204e4cf647127c9375d9d4d84240a56dd4ae0f1f1727bcc814e7c0f19d99a9cc9664736f6c634300081a0033", u = class u extends Z {
7
+ import { prepareClaimPayload as x } from "../claiming.js";
8
+ import { DecodedArgsError as n, NoMatchingLogsError as R, InvalidCriteriaTypeError as f0, IncentiveCriteriaNotFoundError as a0 } from "../errors.js";
9
+ import { RegistryType as e0, CheatCodes as b0 } from "../utils.js";
10
+ const d0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6122ba806100895f395ff3fe6080604052600436106102ab575f3560e01c8063715018a611610165578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b146107a9578063fe9fbb80146107bc578063fee81cf4146107db575f80fd5b8063ec87621c14610782578063f04e283e14610796575f80fd5b8063db09da12116100ac578063db09da121461072f578063dcc213611461074e578063dcc59b6f1461076d575f80fd5b8063c884ef83146106ec578063d54ad2a11461071a575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf1461069a578063be4994f8146106b9578063c213f3f9146106d8575f80fd5b8063a4d66daf14610664578063a871ced214610679575f80fd5b8063775486871161014b57806377548687146105b45780638da5cb5b146106225780639214fa4d1461063a575f80fd5b8063715018a61461059857806375b238fc146105a0575f80fd5b806330db555f1161020f5780634a4ee7b1116101c5578063514e62fc116101ab578063514e62fc14610546578063547d18641461057b57806354d1f13d14610590575f80fd5b80634a4ee7b1146105075780634e7165a21461051a575f80fd5b80634359d28a116101f55780634359d28a14610480578063439fab911461049f578063474f5a44146104be575f80fd5b806330db555f1461043557806338d52e0f14610454575f80fd5b80631f1cb62b11610264578063256929621161024a57806325692962146103c257806328d6183b146103ca5780632de9480714610404575f80fd5b80631f1cb62b1461035d578063228cb733146103ae575f80fd5b8063183a4f6e11610294578063183a4f6e146103005780631c10893f146103155780631cd64df414610328575f80fd5b806301ffc9a7146102af57806307621eca146102e3575b5f80fd5b3480156102ba575f80fd5b506102ce6102c93660046119c5565b61080c565b60405190151581526020015b60405180910390f35b3480156102ee575f80fd5b505f545b6040519081526020016102da565b61031361030e366004611a0b565b610867565b005b610313610323366004611a4a565b610874565b348015610333575f80fd5b506102ce610342366004611a4a565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610368575f80fd5b50600a546103899073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102da565b3480156103b9575f80fd5b506102f25f5481565b61031361088a565b3480156103d5575f80fd5b506040517ff60c99c90000000000000000000000000000000000000000000000000000000081526020016102da565b34801561040f575f80fd5b506102f261041e366004611a72565b638b78c6d8600c9081525f91909152602090205490565b348015610440575f80fd5b5061031361044f366004611a0b565b6108d7565b34801561045f575f80fd5b506006546103899073ffffffffffffffffffffffffffffffffffffffff1681565b34801561048b575f80fd5b5061031361049a366004611ad3565b610993565b3480156104aa575f80fd5b506103136104b9366004611b7d565b610a8d565b3480156104c9575f80fd5b506104dd6104d8366004611b7d565b610e1c565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102da565b610313610515366004611a4a565b610f7e565b348015610525575f80fd5b50610539610534366004611b7d565b610f90565b6040516102da9190611c08565b348015610551575f80fd5b506102ce610560366004611a4a565b638b78c6d8600c9081525f9290925260209091205416151590565b348015610586575f80fd5b506102f260025481565b61031361102a565b610313611063565b3480156105ab575f80fd5b506102f2600281565b3480156105bf575f80fd5b506003546004546005546106119260ff90811692918082169173ffffffffffffffffffffffffffffffffffffffff61010083041691750100000000000000000000000000000000000000000090041685565b6040516102da959493929190611c57565b34801561062d575f80fd5b50638b78c6d81954610389565b348015610645575f80fd5b50600a5473ffffffffffffffffffffffffffffffffffffffff16610389565b34801561066f575f80fd5b506102f260085481565b348015610684575f80fd5b5061068d611076565b6040516102da9190611d0a565b3480156106a5575f80fd5b506102ce6106b4366004611d18565b61115c565b3480156106c4575f80fd5b506103136106d3366004611ad3565b611389565b3480156106e3575f80fd5b50600b546102f2565b3480156106f7575f80fd5b506102ce610706366004611a72565b60016020525f908152604090205460ff1681565b348015610725575f80fd5b506102f260095481565b34801561073a575f80fd5b506102ce610749366004611d18565b611427565b348015610759575f80fd5b50610313610768366004611ad3565b61149a565b348015610778575f80fd5b506102f260075481565b34801561078d575f80fd5b506102f2600181565b6103136107a4366004611a72565b611538565b6103136107b7366004611a72565b611572565b3480156107c7575f80fd5b506102ce6107d6366004611a72565b611598565b3480156107e6575f80fd5b506102f26107f5366004611a72565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167ff60c99c90000000000000000000000000000000000000000000000000000000014806108615750610861826115f7565b92915050565b610871338261164c565b50565b61087c611657565b6108868282611671565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b60016108e28161167d565b815f0361091b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006546109409073ffffffffffffffffffffffffffffffffffffffff163330856116ae565b8160085f8282546109519190611d94565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b600261099e8161167d565b8382146109d7576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a85575f8484838181106109f4576109f4611da7565b9050602002016020810190610a099190611dd4565b9050801515600103610a4b57610a46878784818110610a2a57610a2a611da7565b9050602002016020810190610a3f9190611a72565b6001611671565b610a7c565b610a7c878784818110610a6057610a60611da7565b9050602002016020810190610a759190611a72565b600161164c565b506001016109d9565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610ade5760018160011c14303b10610ad55763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610aec83850185611e9b565b905080606001515f03610b2b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015181515f90610b549073ffffffffffffffffffffffffffffffffffffffff1630611710565b905081811015610bbd5782516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810183905260640160405180910390fd5b60c083015183516006805473ffffffffffffffffffffffffffffffffffffffff9283167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556020860151600a805491909316911617905560408401515f55606084015160085560a0840151600b5580516003805483929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610c7157610c71611c1a565b021790555060208201516001808301919091556040830151600283018054606086015173ffffffffffffffffffffffffffffffffffffffff16610100027fffffffffffffffffffffff00000000000000000000000000000000000000000090911660ff90931692909217919091178082556080850151927fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909116907501000000000000000000000000000000000000000000908490811115610d3657610d36611c1a565b0217905550905050610d4733611743565b610d568460800151600161178b565b836020015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff167f2610f3b22dbb1fc9e125919ede742dad90b4f3dd49ce0c10118c6ef34410e3c98660400151876060015188608001518960a001518a60c00151604051610dd6959493929190611fa1565b60405180910390a3505050508015610e17576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610e298161167d565b5f610e3685870187612093565b90505f8160200151806020019051810190610e519190612110565b90508060085f828254610e649190612127565b90915550508151600654610e919173ffffffffffffffffffffffffffffffffffffffff90911690836117cc565b81516006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610f4f91611c08565b60405180910390a260065490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610f86611657565b610886828261164c565b60605f610f9f83850185611e9b565b6060818101516040805160808101825260018152845173ffffffffffffffffffffffffffffffffffffffff16602080830191909152308284015282518082018452849052825180820185905283518082038301815290840184529482019490945290519394509092611011920161213a565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61106b611657565b6110745f61181f565b565b6040805160a0810182525f808252602082018190529181018290526060810182905260808101919091526040805160a0810190915260038054829060ff1660018111156110c5576110c5611c1a565b60018111156110d6576110d6611c1a565b81526001828101546020830152600283015460ff808216604085015273ffffffffffffffffffffffffffffffffffffffff61010083041660608501526080909301927501000000000000000000000000000000000000000000909104169081111561114357611143611c1a565b600181111561115457611154611c1a565b905250919050565b5f611165611657565b5f611172838501856121b8565b90505f816020015180602001905181019061118d9190612110565b90505f80545f0361119f5750806111c2565b670de0b6b3a7640000825f546111b59190612235565b6111bf919061224c565b90505b600b54158015906111d45750600b5481115b156111de5750600b545b6111e781611869565b61121d576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6008548160095461122e9190611d94565b1115611266576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060095f8282546112779190611d94565b92505081905550600160075f8282546112909190611d94565b90915550506006546112b99073ffffffffffffffffffffffffffffffffffffffff1688836117cc565b6006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261137491611c08565b60405180910390a25060019695505050505050565b60026113948161167d565b8382146113cd576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a855761141f8686838181106113ec576113ec611da7565b90506020020160208101906114019190611a72565b85858481811061141357611413611da7565b90506020020135611671565b6001016113cf565b5f8080611436848601866121b8565b90505f81602001518060200190518101906114519190612110565b90505f545f0361146357809250611486565b670de0b6b3a7640000815f546114799190612235565b611483919061224c565b92505b61148f83611869565b979650505050505050565b60026114a58161167d565b8382146114de576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a85576115308686838181106114fd576114fd611da7565b90506020020160208101906115129190611a72565b85858481811061152457611524611da7565b9050602002013561164c565b6001016114e0565b611540611657565b63389a75e1600c52805f526020600c20805442111561156657636f5e88185f526004601cfd5b5f90556108718161181f565b61157a611657565b8060601b61158f57637448fbae5f526004601cfd5b6108718161181f565b5f8173ffffffffffffffffffffffffffffffffffffffff166115bd638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806108615750638b78c6d8600c9081525f83905260209020546003161515610861565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f56586338000000000000000000000000000000000000000000000000000000001480610861575061086182611883565b61088682825f6118d8565b638b78c6d819543314611074576382b429005f526004601cfd5b610886828260016118d8565b638b78c6d81954331461087157638b78c6d8600c52335f52806020600c205416610871576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f51141661170257803d873b15171061170257637939f4245f526004601cfd5b505f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f51141661181557803d853b151710611815576390b8ec185f526004601cfd5b505f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f6008548260095461187b9190611d94565b111592915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa921670500000000000000000000000000000000000000000000000000000000148061086157506108618261192f565b638b78c6d8600c52825f526020600c208054838117836118f9575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061086157507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610861565b5f602082840312156119d5575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611a04575f80fd5b9392505050565b5f60208284031215611a1b575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611a45575f80fd5b919050565b5f8060408385031215611a5b575f80fd5b611a6483611a22565b946020939093013593505050565b5f60208284031215611a82575f80fd5b611a0482611a22565b5f8083601f840112611a9b575f80fd5b50813567ffffffffffffffff811115611ab2575f80fd5b6020830191508360208260051b8501011115611acc575f80fd5b9250929050565b5f805f8060408587031215611ae6575f80fd5b843567ffffffffffffffff811115611afc575f80fd5b611b0887828801611a8b565b909550935050602085013567ffffffffffffffff811115611b27575f80fd5b611b3387828801611a8b565b95989497509550505050565b5f8083601f840112611b4f575f80fd5b50813567ffffffffffffffff811115611b66575f80fd5b602083019150836020828501011115611acc575f80fd5b5f8060208385031215611b8e575f80fd5b823567ffffffffffffffff811115611ba4575f80fd5b611bb085828601611b3f565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f611a046020830184611bbc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061087157610871611c1a565b60a08101611c6487611c47565b86825285602083015260ff8516604083015273ffffffffffffffffffffffffffffffffffffffff84166060830152611c9b83611c47565b8260808301529695505050505050565b8051611cb681611c47565b808352506020810151602083015260ff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301526080810151611cff81611c47565b806080840152505050565b60a081016108618284611cab565b5f805f60408486031215611d2a575f80fd5b611d3384611a22565b9250602084013567ffffffffffffffff811115611d4e575f80fd5b611d5a86828701611b3f565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561086157610861611d67565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611de4575f80fd5b81358015158114611a04575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160e0810167ffffffffffffffff81118282101715611e4357611e43611df3565b60405290565b60405160a0810167ffffffffffffffff81118282101715611e4357611e43611df3565b6040805190810167ffffffffffffffff81118282101715611e4357611e43611df3565b60028110610871575f80fd5b5f81830361016081128015611eae575f80fd5b50611eb7611e20565b611ec084611a22565b8152611ece60208501611a22565b60208201526040848101359082015260608085013590820152611ef360808501611a22565b608082015260a084810135818301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4083011215611f2f575f80fd5b611f37611e49565b915060c0840135611f4781611e8f565b825260e0840135602083015261010084013560ff81168114611f67575f80fd5b6040830152611f796101208501611a22565b6060830152610140840135611f8d81611e8f565b608083015260c08101919091529392505050565b8581526020810185905273ffffffffffffffffffffffffffffffffffffffff84166040820152606081018390526101208101611fe06080830184611cab565b9695505050505050565b5f82601f830112611ff9575f80fd5b813567ffffffffffffffff81111561201357612013611df3565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff8111828210171561206057612060611df3565b604052818152838201602001851015612077575f80fd5b816020850160208301375f918101602001919091529392505050565b5f602082840312156120a3575f80fd5b813567ffffffffffffffff8111156120b9575f80fd5b8201604081850312156120ca575f80fd5b6120d2611e6c565b6120db82611a22565b8152602082013567ffffffffffffffff8111156120f6575f80fd5b61210286828501611fea565b602083015250949350505050565b5f60208284031215612120575f80fd5b5051919050565b8181038181111561086157610861611d67565b602081525f82516003811061215157612151611c1a565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526121b060a0840182611bbc565b949350505050565b5f602082840312156121c8575f80fd5b813567ffffffffffffffff8111156121de575f80fd5b8201604081850312156121ef575f80fd5b6121f7611e6c565b813567ffffffffffffffff81111561220d575f80fd5b61221986828501611fea565b825250602082013567ffffffffffffffff8111156120f6575f80fd5b808202811582820484141761086157610861611d67565b5f8261227f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea26469706673582212204e4cf647127c9375d9d4d84240a56dd4ae0f1f1727bcc814e7c0f19d99a9cc9664736f6c634300081a0033", y = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_BOOST_MAINNET_SIGNER_EOA: "0xCBD0C302040bC803B4B2EDaF21Be0e49Deff5480", VITE_BOOST_TESTNET_SIGNER_EOA: "0xd63167e9db11B108940b2E8236581F961f33f396" }, u = class u extends Z {
11
11
  constructor() {
12
- super(...arguments), this.abi = C;
12
+ super(...arguments), this.abi = E;
13
13
  }
14
14
  /**
15
15
  * The owner of the incentive
@@ -36,7 +36,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
36
36
  * @returns {Promise<bigint>} - The current reward
37
37
  */
38
38
  async currentReward(f) {
39
- return await E(
39
+ return await O(
40
40
  this._config,
41
41
  {
42
42
  address: this.assertValidAddress(),
@@ -55,7 +55,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
55
55
  * @returns {Promise<bigint>} The maximum reward amount per claim
56
56
  */
57
57
  async getMaxReward(f) {
58
- return await P(
58
+ return await B(
59
59
  this._config,
60
60
  {
61
61
  ...f,
@@ -72,12 +72,12 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
72
72
  * @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}
73
73
  */
74
74
  async getIncentiveScalar({ chainId: f, hash: e, knownSignatures: b, logs: d }, s) {
75
- var w;
75
+ var A;
76
76
  const a = await this.getIncentiveCriteria(s);
77
- if (a.criteriaType === x.EVENT) {
77
+ if (a.criteriaType === T.EVENT) {
78
78
  const m = b[a.signature];
79
- if (a.fieldIndex === e0.GAS_REBATE_INCENTIVE) {
80
- const t = await A(this._config, {
79
+ if (a.fieldIndex === b0.GAS_REBATE_INCENTIVE) {
80
+ const t = await I(this._config, {
81
81
  chainId: f,
82
82
  hash: e
83
83
  });
@@ -86,7 +86,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
86
86
  }
87
87
  if (d && d.length > 0)
88
88
  try {
89
- const t = d.filter((c) => c.topics && c.topics[0] === a.signature).map((c) => X(m, c));
89
+ const t = d.filter((c) => c.topics && c.topics[0] === a.signature).map((c) => Y(m, c));
90
90
  if (t.length > 0)
91
91
  for (const c of t) {
92
92
  if (p(a.fieldIndex))
@@ -103,26 +103,26 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
103
103
  `An error occurred while extracting scalar from logs: ${t.message}`
104
104
  );
105
105
  }
106
- const i = (await A(this._config, {
106
+ const i = (await I(this._config, {
107
107
  chainId: f,
108
108
  hash: e
109
109
  })).logs;
110
110
  if (i.length === 0)
111
- throw new T(
111
+ throw new R(
112
112
  `No logs found for event signature ${a.signature}`
113
113
  );
114
114
  try {
115
- const t = b[a.signature], c = K({
115
+ const t = b[a.signature], c = Q({
116
116
  abi: [t],
117
117
  logs: i
118
118
  });
119
119
  if (c == null || c.length === 0)
120
- throw new T(
120
+ throw new R(
121
121
  `No logs found for event signature ${a.signature}`
122
122
  );
123
123
  if (p(a.fieldIndex))
124
124
  return h(
125
- (w = c[0]) == null ? void 0 : w.args,
125
+ (A = c[0]) == null ? void 0 : A.args,
126
126
  a.fieldIndex
127
127
  );
128
128
  const r = c[0] && c[0].args ? c[0].args[a.fieldIndex] : void 0;
@@ -136,13 +136,13 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
136
136
  `Failed to decode event log for signature ${a.signature}: ${t.message}`
137
137
  );
138
138
  }
139
- } else if (a.criteriaType === x.FUNC) {
140
- const m = await J(this._config, {
139
+ } else if (a.criteriaType === T.FUNC) {
140
+ const m = await K(this._config, {
141
141
  chainId: f,
142
142
  hash: e
143
143
  });
144
144
  try {
145
- const l = b[a.signature], i = j({
145
+ const l = b[a.signature], i = W({
146
146
  abi: [l],
147
147
  data: m.input
148
148
  });
@@ -163,7 +163,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
163
163
  );
164
164
  }
165
165
  } else
166
- throw new Y(
166
+ throw new f0(
167
167
  `Invalid criteria type ${a.criteriaType}`
168
168
  );
169
169
  }
@@ -176,7 +176,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
176
176
  * @returns {Promise<bigint>}
177
177
  */
178
178
  async claims(f) {
179
- return await $(
179
+ return await N(
180
180
  this._config,
181
181
  {
182
182
  address: this.assertValidAddress(),
@@ -195,7 +195,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
195
195
  * @returns {Promise<bigint>}
196
196
  */
197
197
  async totalClaimed(f) {
198
- return await N(
198
+ return await P(
199
199
  this._config,
200
200
  {
201
201
  address: this.assertValidAddress(),
@@ -215,7 +215,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
215
215
  * @returns {Promise<boolean>}
216
216
  */
217
217
  async claimed(f, e) {
218
- return await O(
218
+ return await S(
219
219
  this._config,
220
220
  {
221
221
  address: this.assertValidAddress(),
@@ -234,7 +234,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
234
234
  * @returns {Promise<Address>}
235
235
  */
236
236
  async asset(f) {
237
- return await B(this._config, {
237
+ return await F(this._config, {
238
238
  address: this.assertValidAddress(),
239
239
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
240
240
  ...f
@@ -249,7 +249,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
249
249
  * @returns {Promise<Address>}
250
250
  */
251
251
  async peg(f) {
252
- return await F(this._config, {
252
+ return await $(this._config, {
253
253
  address: this.assertValidAddress(),
254
254
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
255
255
  ...f
@@ -264,7 +264,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
264
264
  * @returns {Promise<bigint>}
265
265
  */
266
266
  async reward(f) {
267
- return await L(
267
+ return await G(
268
268
  this._config,
269
269
  {
270
270
  address: this.assertValidAddress(),
@@ -282,7 +282,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
282
282
  * @returns {Promise<bigint>}
283
283
  */
284
284
  async limit(f) {
285
- return await G(this._config, {
285
+ return await L(this._config, {
286
286
  address: this.assertValidAddress(),
287
287
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
288
288
  ...f
@@ -312,7 +312,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
312
312
  async claimRaw(f, e) {
313
313
  const { request: b, result: d } = await M(this._config, {
314
314
  address: this.assertValidAddress(),
315
- args: [I(f)],
315
+ args: [x(f)],
316
316
  ...this.optionallyAttachAccount(),
317
317
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
318
318
  ...e
@@ -344,17 +344,17 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
344
344
  * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
345
345
  */
346
346
  async clawbackRaw(f, e) {
347
- const { request: b, result: d } = await H(
347
+ const { request: b, result: d } = await z(
348
348
  this._config,
349
349
  {
350
350
  address: this.assertValidAddress(),
351
- args: [I(f)],
351
+ args: [x(f)],
352
352
  ...this.optionallyAttachAccount(),
353
353
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
354
354
  ...e
355
355
  }
356
356
  );
357
- return { hash: await S(
357
+ return { hash: await H(
358
358
  this._config,
359
359
  b
360
360
  ), result: d };
@@ -447,7 +447,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
447
447
  */
448
448
  async getIncentiveCriteria(f) {
449
449
  try {
450
- return await z(
450
+ return await J(
451
451
  this._config,
452
452
  {
453
453
  ...f,
@@ -455,7 +455,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
455
455
  }
456
456
  );
457
457
  } catch (e) {
458
- throw new f0(e);
458
+ throw new a0(e);
459
459
  }
460
460
  }
461
461
  /**
@@ -478,7 +478,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
478
478
  manager: ((s = this.payload) == null ? void 0 : s.manager) ?? o,
479
479
  criteria: ((a = this.payload) == null ? void 0 : a.criteria) ?? {
480
480
  criteriaType: 0,
481
- signature: Q,
481
+ signature: j,
482
482
  fieldIndex: 0,
483
483
  targetContract: o,
484
484
  valueType: 0
@@ -499,8 +499,8 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
499
499
  e
500
500
  );
501
501
  return {
502
- abi: C,
503
- bytecode: b0,
502
+ abi: E,
503
+ bytecode: d0,
504
504
  args: [D(b)],
505
505
  ...this.optionallyAttachAccount(d.account)
506
506
  };
@@ -513,7 +513,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
513
513
  * @returns {Hex} - Returns an encoded uint256
514
514
  */
515
515
  buildClawbackData(f) {
516
- return y([{ type: "uint256" }], [f]);
516
+ return w([{ type: "uint256" }], [f]);
517
517
  }
518
518
  /**
519
519
  * Builds the claim data for the ERC20PeggedVariableCriteriaIncentivePayload.
@@ -524,7 +524,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
524
524
  * @description This function returns the encoded claim data for the ERC20PeggedVariableCriteriaIncentiveV2Payload.
525
525
  */
526
526
  buildClaimData(f) {
527
- return y(
527
+ return w(
528
528
  [{ type: "uint256", name: "signedAmount" }],
529
529
  [f]
530
530
  );
@@ -559,7 +559,7 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
559
559
  this.reward(),
560
560
  this.getMaxReward()
561
561
  ]);
562
- return s === 0n || (d = s * b / v("1"), a !== 0n && d > a && (d = a)), d;
562
+ return s === 0n || (d = s * b / C("1"), a !== 0n && d > a && (d = a)), d;
563
563
  }
564
564
  /**
565
565
  * Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.
@@ -590,14 +590,16 @@ const b0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd1980
590
590
  d[0].incentiveData
591
591
  )[0];
592
592
  let a = s;
593
- return e === 0n || (a = e * s / v("1"), b !== 0n && a > b && (a = b)), a;
593
+ return e === 0n || (a = e * s / C("1"), b !== 0n && a > b && (a = b)), a;
594
594
  }
595
595
  };
596
596
  u.bases = {
597
- 31337: void 0,
598
- ...W
599
- }, u.registryType = a0.INCENTIVE;
600
- let R = u;
597
+ ...y != null && y.VITE_ERC20_PEGGED_VARIABLE_CRITERIA_INCENTIVE_V2_BASE ? {
598
+ 31337: void 0
599
+ } : {},
600
+ ...X
601
+ }, u.registryType = e0.INCENTIVE;
602
+ let v = u;
601
603
  function D({
602
604
  asset: V,
603
605
  peg: f,
@@ -607,7 +609,7 @@ function D({
607
609
  manager: s = o,
608
610
  criteria: a
609
611
  }) {
610
- return y(
612
+ return w(
611
613
  [
612
614
  {
613
615
  type: "tuple",
@@ -653,8 +655,8 @@ function D({
653
655
  );
654
656
  }
655
657
  export {
656
- R as ERC20PeggedVariableCriteriaIncentiveV2,
657
- C as erc20PeggedVariableCriteriaIncentiveV2Abi,
658
+ v as ERC20PeggedVariableCriteriaIncentiveV2,
659
+ E as erc20PeggedVariableCriteriaIncentiveV2Abi,
658
660
  D as prepareERC20PeggedVariableCriteriaIncentiveV2Payload
659
661
  };
660
662
  //# sourceMappingURL=ERC20PeggedVariableCriteriaIncentiveV2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ERC20PeggedVariableCriteriaIncentiveV2.js","sources":["../../src/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.ts"],"sourcesContent":["import {\n erc20PeggedVariableCriteriaIncentiveV2Abi,\n readErc20PeggedVariableCriteriaIncentiveV2Asset,\n readErc20PeggedVariableCriteriaIncentiveV2Claimed,\n readErc20PeggedVariableCriteriaIncentiveV2Claims,\n readErc20PeggedVariableCriteriaIncentiveV2CurrentReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria,\n readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetPeg,\n readErc20PeggedVariableCriteriaIncentiveV2IsClaimable,\n readErc20PeggedVariableCriteriaIncentiveV2Limit,\n readErc20PeggedVariableCriteriaIncentiveV2Owner,\n readErc20PeggedVariableCriteriaIncentiveV2Peg,\n readErc20PeggedVariableCriteriaIncentiveV2Reward,\n readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed,\n simulateErc20PeggedVariableCriteriaIncentiveV2Claim,\n simulateErc20PeggedVariableCriteriaIncentiveV2Clawback,\n writeErc20PeggedVariableCriteriaIncentiveV2Claim,\n writeErc20PeggedVariableCriteriaIncentiveV2Clawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20PeggedVariableCriteriaIncentiveV2.sol/ERC20PeggedVariableCriteriaIncentiveV2.json';\nimport { getTransaction, getTransactionReceipt } from '@wagmi/core';\nimport type { AbiEvent } from 'abitype';\nimport {\n type AbiFunction,\n type Address,\n type ContractEventName,\n type Hex,\n decodeAbiParameters,\n decodeFunctionData,\n encodeAbiParameters,\n parseEther,\n parseEventLogs,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20PeggedVariableCriteriaIncentiveV2 as ERC20PeggedVariableCriteriaIncentiveV2Bases } from '../../dist/deployments.json';\nimport {\n SignatureType,\n decodeAndReorderLogArgs,\n getScalarValueFromTuple,\n isCriteriaFieldIndexTuple,\n} from '../Actions/EventAction';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n DecodedArgsError,\n IncentiveCriteriaNotFoundError,\n InvalidCriteriaTypeError,\n NoMatchingLogsError,\n} from '../errors';\nimport {\n CheatCodes,\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\nimport type {\n GetIncentiveScalarV2Params,\n IncentiveCriteriaV2,\n} from './ERC20VariableCriteriaIncentiveV2';\n\nexport { erc20PeggedVariableCriteriaIncentiveV2Abi };\n\n/**\n * The object representation of a `Erc20PeggedVariableCriteriaIncentiveV2.InitPayload`\n *\n * @export\n * @interface Erc20PeggedVariableCriteriaIncentiveV2\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2}\n */\nexport interface ERC20PeggedVariableCriteriaIncentiveV2Payload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The peg to normalize to.\n *\n * @type {Address}\n */\n peg: Address;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * Total spend for the incentive.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * Maximum reward each claim is elligible for.\n *\n * @type {bigint}\n */\n maxReward: bigint;\n /**\n * (Optional) The address of the entity that can managed the incentive.\n *\n * @type {Address}\n * @optional\n */\n manager?: Address;\n /**\n * The criteria for the incentive that determines how the reward is distributed.\n *\n * @type {IncentiveCriteria}\n */\n criteria: IncentiveCriteriaV2;\n}\n\n/**\n * A generic `viem.Log` event with support for `Erc20PeggedVariableCriteriaIncentiveV2` event types.\n *\n * @export\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2Log}\n * @template {ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>} [event=ContractEventName<\n * typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n * >]\n */\nexport type Erc20PeggedVariableCriteriaIncentiveV2Log<\n event extends ContractEventName<\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n > = ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>,\n> = GenericLog<typeof erc20PeggedVariableCriteriaIncentiveV2Abi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class Erc20PeggedVariableCriteriaIncentive\n * @typedef {ERC20PeggedVariableCriteriaIncentiveV2}\n * @extends {DeployableTarget<ERC20PeggedVariableCriteriaIncentiveV2>}\n */\nexport class ERC20PeggedVariableCriteriaIncentiveV2 extends DeployableTarget<\n ERC20PeggedVariableCriteriaIncentiveV2Payload,\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n> {\n public override readonly abi = erc20PeggedVariableCriteriaIncentiveV2Abi;\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\n .VITE_ERC20_PEGGED_VARIABLE_CRITERIA_INCENTIVE_V2_BASE,\n ...(ERC20PeggedVariableCriteriaIncentiveV2Bases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Owner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2CurrentReward(\n this._config,\n {\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 /**\n * Retrieves the maximum reward amount per claim.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} The maximum reward amount per claim\n */\n public async getMaxReward(params?: ReadParams): Promise<bigint> {\n const maxReward =\n await readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return maxReward;\n }\n\n /**\n * Fetches the incentive scalar from a transaction hash\n *\n * @param {GetIncentiveScalarParams} params\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n * @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}\n */\n public async getIncentiveScalar(\n { chainId, hash, knownSignatures, logs }: GetIncentiveScalarV2Params,\n params?: ReadParams,\n ): Promise<bigint> {\n const criteria = await this.getIncentiveCriteria(params);\n if (criteria.criteriaType === SignatureType.EVENT) {\n const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n\n if (criteria.fieldIndex === CheatCodes.GAS_REBATE_INCENTIVE) {\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\n const totalCost =\n transactionReceipt.gasUsed * transactionReceipt.effectiveGasPrice + // Normal gas cost\n (transactionReceipt.blobGasUsed ?? 0n) *\n (transactionReceipt.blobGasPrice ?? 0n); // Blob gas cost - account for potential undefined values\n return totalCost;\n }\n\n // if logs are provided, use them to extract the scalar\n if (logs && logs.length > 0) {\n try {\n // only check logs that match the criteria signature\n const signatureMatchingLogs = logs\n .filter((log) => log.topics && log.topics[0] === criteria.signature)\n .map((log) => decodeAndReorderLogArgs(eventAbi, log));\n\n if (signatureMatchingLogs.length > 0) {\n for (const log of signatureMatchingLogs) {\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n log.args as unknown[],\n criteria.fieldIndex,\n );\n }\n const scalarValue = log.args\n ? (log.args as string[])[criteria.fieldIndex]\n : undefined;\n if (scalarValue !== undefined) {\n return BigInt(scalarValue);\n }\n }\n }\n } catch (e) {\n throw new DecodedArgsError(\n `An error occurred while extracting scalar from logs: ${(e as Error).message}`,\n );\n }\n }\n\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\n const receiptLogs = transactionReceipt.logs;\n\n if (receiptLogs.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n\n // Decode the event log\n try {\n const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n const decodedEvents = parseEventLogs({\n abi: [eventAbi],\n logs: receiptLogs,\n });\n if (decodedEvents == undefined || decodedEvents.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n decodedEvents[0]?.args as unknown[],\n criteria.fieldIndex,\n );\n }\n\n const scalarValue =\n decodedEvents[0] && decodedEvents[0].args\n ? (decodedEvents[0].args as string[])[criteria.fieldIndex]\n : undefined;\n if (scalarValue === undefined) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode event log for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else if (criteria.criteriaType === SignatureType.FUNC) {\n // Fetch the transaction data\n const transaction = await getTransaction(this._config, {\n chainId,\n hash,\n });\n try {\n // Decode function data\n const func = knownSignatures[criteria.signature] as AbiFunction;\n const decodedFunction = decodeFunctionData({\n abi: [func],\n data: transaction.input,\n });\n\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n decodedFunction.args as unknown[],\n criteria.fieldIndex,\n );\n }\n\n const scalarValue = decodedFunction.args[criteria.fieldIndex] as string;\n if (scalarValue === undefined || scalarValue === null) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode function data for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else {\n throw new InvalidCriteriaTypeError(\n `Invalid criteria type ${criteria.criteriaType}`,\n );\n }\n }\n\n /**\n * 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 readErc20PeggedVariableCriteriaIncentiveV2Claims(\n this._config,\n {\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 /**\n * The total amount of rewards claimed\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalClaimed(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed(\n this._config,\n {\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 /**\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 readErc20PeggedVariableCriteriaIncentiveV2Claimed(\n this._config,\n {\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 /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Asset(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 address of the pegged ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async peg(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Peg(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Reward(\n this._config,\n {\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 /**\n * The limit (max possible rewards payout in reward token)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Limit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } =\n await simulateErc20PeggedVariableCriteriaIncentiveV2Claim(this._config, {\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 const hash = await writeErc20PeggedVariableCriteriaIncentiveV2Claim(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } =\n await simulateErc20PeggedVariableCriteriaIncentiveV2Clawback(\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 writeErc20PeggedVariableCriteriaIncentiveV2Clawback(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\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 readErc20PeggedVariableCriteriaIncentiveV2IsClaimable(\n this._config,\n {\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 /**\n * read the peg token for the incentive.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} = The address of the token the reward is pegged to\n */\n public async getPeg(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2GetPeg(\n this._config,\n {\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 /**\n * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.\n */\n public async getTotalBudget(params?: ReadParams) {\n return await this.limit(params);\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 [totalClaimed, limit] = await Promise.all([\n this.totalClaimed(params),\n this.limit(params),\n ]);\n return limit - totalClaimed;\n }\n\n /**\n *Functions from the ERC20VariableIncentive contract\n */\n\n /**\n * Fetches the IncentiveCriteria struct from the contract\n *\n * @param {?ReadParams} [params]\n * @returns {Promise<IncentiveCriteria>} Incentive criteria structure\n * @throws {IncentiveCriteriaNotFoundError}\n */\n public async getIncentiveCriteria(\n params?: ReadParams,\n ): Promise<IncentiveCriteriaV2> {\n try {\n const criteria =\n await readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return criteria;\n } catch (e) {\n throw new IncentiveCriteriaNotFoundError(e as Error);\n }\n }\n\n /**\n * Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing\n * the existing `limit` field by `netAmount`. The entire payload is then re-encoded\n * via `prepareERC20PeggedIncentivePayload(...)`.\n *\n * @public\n * @param {bigint} netAmount - The additional limit to add to this incentive.\n * @returns {Hex} The ABI-encoded payload with the updated `limit`.\n */\n public async getTopupPayload(netAmount: bigint): Promise<Hex> {\n return prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset: (await this.asset()) ?? zeroAddress,\n peg: this.payload?.peg ?? zeroAddress,\n reward: this.payload?.reward ?? 0n,\n limit: netAmount,\n maxReward: this.payload?.maxReward ?? 0n,\n manager: this.payload?.manager ?? zeroAddress,\n criteria: this.payload?.criteria ?? {\n criteriaType: 0,\n signature: zeroHash,\n fieldIndex: 0,\n targetContract: zeroAddress,\n valueType: 0,\n },\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20PeggedVariableCriteriaIncentiveV2Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20PeggedVariableCriteriaIncentiveV2Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20PeggedVariableCriteriaIncentiveV2Abi,\n bytecode: bytecode as Hex,\n args: [prepareERC20PeggedVariableCriteriaIncentiveV2Payload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Encodes an amount to clawback from the incentive\n *\n * @public\n * @param {bigint} amount - How much of the asset to clawback\n * @returns {Hex} - Returns an encoded uint256\n */\n public buildClawbackData(amount: bigint) {\n return encodeAbiParameters([{ type: 'uint256' }], [amount]);\n }\n\n /**\n * Builds the claim data for the ERC20PeggedVariableCriteriaIncentivePayload.\n *\n * @public\n * @param {bigint} signedAmount\n * @returns {Hash} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20PeggedVariableCriteriaIncentiveV2Payload.\n */\n public buildClaimData(signedAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'signedAmount' }],\n [signedAmount],\n );\n }\n\n /**\n * Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {Promise<bigint>} Returns the reward amount from a claim data payload\n */\n public async decodeClaimData(claimData: Hex) {\n const boostClaimData = decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n claimData,\n );\n const signedAmount = decodeAbiParameters(\n [{ type: 'uint256' }],\n boostClaimData[0].incentiveData,\n )[0];\n let claimAmount = signedAmount;\n const [reward, maxReward] = await Promise.all([\n this.reward(),\n this.getMaxReward(),\n ]);\n\n if (reward === 0n) {\n return claimAmount;\n } else {\n claimAmount = (reward * signedAmount) / parseEther('1');\n }\n\n if (maxReward !== 0n && claimAmount > maxReward) {\n claimAmount = maxReward;\n }\n\n return claimAmount;\n }\n\n /**\n * Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n * Use this function instead of `decodeClaimData` if you have reward details.\n *\n * @public\n * @param {Hex} claimData\n * @param {bigint} [reward]\n * @param {bigint} [maxReward]\n * @returns {BigInt} Returns the reward amount from a claim data payload\n */\n public decodeClaimDataWithRewardDetails(\n claimData: Hex,\n reward: bigint,\n maxReward: bigint,\n ) {\n const boostClaimData = decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n claimData,\n );\n const signedAmount = decodeAbiParameters(\n [{ type: 'uint256' }],\n boostClaimData[0].incentiveData,\n )[0];\n let claimAmount = signedAmount;\n\n if (reward === 0n) {\n return claimAmount;\n } else {\n claimAmount = (reward * signedAmount) / parseEther('1');\n }\n\n if (maxReward !== 0n && claimAmount > maxReward) {\n claimAmount = maxReward;\n }\n\n return claimAmount;\n }\n}\n\n/**\n * Given a {@link ERC20PeggedVariableCriteriaIncentiveV2Payload}, properly encode a `ERC20PeggedVariableCriteriaIncentiveV2Payload.InitPayload` for use with {@link ERC20PeggedVariableCriteriaIncentiveV2Payload} initialization.\n *\n * @param {ERC20PeggedVariableCriteriaIncentiveV2Payload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {Address} param0.peg - The peg to normalize to.\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @param {Address} [param0.manager=zeroAddress] - The entity that can manage the incentive.\n * @param {IncentiveCriteria} param0.criteria - The incentive criteria for reward distribution.\n * @returns {Hex}\n */\nexport function prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset,\n peg,\n reward,\n limit,\n maxReward = 0n,\n manager = zeroAddress,\n criteria,\n}: ERC20PeggedVariableCriteriaIncentiveV2Payload) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayloadExtended',\n components: [\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'peg' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n { type: 'uint256', name: 'maxReward' },\n {\n type: 'tuple',\n name: 'criteria',\n components: [\n { type: 'uint8', name: 'criteriaType' },\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint8', name: 'valueType' },\n ],\n },\n ],\n },\n ],\n [\n {\n asset,\n peg,\n reward,\n limit,\n manager,\n maxReward,\n criteria: {\n criteriaType: criteria.criteriaType,\n signature: criteria.signature,\n fieldIndex: criteria.fieldIndex,\n targetContract: criteria.targetContract,\n valueType: criteria.valueType,\n },\n },\n ],\n );\n}\n"],"names":["_ERC20PeggedVariableCriteriaIncentiveV2","DeployableTarget","erc20PeggedVariableCriteriaIncentiveV2Abi","params","readErc20PeggedVariableCriteriaIncentiveV2Owner","readErc20PeggedVariableCriteriaIncentiveV2CurrentReward","readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward","chainId","hash","knownSignatures","logs","criteria","SignatureType","eventAbi","CheatCodes","transactionReceipt","getTransactionReceipt","signatureMatchingLogs","log","decodeAndReorderLogArgs","isCriteriaFieldIndexTuple","getScalarValueFromTuple","scalarValue","e","DecodedArgsError","receiptLogs","NoMatchingLogsError","decodedEvents","parseEventLogs","_a","transaction","getTransaction","func","decodedFunction","decodeFunctionData","InvalidCriteriaTypeError","readErc20PeggedVariableCriteriaIncentiveV2Claims","readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed","address","readErc20PeggedVariableCriteriaIncentiveV2Claimed","readErc20PeggedVariableCriteriaIncentiveV2Asset","readErc20PeggedVariableCriteriaIncentiveV2Peg","readErc20PeggedVariableCriteriaIncentiveV2Reward","readErc20PeggedVariableCriteriaIncentiveV2Limit","payload","request","result","simulateErc20PeggedVariableCriteriaIncentiveV2Claim","prepareClaimPayload","writeErc20PeggedVariableCriteriaIncentiveV2Claim","simulateErc20PeggedVariableCriteriaIncentiveV2Clawback","writeErc20PeggedVariableCriteriaIncentiveV2Clawback","readErc20PeggedVariableCriteriaIncentiveV2IsClaimable","readErc20PeggedVariableCriteriaIncentiveV2GetPeg","totalClaimed","limit","readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria","IncentiveCriteriaNotFoundError","netAmount","prepareERC20PeggedVariableCriteriaIncentiveV2Payload","zeroAddress","_b","_c","_d","_e","zeroHash","_payload","_options","options","bytecode","amount","encodeAbiParameters","signedAmount","claimData","boostClaimData","decodeAbiParameters","claimAmount","reward","maxReward","parseEther","ERC20PeggedVariableCriteriaIncentiveV2Bases","RegistryType","ERC20PeggedVariableCriteriaIncentiveV2","asset","peg","manager"],"mappings":";;;;;;;;;upjBAiJaA,IAAN,MAAMA,UAA+CC,EAG1D;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA8B/B,MAAa,MAAMC,GAAqB;AAC/B,WAAA,MAAMC,EAAgD,KAAK,SAAS;AAAA,MACzE,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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;AAAA,UACvB,WAAWA,EAAS;AAAA,UACpB,YAAYA,EAAS;AAAA,UACrB,gBAAgBA,EAAS;AAAA,UACzB,WAAWA,EAAS;AAAA,QACtB;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"ERC20PeggedVariableCriteriaIncentiveV2.js","sources":["../../src/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.ts"],"sourcesContent":["import {\n erc20PeggedVariableCriteriaIncentiveV2Abi,\n readErc20PeggedVariableCriteriaIncentiveV2Asset,\n readErc20PeggedVariableCriteriaIncentiveV2Claimed,\n readErc20PeggedVariableCriteriaIncentiveV2Claims,\n readErc20PeggedVariableCriteriaIncentiveV2CurrentReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria,\n readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetPeg,\n readErc20PeggedVariableCriteriaIncentiveV2IsClaimable,\n readErc20PeggedVariableCriteriaIncentiveV2Limit,\n readErc20PeggedVariableCriteriaIncentiveV2Owner,\n readErc20PeggedVariableCriteriaIncentiveV2Peg,\n readErc20PeggedVariableCriteriaIncentiveV2Reward,\n readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed,\n simulateErc20PeggedVariableCriteriaIncentiveV2Claim,\n simulateErc20PeggedVariableCriteriaIncentiveV2Clawback,\n writeErc20PeggedVariableCriteriaIncentiveV2Claim,\n writeErc20PeggedVariableCriteriaIncentiveV2Clawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20PeggedVariableCriteriaIncentiveV2.sol/ERC20PeggedVariableCriteriaIncentiveV2.json';\nimport { getTransaction, getTransactionReceipt } from '@wagmi/core';\nimport type { AbiEvent } from 'abitype';\nimport {\n type AbiFunction,\n type Address,\n type ContractEventName,\n type Hex,\n decodeAbiParameters,\n decodeFunctionData,\n encodeAbiParameters,\n parseEther,\n parseEventLogs,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20PeggedVariableCriteriaIncentiveV2 as ERC20PeggedVariableCriteriaIncentiveV2Bases } from '../../dist/deployments.json';\nimport {\n SignatureType,\n decodeAndReorderLogArgs,\n getScalarValueFromTuple,\n isCriteriaFieldIndexTuple,\n} from '../Actions/EventAction';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n DecodedArgsError,\n IncentiveCriteriaNotFoundError,\n InvalidCriteriaTypeError,\n NoMatchingLogsError,\n} from '../errors';\nimport {\n CheatCodes,\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\nimport type {\n GetIncentiveScalarV2Params,\n IncentiveCriteriaV2,\n} from './ERC20VariableCriteriaIncentiveV2';\n\nexport { erc20PeggedVariableCriteriaIncentiveV2Abi };\n\n/**\n * The object representation of a `Erc20PeggedVariableCriteriaIncentiveV2.InitPayload`\n *\n * @export\n * @interface Erc20PeggedVariableCriteriaIncentiveV2\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2}\n */\nexport interface ERC20PeggedVariableCriteriaIncentiveV2Payload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The peg to normalize to.\n *\n * @type {Address}\n */\n peg: Address;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * Total spend for the incentive.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * Maximum reward each claim is elligible for.\n *\n * @type {bigint}\n */\n maxReward: bigint;\n /**\n * (Optional) The address of the entity that can managed the incentive.\n *\n * @type {Address}\n * @optional\n */\n manager?: Address;\n /**\n * The criteria for the incentive that determines how the reward is distributed.\n *\n * @type {IncentiveCriteria}\n */\n criteria: IncentiveCriteriaV2;\n}\n\n/**\n * A generic `viem.Log` event with support for `Erc20PeggedVariableCriteriaIncentiveV2` event types.\n *\n * @export\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2Log}\n * @template {ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>} [event=ContractEventName<\n * typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n * >]\n */\nexport type Erc20PeggedVariableCriteriaIncentiveV2Log<\n event extends ContractEventName<\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n > = ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>,\n> = GenericLog<typeof erc20PeggedVariableCriteriaIncentiveV2Abi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class Erc20PeggedVariableCriteriaIncentive\n * @typedef {ERC20PeggedVariableCriteriaIncentiveV2}\n * @extends {DeployableTarget<ERC20PeggedVariableCriteriaIncentiveV2>}\n */\nexport class ERC20PeggedVariableCriteriaIncentiveV2 extends DeployableTarget<\n ERC20PeggedVariableCriteriaIncentiveV2Payload,\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n> {\n public override readonly abi = erc20PeggedVariableCriteriaIncentiveV2Abi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n ...(import.meta.env?.VITE_ERC20_PEGGED_VARIABLE_CRITERIA_INCENTIVE_V2_BASE\n ? {\n 31337: import.meta.env\n .VITE_ERC20_PEGGED_VARIABLE_CRITERIA_INCENTIVE_V2_BASE,\n }\n : {}),\n ...(ERC20PeggedVariableCriteriaIncentiveV2Bases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Owner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2CurrentReward(\n this._config,\n {\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 /**\n * Retrieves the maximum reward amount per claim.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} The maximum reward amount per claim\n */\n public async getMaxReward(params?: ReadParams): Promise<bigint> {\n const maxReward =\n await readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return maxReward;\n }\n\n /**\n * Fetches the incentive scalar from a transaction hash\n *\n * @param {GetIncentiveScalarParams} params\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n * @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}\n */\n public async getIncentiveScalar(\n { chainId, hash, knownSignatures, logs }: GetIncentiveScalarV2Params,\n params?: ReadParams,\n ): Promise<bigint> {\n const criteria = await this.getIncentiveCriteria(params);\n if (criteria.criteriaType === SignatureType.EVENT) {\n const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n\n if (criteria.fieldIndex === CheatCodes.GAS_REBATE_INCENTIVE) {\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\n const totalCost =\n transactionReceipt.gasUsed * transactionReceipt.effectiveGasPrice + // Normal gas cost\n (transactionReceipt.blobGasUsed ?? 0n) *\n (transactionReceipt.blobGasPrice ?? 0n); // Blob gas cost - account for potential undefined values\n return totalCost;\n }\n\n // if logs are provided, use them to extract the scalar\n if (logs && logs.length > 0) {\n try {\n // only check logs that match the criteria signature\n const signatureMatchingLogs = logs\n .filter((log) => log.topics && log.topics[0] === criteria.signature)\n .map((log) => decodeAndReorderLogArgs(eventAbi, log));\n\n if (signatureMatchingLogs.length > 0) {\n for (const log of signatureMatchingLogs) {\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n log.args as unknown[],\n criteria.fieldIndex,\n );\n }\n const scalarValue = log.args\n ? (log.args as string[])[criteria.fieldIndex]\n : undefined;\n if (scalarValue !== undefined) {\n return BigInt(scalarValue);\n }\n }\n }\n } catch (e) {\n throw new DecodedArgsError(\n `An error occurred while extracting scalar from logs: ${(e as Error).message}`,\n );\n }\n }\n\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\n const receiptLogs = transactionReceipt.logs;\n\n if (receiptLogs.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n\n // Decode the event log\n try {\n const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n const decodedEvents = parseEventLogs({\n abi: [eventAbi],\n logs: receiptLogs,\n });\n if (decodedEvents == undefined || decodedEvents.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n decodedEvents[0]?.args as unknown[],\n criteria.fieldIndex,\n );\n }\n\n const scalarValue =\n decodedEvents[0] && decodedEvents[0].args\n ? (decodedEvents[0].args as string[])[criteria.fieldIndex]\n : undefined;\n if (scalarValue === undefined) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode event log for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else if (criteria.criteriaType === SignatureType.FUNC) {\n // Fetch the transaction data\n const transaction = await getTransaction(this._config, {\n chainId,\n hash,\n });\n try {\n // Decode function data\n const func = knownSignatures[criteria.signature] as AbiFunction;\n const decodedFunction = decodeFunctionData({\n abi: [func],\n data: transaction.input,\n });\n\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n decodedFunction.args as unknown[],\n criteria.fieldIndex,\n );\n }\n\n const scalarValue = decodedFunction.args[criteria.fieldIndex] as string;\n if (scalarValue === undefined || scalarValue === null) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode function data for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else {\n throw new InvalidCriteriaTypeError(\n `Invalid criteria type ${criteria.criteriaType}`,\n );\n }\n }\n\n /**\n * 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 readErc20PeggedVariableCriteriaIncentiveV2Claims(\n this._config,\n {\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 /**\n * The total amount of rewards claimed\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalClaimed(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed(\n this._config,\n {\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 /**\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 readErc20PeggedVariableCriteriaIncentiveV2Claimed(\n this._config,\n {\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 /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Asset(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 address of the pegged ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async peg(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Peg(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Reward(\n this._config,\n {\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 /**\n * The limit (max possible rewards payout in reward token)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Limit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } =\n await simulateErc20PeggedVariableCriteriaIncentiveV2Claim(this._config, {\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 const hash = await writeErc20PeggedVariableCriteriaIncentiveV2Claim(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } =\n await simulateErc20PeggedVariableCriteriaIncentiveV2Clawback(\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 writeErc20PeggedVariableCriteriaIncentiveV2Clawback(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\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 readErc20PeggedVariableCriteriaIncentiveV2IsClaimable(\n this._config,\n {\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 /**\n * read the peg token for the incentive.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} = The address of the token the reward is pegged to\n */\n public async getPeg(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2GetPeg(\n this._config,\n {\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 /**\n * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.\n */\n public async getTotalBudget(params?: ReadParams) {\n return await this.limit(params);\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 [totalClaimed, limit] = await Promise.all([\n this.totalClaimed(params),\n this.limit(params),\n ]);\n return limit - totalClaimed;\n }\n\n /**\n *Functions from the ERC20VariableIncentive contract\n */\n\n /**\n * Fetches the IncentiveCriteria struct from the contract\n *\n * @param {?ReadParams} [params]\n * @returns {Promise<IncentiveCriteria>} Incentive criteria structure\n * @throws {IncentiveCriteriaNotFoundError}\n */\n public async getIncentiveCriteria(\n params?: ReadParams,\n ): Promise<IncentiveCriteriaV2> {\n try {\n const criteria =\n await readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return criteria;\n } catch (e) {\n throw new IncentiveCriteriaNotFoundError(e as Error);\n }\n }\n\n /**\n * Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing\n * the existing `limit` field by `netAmount`. The entire payload is then re-encoded\n * via `prepareERC20PeggedIncentivePayload(...)`.\n *\n * @public\n * @param {bigint} netAmount - The additional limit to add to this incentive.\n * @returns {Hex} The ABI-encoded payload with the updated `limit`.\n */\n public async getTopupPayload(netAmount: bigint): Promise<Hex> {\n return prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset: (await this.asset()) ?? zeroAddress,\n peg: this.payload?.peg ?? zeroAddress,\n reward: this.payload?.reward ?? 0n,\n limit: netAmount,\n maxReward: this.payload?.maxReward ?? 0n,\n manager: this.payload?.manager ?? zeroAddress,\n criteria: this.payload?.criteria ?? {\n criteriaType: 0,\n signature: zeroHash,\n fieldIndex: 0,\n targetContract: zeroAddress,\n valueType: 0,\n },\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20PeggedVariableCriteriaIncentiveV2Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20PeggedVariableCriteriaIncentiveV2Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20PeggedVariableCriteriaIncentiveV2Abi,\n bytecode: bytecode as Hex,\n args: [prepareERC20PeggedVariableCriteriaIncentiveV2Payload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Encodes an amount to clawback from the incentive\n *\n * @public\n * @param {bigint} amount - How much of the asset to clawback\n * @returns {Hex} - Returns an encoded uint256\n */\n public buildClawbackData(amount: bigint) {\n return encodeAbiParameters([{ type: 'uint256' }], [amount]);\n }\n\n /**\n * Builds the claim data for the ERC20PeggedVariableCriteriaIncentivePayload.\n *\n * @public\n * @param {bigint} signedAmount\n * @returns {Hash} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20PeggedVariableCriteriaIncentiveV2Payload.\n */\n public buildClaimData(signedAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'signedAmount' }],\n [signedAmount],\n );\n }\n\n /**\n * Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {Promise<bigint>} Returns the reward amount from a claim data payload\n */\n public async decodeClaimData(claimData: Hex) {\n const boostClaimData = decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n claimData,\n );\n const signedAmount = decodeAbiParameters(\n [{ type: 'uint256' }],\n boostClaimData[0].incentiveData,\n )[0];\n let claimAmount = signedAmount;\n const [reward, maxReward] = await Promise.all([\n this.reward(),\n this.getMaxReward(),\n ]);\n\n if (reward === 0n) {\n return claimAmount;\n } else {\n claimAmount = (reward * signedAmount) / parseEther('1');\n }\n\n if (maxReward !== 0n && claimAmount > maxReward) {\n claimAmount = maxReward;\n }\n\n return claimAmount;\n }\n\n /**\n * Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n * Use this function instead of `decodeClaimData` if you have reward details.\n *\n * @public\n * @param {Hex} claimData\n * @param {bigint} [reward]\n * @param {bigint} [maxReward]\n * @returns {BigInt} Returns the reward amount from a claim data payload\n */\n public decodeClaimDataWithRewardDetails(\n claimData: Hex,\n reward: bigint,\n maxReward: bigint,\n ) {\n const boostClaimData = decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n claimData,\n );\n const signedAmount = decodeAbiParameters(\n [{ type: 'uint256' }],\n boostClaimData[0].incentiveData,\n )[0];\n let claimAmount = signedAmount;\n\n if (reward === 0n) {\n return claimAmount;\n } else {\n claimAmount = (reward * signedAmount) / parseEther('1');\n }\n\n if (maxReward !== 0n && claimAmount > maxReward) {\n claimAmount = maxReward;\n }\n\n return claimAmount;\n }\n}\n\n/**\n * Given a {@link ERC20PeggedVariableCriteriaIncentiveV2Payload}, properly encode a `ERC20PeggedVariableCriteriaIncentiveV2Payload.InitPayload` for use with {@link ERC20PeggedVariableCriteriaIncentiveV2Payload} initialization.\n *\n * @param {ERC20PeggedVariableCriteriaIncentiveV2Payload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {Address} param0.peg - The peg to normalize to.\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @param {Address} [param0.manager=zeroAddress] - The entity that can manage the incentive.\n * @param {IncentiveCriteria} param0.criteria - The incentive criteria for reward distribution.\n * @returns {Hex}\n */\nexport function prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset,\n peg,\n reward,\n limit,\n maxReward = 0n,\n manager = zeroAddress,\n criteria,\n}: ERC20PeggedVariableCriteriaIncentiveV2Payload) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayloadExtended',\n components: [\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'peg' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n { type: 'uint256', name: 'maxReward' },\n {\n type: 'tuple',\n name: 'criteria',\n components: [\n { type: 'uint8', name: 'criteriaType' },\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint8', name: 'valueType' },\n ],\n },\n ],\n },\n ],\n [\n {\n asset,\n peg,\n reward,\n limit,\n manager,\n maxReward,\n criteria: {\n criteriaType: criteria.criteriaType,\n signature: criteria.signature,\n fieldIndex: criteria.fieldIndex,\n targetContract: criteria.targetContract,\n valueType: criteria.valueType,\n },\n },\n ],\n );\n}\n"],"names":["_ERC20PeggedVariableCriteriaIncentiveV2","DeployableTarget","erc20PeggedVariableCriteriaIncentiveV2Abi","params","readErc20PeggedVariableCriteriaIncentiveV2Owner","readErc20PeggedVariableCriteriaIncentiveV2CurrentReward","readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward","chainId","hash","knownSignatures","logs","criteria","SignatureType","eventAbi","CheatCodes","transactionReceipt","getTransactionReceipt","signatureMatchingLogs","log","decodeAndReorderLogArgs","isCriteriaFieldIndexTuple","getScalarValueFromTuple","scalarValue","e","DecodedArgsError","receiptLogs","NoMatchingLogsError","decodedEvents","parseEventLogs","_a","transaction","getTransaction","func","decodedFunction","decodeFunctionData","InvalidCriteriaTypeError","readErc20PeggedVariableCriteriaIncentiveV2Claims","readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed","address","readErc20PeggedVariableCriteriaIncentiveV2Claimed","readErc20PeggedVariableCriteriaIncentiveV2Asset","readErc20PeggedVariableCriteriaIncentiveV2Peg","readErc20PeggedVariableCriteriaIncentiveV2Reward","readErc20PeggedVariableCriteriaIncentiveV2Limit","payload","request","result","simulateErc20PeggedVariableCriteriaIncentiveV2Claim","prepareClaimPayload","writeErc20PeggedVariableCriteriaIncentiveV2Claim","simulateErc20PeggedVariableCriteriaIncentiveV2Clawback","writeErc20PeggedVariableCriteriaIncentiveV2Clawback","readErc20PeggedVariableCriteriaIncentiveV2IsClaimable","readErc20PeggedVariableCriteriaIncentiveV2GetPeg","totalClaimed","limit","readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria","IncentiveCriteriaNotFoundError","netAmount","prepareERC20PeggedVariableCriteriaIncentiveV2Payload","zeroAddress","_b","_c","_d","_e","zeroHash","_payload","_options","options","bytecode","amount","encodeAbiParameters","signedAmount","claimData","boostClaimData","decodeAbiParameters","claimAmount","reward","maxReward","parseEther","__vite_import_meta_env__","ERC20PeggedVariableCriteriaIncentiveV2Bases","RegistryType","ERC20PeggedVariableCriteriaIncentiveV2","asset","peg","manager"],"mappings":";;;;;;;;;w3jBAiJaA,IAAN,MAAMA,UAA+CC,EAG1D;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkC/B,MAAa,MAAMC,GAAqB;AAC/B,WAAA,MAAMC,EAAgD,KAAK,SAAS;AAAA,MACzE,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;AAC9C,WAAO,MAAME;AAAAA,MACX,KAAK;AAAA,MACL;AAAA,QACE,SAAS,KAAK,mBAAmB;AAAA,QACjC,MAAM,CAAC;AAAA;AAAA,QAEP,GAAIF;AAAA,MACN;AAAA,IAAA;AAAA,EAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,aAAaA,GAAsC;AAUvD,WARL,MAAMG;AAAAA,MACJ,KAAK;AAAA,MACL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