@boostxyz/sdk 5.3.1 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/Actions/Action.cjs +1 -1
  2. package/dist/Actions/Action.js +3 -3
  3. package/dist/Actions/EventAction.cjs +1 -1
  4. package/dist/Actions/EventAction.cjs.map +1 -1
  5. package/dist/Actions/EventAction.d.ts +13 -3
  6. package/dist/Actions/EventAction.d.ts.map +1 -1
  7. package/dist/Actions/EventAction.js +216 -193
  8. package/dist/Actions/EventAction.js.map +1 -1
  9. package/dist/AllowLists/AllowList.cjs +1 -1
  10. package/dist/AllowLists/AllowList.js +2 -2
  11. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  12. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
  13. package/dist/AllowLists/SimpleAllowList.js +24 -24
  14. package/dist/AllowLists/SimpleAllowList.js.map +1 -1
  15. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  16. package/dist/AllowLists/SimpleDenyList.js +3 -3
  17. package/dist/Auth/PassthroughAuth.cjs +1 -1
  18. package/dist/Auth/PassthroughAuth.cjs.map +1 -1
  19. package/dist/Auth/PassthroughAuth.js +14 -14
  20. package/dist/Boost.cjs.map +1 -1
  21. package/dist/Boost.js.map +1 -1
  22. package/dist/BoostCore.cjs +2 -2
  23. package/dist/BoostCore.cjs.map +1 -1
  24. package/dist/BoostCore.d.ts +247 -0
  25. package/dist/BoostCore.d.ts.map +1 -1
  26. package/dist/BoostCore.js +421 -259
  27. package/dist/BoostCore.js.map +1 -1
  28. package/dist/BoostRegistry.cjs +1 -1
  29. package/dist/BoostRegistry.cjs.map +1 -1
  30. package/dist/BoostRegistry.js +43 -43
  31. package/dist/BoostRegistry.js.map +1 -1
  32. package/dist/Budget-DMbfdTom.cjs +2 -0
  33. package/dist/{Budget-AoNx7uFd.cjs.map → Budget-DMbfdTom.cjs.map} +1 -1
  34. package/dist/Budget-DO6sGTIR.js +463 -0
  35. package/dist/{Budget-DYIV9iNK.js.map → Budget-DO6sGTIR.js.map} +1 -1
  36. package/dist/Budgets/Budget.cjs +1 -1
  37. package/dist/Budgets/Budget.js +2 -2
  38. package/dist/Budgets/ManagedBudget.cjs +1 -1
  39. package/dist/Budgets/ManagedBudget.cjs.map +1 -1
  40. package/dist/Budgets/ManagedBudget.js +53 -53
  41. package/dist/Budgets/ManagedBudgetWithFees.d.ts +26 -0
  42. package/dist/Budgets/ManagedBudgetWithFees.d.ts.map +1 -1
  43. package/dist/Deployable/DeployableTarget.cjs +1 -1
  44. package/dist/Deployable/DeployableTarget.js +1 -1
  45. package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
  46. package/dist/Deployable/DeployableTargetWithRBAC.js +15 -15
  47. package/dist/Incentive-Boviez4z.js +1036 -0
  48. package/dist/Incentive-Boviez4z.js.map +1 -0
  49. package/dist/Incentive-wM4zizTH.cjs +2 -0
  50. package/dist/Incentive-wM4zizTH.cjs.map +1 -0
  51. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  52. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  53. package/dist/Incentives/AllowListIncentive.d.ts +9 -1
  54. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  55. package/dist/Incentives/AllowListIncentive.js +64 -47
  56. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  57. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  58. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  59. package/dist/Incentives/CGDAIncentive.d.ts +12 -1
  60. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  61. package/dist/Incentives/CGDAIncentive.js +64 -33
  62. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  63. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  64. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  65. package/dist/Incentives/ERC20Incentive.d.ts +37 -1
  66. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  67. package/dist/Incentives/ERC20Incentive.js +73 -49
  68. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  69. package/dist/Incentives/ERC20PeggedIncentive.d.ts +35 -0
  70. package/dist/Incentives/ERC20PeggedIncentive.d.ts.map +1 -1
  71. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +35 -0
  72. package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +1 -1
  73. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
  74. package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
  75. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +25 -0
  76. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -1
  77. package/dist/Incentives/ERC20VariableCriteriaIncentive.js +24 -24
  78. package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
  79. package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
  80. package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
  81. package/dist/Incentives/ERC20VariableIncentive.d.ts +35 -0
  82. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  83. package/dist/Incentives/ERC20VariableIncentive.js +55 -38
  84. package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
  85. package/dist/Incentives/Incentive.cjs +1 -1
  86. package/dist/Incentives/Incentive.d.ts +25 -0
  87. package/dist/Incentives/Incentive.d.ts.map +1 -1
  88. package/dist/Incentives/Incentive.js +2 -2
  89. package/dist/Incentives/PointsIncentive.cjs +1 -1
  90. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  91. package/dist/Incentives/PointsIncentive.d.ts +8 -0
  92. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  93. package/dist/Incentives/PointsIncentive.js +50 -28
  94. package/dist/Incentives/PointsIncentive.js.map +1 -1
  95. package/dist/SimpleDenyList-CW4RwwRw.js +133 -0
  96. package/dist/{SimpleDenyList-ByAr4X1r.js.map → SimpleDenyList-CW4RwwRw.js.map} +1 -1
  97. package/dist/SimpleDenyList-Cybtz7AK.cjs +2 -0
  98. package/dist/{SimpleDenyList-CsRXJPwm.cjs.map → SimpleDenyList-Cybtz7AK.cjs.map} +1 -1
  99. package/dist/Validators/LimitedSignerValidator.cjs +1 -1
  100. package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
  101. package/dist/Validators/LimitedSignerValidator.js +33 -33
  102. package/dist/Validators/LimitedSignerValidator.js.map +1 -1
  103. package/dist/Validators/SignerValidator.cjs +1 -1
  104. package/dist/Validators/SignerValidator.cjs.map +1 -1
  105. package/dist/Validators/SignerValidator.js +26 -26
  106. package/dist/Validators/SignerValidator.js.map +1 -1
  107. package/dist/Validators/Validator.cjs +1 -1
  108. package/dist/Validators/Validator.js +3 -3
  109. package/dist/deployments-CIXw_WKk.cjs +2 -0
  110. package/dist/deployments-CIXw_WKk.cjs.map +1 -0
  111. package/dist/{deployments-D0fs26TV.js → deployments-DqjtOTUr.js} +47 -47
  112. package/dist/{deployments-D0fs26TV.js.map → deployments-DqjtOTUr.js.map} +1 -1
  113. package/dist/deployments.json +24 -24
  114. package/dist/generated-DgXPUgXl.cjs +3 -0
  115. package/dist/generated-DgXPUgXl.cjs.map +1 -0
  116. package/dist/{generated-Cyvr_Tjx.js → generated-pJZHmRCK.js} +728 -459
  117. package/dist/generated-pJZHmRCK.js.map +1 -0
  118. package/dist/index.cjs +1 -1
  119. package/dist/index.js +137 -136
  120. package/package.json +1 -1
  121. package/src/Actions/EventAction.ts +108 -27
  122. package/src/BoostCore.test.ts +124 -2
  123. package/src/BoostCore.ts +227 -0
  124. package/src/Incentives/AllowListIncentive.ts +17 -0
  125. package/src/Incentives/CGDAIncentive.ts +31 -0
  126. package/src/Incentives/ERC20Incentive.ts +27 -0
  127. package/src/Incentives/ERC20PeggedIncentive.ts +18 -0
  128. package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts +26 -0
  129. package/src/Incentives/ERC20VariableIncentive.ts +18 -0
  130. package/src/Incentives/PointsIncentive.ts +22 -0
  131. package/dist/Budget-AoNx7uFd.cjs +0 -2
  132. package/dist/Budget-DYIV9iNK.js +0 -463
  133. package/dist/Incentive-BbkfwGOb.cjs +0 -2
  134. package/dist/Incentive-BbkfwGOb.cjs.map +0 -1
  135. package/dist/Incentive-qlnv5kQB.js +0 -991
  136. package/dist/Incentive-qlnv5kQB.js.map +0 -1
  137. package/dist/SimpleDenyList-ByAr4X1r.js +0 -133
  138. package/dist/SimpleDenyList-CsRXJPwm.cjs +0 -2
  139. package/dist/deployments-DoIOqxco.cjs +0 -2
  140. package/dist/deployments-DoIOqxco.cjs.map +0 -1
  141. package/dist/generated-Cyvr_Tjx.js.map +0 -1
  142. package/dist/generated-DtYPHhtX.cjs +0 -3
  143. package/dist/generated-DtYPHhtX.cjs.map +0 -1
