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

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 (254) 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 +2 -2
  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 +174 -41
  11. package/dist/Actions/EventAction.d.ts.map +1 -1
  12. package/dist/Actions/EventAction.js +557 -129
  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 +60 -75
  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-Btl5BdAs.cjs +3 -0
  43. package/dist/BoostCore-Btl5BdAs.cjs.map +1 -0
  44. package/dist/BoostCore-CD56zbYX.js +2641 -0
  45. package/dist/BoostCore-CD56zbYX.js.map +1 -0
  46. package/dist/BoostCore.cjs +1 -2
  47. package/dist/BoostCore.cjs.map +1 -1
  48. package/dist/BoostCore.d.ts +749 -78
  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 +164 -82
  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 +103 -221
  66. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  67. package/dist/Budgets/ManagedBudget.js +81 -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 +248 -0
  91. package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
  92. package/dist/Deployable/DeployableTargetWithRBAC.js +320 -0
  93. package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
  94. package/dist/Incentive-CcnOIc8L.cjs +2 -0
  95. package/dist/Incentive-CcnOIc8L.cjs.map +1 -0
  96. package/dist/Incentive-rM5nKznp.js +313 -0
  97. package/dist/Incentive-rM5nKznp.js.map +1 -0
  98. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  99. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  100. package/dist/Incentives/AllowListIncentive.d.ts +38 -16
  101. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  102. package/dist/Incentives/AllowListIncentive.js +43 -29
  103. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  104. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  105. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  106. package/dist/Incentives/CGDAIncentive.d.ts +234 -21
  107. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  108. package/dist/Incentives/CGDAIncentive.js +46 -32
  109. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  110. package/dist/Incentives/ERC1155Incentive.d.ts +224 -37
  111. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
  112. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  113. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  114. package/dist/Incentives/ERC20Incentive.d.ts +234 -30
  115. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  116. package/dist/Incentives/ERC20Incentive.js +62 -46
  117. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  118. package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +333 -438
  119. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
  120. package/dist/Incentives/ERC20VariableIncentive.d.ts +231 -29
  121. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  122. package/dist/Incentives/Incentive.cjs +1 -1
  123. package/dist/Incentives/Incentive.cjs.map +1 -1
  124. package/dist/Incentives/Incentive.d.ts +4 -4
  125. package/dist/Incentives/Incentive.d.ts.map +1 -1
  126. package/dist/Incentives/Incentive.js +16 -296
  127. package/dist/Incentives/Incentive.js.map +1 -1
  128. package/dist/Incentives/PointsIncentive.cjs +1 -1
  129. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  130. package/dist/Incentives/PointsIncentive.d.ts +40 -18
  131. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  132. package/dist/Incentives/PointsIncentive.js +38 -24
  133. package/dist/Incentives/PointsIncentive.js.map +1 -1
  134. package/dist/SimpleDenyList-BDXpY74P.js +133 -0
  135. package/dist/SimpleDenyList-BDXpY74P.js.map +1 -0
  136. package/dist/SimpleDenyList-DNj5qDWM.cjs +2 -0
  137. package/dist/SimpleDenyList-DNj5qDWM.cjs.map +1 -0
  138. package/dist/Validators/SignerValidator.cjs +1 -1
  139. package/dist/Validators/SignerValidator.cjs.map +1 -1
  140. package/dist/Validators/SignerValidator.d.ts +16 -16
  141. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  142. package/dist/Validators/SignerValidator.js +32 -28
  143. package/dist/Validators/SignerValidator.js.map +1 -1
  144. package/dist/Validators/Validator.cjs +1 -1
  145. package/dist/Validators/Validator.cjs.map +1 -1
  146. package/dist/Validators/Validator.d.ts +1 -1
  147. package/dist/Validators/Validator.js +2 -2
  148. package/dist/Validators/Validator.js.map +1 -1
  149. package/dist/claiming.cjs.map +1 -1
  150. package/dist/claiming.d.ts +1 -1
  151. package/dist/claiming.js.map +1 -1
  152. package/dist/componentInterfaces-BBCFkrZv.js +14 -0
  153. package/dist/componentInterfaces-BBCFkrZv.js.map +1 -0
  154. package/dist/componentInterfaces-DRI_dQ-P.cjs +2 -0
  155. package/dist/componentInterfaces-DRI_dQ-P.cjs.map +1 -0
  156. package/dist/deployments-DF_6-7hH.cjs +2 -0
  157. package/dist/deployments-DF_6-7hH.cjs.map +1 -0
  158. package/dist/deployments-fJsWblwS.js +56 -0
  159. package/dist/deployments-fJsWblwS.js.map +1 -0
  160. package/dist/deployments.json +58 -0
  161. package/dist/errors.cjs +1 -1
  162. package/dist/errors.cjs.map +1 -1
  163. package/dist/errors.d.ts +256 -20
  164. package/dist/errors.d.ts.map +1 -1
  165. package/dist/errors.js +183 -26
  166. package/dist/errors.js.map +1 -1
  167. package/dist/{generated-57_Kffpz.js → generated-CsNyWPKA.js} +3843 -2084
  168. package/dist/generated-CsNyWPKA.js.map +1 -0
  169. package/dist/generated-DHerxf1y.cjs +3 -0
  170. package/dist/generated-DHerxf1y.cjs.map +1 -0
  171. package/dist/index.cjs +1 -1
  172. package/dist/index.d.ts +5 -0
  173. package/dist/index.d.ts.map +1 -1
  174. package/dist/index.js +142 -108
  175. package/dist/index.js.map +1 -1
  176. package/dist/transfers.cjs.map +1 -1
  177. package/dist/transfers.d.ts +1 -1
  178. package/dist/transfers.js.map +1 -1
  179. package/dist/utils.cjs +1 -1
  180. package/dist/utils.cjs.map +1 -1
  181. package/dist/utils.d.ts +26 -12
  182. package/dist/utils.d.ts.map +1 -1
  183. package/dist/utils.js +38 -23
  184. package/dist/utils.js.map +1 -1
  185. package/package.json +20 -10
  186. package/src/Actions/Action.test.ts +14 -13
  187. package/src/Actions/ContractAction.test.ts +10 -10
  188. package/src/Actions/ContractAction.ts +11 -12
  189. package/src/Actions/ERC721MintAction.test.ts +6 -6
  190. package/src/Actions/ERC721MintAction.ts +14 -15
  191. package/src/Actions/EventAction.test.ts +735 -109
  192. package/src/Actions/EventAction.ts +527 -88
  193. package/src/AllowLists/AllowList.test.ts +7 -7
  194. package/src/AllowLists/AllowList.ts +5 -3
  195. package/src/AllowLists/OpenAllowList.test.ts +40 -0
  196. package/src/AllowLists/OpenAllowList.ts +45 -0
  197. package/src/AllowLists/SimpleAllowList.test.ts +4 -4
  198. package/src/AllowLists/SimpleAllowList.ts +40 -61
  199. package/src/AllowLists/SimpleDenyList.test.ts +4 -4
  200. package/src/AllowLists/SimpleDenyList.ts +41 -17
  201. package/src/Auth/PassthroughAuth.test.ts +1 -1
  202. package/src/Boost.ts +21 -24
  203. package/src/BoostCore.test.ts +361 -306
  204. package/src/BoostCore.ts +403 -220
  205. package/src/BoostRegistry.test.ts +53 -0
  206. package/src/BoostRegistry.ts +161 -40
  207. package/src/Budgets/Budget.test.ts +2 -2
  208. package/src/Budgets/Budget.ts +1 -2
  209. package/src/Budgets/ManagedBudget.test.ts +106 -19
  210. package/src/Budgets/ManagedBudget.ts +49 -321
  211. package/src/Budgets/VestingBudget.test.ts +7 -7
  212. package/src/Budgets/VestingBudget.ts +36 -106
  213. package/src/Deployable/Contract.ts +4 -5
  214. package/src/Deployable/Deployable.ts +1 -1
  215. package/src/Deployable/DeployableTarget.ts +30 -19
  216. package/src/Deployable/DeployableTargetWithRBAC.test.ts +103 -0
  217. package/src/Deployable/DeployableTargetWithRBAC.ts +447 -0
  218. package/src/Incentives/AllowListIncentive.test.ts +12 -12
  219. package/src/Incentives/AllowListIncentive.ts +30 -15
  220. package/src/Incentives/CGDAIncentive.test.ts +9 -6
  221. package/src/Incentives/CGDAIncentive.ts +39 -18
  222. package/src/Incentives/ERC1155Incentive.test.ts +3 -3
  223. package/src/Incentives/ERC1155Incentive.ts +30 -29
  224. package/src/Incentives/ERC20Incentive.test.ts +9 -6
  225. package/src/Incentives/ERC20Incentive.ts +54 -27
  226. package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
  227. package/src/Incentives/ERC20VariableCriteriaIncentive.ts +325 -0
  228. package/src/Incentives/ERC20VariableIncentive.test.ts +8 -11
  229. package/src/Incentives/ERC20VariableIncentive.ts +50 -26
  230. package/src/Incentives/Incentive.test.ts +4 -1
  231. package/src/Incentives/Incentive.ts +7 -6
  232. package/src/Incentives/PointsIncentive.test.ts +24 -25
  233. package/src/Incentives/PointsIncentive.ts +32 -17
  234. package/src/Validators/SignerValidator.test.ts +6 -6
  235. package/src/Validators/SignerValidator.ts +20 -17
  236. package/src/Validators/Validator.test.ts +2 -2
  237. package/src/Validators/Validator.ts +1 -1
  238. package/src/claiming.ts +1 -1
  239. package/src/errors.ts +345 -21
  240. package/src/index.test.ts +118 -36
  241. package/src/index.ts +5 -0
  242. package/src/transfers.ts +1 -1
  243. package/src/utils.test.ts +2 -2
  244. package/src/utils.ts +61 -12
  245. package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
  246. package/dist/componentInterfaces-CKCBwG16.cjs +0 -2
  247. package/dist/componentInterfaces-CKCBwG16.cjs.map +0 -1
  248. package/dist/componentInterfaces-DYkaxBda.js +0 -13
  249. package/dist/componentInterfaces-DYkaxBda.js.map +0 -1
  250. package/dist/generated-57_Kffpz.js.map +0 -1
  251. package/dist/generated-wKBNvm48.cjs +0 -3
  252. package/dist/generated-wKBNvm48.cjs.map +0 -1
  253. package/src/Budgets/SimpleBudget.test.ts +0 -152
  254. package/src/Budgets/SimpleBudget.ts +0 -564
