@boostxyz/sdk 0.0.0-alpha.9 → 1.1.0-alpha.22

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 (257) hide show
  1. package/dist/Actions/Action.cjs +1 -1
  2. package/dist/Actions/Action.cjs.map +1 -1
  3. package/dist/Actions/Action.js +7 -7
  4. package/dist/Actions/ContractAction.d.ts +11 -11
  5. package/dist/Actions/ContractAction.d.ts.map +1 -1
  6. package/dist/Actions/ERC721MintAction.d.ts +14 -14
  7. package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
  8. package/dist/Actions/EventAction.cjs +1 -1
  9. package/dist/Actions/EventAction.cjs.map +1 -1
  10. package/dist/Actions/EventAction.d.ts +171 -41
  11. package/dist/Actions/EventAction.d.ts.map +1 -1
  12. package/dist/Actions/EventAction.js +15 -392
  13. package/dist/Actions/EventAction.js.map +1 -1
  14. package/dist/AllowLists/AllowList.cjs +1 -1
  15. package/dist/AllowLists/AllowList.cjs.map +1 -1
  16. package/dist/AllowLists/AllowList.d.ts +6 -4
  17. package/dist/AllowLists/AllowList.d.ts.map +1 -1
  18. package/dist/AllowLists/AllowList.js +45 -23
  19. package/dist/AllowLists/AllowList.js.map +1 -1
  20. package/dist/AllowLists/OpenAllowList.d.ts +423 -0
  21. package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
  22. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  23. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
  24. package/dist/AllowLists/SimpleAllowList.d.ts +92 -37
  25. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
  26. package/dist/AllowLists/SimpleAllowList.js +55 -71
  27. package/dist/AllowLists/SimpleAllowList.js.map +1 -1
  28. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  29. package/dist/AllowLists/SimpleDenyList.cjs.map +1 -1
  30. package/dist/AllowLists/SimpleDenyList.d.ts +203 -11
  31. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
  32. package/dist/AllowLists/SimpleDenyList.js +11 -112
  33. package/dist/AllowLists/SimpleDenyList.js.map +1 -1
  34. package/dist/Auth/PassthroughAuth.cjs +1 -1
  35. package/dist/Auth/PassthroughAuth.js +1 -1
  36. package/dist/Boost.cjs +1 -1
  37. package/dist/Boost.cjs.map +1 -1
  38. package/dist/Boost.d.ts +20 -21
  39. package/dist/Boost.d.ts.map +1 -1
  40. package/dist/Boost.js +43 -57
  41. package/dist/Boost.js.map +1 -1
  42. package/dist/BoostCore-BVZExPPu.js +1462 -0
  43. package/dist/BoostCore-BVZExPPu.js.map +1 -0
  44. package/dist/BoostCore-D-E-cnGI.cjs +3 -0
  45. package/dist/BoostCore-D-E-cnGI.cjs.map +1 -0
  46. package/dist/BoostCore.cjs +1 -2
  47. package/dist/BoostCore.cjs.map +1 -1
  48. package/dist/BoostCore.d.ts +748 -77
  49. package/dist/BoostCore.d.ts.map +1 -1
  50. package/dist/BoostCore.js +29 -1150
  51. package/dist/BoostCore.js.map +1 -1
  52. package/dist/BoostRegistry.cjs +1 -1
  53. package/dist/BoostRegistry.cjs.map +1 -1
  54. package/dist/BoostRegistry.d.ts +80 -25
  55. package/dist/BoostRegistry.d.ts.map +1 -1
  56. package/dist/BoostRegistry.js +165 -83
  57. package/dist/BoostRegistry.js.map +1 -1
  58. package/dist/Budgets/Budget.cjs +1 -1
  59. package/dist/Budgets/Budget.cjs.map +1 -1
  60. package/dist/Budgets/Budget.d.ts.map +1 -1
  61. package/dist/Budgets/Budget.js +2 -2
  62. package/dist/Budgets/Budget.js.map +1 -1
  63. package/dist/Budgets/ManagedBudget.cjs +1 -1
  64. package/dist/Budgets/ManagedBudget.cjs.map +1 -1
  65. package/dist/Budgets/ManagedBudget.d.ts +75 -193
  66. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  67. package/dist/Budgets/ManagedBudget.js +80 -298
  68. package/dist/Budgets/ManagedBudget.js.map +1 -1
  69. package/dist/Budgets/VestingBudget.d.ts +223 -89
  70. package/dist/Budgets/VestingBudget.d.ts.map +1 -1
  71. package/dist/Deployable/Contract.cjs +1 -1
  72. package/dist/Deployable/Contract.cjs.map +1 -1
  73. package/dist/Deployable/Contract.d.ts +4 -5
  74. package/dist/Deployable/Contract.d.ts.map +1 -1
  75. package/dist/Deployable/Contract.js +5 -7
  76. package/dist/Deployable/Contract.js.map +1 -1
  77. package/dist/Deployable/Deployable.cjs.map +1 -1
  78. package/dist/Deployable/Deployable.d.ts +1 -1
  79. package/dist/Deployable/Deployable.d.ts.map +1 -1
  80. package/dist/Deployable/Deployable.js +3 -5
  81. package/dist/Deployable/Deployable.js.map +1 -1
  82. package/dist/Deployable/DeployableTarget.cjs +1 -1
  83. package/dist/Deployable/DeployableTarget.cjs.map +1 -1
  84. package/dist/Deployable/DeployableTarget.d.ts +13 -13
  85. package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
  86. package/dist/Deployable/DeployableTarget.js +28 -25
  87. package/dist/Deployable/DeployableTarget.js.map +1 -1
  88. package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
  89. package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
  90. package/dist/Deployable/DeployableTargetWithRBAC.d.ts +179 -0
  91. package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
  92. package/dist/Deployable/DeployableTargetWithRBAC.js +222 -0
  93. package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
  94. package/dist/EventAction-BZt5cjbe.cjs +2 -0
  95. package/dist/EventAction-BZt5cjbe.cjs.map +1 -0
  96. package/dist/EventAction-C_-hJXWm.js +1541 -0
  97. package/dist/EventAction-C_-hJXWm.js.map +1 -0
  98. package/dist/Incentive-BhHaK3PZ.cjs +2 -0
  99. package/dist/Incentive-BhHaK3PZ.cjs.map +1 -0
  100. package/dist/Incentive-Cqg1w6wD.js +312 -0
  101. package/dist/Incentive-Cqg1w6wD.js.map +1 -0
  102. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  103. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  104. package/dist/Incentives/AllowListIncentive.d.ts +38 -16
  105. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  106. package/dist/Incentives/AllowListIncentive.js +42 -29
  107. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  108. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  109. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  110. package/dist/Incentives/CGDAIncentive.d.ts +234 -21
  111. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  112. package/dist/Incentives/CGDAIncentive.js +45 -32
  113. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  114. package/dist/Incentives/ERC1155Incentive.d.ts +224 -37
  115. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
  116. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  117. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  118. package/dist/Incentives/ERC20Incentive.d.ts +230 -29
  119. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  120. package/dist/Incentives/ERC20Incentive.js +56 -43
  121. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  122. package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +335 -440
  123. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
  124. package/dist/Incentives/ERC20VariableIncentive.d.ts +231 -29
  125. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  126. package/dist/Incentives/Incentive.cjs +1 -1
  127. package/dist/Incentives/Incentive.cjs.map +1 -1
  128. package/dist/Incentives/Incentive.d.ts +4 -4
  129. package/dist/Incentives/Incentive.d.ts.map +1 -1
  130. package/dist/Incentives/Incentive.js +16 -296
  131. package/dist/Incentives/Incentive.js.map +1 -1
  132. package/dist/Incentives/PointsIncentive.cjs +1 -1
  133. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  134. package/dist/Incentives/PointsIncentive.d.ts +40 -18
  135. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  136. package/dist/Incentives/PointsIncentive.js +37 -24
  137. package/dist/Incentives/PointsIncentive.js.map +1 -1
  138. package/dist/SimpleDenyList-BUR17Tt1.cjs +2 -0
  139. package/dist/SimpleDenyList-BUR17Tt1.cjs.map +1 -0
  140. package/dist/SimpleDenyList-CGaWjuld.js +132 -0
  141. package/dist/SimpleDenyList-CGaWjuld.js.map +1 -0
  142. package/dist/Validators/SignerValidator.cjs +1 -1
  143. package/dist/Validators/SignerValidator.cjs.map +1 -1
  144. package/dist/Validators/SignerValidator.d.ts +16 -16
  145. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  146. package/dist/Validators/SignerValidator.js +30 -27
  147. package/dist/Validators/SignerValidator.js.map +1 -1
  148. package/dist/Validators/Validator.cjs +1 -1
  149. package/dist/Validators/Validator.cjs.map +1 -1
  150. package/dist/Validators/Validator.d.ts +1 -1
  151. package/dist/Validators/Validator.js +2 -2
  152. package/dist/Validators/Validator.js.map +1 -1
  153. package/dist/claiming.cjs.map +1 -1
  154. package/dist/claiming.d.ts +1 -1
  155. package/dist/claiming.js.map +1 -1
  156. package/dist/componentInterfaces-BBCFkrZv.js +14 -0
  157. package/dist/componentInterfaces-BBCFkrZv.js.map +1 -0
  158. package/dist/componentInterfaces-DRI_dQ-P.cjs +2 -0
  159. package/dist/componentInterfaces-DRI_dQ-P.cjs.map +1 -0
  160. package/dist/deployments-DVXioW2i.cjs +2 -0
  161. package/dist/deployments-DVXioW2i.cjs.map +1 -0
  162. package/dist/deployments-oykLv3_Z.js +43 -0
  163. package/dist/deployments-oykLv3_Z.js.map +1 -0
  164. package/dist/deployments.json +44 -0
  165. package/dist/errors.cjs +1 -1
  166. package/dist/errors.cjs.map +1 -1
  167. package/dist/errors.d.ts +256 -20
  168. package/dist/errors.d.ts.map +1 -1
  169. package/dist/errors.js +183 -26
  170. package/dist/errors.js.map +1 -1
  171. package/dist/{generated-57_Kffpz.js → generated-CKt2yCQd.js} +3613 -1869
  172. package/dist/generated-CKt2yCQd.js.map +1 -0
  173. package/dist/generated-CyTNlOwM.cjs +3 -0
  174. package/dist/generated-CyTNlOwM.cjs.map +1 -0
  175. package/dist/index.cjs +1 -1
  176. package/dist/index.d.ts +5 -0
  177. package/dist/index.d.ts.map +1 -1
  178. package/dist/index.js +142 -108
  179. package/dist/index.js.map +1 -1
  180. package/dist/transfers.cjs.map +1 -1
  181. package/dist/transfers.d.ts +1 -1
  182. package/dist/transfers.js.map +1 -1
  183. package/dist/utils.cjs +1 -1
  184. package/dist/utils.cjs.map +1 -1
  185. package/dist/utils.d.ts +26 -12
  186. package/dist/utils.d.ts.map +1 -1
  187. package/dist/utils.js +38 -23
  188. package/dist/utils.js.map +1 -1
  189. package/package.json +20 -10
  190. package/src/Actions/Action.test.ts +14 -13
  191. package/src/Actions/ContractAction.test.ts +10 -10
  192. package/src/Actions/ContractAction.ts +11 -12
  193. package/src/Actions/ERC721MintAction.test.ts +6 -6
  194. package/src/Actions/ERC721MintAction.ts +14 -15
  195. package/src/Actions/EventAction.test.ts +729 -109
  196. package/src/Actions/EventAction.ts +542 -84
  197. package/src/AllowLists/AllowList.test.ts +7 -7
  198. package/src/AllowLists/AllowList.ts +5 -3
  199. package/src/AllowLists/OpenAllowList.test.ts +40 -0
  200. package/src/AllowLists/OpenAllowList.ts +45 -0
  201. package/src/AllowLists/SimpleAllowList.test.ts +4 -4
  202. package/src/AllowLists/SimpleAllowList.ts +39 -61
  203. package/src/AllowLists/SimpleDenyList.test.ts +4 -4
  204. package/src/AllowLists/SimpleDenyList.ts +40 -17
  205. package/src/Auth/PassthroughAuth.test.ts +1 -1
  206. package/src/Boost.ts +21 -24
  207. package/src/BoostCore.test.ts +323 -268
  208. package/src/BoostCore.ts +396 -219
  209. package/src/BoostRegistry.test.ts +53 -0
  210. package/src/BoostRegistry.ts +161 -40
  211. package/src/Budgets/Budget.test.ts +2 -2
  212. package/src/Budgets/Budget.ts +1 -2
  213. package/src/Budgets/ManagedBudget.test.ts +82 -19
  214. package/src/Budgets/ManagedBudget.ts +48 -310
  215. package/src/Budgets/VestingBudget.test.ts +7 -7
  216. package/src/Budgets/VestingBudget.ts +34 -106
  217. package/src/Deployable/Contract.ts +4 -5
  218. package/src/Deployable/Deployable.ts +1 -1
  219. package/src/Deployable/DeployableTarget.ts +30 -19
  220. package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
  221. package/src/Incentives/AllowListIncentive.test.ts +5 -5
  222. package/src/Incentives/AllowListIncentive.ts +29 -15
  223. package/src/Incentives/CGDAIncentive.test.ts +9 -6
  224. package/src/Incentives/CGDAIncentive.ts +38 -18
  225. package/src/Incentives/ERC1155Incentive.test.ts +3 -3
  226. package/src/Incentives/ERC1155Incentive.ts +28 -29
  227. package/src/Incentives/ERC20Incentive.test.ts +9 -6
  228. package/src/Incentives/ERC20Incentive.ts +46 -26
  229. package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
  230. package/src/Incentives/ERC20VariableCriteriaIncentive.ts +324 -0
  231. package/src/Incentives/ERC20VariableIncentive.test.ts +8 -11
  232. package/src/Incentives/ERC20VariableIncentive.ts +49 -26
  233. package/src/Incentives/Incentive.test.ts +4 -1
  234. package/src/Incentives/Incentive.ts +7 -6
  235. package/src/Incentives/PointsIncentive.test.ts +24 -25
  236. package/src/Incentives/PointsIncentive.ts +31 -17
  237. package/src/Validators/SignerValidator.test.ts +6 -6
  238. package/src/Validators/SignerValidator.ts +19 -17
  239. package/src/Validators/Validator.test.ts +2 -2
  240. package/src/Validators/Validator.ts +1 -1
  241. package/src/claiming.ts +1 -1
  242. package/src/errors.ts +345 -21
  243. package/src/index.test.ts +118 -36
  244. package/src/index.ts +5 -0
  245. package/src/transfers.ts +1 -1
  246. package/src/utils.test.ts +2 -2
  247. package/src/utils.ts +61 -12
  248. package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
  249. package/dist/componentInterfaces-CKCBwG16.cjs +0 -2
  250. package/dist/componentInterfaces-CKCBwG16.cjs.map +0 -1
  251. package/dist/componentInterfaces-DYkaxBda.js +0 -13
  252. package/dist/componentInterfaces-DYkaxBda.js.map +0 -1
  253. package/dist/generated-57_Kffpz.js.map +0 -1
  254. package/dist/generated-wKBNvm48.cjs +0 -3
  255. package/dist/generated-wKBNvm48.cjs.map +0 -1
  256. package/src/Budgets/SimpleBudget.test.ts +0 -152
  257. package/src/Budgets/SimpleBudget.ts +0 -564