@@ -0,0 +1,1036 @@
1
+ import { f as C, bQ as x, bR as P, bS as $, bT as B, bU as k, bV as F, bW as G, bX as L, bY as q, bZ as M, b_ as U, b$ as S, c0 as j, c1 as z, c2 as O, y as v, c3 as Q, c4 as W, c5 as X, c6 as Y, c7 as H, c8 as Z, c9 as J, ca as K, cb as f0, cc as a0, cd as b0, ce as e0, cf as d0, cg as c0, ch as t0, ci as s0, cj as i0, ck as r0 } from "./generated-pJZHmRCK.js";
2
+ import { f as n0, g as o0, h as l0, i as u0, j as m0, k as g0, l as h0, m as y0 } from "./componentInterfaces-PR3ijhgZ.js";
3
+ import { getTransactionReceipt as p0, getTransaction as w0, readContract as A0 } from "@wagmi/core";
4
+ import { NoMatchingLogsError as I, DecodedArgsError as m, InvalidCriteriaTypeError as C0, IncentiveCriteriaNotFoundError as v0, InvalidComponentInterfaceError as I0 } from "./errors.js";
5
+ import { AllowListIncentive as V0 } from "./Incentives/AllowListIncentive.js";
6
+ import { CGDAIncentive as R0 } from "./Incentives/CGDAIncentive.js";
7
+ import { ERC20Incentive as _0 } from "./Incentives/ERC20Incentive.js";
8
+ import { encodeAbiParameters as l, zeroAddress as t, decodeAbiParameters as o, parseEventLogs as D0, decodeFunctionData as N0, parseEther as V } from "viem";
9
+ import { g as E0, h as T0 } from "./deployments-DqjtOTUr.js";
10
+ import { DeployableTarget as E } from "./Deployable/DeployableTarget.js";
11
+ import { prepareClaimPayload as g } from "./claiming.js";
12
+ import { RegistryType as T, CheatCodes as x0 } from "./utils.js";
13
+ import { SignatureType as R } from "./Actions/EventAction.js";
14
+ import { ERC20VariableCriteriaIncentive as P0 } from "./Incentives/ERC20VariableCriteriaIncentive.js";
15
+ import { ERC20VariableIncentive as $0 } from "./Incentives/ERC20VariableIncentive.js";
16
+ import { PointsIncentive as B0 } from "./Incentives/PointsIncentive.js";
17
+ const k0 = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b8160c01c808260011c146073578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b611ce6806100855f395ff3fe60806040526004361061025d575f3560e01c8063547d18641161014b578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b146106b8578063fe9fbb80146106cb578063fee81cf4146106ea575f80fd5b8063ec87621c14610691578063f04e283e146106a5575f80fd5b8063db09da12116100ac578063db09da121461063e578063dcc213611461065d578063dcc59b6f1461067c575f80fd5b8063c884ef83146105fb578063d54ad2a114610629575f80fd5b80638da5cb5b1161011b578063a4d66daf11610101578063a4d66daf146105a8578063bb1757cf146105bd578063be4994f8146105dc575f80fd5b80638da5cb5b146105665780639214fa4d1461057e575f80fd5b8063547d18641461052d57806354d1f13d14610542578063715018a61461054a57806375b238fc14610552575f80fd5b80632de94807116101db578063439fab91116101ab5780634a4ee7b1116101915780634a4ee7b1146104b95780634e7165a2146104cc578063514e62fc146104f8575f80fd5b8063439fab9114610451578063474f5a4414610470575f80fd5b80632de94807146103b657806330db555f146103e757806338d52e0f146104065780634359d28a14610432575f80fd5b80631cd64df411610230578063228cb73311610216578063228cb73314610360578063256929621461037457806328d6183b1461037c575f80fd5b80631cd64df4146102da5780631f1cb62b1461030f575f80fd5b806301ffc9a71461026157806307621eca14610295578063183a4f6e146102b25780631c10893f146102c7575b5f80fd5b34801561026c575f80fd5b5061028061027b366004611641565b61071b565b60405190151581526020015b60405180910390f35b3480156102a0575f80fd5b505f545b60405190815260200161028c565b6102c56102c0366004611680565b610776565b005b6102c56102d53660046116bf565b610783565b3480156102e5575f80fd5b506102806102f43660046116bf565b638b78c6d8600c9081525f9290925260209091205481161490565b34801561031a575f80fd5b5060075461033b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161028c565b34801561036b575f80fd5b506102a45f5481565b6102c5610799565b348015610387575f80fd5b506040517f5658633800000000000000000000000000000000000000000000000000000000815260200161028c565b3480156103c1575f80fd5b506102a46103d03660046116e7565b638b78c6d8600c9081525f91909152602090205490565b3480156103f2575f80fd5b506102c5610401366004611680565b6107e6565b348015610411575f80fd5b5060035461033b9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561043d575f80fd5b506102c561044c366004611748565b6108a2565b34801561045c575f80fd5b506102c561046b3660046117f2565b61099c565b34801561047b575f80fd5b5061048f61048a3660046117f2565b610c39565b6040805192835273ffffffffffffffffffffffffffffffffffffffff90911660208301520161028c565b6102c56104c73660046116bf565b610d9b565b3480156104d7575f80fd5b506104eb6104e63660046117f2565b610dad565b60405161028c919061187d565b348015610503575f80fd5b506102806105123660046116bf565b638b78c6d8600c9081525f9290925260209091205416151590565b348015610538575f80fd5b506102a460025481565b6102c5610e47565b6102c5610e80565b34801561055d575f80fd5b506102a4600281565b348015610571575f80fd5b50638b78c6d8195461033b565b348015610589575f80fd5b5060075473ffffffffffffffffffffffffffffffffffffffff1661033b565b3480156105b3575f80fd5b506102a460055481565b3480156105c8575f80fd5b506102806105d736600461188f565b610e93565b3480156105e7575f80fd5b506102c56105f6366004611748565b611071565b348015610606575f80fd5b506102806106153660046116e7565b60016020525f908152604090205460ff1681565b348015610634575f80fd5b506102a460065481565b348015610649575f80fd5b5061028061065836600461188f565b61110f565b348015610668575f80fd5b506102c5610677366004611748565b61114e565b348015610687575f80fd5b506102a460045481565b34801561069c575f80fd5b506102a4600181565b6102c56106b33660046116e7565b6111ec565b6102c56106c63660046116e7565b611226565b3480156106d6575f80fd5b506102806106e53660046116e7565b61124c565b3480156106f5575f80fd5b506102a46107043660046116e7565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f565863380000000000000000000000000000000000000000000000000000000014806107705750610770826112ab565b92915050565b6107803382611300565b50565b61078b61130b565b6107958282611325565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b60016107f181611331565b815f0361082a576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035461084f9073ffffffffffffffffffffffffffffffffffffffff16333085611362565b8160055f828254610860919061190b565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b60026108ad81611331565b8382146108e6576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610994575f8484838181106109035761090361191e565b9050602002016020810190610918919061194b565b905080151560010361095a576109558787848181106109395761093961191e565b905060200201602081019061094e91906116e7565b6001611325565b61098b565b61098b87878481811061096f5761096f61191e565b905060200201602081019061098491906116e7565b6001611300565b506001016108e8565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60113280546003825580156109ed5760018160011c14303b106109e45763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f6109fb838501856119c0565b905080604001515f1480610a1157506060810151155b15610a48576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015181515f90610a719073ffffffffffffffffffffffffffffffffffffffff16306113ba565b905081811015610ada5782516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810183905260640160405180910390fd5b82516003805473ffffffffffffffffffffffffffffffffffffffff9283167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560208501516007805491909316911617905560408301515f556060830151600555610b4a336113ed565b610b5983608001516001611435565b826020015173ffffffffffffffffffffffffffffffffffffffff16835f015173ffffffffffffffffffffffffffffffffffffffff167fd20715546497e6d32bc9b61b35416a25a8cc41d2fb7f389a1bb26dc040213a3b856040015186606001518760800151604051610bf493929190928352602083019190915273ffffffffffffffffffffffffffffffffffffffff16604082015260600190565b60405180910390a35050508015610c34576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610c4681611331565b5f610c5385870187611ae9565b90505f8160200151806020019051810190610c6e9190611b66565b90508060055f828254610c819190611b7d565b90915550508151600354610cae9173ffffffffffffffffffffffffffffffffffffffff9091169083611476565b81516003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610d6c9161187d565b60405180910390a260035490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610da361130b565b6107958282611300565b60605f610dbc838501856119c0565b6060818101516040805160808101825260018152845173ffffffffffffffffffffffffffffffffffffffff16602080830191909152308284015282518082018452849052825180820185905283518082038301815290840184529482019490945290519394509092610e2e9201611b90565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610e8861130b565b610e915f6114bf565b565b5f610e9c61130b565b5f610ea983850185611c33565b90505f8160200151806020019051810190610ec49190611b66565b9050610ed08682611509565b610f06576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60055481600654610f17919061190b565b1115610f4f576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060065f828254610f60919061190b565b92505081905550600160045f828254610f79919061190b565b9091555050600354610fa29073ffffffffffffffffffffffffffffffffffffffff168783611476565b6003546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529188901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8716907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261105d9161187d565b60405180910390a250600195945050505050565b600261107c81611331565b8382146110b5576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610994576111078686838181106110d4576110d461191e565b90506020020160208101906110e991906116e7565b8585848181106110fb576110fb61191e565b90506020020135611325565b6001016110b7565b5f8061111d83850185611c33565b90505f81602001518060200190518101906111389190611b66565b90506111448682611509565b9695505050505050565b600261115981611331565b838214611192576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610994576111e48686838181106111b1576111b161191e565b90506020020160208101906111c691906116e7565b8585848181106111d8576111d861191e565b90506020020135611300565b600101611194565b6111f461130b565b63389a75e1600c52805f526020600c20805442111561121a57636f5e88185f526004601cfd5b5f9055610780816114bf565b61122e61130b565b8060601b61124357637448fbae5f526004601cfd5b610780816114bf565b5f8173ffffffffffffffffffffffffffffffffffffffff16611271638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806107705750638b78c6d8600c9081525f83905260209020546003161515610770565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa9216705000000000000000000000000000000000000000000000000000000001480610770575061077082611554565b61079582825f6115ea565b638b78c6d819543314610e91576382b429005f526004601cfd5b610795828260016115ea565b638b78c6d81954331461078057638b78c6d8600c52335f52806020600c205416610780576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f511417166113ad57637939f4245f526004601cfd5b5f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166114b6576390b8ec185f526004601cfd5b5f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b73ffffffffffffffffffffffffffffffffffffffff82165f9081526001602052604081205460ff1615801561154d57506005548260065461154a919061190b565b11155b9392505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061077057507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610770565b638b78c6d8600c52825f526020600c2080548381178361160b575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f60208284031215611651575f80fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461154d575f80fd5b5f60208284031215611690575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146116ba575f80fd5b919050565b5f80604083850312156116d0575f80fd5b6116d983611697565b946020939093013593505050565b5f602082840312156116f7575f80fd5b61154d82611697565b5f8083601f840112611710575f80fd5b50813567ffffffffffffffff811115611727575f80fd5b6020830191508360208260051b8501011115611741575f80fd5b9250929050565b5f805f806040858703121561175b575f80fd5b843567ffffffffffffffff811115611771575f80fd5b61177d87828801611700565b909550935050602085013567ffffffffffffffff81111561179c575f80fd5b6117a887828801611700565b95989497509550505050565b5f8083601f8401126117c4575f80fd5b50813567ffffffffffffffff8111156117db575f80fd5b602083019150836020828501011115611741575f80fd5b5f8060208385031215611803575f80fd5b823567ffffffffffffffff811115611819575f80fd5b611825858286016117b4565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f61154d6020830184611831565b5f805f604084860312156118a1575f80fd5b6118aa84611697565b9250602084013567ffffffffffffffff8111156118c5575f80fd5b6118d1868287016117b4565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115610770576107706118de565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f6020828403121561195b575f80fd5b8135801515811461154d575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040805190810167ffffffffffffffff811182821017156119ba576119ba61196a565b60405290565b5f60a08284031280156119d1575f80fd5b5060405160a0810167ffffffffffffffff811182821017156119f5576119f561196a565b604052611a0183611697565b8152611a0f60208401611697565b60208201526040838101359082015260608084013590820152611a3460808401611697565b60808201529392505050565b5f82601f830112611a4f575f80fd5b813567ffffffffffffffff811115611a6957611a6961196a565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff81118282101715611ab657611ab661196a565b604052818152838201602001851015611acd575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60208284031215611af9575f80fd5b813567ffffffffffffffff811115611b0f575f80fd5b820160408185031215611b20575f80fd5b611b28611997565b611b3182611697565b8152602082013567ffffffffffffffff811115611b4c575f80fd5b611b5886828501611a40565b602083015250949350505050565b5f60208284031215611b76575f80fd5b5051919050565b81810381811115610770576107706118de565b602081525f825160038110611bcc577f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff60408401511660608301526060830151608080840152611c2b60a0840182611831565b949350505050565b5f60208284031215611c43575f80fd5b813567ffffffffffffffff811115611c59575f80fd5b820160408185031215611c6a575f80fd5b611c72611997565b813567ffffffffffffffff811115611c88575f80fd5b611c9486828501611a40565b825250602082013567ffffffffffffffff811115611b4c575f80fdfea2646970667358221220353e16b7caa31db12baf52becbdae02891331e0552614c2e96ac6c694315780464736f6c634300081a0033", h = class h extends E {
18
+ constructor() {
19
+ super(...arguments), this.abi = C;
20
+ }
21
+ /**
22
+ * The owner of the incentive
23
+ *
24
+ * @public
25
+ * @async
26
+ * @param {?ReadParams} [params]
27
+ * @returns {Promise<Address>}
28
+ */
29
+ async owner(f) {
30
+ return await x(this._config, {
31
+ address: this.assertValidAddress(),
32
+ args: [],
33
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
34
+ ...f
35
+ });
36
+ }
37
+ /**
38
+ * 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)`
39
+ *
40
+ * @public
41
+ * @async
42
+ * @param {?ReadParams} [params]
43
+ * @returns {Promise<bigint>} - The current reward
44
+ */
45
+ async currentReward(f) {
46
+ return await P(this._config, {
47
+ address: this.assertValidAddress(),
48
+ args: [],
49
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
50
+ ...f
51
+ });
52
+ }
53
+ /**
54
+ * The number of claims that have been made
55
+ *
56
+ * @public
57
+ * @async
58
+ * @param {?ReadParams} [params]
59
+ * @returns {Promise<bigint>}
60
+ */
61
+ async claims(f) {
62
+ return await $(this._config, {
63
+ address: this.assertValidAddress(),
64
+ args: [],
65
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
66
+ ...f
67
+ });
68
+ }
69
+ /**
70
+ * The total amount of rewards claimed
71
+ *
72
+ * @public
73
+ * @async
74
+ * @param {?ReadParams} [params]
75
+ * @returns {Promise<bigint>}
76
+ */
77
+ async totalClaimed(f) {
78
+ return await B(this._config, {
79
+ address: this.assertValidAddress(),
80
+ args: [],
81
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
82
+ ...f
83
+ });
84
+ }
85
+ /**
86
+ * A mapping of address to claim status
87
+ *
88
+ * @public
89
+ * @async
90
+ * @param {Address} address
91
+ * @param {?ReadParams} [params]
92
+ * @returns {Promise<boolean>}
93
+ */
94
+ async claimed(f, a) {
95
+ return await k(this._config, {
96
+ address: this.assertValidAddress(),
97
+ args: [f],
98
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
99
+ ...a
100
+ });
101
+ }
102
+ /**
103
+ * The address of the ERC20-like token
104
+ *
105
+ * @public
106
+ * @async
107
+ * @param {?ReadParams} [params]
108
+ * @returns {Promise<Address>}
109
+ */
110
+ async asset(f) {
111
+ return await F(this._config, {
112
+ address: this.assertValidAddress(),
113
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
114
+ ...f
115
+ });
116
+ }
117
+ /**
118
+ * The address of the pegged ERC20-like token
119
+ *
120
+ * @public
121
+ * @async
122
+ * @param {?ReadParams} [params]
123
+ * @returns {Promise<Address>}
124
+ */
125
+ async peg(f) {
126
+ return await G(this._config, {
127
+ address: this.assertValidAddress(),
128
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
129
+ ...f
130
+ });
131
+ }
132
+ /**
133
+ * The reward amount issued for each claim
134
+ *
135
+ * @public
136
+ * @async
137
+ * @param {?ReadParams} [params]
138
+ * @returns {Promise<bigint>}
139
+ */
140
+ async reward(f) {
141
+ return await L(this._config, {
142
+ address: this.assertValidAddress(),
143
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
144
+ ...f
145
+ });
146
+ }
147
+ /**
148
+ * The limit (max possible rewards payout in reward token)
149
+ *
150
+ * @public
151
+ * @async
152
+ * @param {?ReadParams} [params]
153
+ * @returns {Promise<bigint>}
154
+ */
155
+ async limit(f) {
156
+ return await q(this._config, {
157
+ address: this.assertValidAddress(),
158
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
159
+ ...f
160
+ });
161
+ }
162
+ /**
163
+ * Claim the incentive
164
+ *
165
+ * @public
166
+ * @async
167
+ * @param {ClaimPayload} payload
168
+ * @param {?WriteParams} [params]
169
+ * @returns {Promise<boolean>} - Returns true if successfully claimed
170
+ */
171
+ async claim(f, a) {
172
+ return await this.awaitResult(this.claimRaw(f, a));
173
+ }
174
+ /**
175
+ * Claim the incentive
176
+ *
177
+ * @public
178
+ * @async
179
+ * @param {ClaimPayload} payload
180
+ * @param {?WriteParams} [params]
181
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed
182
+ */
183
+ async claimRaw(f, a) {
184
+ const { request: b, result: e } = await M(
185
+ this._config,
186
+ {
187
+ address: this.assertValidAddress(),
188
+ args: [g(f)],
189
+ ...this.optionallyAttachAccount(),
190
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
191
+ ...a
192
+ }
193
+ );
194
+ return { hash: await U(this._config, b), result: e };
195
+ }
196
+ /**
197
+ * Clawback assets from the incentive
198
+ *
199
+ * @public
200
+ * @async
201
+ * @param {ClaimPayload} payload
202
+ * @param {?WriteParams} [params]
203
+ * @returns {Promise<boolean>} - True if the assets were successfully clawbacked
204
+ */
205
+ async clawback(f, a) {
206
+ return await this.awaitResult(this.clawbackRaw(f, a));
207
+ }
208
+ /**
209
+ * Clawback assets from the incentive
210
+ *
211
+ * @public
212
+ * @async
213
+ * @param {ClaimPayload} payload
214
+ * @param {?WriteParams} [params]
215
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
216
+ */
217
+ async clawbackRaw(f, a) {
218
+ const { request: b, result: e } = await S(
219
+ this._config,
220
+ {
221
+ address: this.assertValidAddress(),
222
+ args: [g(f)],
223
+ ...this.optionallyAttachAccount(),
224
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
225
+ ...a
226
+ }
227
+ );
228
+ return { hash: await j(this._config, b), result: e };
229
+ }
230
+ /**
231
+ * Check if an incentive is claimable.
232
+ *
233
+ * @public
234
+ * @async
235
+ * @param {ClaimPayload} payload
236
+ * @param {?ReadParams} [params]
237
+ * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
238
+ */
239
+ async isClaimable(f, a) {
240
+ return await z(this._config, {
241
+ address: this.assertValidAddress(),
242
+ args: [f.target, f.data],
243
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
244
+ ...a
245
+ });
246
+ }
247
+ /**
248
+ * read the peg token for the incentive.
249
+ *
250
+ * @public
251
+ * @async
252
+ * @param {?ReadParams} [params]
253
+ * @returns {Promise<Address>} = The address of the token the reward is pegged to
254
+ */
255
+ async getPeg(f) {
256
+ return await O(this._config, {
257
+ address: this.assertValidAddress(),
258
+ args: [],
259
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
260
+ ...f
261
+ });
262
+ }
263
+ /**
264
+ * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`
265
+ *
266
+ * @public
267
+ * @async
268
+ * @param {?ReadParams} [params]
269
+ * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.
270
+ */
271
+ async getTotalBudget(f) {
272
+ return await this.limit(f);
273
+ }
274
+ /**
275
+ * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
276
+ *
277
+ * @public
278
+ * @async
279
+ * @param {?ReadParams} [params]
280
+ * @returns {Promise<boolean>} - True if total claims is less than limit
281
+ */
282
+ async canBeClaimed(f) {
283
+ return await this.getRemainingClaimPotential(f) > 0n;
284
+ }
285
+ /**
286
+ * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
287
+ *
288
+ * @public
289
+ * @async
290
+ * @param {?ReadParams} [params]
291
+ * @returns {Promise<bigint>} - True if total claims is less than limit
292
+ */
293
+ async getRemainingClaimPotential(f) {
294
+ const [a, b] = await Promise.all([
295
+ this.totalClaimed(f),
296
+ this.limit(f)
297
+ ]);
298
+ return b - a;
299
+ }
300
+ /**
301
+ * @inheritdoc
302
+ *
303
+ * @public
304
+ * @param {?ERC20PeggedIncentivePayload} [_payload]
305
+ * @param {?DeployableOptions} [_options]
306
+ * @returns {GenericDeployableParams}
307
+ */
308
+ buildParameters(f, a) {
309
+ const [b, e] = this.validateDeploymentConfig(
310
+ f,
311
+ a
312
+ );
313
+ return {
314
+ abi: C,
315
+ bytecode: k0,
316
+ args: [_(b)],
317
+ ...this.optionallyAttachAccount(e.account)
318
+ };
319
+ }
320
+ /**
321
+ * Encodes an amount to clawback from the incentive
322
+ *
323
+ * @public
324
+ * @param {bigint} amount - How much of the asset to clawback
325
+ * @returns {Hex} - Returns an encoded uint256
326
+ */
327
+ buildClawbackData(f) {
328
+ return l([{ type: "uint256" }], [f]);
329
+ }
330
+ /**
331
+ * Builds the claim data for the ERC20PeggedIncentive.
332
+ *
333
+ * @public
334
+ * @param {bigint} rewardAmount
335
+ * @returns {Hash} Returns the encoded claim data
336
+ * @description This function returns the encoded claim data for the ERC20PeggedIncentive.
337
+ */
338
+ buildClaimData(f) {
339
+ return l(
340
+ [{ type: "uint256", name: "rewardAmount" }],
341
+ [f]
342
+ );
343
+ }
344
+ /**
345
+ * Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing
346
+ * the existing `limit` field by `netAmount`. The entire payload is then re-encoded
347
+ * via `prepareERC20PeggedIncentivePayload(...)`.
348
+ *
349
+ * @public
350
+ * @param {bigint} netAmount - The additional limit to add to this incentive.
351
+ * @returns {Hex} The ABI-encoded payload with the updated `limit`.
352
+ */
353
+ async getTopupPayload(f) {
354
+ var a, b, e;
355
+ return _({
356
+ asset: await this.asset() ?? t,
357
+ peg: ((a = this.payload) == null ? void 0 : a.peg) ?? t,
358
+ reward: ((b = this.payload) == null ? void 0 : b.reward) ?? 0n,
359
+ limit: f,
360
+ manager: ((e = this.payload) == null ? void 0 : e.manager) ?? t
361
+ });
362
+ }
363
+ /**
364
+ * Decodes claim data for the ERC20PeggedIncentive, returning the claim amount.
365
+ * Useful when deriving amount claimed from logs.
366
+ *
367
+ * @public
368
+ * @param {Hex} claimData
369
+ * @returns {BigInt} Returns the reward amount from a claim data payload
370
+ */
371
+ decodeClaimData(f) {
372
+ const a = o(
373
+ [
374
+ {
375
+ type: "tuple",
376
+ name: "BoostClaimData",
377
+ components: [
378
+ { type: "bytes", name: "validatorData" },
379
+ { type: "bytes", name: "incentiveData" }
380
+ ]
381
+ }
382
+ ],
383
+ f
384
+ );
385
+ return o(
386
+ [{ type: "uint256" }],
387
+ a[0].incentiveData
388
+ )[0];
389
+ }
390
+ };
391
+ h.bases = {
392
+ 31337: void 0,
393
+ ...E0
394
+ }, h.registryType = T.INCENTIVE;
395
+ let p = h;
396
+ function _({
397
+ asset: r,
398
+ peg: f,
399
+ reward: a,
400
+ limit: b,
401
+ manager: e = t
402
+ }) {
403
+ return l(
404
+ [
405
+ { type: "address", name: "asset" },
406
+ { type: "address", name: "peg" },
407
+ { type: "uint256", name: "reward" },
408
+ { type: "uint256", name: "limit" },
409
+ { type: "address", name: "manager" }
410
+ ],
411
+ [r, f, a, b, e]
412
+ );
413
+ }
414
+ const F0 = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b8160c01c808260011c146073578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b61219f806100855f395ff3fe6080604052600436106102ab575f3560e01c8063715018a611610165578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b1461078d578063fe9fbb80146107a0578063fee81cf4146107bf575f80fd5b8063ec87621c14610766578063f04e283e1461077a575f80fd5b8063db09da12116100ac578063db09da1214610713578063dcc2136114610732578063dcc59b6f14610751575f80fd5b8063c884ef83146106d0578063d54ad2a1146106fe575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf1461067e578063be4994f81461069d578063c213f3f9146106bc575f80fd5b8063a4d66daf14610648578063a871ced21461065d575f80fd5b8063775486871161014b57806377548687146105b45780638da5cb5b146106065780639214fa4d1461061e575f80fd5b8063715018a61461059857806375b238fc146105a0575f80fd5b806330db555f1161020f5780634a4ee7b1116101c5578063514e62fc116101ab578063514e62fc14610546578063547d18641461057b57806354d1f13d14610590575f80fd5b80634a4ee7b1146105075780634e7165a21461051a575f80fd5b80634359d28a116101f55780634359d28a14610480578063439fab911461049f578063474f5a44146104be575f80fd5b806330db555f1461043557806338d52e0f14610454575f80fd5b80631f1cb62b11610264578063256929621161024a57806325692962146103c257806328d6183b146103ca5780632de9480714610404575f80fd5b80631f1cb62b1461035d578063228cb733146103ae575f80fd5b8063183a4f6e11610294578063183a4f6e146103005780631c10893f146103155780631cd64df414610328575f80fd5b806301ffc9a7146102af57806307621eca146102e3575b5f80fd5b3480156102ba575f80fd5b506102ce6102c93660046118ea565b6107f0565b60405190151581526020015b60405180910390f35b3480156102ee575f80fd5b505f545b6040519081526020016102da565b61031361030e366004611930565b61084b565b005b61031361032336600461196f565b610858565b348015610333575f80fd5b506102ce61034236600461196f565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610368575f80fd5b50600a546103899073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102da565b3480156103b9575f80fd5b506102f25f5481565b61031361086e565b3480156103d5575f80fd5b506040517ff60c99c90000000000000000000000000000000000000000000000000000000081526020016102da565b34801561040f575f80fd5b506102f261041e366004611997565b638b78c6d8600c9081525f91909152602090205490565b348015610440575f80fd5b5061031361044f366004611930565b6108bb565b34801561045f575f80fd5b506006546103899073ffffffffffffffffffffffffffffffffffffffff1681565b34801561048b575f80fd5b5061031361049a3660046119f8565b610977565b3480156104aa575f80fd5b506103136104b9366004611aa2565b610a71565b3480156104c9575f80fd5b506104dd6104d8366004611aa2565b610da1565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102da565b61031361051536600461196f565b610f03565b348015610525575f80fd5b50610539610534366004611aa2565b610f15565b6040516102da9190611b2d565b348015610551575f80fd5b506102ce61056036600461196f565b638b78c6d8600c9081525f9290925260209091205416151590565b348015610586575f80fd5b506102f260025481565b610313610faf565b610313610fe8565b3480156105ab575f80fd5b506102f2600281565b3480156105bf575f80fd5b506003546004546005546105f69260ff908116929190811690610100900473ffffffffffffffffffffffffffffffffffffffff1684565b6040516102da9493929190611b80565b348015610611575f80fd5b50638b78c6d81954610389565b348015610629575f80fd5b50600a5473ffffffffffffffffffffffffffffffffffffffff16610389565b348015610653575f80fd5b506102f260085481565b348015610668575f80fd5b50610671610ffb565b6040516102da9190611c08565b348015610689575f80fd5b506102ce610698366004611c16565b611095565b3480156106a8575f80fd5b506103136106b73660046119f8565b6112c2565b3480156106c7575f80fd5b50600b546102f2565b3480156106db575f80fd5b506102ce6106ea366004611997565b60016020525f908152604090205460ff1681565b348015610709575f80fd5b506102f260095481565b34801561071e575f80fd5b506102ce61072d366004611c16565b611360565b34801561073d575f80fd5b5061031361074c3660046119f8565b6113d3565b34801561075c575f80fd5b506102f260075481565b348015610771575f80fd5b506102f2600181565b610313610788366004611997565b611471565b61031361079b366004611997565b6114ab565b3480156107ab575f80fd5b506102ce6107ba366004611997565b6114d1565b3480156107ca575f80fd5b506102f26107d9366004611997565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167ff60c99c9000000000000000000000000000000000000000000000000000000001480610845575061084582611530565b92915050565b6108553382611585565b50565b610860611590565b61086a82826115aa565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b60016108c6816115b6565b815f036108ff576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006546109249073ffffffffffffffffffffffffffffffffffffffff163330856115e7565b8160085f8282546109359190611c92565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b6002610982816115b6565b8382146109bb576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a69575f8484838181106109d8576109d8611ca5565b90506020020160208101906109ed9190611cd2565b9050801515600103610a2f57610a2a878784818110610a0e57610a0e611ca5565b9050602002016020810190610a239190611997565b60016115aa565b610a60565b610a60878784818110610a4457610a44611ca5565b9050602002016020810190610a599190611997565b6001611585565b506001016109bd565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610ac25760018160011c14303b10610ab95763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610ad083850185611d8d565b905080606001515f03610b0f576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015181515f90610b389073ffffffffffffffffffffffffffffffffffffffff163061163f565b905081811015610ba15782516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810183905260640160405180910390fd5b60c083015183516006805473ffffffffffffffffffffffffffffffffffffffff9283167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556020860151600a805491909316911617905560408401515f55606084015160085560a0840151600b5580516003805483929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610c5557610c55611b3f565b02179055506020820151600182015560408201516002909101805460609093015173ffffffffffffffffffffffffffffffffffffffff16610100027fffffffffffffffffffffff00000000000000000000000000000000000000000090931660ff90921691909117919091179055610ccc33611672565b610cdb846080015160016116ba565b836020015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff167fdc505a50c6f2c816d981a377c8177e2604d8302821a502bc9f742e0748f338428660400151876060015188608001518960a001518a60c00151604051610d5b959493929190611e86565b60405180910390a3505050508015610d9c576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610dae816115b6565b5f610dbb85870187611f78565b90505f8160200151806020019051810190610dd69190611ff5565b90508060085f828254610de9919061200c565b90915550508151600654610e169173ffffffffffffffffffffffffffffffffffffffff90911690836116fb565b81516006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610ed491611b2d565b60405180910390a260065490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610f0b611590565b61086a8282611585565b60605f610f2483850185611d8d565b6060818101516040805160808101825260018152845173ffffffffffffffffffffffffffffffffffffffff16602080830191909152308284015282518082018452849052825180820185905283518082038301815290840184529482019490945290519394509092610f96920161201f565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610ff0611590565b610ff95f611744565b565b604080516080810182525f808252602082018190529181018290526060810191909152604080516080810190915260038054829060ff16600181111561104357611043611b3f565b600181111561105457611054611b3f565b81526001820154602082015260029091015460ff81166040830152610100900473ffffffffffffffffffffffffffffffffffffffff16606090910152919050565b5f61109e611590565b5f6110ab8385018561209d565b90505f81602001518060200190518101906110c69190611ff5565b90505f80545f036110d85750806110fb565b670de0b6b3a7640000825f546110ee919061211a565b6110f89190612131565b90505b600b541580159061110d5750600b5481115b156111175750600b545b6111208161178e565b611156576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600854816009546111679190611c92565b111561119f576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060095f8282546111b09190611c92565b92505081905550600160075f8282546111c99190611c92565b90915550506006546111f29073ffffffffffffffffffffffffffffffffffffffff1688836116fb565b6006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526112ad91611b2d565b60405180910390a25060019695505050505050565b60026112cd816115b6565b838214611306576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a695761135886868381811061132557611325611ca5565b905060200201602081019061133a9190611997565b85858481811061134c5761134c611ca5565b905060200201356115aa565b600101611308565b5f808061136f8486018661209d565b90505f816020015180602001905181019061138a9190611ff5565b90505f545f0361139c578092506113bf565b670de0b6b3a7640000815f546113b2919061211a565b6113bc9190612131565b92505b6113c88361178e565b979650505050505050565b60026113de816115b6565b838214611417576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a695761146986868381811061143657611436611ca5565b905060200201602081019061144b9190611997565b85858481811061145d5761145d611ca5565b90506020020135611585565b600101611419565b611479611590565b63389a75e1600c52805f526020600c20805442111561149f57636f5e88185f526004601cfd5b5f905561085581611744565b6114b3611590565b8060601b6114c857637448fbae5f526004601cfd5b61085581611744565b5f8173ffffffffffffffffffffffffffffffffffffffff166114f6638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806108455750638b78c6d8600c9081525f83905260209020546003161515610845565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f565863380000000000000000000000000000000000000000000000000000000014806108455750610845826117a8565b61086a82825f6117fd565b638b78c6d819543314610ff9576382b429005f526004601cfd5b61086a828260016117fd565b638b78c6d81954331461085557638b78c6d8600c52335f52806020600c205416610855576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f5114171661163257637939f4245f526004601cfd5b5f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f5114171661173b576390b8ec185f526004601cfd5b5f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f600854826009546117a09190611c92565b111592915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa9216705000000000000000000000000000000000000000000000000000000001480610845575061084582611854565b638b78c6d8600c52825f526020600c2080548381178361181e575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061084557507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610845565b5f602082840312156118fa575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611929575f80fd5b9392505050565b5f60208284031215611940575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461196a575f80fd5b919050565b5f8060408385031215611980575f80fd5b61198983611947565b946020939093013593505050565b5f602082840312156119a7575f80fd5b61192982611947565b5f8083601f8401126119c0575f80fd5b50813567ffffffffffffffff8111156119d7575f80fd5b6020830191508360208260051b85010111156119f1575f80fd5b9250929050565b5f805f8060408587031215611a0b575f80fd5b843567ffffffffffffffff811115611a21575f80fd5b611a2d878288016119b0565b909550935050602085013567ffffffffffffffff811115611a4c575f80fd5b611a58878288016119b0565b95989497509550505050565b5f8083601f840112611a74575f80fd5b50813567ffffffffffffffff811115611a8b575f80fd5b6020830191508360208285010111156119f1575f80fd5b5f8060208385031215611ab3575f80fd5b823567ffffffffffffffff811115611ac9575f80fd5b611ad585828601611a64565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f6119296020830184611ae1565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611b7c57611b7c611b3f565b9052565b60808101611b8e8287611b6c565b84602083015260ff8416604083015273ffffffffffffffffffffffffffffffffffffffff8316606083015295945050505050565b611bcd828251611b6c565b6020810151602083015260ff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301525050565b608081016108458284611bc2565b5f805f60408486031215611c28575f80fd5b611c3184611947565b9250602084013567ffffffffffffffff811115611c4c575f80fd5b611c5886828701611a64565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561084557610845611c65565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611ce2575f80fd5b81358015158114611929575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160e0810167ffffffffffffffff81118282101715611d4157611d41611cf1565b60405290565b6040516080810167ffffffffffffffff81118282101715611d4157611d41611cf1565b6040805190810167ffffffffffffffff81118282101715611d4157611d41611cf1565b5f81830361014081128015611da0575f80fd5b50611da9611d1e565b611db284611947565b8152611dc060208501611947565b60208201526040848101359082015260608085013590820152611de560808501611947565b60808281019190915260a085810135908301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4083011215611e25575f80fd5b611e2d611d47565b915060c084013560028110611e40575f80fd5b825260e0840135602083015261010084013560ff81168114611e60575f80fd5b6040830152611e726101208501611947565b606083015260c08101919091529392505050565b8581526020810185905273ffffffffffffffffffffffffffffffffffffffff84166040820152606081018390526101008101611ec56080830184611bc2565b9695505050505050565b5f82601f830112611ede575f80fd5b813567ffffffffffffffff811115611ef857611ef8611cf1565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff81118282101715611f4557611f45611cf1565b604052818152838201602001851015611f5c575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60208284031215611f88575f80fd5b813567ffffffffffffffff811115611f9e575f80fd5b820160408185031215611faf575f80fd5b611fb7611d6a565b611fc082611947565b8152602082013567ffffffffffffffff811115611fdb575f80fd5b611fe786828501611ecf565b602083015250949350505050565b5f60208284031215612005575f80fd5b5051919050565b8181038181111561084557610845611c65565b602081525f82516003811061203657612036611b3f565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff6040840151166060830152606083015160808084015261209560a0840182611ae1565b949350505050565b5f602082840312156120ad575f80fd5b813567ffffffffffffffff8111156120c3575f80fd5b8201604081850312156120d4575f80fd5b6120dc611d6a565b813567ffffffffffffffff8111156120f2575f80fd5b6120fe86828501611ecf565b825250602082013567ffffffffffffffff811115611fdb575f80fd5b808202811582820484141761084557610845611c65565b5f82612164577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea2646970667358221220517dc82bb1d91d6e0f6b7e55452e2fb8c283a4195077a47e957ae77da71227eb64736f6c634300081a0033", y = class y extends E {
415
+ constructor() {
416
+ super(...arguments), this.abi = v;
417
+ }
418
+ /**
419
+ * The owner of the incentive
420
+ *
421
+ * @public
422
+ * @async
423
+ * @param {?ReadParams} [params]
424
+ * @returns {Promise<Address>}
425
+ */
426
+ async owner(f) {
427
+ return await Q(this._config, {
428
+ address: this.assertValidAddress(),
429
+ args: [],
430
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
431
+ ...f
432
+ });
433
+ }
434
+ /**
435
+ * 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)`
436
+ *
437
+ * @public
438
+ * @async
439
+ * @param {?ReadParams} [params]
440
+ * @returns {Promise<bigint>} - The current reward
441
+ */
442
+ async currentReward(f) {
443
+ return await W(
444
+ this._config,
445
+ {
446
+ address: this.assertValidAddress(),
447
+ args: [],
448
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
449
+ ...f
450
+ }
451
+ );
452
+ }
453
+ /**
454
+ * Retrieves the maximum reward amount per claim.
455
+ *
456
+ * @public
457
+ * @async
458
+ * @param {?ReadParams} [params]
459
+ * @returns {Promise<bigint>} The maximum reward amount per claim
460
+ */
461
+ async getMaxReward(f) {
462
+ return await X(this._config, {
463
+ ...f,
464
+ address: this.assertValidAddress()
465
+ });
466
+ }
467
+ /**
468
+ * Fetches the incentive scalar from a transaction hash
469
+ *
470
+ * @param {GetIncentiveScalarParams} params
471
+ * @param {?ReadParams} [params]
472
+ * @returns {Promise<bigint>}
473
+ * @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}
474
+ */
475
+ async getIncentiveScalar({ chainId: f, hash: a, knownSignatures: b }, e) {
476
+ var c;
477
+ const d = await this.getIncentiveCriteria(e);
478
+ if (d.criteriaType === R.EVENT) {
479
+ const s = await p0(this._config, {
480
+ chainId: f,
481
+ hash: a
482
+ });
483
+ if (d.fieldIndex === x0.GAS_REBATE_INCENTIVE)
484
+ return s.gasUsed * s.effectiveGasPrice + // Normal gas cost
485
+ (s.blobGasUsed ?? 0n) * (s.blobGasPrice ?? 0n);
486
+ const n = s.logs;
487
+ if (n.length === 0)
488
+ throw new I(
489
+ `No logs found for event signature ${d.signature}`
490
+ );
491
+ try {
492
+ const u = b[d.signature], i = D0({
493
+ abi: [u],
494
+ logs: n
495
+ });
496
+ if (i == null || i.length === 0)
497
+ throw new I(
498
+ `No logs found for event signature ${d.signature}`
499
+ );
500
+ const A = ((c = i[0]) == null ? void 0 : c.args)[d.fieldIndex];
501
+ if (A === void 0)
502
+ throw new m(
503
+ `Decoded argument at index ${d.fieldIndex} is undefined`
504
+ );
505
+ return BigInt(A);
506
+ } catch (u) {
507
+ throw new m(
508
+ `Failed to decode event log for signature ${d.signature}: ${u.message}`
509
+ );
510
+ }
511
+ } else if (d.criteriaType === R.FUNC) {
512
+ const s = await w0(this._config, {
513
+ chainId: f,
514
+ hash: a
515
+ });
516
+ try {
517
+ const n = b[d.signature], i = N0({
518
+ abi: [n],
519
+ data: s.input
520
+ }).args[d.fieldIndex];
521
+ if (i == null)
522
+ throw new m(
523
+ `Decoded argument at index ${d.fieldIndex} is undefined`
524
+ );
525
+ return BigInt(i);
526
+ } catch (n) {
527
+ throw new m(
528
+ `Failed to decode function data for signature ${d.signature}: ${n.message}`
529
+ );
530
+ }
531
+ } else
532
+ throw new C0(
533
+ `Invalid criteria type ${d.criteriaType}`
534
+ );
535
+ }
536
+ /**
537
+ * The number of claims that have been made
538
+ *
539
+ * @public
540
+ * @async
541
+ * @param {?ReadParams} [params]
542
+ * @returns {Promise<bigint>}
543
+ */
544
+ async claims(f) {
545
+ return await Y(this._config, {
546
+ address: this.assertValidAddress(),
547
+ args: [],
548
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
549
+ ...f
550
+ });
551
+ }
552
+ /**
553
+ * The total amount of rewards claimed
554
+ *
555
+ * @public
556
+ * @async
557
+ * @param {?ReadParams} [params]
558
+ * @returns {Promise<bigint>}
559
+ */
560
+ async totalClaimed(f) {
561
+ return await H(
562
+ this._config,
563
+ {
564
+ address: this.assertValidAddress(),
565
+ args: [],
566
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
567
+ ...f
568
+ }
569
+ );
570
+ }
571
+ /**
572
+ * A mapping of address to claim status
573
+ *
574
+ * @public
575
+ * @async
576
+ * @param {Address} address
577
+ * @param {?ReadParams} [params]
578
+ * @returns {Promise<boolean>}
579
+ */
580
+ async claimed(f, a) {
581
+ return await Z(this._config, {
582
+ address: this.assertValidAddress(),
583
+ args: [f],
584
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
585
+ ...a
586
+ });
587
+ }
588
+ /**
589
+ * The address of the ERC20-like token
590
+ *
591
+ * @public
592
+ * @async
593
+ * @param {?ReadParams} [params]
594
+ * @returns {Promise<Address>}
595
+ */
596
+ async asset(f) {
597
+ return await J(this._config, {
598
+ address: this.assertValidAddress(),
599
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
600
+ ...f
601
+ });
602
+ }
603
+ /**
604
+ * The address of the pegged ERC20-like token
605
+ *
606
+ * @public
607
+ * @async
608
+ * @param {?ReadParams} [params]
609
+ * @returns {Promise<Address>}
610
+ */
611
+ async peg(f) {
612
+ return await K(this._config, {
613
+ address: this.assertValidAddress(),
614
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
615
+ ...f
616
+ });
617
+ }
618
+ /**
619
+ * The reward amount issued for each claim
620
+ *
621
+ * @public
622
+ * @async
623
+ * @param {?ReadParams} [params]
624
+ * @returns {Promise<bigint>}
625
+ */
626
+ async reward(f) {
627
+ return await f0(this._config, {
628
+ address: this.assertValidAddress(),
629
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
630
+ ...f
631
+ });
632
+ }
633
+ /**
634
+ * The limit (max possible rewards payout in reward token)
635
+ *
636
+ * @public
637
+ * @async
638
+ * @param {?ReadParams} [params]
639
+ * @returns {Promise<bigint>}
640
+ */
641
+ async limit(f) {
642
+ return await a0(this._config, {
643
+ address: this.assertValidAddress(),
644
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
645
+ ...f
646
+ });
647
+ }
648
+ /**
649
+ * Claim the incentive
650
+ *
651
+ * @public
652
+ * @async
653
+ * @param {ClaimPayload} payload
654
+ * @param {?WriteParams} [params]
655
+ * @returns {Promise<boolean>} - Returns true if successfully claimed
656
+ */
657
+ async claim(f, a) {
658
+ return await this.awaitResult(this.claimRaw(f, a));
659
+ }
660
+ /**
661
+ * Claim the incentive
662
+ *
663
+ * @public
664
+ * @async
665
+ * @param {ClaimPayload} payload
666
+ * @param {?WriteParams} [params]
667
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed
668
+ */
669
+ async claimRaw(f, a) {
670
+ const { request: b, result: e } = await b0(this._config, {
671
+ address: this.assertValidAddress(),
672
+ args: [g(f)],
673
+ ...this.optionallyAttachAccount(),
674
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
675
+ ...a
676
+ });
677
+ return { hash: await e0(
678
+ this._config,
679
+ b
680
+ ), result: e };
681
+ }
682
+ /**
683
+ * Clawback assets from the incentive
684
+ *
685
+ * @public
686
+ * @async
687
+ * @param {ClaimPayload} payload
688
+ * @param {?WriteParams} [params]
689
+ * @returns {Promise<boolean>} - True if the assets were successfully clawbacked
690
+ */
691
+ async clawback(f, a) {
692
+ return await this.awaitResult(this.clawbackRaw(f, a));
693
+ }
694
+ /**
695
+ * Clawback assets from the incentive
696
+ *
697
+ * @public
698
+ * @async
699
+ * @param {ClaimPayload} payload
700
+ * @param {?WriteParams} [params]
701
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
702
+ */
703
+ async clawbackRaw(f, a) {
704
+ const { request: b, result: e } = await d0(this._config, {
705
+ address: this.assertValidAddress(),
706
+ args: [g(f)],
707
+ ...this.optionallyAttachAccount(),
708
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
709
+ ...a
710
+ });
711
+ return { hash: await c0(
712
+ this._config,
713
+ b
714
+ ), result: e };
715
+ }
716
+ /**
717
+ * Check if an incentive is claimable.
718
+ *
719
+ * @public
720
+ * @async
721
+ * @param {ClaimPayload} payload
722
+ * @param {?ReadParams} [params]
723
+ * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
724
+ */
725
+ async isClaimable(f, a) {
726
+ return await t0(
727
+ this._config,
728
+ {
729
+ address: this.assertValidAddress(),
730
+ args: [f.target, f.data],
731
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
732
+ ...a
733
+ }
734
+ );
735
+ }
736
+ /**
737
+ * read the peg token for the incentive.
738
+ *
739
+ * @public
740
+ * @async
741
+ * @param {?ReadParams} [params]
742
+ * @returns {Promise<Address>} = The address of the token the reward is pegged to
743
+ */
744
+ async getPeg(f) {
745
+ return await s0(this._config, {
746
+ address: this.assertValidAddress(),
747
+ args: [],
748
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
749
+ ...f
750
+ });
751
+ }
752
+ /**
753
+ * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`
754
+ *
755
+ * @public
756
+ * @async
757
+ * @param {?ReadParams} [params]
758
+ * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.
759
+ */
760
+ async getTotalBudget(f) {
761
+ return await this.limit(f);
762
+ }
763
+ /**
764
+ * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
765
+ *
766
+ * @public
767
+ * @async
768
+ * @param {?ReadParams} [params]
769
+ * @returns {Promise<boolean>} - True if total claims is less than limit
770
+ */
771
+ async canBeClaimed(f) {
772
+ return await this.getRemainingClaimPotential(f) > 0n;
773
+ }
774
+ /**
775
+ * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.
776
+ *
777
+ * @public
778
+ * @async
779
+ * @param {?ReadParams} [params]
780
+ * @returns {Promise<bigint>} - True if total claims is less than limit
781
+ */
782
+ async getRemainingClaimPotential(f) {
783
+ const [a, b] = await Promise.all([
784
+ this.totalClaimed(f),
785
+ this.limit(f)
786
+ ]);
787
+ return b - a;
788
+ }
789
+ /**
790
+ *Functions from the ERC20VariableIncentive contract
791
+ */
792
+ /**
793
+ * Fetches the IncentiveCriteria struct from the contract
794
+ *
795
+ * @param {?ReadParams} [params]
796
+ * @returns {Promise<IncentiveCriteria>} Incentive criteria structure
797
+ * @throws {IncentiveCriteriaNotFoundError}
798
+ */
799
+ async getIncentiveCriteria(f) {
800
+ try {
801
+ return await i0(
802
+ this._config,
803
+ {
804
+ ...f,
805
+ address: this.assertValidAddress()
806
+ }
807
+ );
808
+ } catch (a) {
809
+ throw new v0(a);
810
+ }
811
+ }
812
+ /**
813
+ * Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing
814
+ * the existing `limit` field by `netAmount`. The entire payload is then re-encoded
815
+ * via `prepareERC20PeggedIncentivePayload(...)`.
816
+ *
817
+ * @public
818
+ * @param {bigint} netAmount - The additional limit to add to this incentive.
819
+ * @returns {Hex} The ABI-encoded payload with the updated `limit`.
820
+ */
821
+ async getTopupPayload(f) {
822
+ var a, b, e, d, c;
823
+ return D({
824
+ asset: await this.asset() ?? t,
825
+ peg: ((a = this.payload) == null ? void 0 : a.peg) ?? t,
826
+ reward: ((b = this.payload) == null ? void 0 : b.reward) ?? 0n,
827
+ limit: f,
828
+ maxReward: ((e = this.payload) == null ? void 0 : e.maxReward) ?? 0n,
829
+ manager: ((d = this.payload) == null ? void 0 : d.manager) ?? t,
830
+ criteria: ((c = this.payload) == null ? void 0 : c.criteria) ?? {
831
+ criteriaType: 0,
832
+ signature: t,
833
+ fieldIndex: 0,
834
+ targetContract: t
835
+ }
836
+ });
837
+ }
838
+ /**
839
+ * @inheritdoc
840
+ *
841
+ * @public
842
+ * @param {?ERC20PeggedVariableCriteriaIncentivePayload} [_payload]
843
+ * @param {?DeployableOptions} [_options]
844
+ * @returns {GenericDeployableParams}
845
+ */
846
+ buildParameters(f, a) {
847
+ const [b, e] = this.validateDeploymentConfig(
848
+ f,
849
+ a
850
+ );
851
+ return {
852
+ abi: v,
853
+ bytecode: F0,
854
+ args: [D(b)],
855
+ ...this.optionallyAttachAccount(e.account)
856
+ };
857
+ }
858
+ /**
859
+ * Encodes an amount to clawback from the incentive
860
+ *
861
+ * @public
862
+ * @param {bigint} amount - How much of the asset to clawback
863
+ * @returns {Hex} - Returns an encoded uint256
864
+ */
865
+ buildClawbackData(f) {
866
+ return l([{ type: "uint256" }], [f]);
867
+ }
868
+ /**
869
+ * Builds the claim data for the ERC20PeggedVariableCriteriaIncentivePayload.
870
+ *
871
+ * @public
872
+ * @param {bigint} signedAmount
873
+ * @returns {Hash} Returns the encoded claim data
874
+ * @description This function returns the encoded claim data for the ERC20PeggedVariableCriteriaIncentivePayload.
875
+ */
876
+ buildClaimData(f) {
877
+ return l(
878
+ [{ type: "uint256", name: "signedAmount" }],
879
+ [f]
880
+ );
881
+ }
882
+ /**
883
+ * Decodes claim data for the ERC20PeggedVariableCriteriaIncentive, returning the claim amount.
884
+ * Useful when deriving amount claimed from logs.
885
+ *
886
+ * @public
887
+ * @param {Hex} claimData
888
+ * @returns {BigInt} Returns the reward amount from a claim data payload
889
+ */
890
+ async decodeClaimData(f) {
891
+ const a = o(
892
+ [
893
+ {
894
+ type: "tuple",
895
+ name: "BoostClaimData",
896
+ components: [
897
+ { type: "bytes", name: "validatorData" },
898
+ { type: "bytes", name: "incentiveData" }
899
+ ]
900
+ }
901
+ ],
902
+ f
903
+ ), b = o(
904
+ [{ type: "uint256" }],
905
+ a[0].incentiveData
906
+ )[0];
907
+ let e = b;
908
+ const [d, c] = await Promise.all([
909
+ this.reward(),
910
+ this.getMaxReward()
911
+ ]);
912
+ return d === 0n || (e = d * b / V("1"), c !== 0n && e > c && (e = c)), e;
913
+ }
914
+ /**
915
+ * Decodes claim data for the ERC20PeggedVariableCriteriaIncentive, returning the claim amount.
916
+ * Useful when deriving amount claimed from logs.
917
+ * Use this function instead of `decodeClaimData` if you have reward details.
918
+ *
919
+ * @public
920
+ * @param {Hex} claimData
921
+ * @param {bigint} [reward]
922
+ * @param {bigint} [maxReward]
923
+ * @returns {BigInt} Returns the reward amount from a claim data payload
924
+ */
925
+ decodeClaimDataWithRewardDetails(f, a, b) {
926
+ const e = o(
927
+ [
928
+ {
929
+ type: "tuple",
930
+ name: "BoostClaimData",
931
+ components: [
932
+ { type: "bytes", name: "validatorData" },
933
+ { type: "bytes", name: "incentiveData" }
934
+ ]
935
+ }
936
+ ],
937
+ f
938
+ ), d = o(
939
+ [{ type: "uint256" }],
940
+ e[0].incentiveData
941
+ )[0];
942
+ let c = d;
943
+ return a === 0n || (c = a * d / V("1"), b !== 0n && c > b && (c = b)), c;
944
+ }
945
+ };
946
+ y.bases = {
947
+ 31337: void 0,
948
+ ...T0
949
+ }, y.registryType = T.INCENTIVE;
950
+ let w = y;
951
+ function D({
952
+ asset: r,
953
+ peg: f,
954
+ reward: a,
955
+ limit: b,
956
+ maxReward: e = 0n,
957
+ manager: d = t,
958
+ criteria: c
959
+ }) {
960
+ return l(
961
+ [
962
+ {
963
+ type: "tuple",
964
+ name: "initPayloadExtended",
965
+ components: [
966
+ { type: "address", name: "asset" },
967
+ { type: "address", name: "peg" },
968
+ { type: "uint256", name: "reward" },
969
+ { type: "uint256", name: "limit" },
970
+ { type: "address", name: "manager" },
971
+ { type: "uint256", name: "maxReward" },
972
+ {
973
+ type: "tuple",
974
+ name: "criteria",
975
+ components: [
976
+ { type: "uint8", name: "criteriaType" },
977
+ { type: "bytes32", name: "signature" },
978
+ { type: "uint8", name: "fieldIndex" },
979
+ { type: "address", name: "targetContract" }
980
+ ]
981
+ }
982
+ ]
983
+ }
984
+ ],
985
+ [
986
+ {
987
+ asset: r,
988
+ peg: f,
989
+ reward: a,
990
+ limit: b,
991
+ manager: d,
992
+ maxReward: e,
993
+ criteria: {
994
+ criteriaType: c.criteriaType,
995
+ signature: c.signature,
996
+ fieldIndex: c.fieldIndex,
997
+ targetContract: c.targetContract
998
+ }
999
+ }
1000
+ ]
1001
+ );
1002
+ }
1003
+ const N = {
1004
+ [n0]: B0,
1005
+ [o0]: _0,
1006
+ [l0]: w,
1007
+ [u0]: p,
1008
+ [m0]: V0,
1009
+ // [AERC1155Incentive as Hex]: ERC1155Incentive,
1010
+ [g0]: R0,
1011
+ [h0]: $0,
1012
+ [y0]: P0
1013
+ };
1014
+ async function K0(r, f, a) {
1015
+ const b = await A0(r.config, {
1016
+ abi: r0,
1017
+ functionName: "getComponentInterface",
1018
+ address: f,
1019
+ ...a
1020
+ }), e = N[b];
1021
+ if (!e)
1022
+ throw new I0(
1023
+ Object.keys(N),
1024
+ b
1025
+ );
1026
+ return new e(r, f);
1027
+ }
1028
+ export {
1029
+ p as E,
1030
+ N as I,
1031
+ w as a,
1032
+ D as b,
1033
+ K0 as i,
1034
+ _ as p
1035
+ };
1036
+ //# sourceMappingURL=Incentive-Boviez4z.js.map