@@ -21,6 +21,7 @@ import {
21
21
  type Hex,
22
22
  encodeAbiParameters,
23
23
  } from 'viem';
24
+ import { ERC20VariableIncentive as ERC20VariableIncentiveBases } from '../../dist/deployments.json';
24
25
  import type {
25
26
  DeployableOptions,
26
27
  GenericDeployableParams,
@@ -56,11 +57,17 @@ export interface ERC20VariableIncentivePayload {
56
57
  */
57
58
  reward: bigint;
58
59
  /**
59
- * How many times can this incentive be claimed.
60
+ * The total spending limit of the asset that will be distributed.
60
61
  *
61
62
  * @type {bigint}
62
63
  */
63
64
  limit: bigint;
65
+ /**
66
+ * The entity that can `clawback` funds
67
+ *
68
+ * @type {Address}
69
+ */
70
+ manager: Address;
64
71
  }
65
72
 
66
73
  /**
@@ -79,7 +86,7 @@ export type ERC20VariableIncentiveLog<
79
86
  > = GenericLog<typeof erc20VariableIncentiveAbi, event>;
80
87
 
81
88
  /**
82
- * A simple ERC20 incentive implementation that allows claiming of tokens
89
+ * A modified ERC20 incentive implementation that allows claiming of variable token amounts with a spending limit
83
90
  *
84
91
  * @export
85
92
  * @class ERC20VariableIncentive
@@ -96,10 +103,12 @@ export class ERC20VariableIncentive extends DeployableTarget<
96
103
  *
97
104
  * @public
98
105
  * @static
99
- * @type {Address}
106
+ * @type {Record<number, Address>}
100
107
  */
101
- public static override base: Address = import.meta.env
102
- .VITE_ERC20_VARIABLE_INCENTIVE_BASE;
108
+ public static override bases: Record<number, Address> = {
109
+ 31337: import.meta.env.VITE_ERC20_VARIABLE_INCENTIVE_BASE,
110
+ ...(ERC20VariableIncentiveBases as Record<number, Address>),
111
+ };
103
112
  /**
104
113
  * @inheritdoc
105
114
  *
@@ -114,8 +123,8 @@ export class ERC20VariableIncentive extends DeployableTarget<
114
123
  *
115
124
  * @public
116
125
  * @async
117
- * @param {?ReadParams<typeof erc20VariableIncentiveAbi, 'owner'>} [params]
118
- * @returns {unknown}
126
+ * @param {?ReadParams} [params]
127
+ * @returns {Promise<Address>}
119
128
  */
120
129
  public async owner(
121
130
  params?: ReadParams<typeof erc20VariableIncentiveAbi, 'owner'>,
@@ -129,12 +138,12 @@ export class ERC20VariableIncentive extends DeployableTarget<
129
138
  }
130
139
 
131
140
  /**
132
- * The current reward
141
+ * The total amount of rewards claimed
133
142
  *
134
143
  * @public
135
144
  * @async
136
- * @param {?ReadParams<typeof erc20VariableIncentiveAbi, 'currentReward'>} [params]
137
- * @returns {Promise<bigint>} - The current reward
145
+ * @param {?ReadParams} [params]
146
+ * @returns {Promise<bigint>}
138
147
  */
139
148
  public async totalClaimed(
140
149
  params?: ReadParams<typeof erc20VariableIncentiveAbi, 'totalClaimed'>,
@@ -152,7 +161,7 @@ export class ERC20VariableIncentive extends DeployableTarget<
152
161
  *
153
162
  * @public
154
163
  * @async
155
- * @param {?ReadParams<typeof erc20VariableIncentiveAbi, 'currentReward'>} [params]
164
+ * @param {?ReadParams} [params]
156
165
  * @returns {Promise<bigint>} - The current reward
157
166
  */
158
167
  public async currentReward(
@@ -171,7 +180,7 @@ export class ERC20VariableIncentive extends DeployableTarget<
171
180
  *
172
181
  * @public
173
182
  * @async
174
- * @param {?ReadParams<typeof erc20VariableIncentiveAbi, 'claims'>} [params]
183
+ * @param {?ReadParams} [params]
175
184
  * @returns {Promise<bigint>}
176
185
  */
177
186
  public async claims(
@@ -191,7 +200,7 @@ export class ERC20VariableIncentive extends DeployableTarget<
191
200
  * @public
192
201
  * @async
193
202
  * @param {Address} address
194
- * @param {?ReadParams<typeof erc20VariableIncentiveAbi, 'claimed'>} [params]
203
+ * @param {?ReadParams} [params]
195
204
  * @returns {Promise<boolean>}
196
205
  */
197
206
  public async claimed(
@@ -211,7 +220,7 @@ export class ERC20VariableIncentive extends DeployableTarget<
211
220
  *
212
221
  * @public
213
222
  * @async
214
- * @param {?ReadParams<typeof erc20VariableIncentiveAbi, 'asset'>} [params]
223
+ * @param {?ReadParams} [params]
215
224
  * @returns {Promise<Address>}
216
225
  */
217
226
  public async asset(
@@ -229,7 +238,7 @@ export class ERC20VariableIncentive extends DeployableTarget<
229
238
  *
230
239
  * @public
231
240
  * @async
232
- * @param {?ReadParams<typeof erc20VariableIncentiveAbi, 'reward'>} [params]
241
+ * @param {?ReadParams} [params]
233
242
  * @returns {Promise<bigint>}
234
243
  */
235
244
  public async reward(
@@ -247,8 +256,8 @@ export class ERC20VariableIncentive extends DeployableTarget<
247
256
  *
248
257
  * @public
249
258
  * @async
250
- * @param {?ReadParams<typeof erc20VariableIncentiveAbi, 'limit'>} [params]
251
- * @returns {unknown}
259
+ * @param {?ReadParams} [params]
260
+ * @returns {Promise<bigint>}
252
261
  */
253
262
  public async limit(
254
263
  params?: ReadParams<typeof erc20VariableIncentiveAbi, 'limit'>,
@@ -266,7 +275,7 @@ export class ERC20VariableIncentive extends DeployableTarget<
266
275
  * @public
267
276
  * @async
268
277
  * @param {ClaimPayload} payload
269
- * @param {?WriteParams<typeof erc20VariableIncentiveAbi, 'claim'>} [params]
278
+ * @param {?WriteParams} [params]
270
279
  * @returns {Promise<boolean>} - Returns true if successfully claimed
271
280
  */
272
281
  protected async claim(
@@ -282,8 +291,8 @@ export class ERC20VariableIncentive extends DeployableTarget<
282
291
  * @public
283
292
  * @async
284
293
  * @param {ClaimPayload} payload
285
- * @param {?WriteParams<typeof erc20VariableIncentiveAbi, 'claim'>} [params]
286
- * @returns {Promise<boolean>} - Returns true if successfully claimed
294
+ * @param {?WriteParams} [params]
295
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed
287
296
  */
288
297
  protected async claimRaw(
289
298
  payload: ClaimPayload,
@@ -309,7 +318,7 @@ export class ERC20VariableIncentive extends DeployableTarget<
309
318
  * @public
310
319
  * @async
311
320
  * @param {ClaimPayload} payload
312
- * @param {?WriteParams<typeof erc20VariableIncentiveAbi, 'clawback'>} [params]
321
+ * @param {?WriteParams} [params]
313
322
  * @returns {Promise<boolean>} - True if the assets were successfully clawbacked
314
323
  */
315
324
  public async clawback(
@@ -325,8 +334,8 @@ export class ERC20VariableIncentive extends DeployableTarget<
325
334
  * @public
326
335
  * @async
327
336
  * @param {ClaimPayload} payload
328
- * @param {?WriteParams<typeof erc20VariableIncentiveAbi, 'clawback'>} [params]
329
- * @returns {Promise<boolean>} - True if the assets were successfully clawbacked
337
+ * @param {?WriteParams} [params]
338
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
330
339
  */
331
340
  public async clawbackRaw(
332
341
  payload: ClaimPayload,
@@ -355,8 +364,8 @@ export class ERC20VariableIncentive extends DeployableTarget<
355
364
  * @public
356
365
  * @async
357
366
  * @param {ClaimPayload} payload
358
- * @param {?ReadParams<typeof erc20VariableIncentiveAbi, 'isClaimable'>} [params]
359
- * @returns {unknown} = True if the incentive is claimable based on the data payload
367
+ * @param {?ReadParams} [params]
368
+ * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
360
369
  */
361
370
  public async isClaimable(
362
371
  payload: ClaimPayload,
@@ -370,6 +379,21 @@ export class ERC20VariableIncentive extends DeployableTarget<
370
379
  });
371
380
  }
372
381
 
382
+ /**
383
+ * Builds the claim data for the ERC20VariableIncentive.
384
+ *
385
+ * @public
386
+ * @param {bigint} rewardAmount
387
+ * @returns {Hex} Returns the encoded claim data
388
+ * @description This function returns the encoded claim data for the ERC20VariableIncentive.
389
+ */
390
+ public buildClaimData(rewardAmount: bigint) {
391
+ return encodeAbiParameters(
392
+ [{ type: 'uint256', name: 'rewardAmount' }],
393
+ [rewardAmount],
394
+ );
395
+ }
396
+
373
397
  /**
374
398
  * @inheritdoc
375
399
  *
@@ -402,7 +426,7 @@ export class ERC20VariableIncentive extends DeployableTarget<
402
426
  * @param {Address} param0.asset - The address of the incentivized asset.
403
427
  * @param {bigint} param0.reward - The amount of the asset to distribute.
404
428
  * @param {bigint} param0.limit - How many times can this incentive be claimed.
405
- * @returns {*}
429
+ * @returns {Hex}
406
430
  */
407
431
  export function prepareERC20VariableIncentivePayload({
408
432
  asset,
@@ -1,6 +1,6 @@
1
1
  import { zeroAddress } from 'viem';
2
2
  import { describe, expect, test } from 'vitest';
3
- import { defaultOptions } from '../../test/helpers';
3
+ import { defaultOptions } from '@boostxyz/test/helpers';
4
4
  import { StrategyType } from '../claiming';
5
5
  import {
6
6
  AllowListIncentive,
@@ -49,6 +49,7 @@ describe('Incentive', () => {
49
49
  totalBudget: 10n,
50
50
  rewardBoost: 1n,
51
51
  rewardDecay: 1n,
52
+ manager: zeroAddress,
52
53
  });
53
54
  await incentive.deploy();
54
55
  expect(
@@ -65,6 +66,7 @@ describe('Incentive', () => {
65
66
  strategy: StrategyType.POOL,
66
67
  reward: 1n,
67
68
  limit: 10n,
69
+ manager: zeroAddress,
68
70
  });
69
71
  await incentive.deploy();
70
72
  expect(
@@ -80,6 +82,7 @@ describe('Incentive', () => {
80
82
  asset: zeroAddress,
81
83
  reward: 1n,
82
84
  limit: 10n,
85
+ manager: zeroAddress,
83
86
  });
84
87
  await incentive.deploy();
85
88
  expect(
@@ -13,6 +13,7 @@ import { InvalidComponentInterfaceError } from '../errors';
13
13
  import { AllowListIncentive } from './AllowListIncentive';
14
14
  import { CGDAIncentive } from './CGDAIncentive';
15
15
  import { ERC20Incentive } from './ERC20Incentive';
16
+ import type { ERC20VariableCriteriaIncentive } from './ERC20VariableCriteriaIncentive';
16
17
  import { ERC20VariableIncentive } from './ERC20VariableIncentive';
17
18
  // import { ERC1155Incentive } from './ERC1155Incentive';
18
19
  import { PointsIncentive } from './PointsIncentive';
@@ -38,19 +39,19 @@ export type Incentive =
38
39
  | ERC20Incentive
39
40
  // | ERC1155Incentive
40
41
  | PointsIncentive
41
- | ERC20VariableIncentive;
42
+ | ERC20VariableIncentive
43
+ | ERC20VariableCriteriaIncentive;
42
44
 
43
45
  /**
44
46
  * A map of Incentive component interfaces to their constructors.
45
47
  *
46
- * @type {{ "0xc5b24b8e": typeof PointsIncentive; "0x8c901437": typeof ERC20Incentive; "0x0a466e6f": typeof AllowListIncentive; "0xa39e44d9": typeof CGDAIncentive; "0x6060409d": typeof ERC20VariableIncentive }}
48
+ * @type {{ "0xc5b24b8e": typeof PointsIncentive; "0x8c901437": typeof ERC20Incentive; "0x4414fbb4": typeof AllowListIncentive; "0xa39e44d9": typeof CGDAIncentive; "0xa8e4af1e": typeof ERC20VariableIncentive }}
47
49
  */
48
50
  export const IncentiveByComponentInterface = {
49
51
  [APointsIncentive as Hex]: PointsIncentive,
50
52
  [AERC20Incentive as Hex]: ERC20Incentive,
51
- // TODO: figure out why evm generates bad bytes4 here
52
- ['0x0a466e6f']: AllowListIncentive,
53
- // [APointsIncentive as Hex]: ERC1155Incentive,
53
+ [AAllowListIncentive]: AllowListIncentive,
54
+ // [AERC1155Incentive as Hex]: ERC1155Incentive,
54
55
  [ACGDAIncentive as Hex]: CGDAIncentive,
55
56
  [AERC20VariableIncentive as Hex]: ERC20VariableIncentive,
56
57
  };
@@ -62,7 +63,7 @@ export const IncentiveByComponentInterface = {
62
63
  * @async
63
64
  * @param {DeployableOptions} options
64
65
  * @param {Address} address
65
- * @returns {unknown}
66
+ * @returns {Incentive}
66
67
  * @throws {@link InvalidComponentInterfaceError}
67
68
  */
68
69
  export async function incentiveFromAddress(
@@ -1,34 +1,34 @@
1
- import { readPointsBalanceOf, writePointsGrantRoles } from '@boostxyz/evm';
2
- import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
3
- import { isAddress, pad, parseEther, zeroAddress } from 'viem';
4
- import { beforeAll, beforeEach, describe, expect, test } from 'vitest';
5
- import type { MockPoints } from '../../test/MockPoints';
6
- import { accounts } from '../../test/accounts';
1
+ import { readPointsBalanceOf, writePointsGrantRoles } from "@boostxyz/evm";
2
+ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
3
+ import { isAddress, pad, parseEther, zeroAddress } from "viem";
4
+ import { beforeAll, beforeEach, describe, expect, test } from "vitest";
5
+ import type { MockPoints } from "@boostxyz/test/MockPoints";
6
+ import { accounts } from "@boostxyz/test/accounts";
7
7
  import {
8
8
  type Fixtures,
9
9
  defaultOptions,
10
10
  deployFixtures,
11
11
  freshBoost,
12
12
  freshPoints,
13
- } from '../../test/helpers';
14
- import { bytes4 } from '../utils';
15
- import { PointsIncentive } from './PointsIncentive';
13
+ } from "@boostxyz/test/helpers";
14
+ import { bytes4 } from "../utils";
15
+ import { PointsIncentive } from "./PointsIncentive";
16
16
 
17
17
  let fixtures: Fixtures, points: MockPoints;
18
18
 
19
- describe('PointsIncentive', () => {
19
+ describe("PointsIncentive", () => {
20
20
  beforeAll(async () => {
21
- fixtures = await loadFixture(deployFixtures);
21
+ fixtures = await loadFixture(deployFixtures(defaultOptions));
22
22
  });
23
23
 
24
24
  beforeEach(async () => {
25
25
  points = await loadFixture(freshPoints);
26
26
  });
27
27
 
28
- test('can successfully be deployed', async () => {
28
+ test("can successfully be deployed", async () => {
29
29
  const action = new PointsIncentive(defaultOptions, {
30
30
  venue: zeroAddress,
31
- selector: '0xdeadb33f',
31
+ selector: "0xdeadb33f",
32
32
  reward: 1n,
33
33
  limit: 1n,
34
34
  });
@@ -36,14 +36,14 @@ describe('PointsIncentive', () => {
36
36
  expect(isAddress(action.assertValidAddress())).toBe(true);
37
37
  });
38
38
 
39
- test('can claim', async () => {
39
+ test("can claim", async () => {
40
40
  // biome-ignore lint/style/noNonNullAssertion: we know this is defined
41
41
  const referrer = accounts.at(1)!.account!;
42
42
  // biome-ignore lint/style/noNonNullAssertion: we know this is defined
43
43
  const trustedSigner = accounts.at(0)!;
44
- const pointsIncentive = new fixtures.bases.PointsIncentive(defaultOptions, {
44
+ const pointsIncentive = fixtures.core.PointsIncentive({
45
45
  venue: points.assertValidAddress(),
46
- selector: bytes4('issue(address,uint256)'),
46
+ selector: bytes4("issue(address,uint256)"),
47
47
  reward: 1n,
48
48
  limit: 10n,
49
49
  });
@@ -52,7 +52,7 @@ describe('PointsIncentive', () => {
52
52
  });
53
53
 
54
54
  const claimant = trustedSigner.account;
55
- const incentiveData = pad('0xdef456232173821931823712381232131391321934');
55
+ const incentiveData = pad("0xdef456232173821931823712381232131391321934");
56
56
  const incentiveQuantity = 1;
57
57
  const claimDataPayload = await boost.validator.encodeClaimData({
58
58
  signer: trustedSigner,
@@ -72,8 +72,7 @@ describe('PointsIncentive', () => {
72
72
  boost.id,
73
73
  0n,
74
74
  referrer,
75
- claimDataPayload,
76
- { value: parseEther('0.000075') },
75
+ claimDataPayload
77
76
  );
78
77
  expect(
79
78
  await readPointsBalanceOf(defaultOptions.config, {
@@ -83,16 +82,16 @@ describe('PointsIncentive', () => {
83
82
  ).toBe(1n);
84
83
  });
85
84
 
86
- test('cannot claim twice', async () => {
85
+ test("cannot claim twice", async () => {
87
86
  const reward = 1n;
88
87
  // biome-ignore lint/style/noNonNullAssertion: we know this is defined
89
88
  const referrer = accounts.at(1)!.account!;
90
89
  // biome-ignore lint/style/noNonNullAssertion: we know this is defined
91
90
  const trustedSigner = accounts.at(0)!;
92
91
 
93
- const pointsIncentive = new fixtures.bases.PointsIncentive(defaultOptions, {
92
+ const pointsIncentive = fixtures.core.PointsIncentive({
94
93
  venue: points.assertValidAddress(),
95
- selector: bytes4('issue(address,uint256)'),
94
+ selector: bytes4("issue(address,uint256)"),
96
95
  reward,
97
96
  limit: 10n,
98
97
  });
@@ -101,7 +100,7 @@ describe('PointsIncentive', () => {
101
100
  });
102
101
 
103
102
  const claimant = trustedSigner.account;
104
- const incentiveData = pad('0xdef456232173821931823712381232131391321934');
103
+ const incentiveData = pad("0xdef456232173821931823712381232131391321934");
105
104
  const incentiveQuantity = 1;
106
105
  const claimDataPayload = await boost.validator.encodeClaimData({
107
106
  signer: trustedSigner,
@@ -122,7 +121,7 @@ describe('PointsIncentive', () => {
122
121
  0n,
123
122
  referrer,
124
123
  claimDataPayload,
125
- { value: parseEther('0.000075') },
124
+ { value: parseEther("0.000075") },
126
125
  );
127
126
  try {
128
127
  await fixtures.core.claimIncentive(
@@ -130,7 +129,7 @@ describe('PointsIncentive', () => {
130
129
  0n,
131
130
  referrer,
132
131
  claimDataPayload,
133
- { value: parseEther('0.000075') },
132
+ { value: parseEther("0.000075") },
134
133
  );
135
134
  } catch (e) {
136
135
  expect(e).toBeInstanceOf(Error);
@@ -17,7 +17,9 @@ import {
17
17
  type ContractEventName,
18
18
  type Hex,
19
19
  encodeAbiParameters,
20
+ zeroHash,
20
21
  } from 'viem';
22
+ import { PointsIncentive as PointsIncentiveBases } from '../../dist/deployments.json';
21
23
  import type {
22
24
  DeployableOptions,
23
25
  GenericDeployableParams,
@@ -105,10 +107,12 @@ export class PointsIncentive extends DeployableTarget<
105
107
  *
106
108
  * @public
107
109
  * @static
108
- * @type {Address}
110
+ * @type {Record<number, Address>}
109
111
  */
110
- public static override base: Address = import.meta.env
111
- .VITE_POINTS_INCENTIVE_BASE;
112
+ public static override bases: Record<number, Address> = {
113
+ 31337: import.meta.env.VITE_POINTS_INCENTIVE_BASE,
114
+ ...(PointsIncentiveBases as Record<number, Address>),
115
+ };
112
116
  /**
113
117
  * @inheritdoc
114
118
  *
@@ -123,7 +127,7 @@ export class PointsIncentive extends DeployableTarget<
123
127
  *
124
128
  * @public
125
129
  * @async
126
- * @param {?ReadParams<typeof erc20IncentiveAbi, 'claims'>} [params]
130
+ * @param {?ReadParams} [params]
127
131
  * @returns {Promise<bigint>}
128
132
  */
129
133
  public async claims(
@@ -142,7 +146,7 @@ export class PointsIncentive extends DeployableTarget<
142
146
  *
143
147
  * @public
144
148
  * @async
145
- * @param {?ReadParams<typeof erc20IncentiveAbi, 'currentReward'>} [params]
149
+ * @param {?ReadParams} [params]
146
150
  * @returns {Promise<bigint>} - The current reward
147
151
  */
148
152
  public async currentReward(
@@ -161,8 +165,8 @@ export class PointsIncentive extends DeployableTarget<
161
165
  *
162
166
  * @public
163
167
  * @async
164
- * @param {?ReadParams<typeof pointsIncentiveAbi, 'reward'>} [params]
165
- * @returns {unknown}
168
+ * @param {?ReadParams} [params]
169
+ * @returns {Promise<bigint>} The reward amount issued for each claim
166
170
  */
167
171
  public async reward(
168
172
  params?: ReadParams<typeof pointsIncentiveAbi, 'reward'>,
@@ -181,8 +185,8 @@ export class PointsIncentive extends DeployableTarget<
181
185
  * @public
182
186
  * @async
183
187
  * @param {Address} address
184
- * @param {?ReadParams<typeof pointsIncentiveAbi, 'claimed'>} [params]
185
- * @returns {unknown}
188
+ * @param {?ReadParams} [params]
189
+ * @returns {Promise<boolean>}
186
190
  */
187
191
  public async claimed(
188
192
  address: Address,
@@ -201,8 +205,8 @@ export class PointsIncentive extends DeployableTarget<
201
205
  *
202
206
  * @public
203
207
  * @async
204
- * @param {?ReadParams<typeof pointsIncentiveAbi, 'venue'>} [params]
205
- * @returns {unknown}
208
+ * @param {?ReadParams} [params]
209
+ * @returns {Promise<Address>}
206
210
  */
207
211
  public async venue(params?: ReadParams<typeof pointsIncentiveAbi, 'venue'>) {
208
212
  return await readPointsIncentiveVenue(this._config, {
@@ -217,7 +221,7 @@ export class PointsIncentive extends DeployableTarget<
217
221
  *
218
222
  * @public
219
223
  * @async
220
- * @param {?ReadParams<typeof pointsIncentiveAbi, 'limit'>} [params]
224
+ * @param {?ReadParams} [params]
221
225
  * @returns {Promise<bigint>}
222
226
  */
223
227
  public async limit(params?: ReadParams<typeof pointsIncentiveAbi, 'limit'>) {
@@ -233,7 +237,7 @@ export class PointsIncentive extends DeployableTarget<
233
237
  *
234
238
  * @public
235
239
  * @async
236
- * @param {?ReadParams<typeof pointsIncentiveAbi, 'selector'>} [params]
240
+ * @param {?ReadParams} [params]
237
241
  * @returns {Promise<Hex>}
238
242
  */
239
243
  public async selector(
@@ -252,7 +256,7 @@ export class PointsIncentive extends DeployableTarget<
252
256
  * @public
253
257
  * @async
254
258
  * @param {ClaimPayload} payload
255
- * @param {?WriteParams<typeof pointsIncentiveAbi, 'claim'>} [params]
259
+ * @param {?WriteParams} [params]
256
260
  * @returns {Promise<boolean>} - True if the incentive was successfully claimed
257
261
  */
258
262
  protected async claim(
@@ -268,8 +272,8 @@ export class PointsIncentive extends DeployableTarget<
268
272
  * @public
269
273
  * @async
270
274
  * @param {ClaimPayload} payload
271
- * @param {?WriteParams<typeof pointsIncentiveAbi, 'claim'>} [params]
272
- * @returns {Promise<boolean>} - True if the incentive was successfully claimed
275
+ * @param {?WriteParams} [params]
276
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the incentive was successfully claimed
273
277
  */
274
278
  protected async claimRaw(
275
279
  payload: ClaimPayload,
@@ -297,7 +301,7 @@ export class PointsIncentive extends DeployableTarget<
297
301
  * @public
298
302
  * @async
299
303
  * @param {ClaimPayload} payload
300
- * @param {?ReadParams<typeof pointsIncentiveAbi, 'isClaimable'>} [params]
304
+ * @param {?ReadParams} [params]
301
305
  * @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload
302
306
  */
303
307
  public async isClaimable(
@@ -335,6 +339,17 @@ export class PointsIncentive extends DeployableTarget<
335
339
  ...this.optionallyAttachAccount(options.account),
336
340
  };
337
341
  }
342
+
343
+ /**
344
+ * Builds the claim data for the PointsIncentive.
345
+ *
346
+ * @public
347
+ * @returns {Hash} A `zeroHash`, as PointsIncentive doesn't require specific claim data.
348
+ * @description This function returns `zeroHash` because PointsIncentive doesn't use any specific claim data.
349
+ */
350
+ public buildClaimData() {
351
+ return zeroHash;
352
+ }
338
353
  }
339
354
 
340
355
  /**
@@ -1,13 +1,13 @@
1
1
  import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
2
2
  import { isAddress, pad } from 'viem';
3
3
  import { beforeAll, describe, expect, test } from 'vitest';
4
- import { accounts } from '../../test/accounts';
4
+ import { accounts } from '@boostxyz/test/accounts';
5
5
  import {
6
6
  type Fixtures,
7
7
  defaultOptions,
8
8
  deployFixtures,
9
- } from '../../test/helpers';
10
- import { testAccount } from '../../test/viem';
9
+ } from '@boostxyz/test/helpers';
10
+ import { testAccount } from '@boostxyz/test/viem';
11
11
  import { SignerValidator } from './SignerValidator';
12
12
 
13
13
  let fixtures: Fixtures;
@@ -16,9 +16,9 @@ function freshValidator(fixtures: Fixtures) {
16
16
  return function freshValidator() {
17
17
  // biome-ignore lint/style/noNonNullAssertion: this will never be undefined
18
18
  const account = accounts.at(1)!.account;
19
- return fixtures.registry.clone(
19
+ return fixtures.registry.initialize(
20
20
  crypto.randomUUID(),
21
- new fixtures.bases.SignerValidator(defaultOptions, {
21
+ fixtures.core.SignerValidator({
22
22
  signers: [defaultOptions.account.address, account],
23
23
  validatorCaller: testAccount.address,
24
24
  }),
@@ -28,7 +28,7 @@ function freshValidator(fixtures: Fixtures) {
28
28
 
29
29
  describe('SignerValidator', () => {
30
30
  beforeAll(async () => {
31
- fixtures = await loadFixture(deployFixtures);
31
+ fixtures = await loadFixture(deployFixtures(defaultOptions));
32
32
  });
33
33
 
34
34
  test('can successfully be deployed', async () => {