@@ -20,7 +20,9 @@ import {
20
20
  type ContractEventName,
21
21
  type Hex,
22
22
  encodeAbiParameters,
23
+ zeroHash,
23
24
  } from 'viem';
25
+ import { CGDAIncentive as CGDAIncentiveBases } from '../../dist/deployments.json';
24
26
  import type {
25
27
  DeployableOptions,
26
28
  GenericDeployableParams,
@@ -74,6 +76,12 @@ export interface CGDAIncentivePayload {
74
76
  * @type {bigint}
75
77
  */
76
78
  totalBudget: bigint;
79
+ /**
80
+ * The entity that can `clawback` funds
81
+ *
82
+ * @type {Address}
83
+ */
84
+ manager: Address;
77
85
  }
78
86
 
79
87
  /**
@@ -144,10 +152,11 @@ export class CGDAIncentive extends DeployableTarget<
144
152
  *
145
153
  * @public
146
154
  * @static
147
- * @type {Address}
155
+ * @type {Record<number, Address>}
148
156
  */
149
- public static override base: Address = import.meta.env
150
- .VITE_CGDA_INCENTIVE_BASE;
157
+ public static override bases: Record<number, Address> = {
158
+ ...(CGDAIncentiveBases as Record<number, Address>),
159
+ };
151
160
  /**
152
161
  * @inheritdoc
153
162
  *
@@ -162,8 +171,8 @@ export class CGDAIncentive extends DeployableTarget<
162
171
  *
163
172
  * @public
164
173
  * @async
165
- * @param {?ReadParams<typeof cgdaIncentiveAbi, 'owner'>} [params]
166
- * @returns {unknown}
174
+ * @param {?ReadParams} [params]
175
+ * @returns {Promise<Address>}
167
176
  */
168
177
  public async owner(params?: ReadParams<typeof cgdaIncentiveAbi, 'owner'>) {
169
178
  return await readCgdaIncentiveOwner(this._config, {
@@ -179,7 +188,7 @@ export class CGDAIncentive extends DeployableTarget<
179
188
  *
180
189
  * @public
181
190
  * @async
182
- * @param {?ReadParams<typeof cgdaIncentiveAbi, 'claims'>} [params]
191
+ * @param {?ReadParams} [params]
183
192
  * @returns {Promise<bigint>}
184
193
  */
185
194
  public async claims(params?: ReadParams<typeof cgdaIncentiveAbi, 'claims'>) {
@@ -196,7 +205,7 @@ export class CGDAIncentive extends DeployableTarget<
196
205
  *
197
206
  * @public
198
207
  * @async
199
- * @param {?ReadParams<typeof allowListIncentiveAbi, 'reward'>} [params]
208
+ * @param {?ReadParams} [params]
200
209
  * @returns {Promise<bigint>}
201
210
  */
202
211
  public async reward(params?: ReadParams<typeof cgdaIncentiveAbi, 'reward'>) {
@@ -214,7 +223,7 @@ export class CGDAIncentive extends DeployableTarget<
214
223
  * @public
215
224
  * @async
216
225
  * @param {Address} address
217
- * @param {?ReadParams<typeof cgdaIncentiveAbi, 'claimed'>} [params]
226
+ * @param {?ReadParams} [params]
218
227
  * @returns {Promise<boolean>}
219
228
  */
220
229
  public async claimed(
@@ -234,8 +243,8 @@ export class CGDAIncentive extends DeployableTarget<
234
243
  *
235
244
  * @public
236
245
  * @async
237
- * @param {?ReadParams<typeof cgdaIncentiveAbi, 'asset'>} [params]
238
- * @returns {unknown}
246
+ * @param {?ReadParams} [params]
247
+ * @returns {Promise<Address>}
239
248
  */
240
249
  public async asset(params?: ReadParams<typeof cgdaIncentiveAbi, 'asset'>) {
241
250
  return await readCgdaIncentiveAsset(this._config, {
@@ -250,7 +259,7 @@ export class CGDAIncentive extends DeployableTarget<
250
259
  *
251
260
  * @public
252
261
  * @async
253
- * @param {?ReadParams<typeof cgdaIncentiveAbi, 'cgdaParams'>} [params]
262
+ * @param {?ReadParams} [params]
254
263
  * @returns {Promise<CGDAParameters>}
255
264
  */
256
265
  public async cgdaParams(
@@ -275,7 +284,7 @@ export class CGDAIncentive extends DeployableTarget<
275
284
  *
276
285
  * @public
277
286
  * @async
278
- * @param {?ReadParams<typeof cgdaIncentiveAbi, 'totalBudget'>} [params]
287
+ * @param {?ReadParams} [params]
279
288
  * @returns {Promise<bigint>}
280
289
  */
281
290
  public async totalBudget(
@@ -294,7 +303,7 @@ export class CGDAIncentive extends DeployableTarget<
294
303
  * @public
295
304
  * @async
296
305
  * @param {ClaimPayload} payload
297
- * @param {?WriteParams<typeof cgdaIncentiveAbi, 'claim'>} [params]
306
+ * @param {?WriteParams} [params]
298
307
  * @returns {Promise<boolean>} - Returns true if successfully claimed
299
308
  */
300
309
  protected async claim(
@@ -310,7 +319,7 @@ export class CGDAIncentive extends DeployableTarget<
310
319
  * @public
311
320
  * @async
312
321
  * @param {ClaimPayload} payload
313
- * @param {?WriteParams<typeof cgdaIncentiveAbi, 'claim'>} [params]
322
+ * @param {?WriteParams} [params]
314
323
  * @returns {Promise<boolean>} - Returns true if successfully claimed
315
324
  */
316
325
  protected async claimRaw(
@@ -334,7 +343,7 @@ export class CGDAIncentive extends DeployableTarget<
334
343
  * @public
335
344
  * @async
336
345
  * @param {ClaimPayload} payload
337
- * @param {?WriteParams<typeof cgdaIncentiveAbi, 'clawback'>} [params]
346
+ * @param {?WriteParams} [params]
338
347
  * @returns {Promise<boolean>} - True if the assets were successfully clawbacked
339
348
  */
340
349
  public async clawback(
@@ -350,7 +359,7 @@ export class CGDAIncentive extends DeployableTarget<
350
359
  * @public
351
360
  * @async
352
361
  * @param {ClaimPayload} payload
353
- * @param {?WriteParams<typeof cgdaIncentiveAbi, 'clawback'>} [params]
362
+ * @param {?WriteParams} [params]
354
363
  * @returns {Promise<boolean>} - True if the assets were successfully clawbacked
355
364
  */
356
365
  public async clawbackRaw(
@@ -377,7 +386,7 @@ export class CGDAIncentive extends DeployableTarget<
377
386
  * @public
378
387
  * @async
379
388
  * @param {ClaimPayload} payload
380
- * @param {?ReadParams<typeof cgdaIncentiveAbi, 'isClaimable'>} [params]
389
+ * @param {?ReadParams} [params]
381
390
  * @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload
382
391
  */
383
392
  public async isClaimable(
@@ -399,7 +408,7 @@ export class CGDAIncentive extends DeployableTarget<
399
408
  *
400
409
  * @public
401
410
  * @async
402
- * @param {?ReadParams<typeof cgdaIncentiveAbi, 'currentReward'>} [params]
411
+ * @param {?ReadParams} [params]
403
412
  * @returns {Promise<bigint>} - The current reward
404
413
  */
405
414
  public async currentReward(
@@ -435,6 +444,17 @@ export class CGDAIncentive extends DeployableTarget<
435
444
  ...this.optionallyAttachAccount(options.account),
436
445
  };
437
446
  }
447
+
448
+ /**
449
+ * Builds the claim data for the CGDAIncentive.
450
+ *
451
+ * @public
452
+ * @returns {Hash} A `zeroHash`, as CGDAIncentive doesn't require specific claim data.
453
+ * @description This function returns `zeroHash` because CGDAIncentive doesn't use any specific claim data.
454
+ */
455
+ public buildClaimData() {
456
+ return zeroHash;
457
+ }
438
458
  }
439
459
 
440
460
  /**
@@ -2,7 +2,7 @@ import { readMockErc1155BalanceOf } from '@boostxyz/evm';
2
2
  import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
3
3
  import { isAddress, pad, parseEther, zeroAddress, zeroHash } from 'viem';
4
4
  import { beforeAll, beforeEach, describe, expect, test } from 'vitest';
5
- import { accounts } from '../../test/accounts';
5
+ import { accounts } from '@boostxyz/test/accounts';
6
6
  import {
7
7
  type BudgetFixtures,
8
8
  type Fixtures,
@@ -10,7 +10,7 @@ import {
10
10
  deployFixtures,
11
11
  freshBoost,
12
12
  fundBudget,
13
- } from '../../test/helpers';
13
+ } from '@boostxyz/test/helpers';
14
14
  import { ERC1155Incentive, ERC1155StrategyType } from './ERC1155Incentive';
15
15
 
16
16
  const BOOST_CORE_CLAIM_FEE = parseEther('0.000075');
@@ -19,7 +19,7 @@ let fixtures: Fixtures, budgets: BudgetFixtures;
19
19
 
20
20
  describe.skip('ERC1155Incentive', () => {
21
21
  beforeAll(async () => {
22
- fixtures = await loadFixture(deployFixtures);
22
+ fixtures = await loadFixture(deployFixtures(defaultOptions));
23
23
  });
24
24
 
25
25
  beforeEach(async () => {
@@ -127,10 +127,9 @@ export class ERC1155Incentive extends DeployableTarget<
127
127
  *
128
128
  * @public
129
129
  * @static
130
- * @type {Address}
130
+ * @type {Record<number, Address>}
131
131
  */
132
- public static override base: Address = import.meta.env
133
- .VITE_ERC1155_INCENTIVE_BASE;
132
+ public static override bases: Record<number, Address> = {};
134
133
  /**
135
134
  * @inheritdoc
136
135
  *
@@ -145,8 +144,8 @@ export class ERC1155Incentive extends DeployableTarget<
145
144
  *
146
145
  * @public
147
146
  * @async
148
- * @param {?ReadParams<typeof erc1155IncentiveAbi, 'claims'>} [params]
149
- * @returns {unknown}
147
+ * @param {?ReadParams} [params]
148
+ * @returns {Promise<bigint>}
150
149
  */
151
150
  public async claims(
152
151
  params?: ReadParams<typeof erc1155IncentiveAbi, 'claims'>,
@@ -164,8 +163,8 @@ export class ERC1155Incentive extends DeployableTarget<
164
163
  *
165
164
  * @public
166
165
  * @async
167
- * @param {?ReadParams<typeof erc1155IncentiveAbi, 'reward'>} [params]
168
- * @returns {unknown}
166
+ * @param {?ReadParams} [params]
167
+ * @returns {Promise<bigint>}
169
168
  */
170
169
  public async reward(
171
170
  params?: ReadParams<typeof erc1155IncentiveAbi, 'reward'>,
@@ -184,8 +183,8 @@ export class ERC1155Incentive extends DeployableTarget<
184
183
  * @public
185
184
  * @async
186
185
  * @param {Address} address
187
- * @param {?ReadParams<typeof erc1155IncentiveAbi, 'claimed'>} [params]
188
- * @returns {unknown}
186
+ * @param {?ReadParams} [params]
187
+ * @returns {Promise<boolean>}
189
188
  */
190
189
  public async claimed(
191
190
  address: Address,
@@ -204,8 +203,8 @@ export class ERC1155Incentive extends DeployableTarget<
204
203
  *
205
204
  * @public
206
205
  * @async
207
- * @param {?ReadParams<typeof erc1155IncentiveAbi, 'asset'>} [params]
208
- * @returns {unknown}
206
+ * @param {?ReadParams} [params]
207
+ * @returns {Promise<Address>}
209
208
  */
210
209
  public async asset(params?: ReadParams<typeof erc1155IncentiveAbi, 'asset'>) {
211
210
  return await readErc1155IncentiveAsset(this._config, {
@@ -220,7 +219,7 @@ export class ERC1155Incentive extends DeployableTarget<
220
219
  *
221
220
  * @public
222
221
  * @async
223
- * @param {?ReadParams<typeof erc1155IncentiveAbi, 'strategy'>} [params]
222
+ * @param {?ReadParams} [params]
224
223
  * @returns {Promise<StrategyType>}
225
224
  */
226
225
  public strategy(
@@ -238,7 +237,7 @@ export class ERC1155Incentive extends DeployableTarget<
238
237
  *
239
238
  * @public
240
239
  * @async
241
- * @param {?ReadParams<typeof erc1155IncentiveAbi, 'limit'>} [params]
240
+ * @param {?ReadParams} [params]
242
241
  * @returns {unknown}
243
242
  */
244
243
  public async limit(params?: ReadParams<typeof erc1155IncentiveAbi, 'limit'>) {
@@ -254,8 +253,8 @@ export class ERC1155Incentive extends DeployableTarget<
254
253
  *
255
254
  * @public
256
255
  * @async
257
- * @param {?ReadParams<typeof erc1155IncentiveAbi, 'tokenId'>} [params]
258
- * @returns {unknown}
256
+ * @param {?ReadParams} [params]
257
+ * @returns {Promise<bigint>}
259
258
  */
260
259
  public async tokenId(
261
260
  params?: ReadParams<typeof erc1155IncentiveAbi, 'tokenId'>,
@@ -272,8 +271,8 @@ export class ERC1155Incentive extends DeployableTarget<
272
271
  *
273
272
  * @public
274
273
  * @async
275
- * @param {?ReadParams<typeof erc1155IncentiveAbi, 'extraData'>} [params]
276
- * @returns {unknown}
274
+ * @param {?ReadParams} [params]
275
+ * @returns {Promise<Hex>}
277
276
  */
278
277
  public async extraData(
279
278
  params?: ReadParams<typeof erc1155IncentiveAbi, 'extraData'>,
@@ -291,8 +290,8 @@ export class ERC1155Incentive extends DeployableTarget<
291
290
  * @public
292
291
  * @async
293
292
  * @param {ClaimPayload} payload
294
- * @param {?WriteParams<typeof erc1155IncentiveAbi, 'claim'>} [params]
295
- * @returns {unknown}
293
+ * @param {?WriteParams} [params]
294
+ * @returns {Promise<boolean>}
296
295
  */
297
296
  protected async claim(
298
297
  payload: ClaimPayload,
@@ -307,8 +306,8 @@ export class ERC1155Incentive extends DeployableTarget<
307
306
  * @public
308
307
  * @async
309
308
  * @param {ClaimPayload} payload
310
- * @param {?WriteParams<typeof erc1155IncentiveAbi, 'claim'>} [params]
311
- * @returns {unknown}
309
+ * @param {?WriteParams} [params]
310
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>}
312
311
  */
313
312
  protected async claimRaw(
314
313
  payload: ClaimPayload,
@@ -334,8 +333,8 @@ export class ERC1155Incentive extends DeployableTarget<
334
333
  * @public
335
334
  * @async
336
335
  * @param {ClaimPayload} payload
337
- * @param {?WriteParams<typeof erc1155IncentiveAbi, 'clawback'>} [params]
338
- * @returns {unknown}
336
+ * @param {?WriteParams} [params]
337
+ * @returns {Promise<boolean>}
339
338
  */
340
339
  public async clawback(
341
340
  payload: ClaimPayload,
@@ -350,8 +349,8 @@ export class ERC1155Incentive extends DeployableTarget<
350
349
  * @public
351
350
  * @async
352
351
  * @param {ClaimPayload} payload
353
- * @param {?WriteParams<typeof erc1155IncentiveAbi, 'clawback'>} [params]
354
- * @returns {unknown}
352
+ * @param {?WriteParams} [params]
353
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>}
355
354
  */
356
355
  public async clawbackRaw(
357
356
  payload: ClaimPayload,
@@ -377,8 +376,8 @@ export class ERC1155Incentive extends DeployableTarget<
377
376
  * @public
378
377
  * @async
379
378
  * @param {ClaimPayload} payload
380
- * @param {?ReadParams<typeof erc1155IncentiveAbi, 'isClaimable'>} [params]
381
- * @returns {unknown}
379
+ * @param {?ReadParams} [params]
380
+ * @returns {Promise<boolean>}
382
381
  */
383
382
  public async isClaimable(
384
383
  payload: ClaimPayload,
@@ -398,8 +397,8 @@ export class ERC1155Incentive extends DeployableTarget<
398
397
  * @public
399
398
  * @async
400
399
  * @param {ERC1155IncentivePayload} data
401
- * @param {?ReadParams<typeof erc1155IncentiveAbi, 'preflight'>} [params]
402
- * @returns {unknown}
400
+ * @param {?ReadParams} [params]
401
+ * @returns {Promise<Hex>}
403
402
  */
404
403
  public async preflight(
405
404
  data: ERC1155IncentivePayload,
@@ -2,7 +2,7 @@ import { readMockErc20BalanceOf } from '@boostxyz/evm';
2
2
  import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
3
3
  import { isAddress, pad, parseEther, zeroAddress } from 'viem';
4
4
  import { beforeAll, beforeEach, describe, expect, test } from 'vitest';
5
- import { accounts } from '../../test/accounts';
5
+ import { accounts } from '@boostxyz/test/accounts';
6
6
  import {
7
7
  type BudgetFixtures,
8
8
  type Fixtures,
@@ -10,7 +10,7 @@ import {
10
10
  deployFixtures,
11
11
  freshBoost,
12
12
  fundBudget,
13
- } from '../../test/helpers';
13
+ } from '@boostxyz/test/helpers';
14
14
  import { BOOST_CORE_CLAIM_FEE } from '../BoostCore';
15
15
  import { StrategyType } from '../claiming';
16
16
  import { ERC20Incentive } from './ERC20Incentive';
@@ -19,7 +19,7 @@ let fixtures: Fixtures, budgets: BudgetFixtures;
19
19
 
20
20
  describe('ERC20Incentive', () => {
21
21
  beforeAll(async () => {
22
- fixtures = await loadFixture(deployFixtures);
22
+ fixtures = await loadFixture(deployFixtures(defaultOptions));
23
23
  });
24
24
 
25
25
  beforeEach(async () => {
@@ -32,6 +32,7 @@ describe('ERC20Incentive', () => {
32
32
  strategy: StrategyType.POOL,
33
33
  reward: 1n,
34
34
  limit: 1n,
35
+ manager: zeroAddress,
35
36
  });
36
37
  await action.deploy();
37
38
  expect(isAddress(action.assertValidAddress())).toBe(true);
@@ -42,11 +43,12 @@ describe('ERC20Incentive', () => {
42
43
  const referrer = accounts.at(1)!.account!,
43
44
  // biome-ignore lint/style/noNonNullAssertion: we know this is defined
44
45
  trustedSigner = accounts.at(0)!;
45
- const erc20Incentive = new fixtures.bases.ERC20Incentive(defaultOptions, {
46
+ const erc20Incentive = fixtures.core.ERC20Incentive({
46
47
  asset: budgets.erc20.assertValidAddress(),
47
48
  strategy: StrategyType.POOL,
48
49
  reward: 1n,
49
50
  limit: 1n,
51
+ manager: budgets.budget.assertValidAddress(),
50
52
  });
51
53
  const boost = await freshBoost(fixtures, {
52
54
  budget: budgets.budget,
@@ -54,7 +56,7 @@ describe('ERC20Incentive', () => {
54
56
  });
55
57
 
56
58
  const claimant = trustedSigner.account;
57
- const incentiveData = pad('0xdef456232173821931823712381232131391321934');
59
+ const incentiveData = erc20Incentive.buildClaimData();
58
60
  const incentiveQuantity = 1;
59
61
  const claimDataPayload = await boost.validator.encodeClaimData({
60
62
  signer: trustedSigner,
@@ -85,11 +87,12 @@ describe('ERC20Incentive', () => {
85
87
  const referrer = accounts.at(1)!.account!;
86
88
  // biome-ignore lint/style/noNonNullAssertion: we know this is defined
87
89
  const trustedSigner = accounts.at(0)!;
88
- const erc20Incentive = new fixtures.bases.ERC20Incentive(defaultOptions, {
90
+ const erc20Incentive = fixtures.core.ERC20Incentive({
89
91
  asset: budgets.erc20.assertValidAddress(),
90
92
  strategy: StrategyType.POOL,
91
93
  reward: 1n,
92
94
  limit: 1n,
95
+ manager: budgets.budget.assertValidAddress(),
93
96
  });
94
97
  const boost = await freshBoost(fixtures, {
95
98
  budget: budgets.budget,
@@ -23,7 +23,9 @@ import {
23
23
  type ContractEventName,
24
24
  type Hex,
25
25
  encodeAbiParameters,
26
+ zeroHash,
26
27
  } from 'viem';
28
+ import { ERC20Incentive as ERC20IncentiveBases } from '../../dist/deployments.json';
27
29
  import type {
28
30
  DeployableOptions,
29
31
  GenericDeployableParams,
@@ -75,6 +77,12 @@ export interface ERC20IncentivePayload {
75
77
  * @type {bigint}
76
78
  */
77
79
  limit: bigint;
80
+ /**
81
+ * The entity that can `clawback` funds
82
+ *
83
+ * @type {Address}
84
+ */
85
+ manager: Address;
78
86
  }
79
87
 
80
88
  /**
@@ -110,10 +118,11 @@ export class ERC20Incentive extends DeployableTarget<
110
118
  *
111
119
  * @public
112
120
  * @static
113
- * @type {Address}
121
+ * @type {Record<number, Address>}
114
122
  */
115
- public static override base: Address = import.meta.env
116
- .VITE_ERC20_INCENTIVE_BASE;
123
+ public static override bases: Record<number, Address> = {
124
+ ...(ERC20IncentiveBases as Record<number, Address>),
125
+ };
117
126
  /**
118
127
  * @inheritdoc
119
128
  *
@@ -128,8 +137,8 @@ export class ERC20Incentive extends DeployableTarget<
128
137
  *
129
138
  * @public
130
139
  * @async
131
- * @param {?ReadParams<typeof erc20IncentiveAbi, 'owner'>} [params]
132
- * @returns {unknown}
140
+ * @param {?ReadParams} [params]
141
+ * @returns {Promise<Address>}
133
142
  */
134
143
  public async owner(params?: ReadParams<typeof erc20IncentiveAbi, 'owner'>) {
135
144
  return await readErc20IncentiveOwner(this._config, {
@@ -145,7 +154,7 @@ export class ERC20Incentive extends DeployableTarget<
145
154
  *
146
155
  * @public
147
156
  * @async
148
- * @param {?ReadParams<typeof erc20IncentiveAbi, 'currentReward'>} [params]
157
+ * @param {?ReadParams} [params]
149
158
  * @returns {Promise<bigint>} - The current reward
150
159
  */
151
160
  public async currentReward(
@@ -164,7 +173,7 @@ export class ERC20Incentive extends DeployableTarget<
164
173
  *
165
174
  * @public
166
175
  * @async
167
- * @param {?ReadParams<typeof erc20IncentiveAbi, 'claims'>} [params]
176
+ * @param {?ReadParams} [params]
168
177
  * @returns {Promise<bigint>}
169
178
  */
170
179
  public async claims(params?: ReadParams<typeof erc20IncentiveAbi, 'claims'>) {
@@ -182,7 +191,7 @@ export class ERC20Incentive extends DeployableTarget<
182
191
  * @public
183
192
  * @async
184
193
  * @param {Address} address
185
- * @param {?ReadParams<typeof erc20IncentiveAbi, 'claimed'>} [params]
194
+ * @param {?ReadParams} [params]
186
195
  * @returns {Promise<boolean>}
187
196
  */
188
197
  public async claimed(
@@ -202,7 +211,7 @@ export class ERC20Incentive extends DeployableTarget<
202
211
  *
203
212
  * @public
204
213
  * @async
205
- * @param {?ReadParams<typeof erc20IncentiveAbi, 'asset'>} [params]
214
+ * @param {?ReadParams} [params]
206
215
  * @returns {Promise<Address>}
207
216
  */
208
217
  public async asset(params?: ReadParams<typeof erc20IncentiveAbi, 'asset'>) {
@@ -218,7 +227,7 @@ export class ERC20Incentive extends DeployableTarget<
218
227
  *
219
228
  * @public
220
229
  * @async
221
- * @param {?ReadParams<typeof erc20IncentiveAbi, 'strategy'>} [params]
230
+ * @param {?ReadParams} [params]
222
231
  * @returns {Promise<StrategyType>}
223
232
  */
224
233
  public strategy(
@@ -236,7 +245,7 @@ export class ERC20Incentive extends DeployableTarget<
236
245
  *
237
246
  * @public
238
247
  * @async
239
- * @param {?ReadParams<typeof erc20IncentiveAbi, 'reward'>} [params]
248
+ * @param {?ReadParams} [params]
240
249
  * @returns {Promise<bigint>}
241
250
  */
242
251
  public async reward(params?: ReadParams<typeof erc20IncentiveAbi, 'reward'>) {
@@ -252,8 +261,8 @@ export class ERC20Incentive extends DeployableTarget<
252
261
  *
253
262
  * @public
254
263
  * @async
255
- * @param {?ReadParams<typeof erc20IncentiveAbi, 'limit'>} [params]
256
- * @returns {unknown}
264
+ * @param {?ReadParams} [params]
265
+ * @returns {Promise<bigint>}
257
266
  */
258
267
  public async limit(params?: ReadParams<typeof erc20IncentiveAbi, 'limit'>) {
259
268
  return await readErc20IncentiveLimit(this._config, {
@@ -269,7 +278,7 @@ export class ERC20Incentive extends DeployableTarget<
269
278
  * @public
270
279
  * @async
271
280
  * @param {bigint} i - Index of address
272
- * @param {?ReadParams<typeof erc20IncentiveAbi, 'entries'>} [params]
281
+ * @param {?ReadParams} [params]
273
282
  * @returns {Promise<Address>}
274
283
  */
275
284
  public async entries(
@@ -290,7 +299,7 @@ export class ERC20Incentive extends DeployableTarget<
290
299
  * @public
291
300
  * @async
292
301
  * @param {ClaimPayload} payload
293
- * @param {?WriteParams<typeof erc20IncentiveAbi, 'claim'>} [params]
302
+ * @param {?WriteParams} [params]
294
303
  * @returns {Promise<boolean>} - Returns true if successfully claimed
295
304
  */
296
305
  protected async claim(
@@ -306,8 +315,8 @@ export class ERC20Incentive extends DeployableTarget<
306
315
  * @public
307
316
  * @async
308
317
  * @param {ClaimPayload} payload
309
- * @param {?WriteParams<typeof erc20IncentiveAbi, 'claim'>} [params]
310
- * @returns {Promise<boolean>} - Returns true if successfully claimed
318
+ * @param {?WriteParams} [params]
319
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed
311
320
  */
312
321
  protected async claimRaw(
313
322
  payload: ClaimPayload,
@@ -333,7 +342,7 @@ export class ERC20Incentive extends DeployableTarget<
333
342
  * @public
334
343
  * @async
335
344
  * @param {ClaimPayload} payload
336
- * @param {?WriteParams<typeof erc20IncentiveAbi, 'clawback'>} [params]
345
+ * @param {?WriteParams} [params]
337
346
  * @returns {Promise<boolean>} - True if the assets were successfully clawbacked
338
347
  */
339
348
  public async clawback(
@@ -349,8 +358,8 @@ export class ERC20Incentive extends DeployableTarget<
349
358
  * @public
350
359
  * @async
351
360
  * @param {ClaimPayload} payload
352
- * @param {?WriteParams<typeof erc20IncentiveAbi, 'clawback'>} [params]
353
- * @returns {Promise<boolean>} - True if the assets were successfully clawbacked
361
+ * @param {?WriteParams} [params]
362
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
354
363
  */
355
364
  public async clawbackRaw(
356
365
  payload: ClaimPayload,
@@ -376,8 +385,8 @@ export class ERC20Incentive extends DeployableTarget<
376
385
  * @public
377
386
  * @async
378
387
  * @param {ClaimPayload} payload
379
- * @param {?ReadParams<typeof erc20IncentiveAbi, 'isClaimable'>} [params]
380
- * @returns {unknown} = True if the incentive is claimable based on the data payload
388
+ * @param {?ReadParams} [params]
389
+ * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
381
390
  */
382
391
  public async isClaimable(
383
392
  payload: ClaimPayload,
@@ -396,7 +405,7 @@ export class ERC20Incentive extends DeployableTarget<
396
405
  *
397
406
  * @public
398
407
  * @async
399
- * @param {?WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>} [params]
408
+ * @param {?WriteParams} [params]
400
409
  * @returns {Promise<void>}
401
410
  */
402
411
  public async drawRaffle(
@@ -410,8 +419,8 @@ export class ERC20Incentive extends DeployableTarget<
410
419
  *
411
420
  * @public
412
421
  * @async
413
- * @param {?WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>} [params]
414
- * @returns {Promise<void>}
422
+ * @param {?WriteParams} [params]
423
+ * @returns {Promise<{ hash: `0x${string}`; result: void; }>}
415
424
  */
416
425
  public async drawRaffleRaw(
417
426
  params?: WriteParams<typeof erc20IncentiveAbi, 'drawRaffle'>,
@@ -452,6 +461,17 @@ export class ERC20Incentive extends DeployableTarget<
452
461
  ...this.optionallyAttachAccount(options.account),
453
462
  };
454
463
  }
464
+
465
+ /**
466
+ * Builds the claim data for the ERC20Incentive.
467
+ *
468
+ * @public
469
+ * @returns {Hash} A `zeroHash`, as ERC20Incentive doesn't require specific claim data.
470
+ * @description This function returns `zeroHash` because ERC20Incentive doesn't use any specific claim data.
471
+ */
472
+ public buildClaimData() {
473
+ return zeroHash;
474
+ }
455
475
  }
456
476
 
457
477
  /**
@@ -462,7 +482,7 @@ export class ERC20Incentive extends DeployableTarget<
462
482
  * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`
463
483
  * @param {bigint} param0.reward - The amount of the asset to distribute.
464
484
  * @param {bigint} param0.limit - How many times can this incentive be claimed.
465
- * @returns {*}
485
+ * @returns {Hex}
466
486
  */
467
487
  export function prepareERC20IncentivePayload({
468
488
  asset,