@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
package/src/BoostCore.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  boostCoreAbi,
3
3
  type iAuthAbi,
4
- readBoostCoreClaimFee,
5
4
  readBoostCoreCreateBoostAuth,
6
5
  readBoostCoreGetBoost,
7
6
  readBoostCoreGetBoostCount,
@@ -10,17 +9,22 @@ import {
10
9
  readIAuthIsAuthorized,
11
10
  simulateBoostCoreClaimIncentive,
12
11
  simulateBoostCoreClaimIncentiveFor,
13
- simulateBoostCoreSetClaimFee,
12
+ simulateBoostCoreCreateBoost,
14
13
  simulateBoostCoreSetCreateBoostAuth,
15
14
  simulateBoostCoreSetProtocolFeeReceiver,
16
15
  writeBoostCoreClaimIncentive,
17
16
  writeBoostCoreClaimIncentiveFor,
18
- writeBoostCoreSetClaimFee,
19
17
  writeBoostCoreSetCreateBoostAuth,
20
18
  writeBoostCoreSetProtocolFeeReceiver,
21
19
  } from '@boostxyz/evm';
22
20
  import { bytecode } from '@boostxyz/evm/artifacts/contracts/BoostCore.sol/BoostCore.json';
23
- import { getAccount, waitForTransactionReceipt } from '@wagmi/core';
21
+ import {
22
+ type GetTransactionReceiptParameters,
23
+ getAccount,
24
+ getTransactionReceipt,
25
+ waitForTransactionReceipt,
26
+ } from '@wagmi/core';
27
+ import type { SimulateContractReturnType } from '@wagmi/core/actions';
24
28
  import { createWriteContract } from '@wagmi/core/codegen';
25
29
  import {
26
30
  type Address,
@@ -31,9 +35,11 @@ import {
31
35
  zeroAddress,
32
36
  zeroHash,
33
37
  } from 'viem';
38
+ import { BoostCore as BoostCoreBases } from '../dist/deployments.json';
34
39
  import { type Action, actionFromAddress } from './Actions/Action';
35
40
  import { EventAction, type EventActionPayload } from './Actions/EventAction';
36
41
  import { type AllowList, allowListFromAddress } from './AllowLists/AllowList';
42
+ import { OpenAllowList } from './AllowLists/OpenAllowList';
37
43
  import {
38
44
  SimpleAllowList,
39
45
  type SimpleAllowListPayload,
@@ -46,6 +52,7 @@ import { type Auth, PassthroughAuth } from './Auth/Auth';
46
52
  import {
47
53
  Boost,
48
54
  type BoostPayload,
55
+ type RawBoost,
49
56
  type Target,
50
57
  prepareBoostPayload,
51
58
  } from './Boost';
@@ -72,6 +79,10 @@ import {
72
79
  ERC20Incentive,
73
80
  type ERC20IncentivePayload,
74
81
  } from './Incentives/ERC20Incentive';
82
+ import {
83
+ ERC20VariableCriteriaIncentive,
84
+ type ERC20VariableCriteriaIncentivePayload,
85
+ } from './Incentives/ERC20VariableCriteriaIncentive';
75
86
  import type { ERC20VariableIncentivePayload } from './Incentives/ERC20VariableIncentive';
76
87
  import {
77
88
  ERC20VariableIncentive,
@@ -89,13 +100,24 @@ import {
89
100
  import { type Validator, validatorFromAddress } from './Validators/Validator';
90
101
  import {
91
102
  BoostCoreNoIdentifierEmitted,
103
+ BoostNotFoundError,
92
104
  BudgetMustAuthorizeBoostCore,
93
105
  DeployableUnknownOwnerProvidedError,
94
106
  IncentiveNotCloneableError,
95
107
  MustInitializeBudgetError,
96
108
  } from './errors';
97
- import type { GenericLog, ReadParams, WriteParams } from './utils';
109
+ import {
110
+ type GenericLog,
111
+ type ReadParams,
112
+ type WriteParams,
113
+ assertValidAddressByChainId,
114
+ } from './utils';
98
115
 
116
+ /**
117
+ * The ABI of the BoostCore contract, if needed for low level operations
118
+ *
119
+ * @type {typeof boostCoreAbi}
120
+ */
99
121
  export { boostCoreAbi };
100
122
 
101
123
  /**
@@ -106,13 +128,24 @@ export { boostCoreAbi };
106
128
  export const BOOST_CORE_CLAIM_FEE = parseEther('0.000075');
107
129
 
108
130
  /**
109
- * The fixed address for the deployed Boost Core.
110
- * By default, `new BoostCore` will use this address if not otherwise provided.
131
+ * The address of the deployed BoostCore instance. In prerelease mode, this will be its sepolia address
111
132
  *
112
133
  * @type {Address}
113
134
  */
114
- export const BOOST_CORE_ADDRESS: Address = import.meta.env
115
- .VITE_BOOST_CORE_ADDRESS;
135
+ export const BOOST_CORE_ADDRESS =
136
+ (BoostCoreBases as Record<string, Address>)[__DEFAULT_CHAIN_ID__] ||
137
+ zeroAddress;
138
+
139
+ /**
140
+ * The fixed addresses for the deployed Boost Core.
141
+ * By default, `new BoostCore` will use the address deployed to the currently connected chain, or `BOOST_CORE_ADDRESS` if not provided.
142
+ *
143
+ * @type {Record<number, Address>}
144
+ */
145
+ export const BOOST_CORE_ADDRESSES: Record<number, Address> = {
146
+ ...(BoostCoreBases as Record<number, Address>),
147
+ 31337: import.meta.env.VITE_BOOST_CORE_ADDRESS,
148
+ };
116
149
 
117
150
  /**
118
151
  * A generic `viem.Log` event with support for `BoostCore` event types.
@@ -210,11 +243,10 @@ export type BoostCoreConfig =
210
243
  export type CreateBoostPayload = {
211
244
  budget: Budget;
212
245
  action: Action;
213
- validator: Validator;
246
+ validator?: Validator;
214
247
  allowList: AllowList;
215
248
  incentives: Array<Incentive>;
216
249
  protocolFee?: bigint;
217
- referralFee?: bigint;
218
250
  maxParticipants?: bigint;
219
251
  owner?: Address;
220
252
  };
@@ -231,6 +263,26 @@ export class BoostCore extends Deployable<
231
263
  [Address, Address],
232
264
  typeof boostCoreAbi
233
265
  > {
266
+ /**
267
+ * A static property representing a map of stringified chain ID's to the address of the deployed implementation on chain
268
+ *
269
+ * @static
270
+ * @readonly
271
+ * @type {Record<string, Address>}
272
+ */
273
+ static readonly addresses: Record<number, Address> = BOOST_CORE_ADDRESSES;
274
+
275
+ /**
276
+ * A getter that will return Boost core's static addresses by numerical chain ID
277
+ *
278
+ * @public
279
+ * @readonly
280
+ * @type {Record<number, Address>}
281
+ */
282
+ public get addresses(): Record<number, Address> {
283
+ return (this.constructor as typeof BoostCore).addresses;
284
+ }
285
+
234
286
  /**
235
287
  * Creates an instance of BoostCore.
236
288
  *
@@ -249,63 +301,155 @@ export class BoostCore extends Deployable<
249
301
  options.protocolFeeReceiver,
250
302
  ]);
251
303
  } else {
252
- super({ account, config }, BOOST_CORE_ADDRESS);
304
+ const { address } = assertValidAddressByChainId(
305
+ config,
306
+ BOOST_CORE_ADDRESSES,
307
+ );
308
+ super({ account, config }, address);
253
309
  }
254
310
  //@ts-expect-error I can't set this property on the class because for some reason it takes super out of constructor scope?
255
311
  this.abi = boostCoreAbi;
256
312
  }
313
+
257
314
  /**
258
315
  * Create a new Boost.
259
316
  *
260
317
  * @public
261
318
  * @async
262
319
  * @param {CreateBoostPayload} _boostPayload
263
- * @param {?DeployableOptions} [_options]
264
- * @returns {Boost}
320
+ * @param {?DeployableOptions} [_params]
321
+ * @returns {Promise<Boost>}
265
322
  */
266
323
  public async createBoost(
267
324
  _boostPayload: CreateBoostPayload,
268
- _options?: DeployableOptions,
325
+ _params?: DeployableOptions &
326
+ WriteParams<typeof boostCoreAbi, 'createBoost'>,
269
327
  ) {
270
- const coreAddress = this.assertValidAddress();
271
328
  const [payload, options] =
272
- this.validateDeploymentConfig<CreateBoostPayload>(
273
- _boostPayload,
274
- _options,
275
- );
276
-
277
- let {
278
- budget,
279
- action,
280
- validator,
281
- allowList,
282
- incentives,
283
- protocolFee = 0n,
284
- referralFee = 0n,
285
- maxParticipants = 0n,
286
- owner,
287
- } = payload;
329
+ this.validateDeploymentConfig<CreateBoostPayload>(_boostPayload, _params);
330
+ const desiredChainId = _params?.chain?.id || _params?.chainId;
331
+ const { chainId, address: coreAddress } = assertValidAddressByChainId(
332
+ options.config,
333
+ this.addresses,
334
+ desiredChainId,
335
+ );
288
336
 
289
337
  const boostFactory = createWriteContract({
290
338
  abi: boostCoreAbi,
291
339
  functionName: 'createBoost',
292
- address: this.address,
340
+ address: coreAddress,
293
341
  });
294
342
 
295
- if (!owner) {
296
- owner =
343
+ const onChainPayload = await this.prepareCreateBoostPayload(
344
+ coreAddress,
345
+ chainId,
346
+ payload,
347
+ options,
348
+ );
349
+
350
+ const boostHash = await boostFactory(options.config, {
351
+ ...this.optionallyAttachAccount(options.account),
352
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
353
+ ...(_params as any),
354
+ chainId,
355
+ args: [prepareBoostPayload(onChainPayload)],
356
+ });
357
+ const receipt = await waitForTransactionReceipt(options.config, {
358
+ hash: boostHash,
359
+ });
360
+ const boostCreatedLog = parseEventLogs({
361
+ abi: boostCoreAbi,
362
+ eventName: 'BoostCreated',
363
+ logs: receipt.logs,
364
+ }).at(0);
365
+ let boostId = 0n;
366
+ if (!boostCreatedLog) throw new BoostCoreNoIdentifierEmitted();
367
+ boostId = boostCreatedLog?.args.boostId;
368
+ const boost = await this.readBoost(boostId);
369
+ return new Boost({
370
+ id: boostId,
371
+ budget: payload.budget.at(boost.budget),
372
+ action: payload.action.at(boost.action),
373
+ validator: payload.validator!.at(boost.validator),
374
+ allowList: payload.allowList.at(boost.allowList),
375
+ incentives: payload.incentives.map((incentive, i) =>
376
+ // biome-ignore lint/style/noNonNullAssertion: this will never be undefined
377
+ incentive.at(boost.incentives.at(i)!),
378
+ ),
379
+ protocolFee: boost.protocolFee,
380
+ maxParticipants: boost.maxParticipants,
381
+ owner: boost.owner,
382
+ });
383
+ }
384
+
385
+ /**
386
+ * Returns a simulated Boost creation.
387
+ *
388
+ * @public
389
+ * @async
390
+ * @param {CreateBoostPayload} _boostPayload
391
+ * @param {?DeployableOptions} [_params]
392
+ * @returns {Promise<SimulateContractReturnType>}
393
+ */
394
+ public async simulateCreateBoost(
395
+ _boostPayload: CreateBoostPayload,
396
+ _params?: DeployableOptions &
397
+ WriteParams<typeof boostCoreAbi, 'createBoost'>,
398
+ ) {
399
+ const [payload, options] =
400
+ this.validateDeploymentConfig<CreateBoostPayload>(_boostPayload, _params);
401
+ const desiredChainId = _params?.chain?.id || _params?.chainId;
402
+ const { chainId, address: coreAddress } = assertValidAddressByChainId(
403
+ options.config,
404
+ this.addresses,
405
+ desiredChainId,
406
+ );
407
+
408
+ const onChainPayload = await this.prepareCreateBoostPayload(
409
+ coreAddress,
410
+ chainId,
411
+ payload,
412
+ options,
413
+ );
414
+
415
+ return await simulateBoostCoreCreateBoost(this._config, {
416
+ ...this.optionallyAttachAccount(),
417
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
418
+ ...(_params as any),
419
+ address: coreAddress,
420
+ chainId,
421
+ args: [prepareBoostPayload(onChainPayload)],
422
+ });
423
+ }
424
+
425
+ // This function mutates payload, which isn't awesome but it's fine
426
+ private async prepareCreateBoostPayload(
427
+ coreAddress: Address,
428
+ chainId: number,
429
+ payload: CreateBoostPayload,
430
+ options: DeployableOptions,
431
+ ): Promise<BoostPayload> {
432
+ if (!payload.owner) {
433
+ payload.owner =
297
434
  this._account?.address ||
298
435
  getAccount(options.config).address ||
299
436
  zeroAddress;
300
- if (owner === zeroAddress) {
437
+ if (payload.owner === zeroAddress) {
301
438
  throw new DeployableUnknownOwnerProvidedError();
302
439
  }
303
440
  }
304
441
 
442
+ if (!payload.validator) {
443
+ payload.validator = this.SignerValidator({
444
+ signers: [payload.owner],
445
+ validatorCaller: coreAddress,
446
+ });
447
+ }
448
+
305
449
  let budgetPayload: BoostPayload['budget'] = zeroAddress;
306
- if (budget.address) {
307
- budgetPayload = budget.address;
308
- if (!(await budget.isAuthorized(coreAddress))) {
450
+ if (payload.budget.address) {
451
+ budgetPayload = payload.budget.address;
452
+ if (!(await payload.budget.isAuthorized(coreAddress))) {
309
453
  throw new BudgetMustAuthorizeBoostCore(coreAddress);
310
454
  }
311
455
  } else {
@@ -319,19 +463,25 @@ export class BoostCore extends Deployable<
319
463
  isBase: true,
320
464
  parameters: zeroHash,
321
465
  };
322
- if (action.address) {
323
- const isBase = action.address === action.base || action.isBase;
466
+ if (payload.action.address) {
467
+ const isBase = payload.action.isBase;
324
468
  actionPayload = {
325
469
  isBase: isBase,
326
- instance: action.address,
470
+ instance: payload.action.address,
327
471
  parameters: isBase
328
- ? action.buildParameters(undefined, options).args.at(0) || zeroHash
472
+ ? payload.action.buildParameters(undefined, options).args.at(0) ||
473
+ zeroHash
329
474
  : zeroHash,
330
475
  };
331
476
  } else {
332
477
  actionPayload.parameters =
333
- action.buildParameters(undefined, options).args.at(0) || zeroHash;
334
- actionPayload.instance = action.base;
478
+ payload.action.buildParameters(undefined, options).args.at(0) ||
479
+ zeroHash;
480
+ actionPayload.instance = assertValidAddressByChainId(
481
+ options.config,
482
+ payload.action.bases,
483
+ chainId,
484
+ ).address;
335
485
  }
336
486
 
337
487
  let validatorPayload: BoostPayload['validator'] = {
@@ -339,35 +489,25 @@ export class BoostCore extends Deployable<
339
489
  isBase: true,
340
490
  parameters: zeroHash,
341
491
  };
342
- if (validator.address) {
343
- const isBase = validator.address === validator.base || validator.isBase;
492
+ if (payload.validator.address) {
493
+ const isBase = payload.validator.isBase;
344
494
  validatorPayload = {
345
495
  isBase: isBase,
346
- instance: validator.address,
496
+ instance: payload.validator.address,
347
497
  parameters: isBase
348
- ? validator
349
- .buildParameters(
350
- {
351
- signers: [owner],
352
- validatorCaller: coreAddress,
353
- },
354
- options,
355
- )
356
- .args.at(0) || zeroHash
498
+ ? payload.validator.buildParameters(undefined, options).args.at(0) ||
499
+ zeroHash
357
500
  : zeroHash,
358
501
  };
359
502
  } else {
360
503
  validatorPayload.parameters =
361
- validator
362
- .buildParameters(
363
- {
364
- signers: [owner],
365
- validatorCaller: coreAddress,
366
- },
367
- options,
368
- )
369
- .args.at(0) || zeroHash;
370
- validatorPayload.instance = validator.base;
504
+ payload.validator.buildParameters(undefined, options).args.at(0) ||
505
+ zeroHash;
506
+ validatorPayload.instance = assertValidAddressByChainId(
507
+ options.config,
508
+ payload.validator.bases,
509
+ chainId,
510
+ ).address;
371
511
  }
372
512
 
373
513
  let allowListPayload: BoostPayload['allowList'] = {
@@ -375,31 +515,36 @@ export class BoostCore extends Deployable<
375
515
  isBase: true,
376
516
  parameters: zeroHash,
377
517
  };
378
- if (allowList.address) {
379
- const isBase = allowList.address === allowList.base || allowList.isBase;
518
+ if (payload.allowList.address) {
519
+ const isBase = payload.allowList.isBase;
380
520
  allowListPayload = {
381
521
  isBase: isBase,
382
- instance: allowList.address,
522
+ instance: payload.allowList.address,
383
523
  parameters: isBase
384
524
  ? zeroHash // allowList.buildParameters(undefined, options).args.at(0) || zeroHash
385
525
  : zeroHash,
386
526
  };
387
527
  } else {
388
528
  allowListPayload.parameters =
389
- allowList.buildParameters(undefined, options).args.at(0) || zeroHash;
390
- allowListPayload.instance = allowList.base;
529
+ payload.allowList.buildParameters(undefined, options).args.at(0) ||
530
+ zeroHash;
531
+ allowListPayload.instance = assertValidAddressByChainId(
532
+ options.config,
533
+ payload.allowList.bases,
534
+ chainId,
535
+ ).address;
391
536
  }
392
537
 
393
- let incentivesPayloads: Array<Target> = incentives.map(() => ({
538
+ const incentivesPayloads: Array<Target> = payload.incentives.map(() => ({
394
539
  instance: zeroAddress,
395
540
  isBase: true,
396
541
  parameters: zeroHash,
397
542
  }));
398
- for (let i = 0; i < incentives.length; i++) {
543
+ for (let i = 0; i < payload.incentives.length; i++) {
399
544
  // biome-ignore lint/style/noNonNullAssertion: this will never be undefined
400
- const incentive = incentives.at(i)!;
545
+ const incentive = payload.incentives.at(i)!;
401
546
  if (incentive.address) {
402
- const isBase = incentive.address === incentive.base || incentive.isBase;
547
+ const isBase = incentive.isBase;
403
548
  if (!isBase) throw new IncentiveNotCloneableError(incentive);
404
549
  incentivesPayloads[i] = {
405
550
  isBase: isBase,
@@ -414,7 +559,11 @@ export class BoostCore extends Deployable<
414
559
  incentivesPayloads[i]!.parameters =
415
560
  incentive.buildParameters(undefined, options).args.at(0) || zeroHash;
416
561
  // biome-ignore lint/style/noNonNullAssertion: this will never be undefined
417
- incentivesPayloads[i]!.instance = incentive.base;
562
+ incentivesPayloads[i]!.instance = assertValidAddressByChainId(
563
+ options.config,
564
+ incentive.bases,
565
+ chainId,
566
+ ).address;
418
567
  }
419
568
  }
420
569
 
@@ -424,43 +573,12 @@ export class BoostCore extends Deployable<
424
573
  validator: validatorPayload,
425
574
  allowList: allowListPayload,
426
575
  incentives: incentivesPayloads,
427
- protocolFee,
428
- referralFee,
429
- maxParticipants,
430
- owner,
576
+ protocolFee: payload.protocolFee || 0n,
577
+ maxParticipants: payload.maxParticipants || 0n,
578
+ owner: payload.owner,
431
579
  };
432
580
 
433
- const boostHash = await boostFactory(options.config, {
434
- args: [prepareBoostPayload(onChainPayload)],
435
- ...this.optionallyAttachAccount(options.account),
436
- });
437
- const receipt = await waitForTransactionReceipt(options.config, {
438
- hash: boostHash,
439
- });
440
- const boostCreatedLog = parseEventLogs({
441
- abi: boostCoreAbi,
442
- eventName: 'BoostCreated',
443
- logs: receipt.logs,
444
- }).at(0);
445
- let boostId = 0n;
446
- if (!boostCreatedLog) throw new BoostCoreNoIdentifierEmitted();
447
- boostId = boostCreatedLog?.args.boostIndex;
448
- const boost = await this.readBoost(boostId);
449
- return new Boost({
450
- id: boostId,
451
- budget: budget.at(boost.budget),
452
- action: action.at(boost.action),
453
- validator: validator.at(boost.validator),
454
- allowList: allowList.at(boost.allowList),
455
- incentives: incentives.map((incentive, i) =>
456
- // biome-ignore lint/style/noNonNullAssertion: this will never be undefined
457
- incentive.at(boost.incentives.at(i)!),
458
- ),
459
- protocolFee: boost.protocolFee,
460
- referralFee: boost.referralFee,
461
- maxParticipants: boost.maxParticipants,
462
- owner: boost.owner,
463
- });
581
+ return onChainPayload;
464
582
  }
465
583
 
466
584
  /**
@@ -472,8 +590,8 @@ export class BoostCore extends Deployable<
472
590
  * @param {bigint} incentiveId
473
591
  * @param {Address} address
474
592
  * @param {Hex} data
475
- * @param {?WriteParams<typeof boostCoreAbi, 'claimIncentive'>} [params]
476
- * @returns {unknown}
593
+ * @param {?WriteParams} [params]
594
+ * @returns {Promise<void>}
477
595
  */
478
596
  public async claimIncentive(
479
597
  boostId: bigint,
@@ -496,8 +614,8 @@ export class BoostCore extends Deployable<
496
614
  * @param {bigint} incentiveId - The ID of the Incentive
497
615
  * @param {Address} referrer - The address of the referrer (if any)
498
616
  * @param {Hex} data- The data for the claim
499
- * @param {?WriteParams<typeof boostCoreAbi, 'claimIncentive'>} [params]
500
- * @returns {unknown}
617
+ * @param {?WriteParams} [params]
618
+ * @returns {Promise<{ hash: `0x${string}`; result: void; }>}
501
619
  */
502
620
  public async claimIncentiveRaw(
503
621
  boostId: bigint,
@@ -509,7 +627,11 @@ export class BoostCore extends Deployable<
509
627
  const { request, result } = await simulateBoostCoreClaimIncentive(
510
628
  this._config,
511
629
  {
512
- address: this.assertValidAddress(),
630
+ ...assertValidAddressByChainId(
631
+ this._config,
632
+ this.addresses,
633
+ params?.chain?.id || params?.chainId,
634
+ ),
513
635
  args: [boostId, incentiveId, referrer, data],
514
636
  ...this.optionallyAttachAccount(),
515
637
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -530,8 +652,8 @@ export class BoostCore extends Deployable<
530
652
  * @param {Address} referrer
531
653
  * @param {Hex} data
532
654
  * @param {Address} claimant
533
- * @param {?WriteParams<typeof boostCoreAbi, 'claimIncentiveFor'>} [params]
534
- * @returns {unknown}
655
+ * @param {?WriteParams} [params]
656
+ * @returns {Promise<void>}
535
657
  */
536
658
  public async claimIncentiveFor(
537
659
  boostId: bigint,
@@ -563,8 +685,8 @@ export class BoostCore extends Deployable<
563
685
  * @param {Address} referrer - The address of the referrer (if any)
564
686
  * @param {Hex} data - The data for the claim
565
687
  * @param {Address} claimant - The address of the user eligible for the incentive payout
566
- * @param {?WriteParams<typeof boostCoreAbi, 'claimIncentiveFor'>} [params]
567
- * @returns {unknown}
688
+ * @param {?WriteParams} [params]
689
+ * @returns {Promise<{ hash: Hex; result: void; }>}
568
690
  */
569
691
  public async claimIncentiveForRaw(
570
692
  boostId: bigint,
@@ -577,7 +699,11 @@ export class BoostCore extends Deployable<
577
699
  const { request, result } = await simulateBoostCoreClaimIncentiveFor(
578
700
  this._config,
579
701
  {
580
- address: this.assertValidAddress(),
702
+ ...assertValidAddressByChainId(
703
+ this._config,
704
+ this.addresses,
705
+ params?.chain?.id || params?.chainId,
706
+ ),
581
707
  args: [boostId, incentiveId, referrer, data, claimant],
582
708
  ...this.optionallyAttachAccount(),
583
709
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -593,21 +719,37 @@ export class BoostCore extends Deployable<
593
719
  *
594
720
  * @public
595
721
  * @async
596
- * @param {bigint} id
597
- * @param {?ReadParams<typeof boostCoreAbi, 'getBoost'>} [params]
598
- * @returns {unknown}
722
+ * @param {bigint | string} id
723
+ * @param {?ReadParams} [params]
724
+ * @returns {Promise<RawBoost>}
725
+ * @throws {@link BoostNotFoundError}
599
726
  */
600
727
  public async readBoost(
601
- id: bigint,
728
+ _id: string | bigint,
602
729
  params?: ReadParams<typeof boostCoreAbi, 'getBoost'>,
603
- ) {
604
- return await readBoostCoreGetBoost(this._config, {
605
- address: this.assertValidAddress(),
606
- args: [id],
607
- ...this.optionallyAttachAccount(),
608
- // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
609
- ...(params as any),
610
- });
730
+ ): Promise<RawBoost> {
731
+ try {
732
+ let id: bigint;
733
+ if (typeof _id === 'string') {
734
+ id = BigInt(_id);
735
+ } else id = _id;
736
+ return await readBoostCoreGetBoost(this._config, {
737
+ ...assertValidAddressByChainId(
738
+ this._config,
739
+ this.addresses,
740
+ params?.chainId,
741
+ ),
742
+ args: [id],
743
+ ...this.optionallyAttachAccount(),
744
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
745
+ ...(params as any),
746
+ });
747
+ // biome-ignore lint/suspicious/noExplicitAny: unknown error
748
+ } catch (e: any) {
749
+ if (e?.message?.includes('bounds'))
750
+ throw new BoostNotFoundError(String(_id));
751
+ throw e;
752
+ }
611
753
  }
612
754
 
613
755
  /**
@@ -616,8 +758,9 @@ export class BoostCore extends Deployable<
616
758
  * @public
617
759
  * @async
618
760
  * @param {(string | bigint)} _id
619
- * @param {?ReadParams<typeof boostCoreAbi, 'getBoost'>} [params]
620
- * @returns {unknown}
761
+ * @param {?ReadParams} [params]
762
+ * @returns {Promise<Boost>}
763
+ * @throws {@link BoostNotFoundError}
621
764
  */
622
765
  public async getBoost(
623
766
  _id: string | bigint,
@@ -627,13 +770,8 @@ export class BoostCore extends Deployable<
627
770
  if (typeof _id === 'string') {
628
771
  id = BigInt(_id);
629
772
  } else id = _id;
630
- const {
631
- protocolFee,
632
- referralFee,
633
- maxParticipants,
634
- owner,
635
- ...boostPayload
636
- } = await this.readBoost(id, params);
773
+ const { protocolFee, maxParticipants, owner, ...boostPayload } =
774
+ await this.readBoost(id, params);
637
775
  const options: DeployableOptions = {
638
776
  config: this._config,
639
777
  account: this._account,
@@ -658,7 +796,6 @@ export class BoostCore extends Deployable<
658
796
  allowList,
659
797
  incentives,
660
798
  protocolFee,
661
- referralFee,
662
799
  maxParticipants,
663
800
  owner,
664
801
  });
@@ -669,14 +806,18 @@ export class BoostCore extends Deployable<
669
806
  *
670
807
  * @public
671
808
  * @async
672
- * @param {?ReadParams<typeof boostCoreAbi, 'getBoostCount'>} [params]
809
+ * @param {?ReadParams} [params]
673
810
  * @returns {Promise<bigint>}
674
811
  */
675
812
  public async getBoostCount(
676
813
  params?: ReadParams<typeof boostCoreAbi, 'getBoostCount'>,
677
814
  ) {
678
815
  return await readBoostCoreGetBoostCount(this._config, {
679
- address: this.assertValidAddress(),
816
+ ...assertValidAddressByChainId(
817
+ this._config,
818
+ this.addresses,
819
+ params?.chainId,
820
+ ),
680
821
  args: [],
681
822
  ...this.optionallyAttachAccount(),
682
823
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -690,7 +831,7 @@ export class BoostCore extends Deployable<
690
831
  * @public
691
832
  * @async
692
833
  * @param {Address} address
693
- * @param {?ReadParams<typeof boostCoreAbi, 'createBoostAuth'> &
834
+ * @param {?ReadParams &
694
835
  * ReadParams<typeof iAuthAbi, 'isAuthorized'>} [params]
695
836
  * @returns {Promise<boolean>}
696
837
  */
@@ -699,7 +840,7 @@ export class BoostCore extends Deployable<
699
840
  params?: ReadParams<typeof boostCoreAbi, 'createBoostAuth'> &
700
841
  ReadParams<typeof iAuthAbi, 'isAuthorized'>,
701
842
  ) {
702
- const auth = await this.createBoostAuth();
843
+ const auth = await this.createBoostAuth(params);
703
844
  return readIAuthIsAuthorized(this._config, {
704
845
  address: auth,
705
846
  args: [address],
@@ -714,14 +855,18 @@ export class BoostCore extends Deployable<
714
855
  *
715
856
  * @public
716
857
  * @async
717
- * @param {?ReadParams<typeof boostCoreAbi, 'createBoostAuth'>} [params]
718
- * @returns {unknown}
858
+ * @param {?ReadParams} [params]
859
+ * @returns {Promise<Address>}
719
860
  */
720
861
  public async createBoostAuth(
721
862
  params?: ReadParams<typeof boostCoreAbi, 'createBoostAuth'>,
722
863
  ) {
723
864
  return await readBoostCoreCreateBoostAuth(this._config, {
724
- address: this.assertValidAddress(),
865
+ ...assertValidAddressByChainId(
866
+ this._config,
867
+ this.addresses,
868
+ params?.chainId,
869
+ ),
725
870
  args: [],
726
871
  ...this.optionallyAttachAccount(),
727
872
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -735,8 +880,8 @@ export class BoostCore extends Deployable<
735
880
  * @public
736
881
  * @async
737
882
  * @param {Auth} auth
738
- * @param {?WriteParams<typeof boostCoreAbi, 'setCreateBoostAuth'>} [params]
739
- * @returns {unknown}
883
+ * @param {?WriteParams} [params]
884
+ * @returns {Promise<void>}
740
885
  */
741
886
  public async setCreateBoostAuth(
742
887
  auth: Auth,
@@ -755,8 +900,8 @@ export class BoostCore extends Deployable<
755
900
  * @public
756
901
  * @async
757
902
  * @param {Address} address
758
- * @param {?WriteParams<typeof boostCoreAbi, 'setCreateBoostAuth'>} [params]
759
- * @returns {unknown}
903
+ * @param {?WriteParams} [params]
904
+ * @returns {Promise<{ hash: `0x${string}`; result: void; }>}
760
905
  */
761
906
  public async setCreateBoostAuthRaw(
762
907
  address: Address,
@@ -765,7 +910,11 @@ export class BoostCore extends Deployable<
765
910
  const { request, result } = await simulateBoostCoreSetCreateBoostAuth(
766
911
  this._config,
767
912
  {
768
- address: this.assertValidAddress(),
913
+ ...assertValidAddressByChainId(
914
+ this._config,
915
+ this.addresses,
916
+ params?.chainId,
917
+ ),
769
918
  args: [address],
770
919
  ...this.optionallyAttachAccount(),
771
920
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -781,14 +930,18 @@ export class BoostCore extends Deployable<
781
930
  *
782
931
  * @public
783
932
  * @async
784
- * @param {?ReadParams<typeof boostCoreAbi, 'protocolFee'>} [params]
933
+ * @param {?ReadParams} [params]
785
934
  * @returns {unknown}
786
935
  */
787
936
  public async protocolFee(
788
937
  params?: ReadParams<typeof boostCoreAbi, 'protocolFee'>,
789
938
  ) {
790
939
  return await readBoostCoreProtocolFee(this._config, {
791
- address: this.assertValidAddress(),
940
+ ...assertValidAddressByChainId(
941
+ this._config,
942
+ this.addresses,
943
+ params?.chainId,
944
+ ),
792
945
  args: [],
793
946
  ...this.optionallyAttachAccount(),
794
947
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -801,14 +954,18 @@ export class BoostCore extends Deployable<
801
954
  *
802
955
  * @public
803
956
  * @async
804
- * @param {?ReadParams<typeof boostCoreAbi, 'protocolFeeReceiver'>} [params]
805
- * @returns {unknown}
957
+ * @param {?ReadParams} [params]
958
+ * @returns {Promise<Address>}
806
959
  */
807
960
  public async protocolFeeReceiver(
808
961
  params?: ReadParams<typeof boostCoreAbi, 'protocolFeeReceiver'>,
809
962
  ) {
810
963
  return await readBoostCoreProtocolFeeReceiver(this._config, {
811
- address: this.assertValidAddress(),
964
+ ...assertValidAddressByChainId(
965
+ this._config,
966
+ this.addresses,
967
+ params?.chainId,
968
+ ),
812
969
  args: [],
813
970
  ...this.optionallyAttachAccount(),
814
971
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -822,8 +979,8 @@ export class BoostCore extends Deployable<
822
979
  * @public
823
980
  * @async
824
981
  * @param {Address} address
825
- * @param {?WriteParams<typeof boostCoreAbi, 'setProtocolFeeReceiver'>} [params]
826
- * @returns {unknown}
982
+ * @param {?WriteParams} [params]
983
+ * @returns {Promise<void>}
827
984
  */
828
985
  public async setProcolFeeReceiver(
829
986
  address: Address,
@@ -842,8 +999,8 @@ export class BoostCore extends Deployable<
842
999
  * @public
843
1000
  * @async
844
1001
  * @param {Address} address
845
- * @param {?WriteParams<typeof boostCoreAbi, 'setProtocolFeeReceiver'>} [params]
846
- * @returns {unknown}
1002
+ * @param {?WriteParams} [params]
1003
+ * @returns {Promise<{ hash: `0x${string}`; result: void; }>}
847
1004
  */
848
1005
  public async setProcolFeeReceiverRaw(
849
1006
  address: Address,
@@ -852,7 +1009,11 @@ export class BoostCore extends Deployable<
852
1009
  const { request, result } = await simulateBoostCoreSetProtocolFeeReceiver(
853
1010
  this._config,
854
1011
  {
855
- address: this.assertValidAddress(),
1012
+ ...assertValidAddressByChainId(
1013
+ this._config,
1014
+ this.addresses,
1015
+ params?.chainId,
1016
+ ),
856
1017
  args: [address],
857
1018
  ...this.optionallyAttachAccount(),
858
1019
  // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
@@ -867,64 +1028,38 @@ export class BoostCore extends Deployable<
867
1028
  }
868
1029
 
869
1030
  /**
870
- * Get the claim fee.
1031
+ * Retrieves the claim information from a transaction receipt.
871
1032
  *
872
- * @public
873
- * @async
874
- * @param {?ReadParams<typeof boostCoreAbi, 'claimFee'>} [params]
875
- * @returns {unknown}
876
- */
877
- public async claimFee(params?: ReadParams<typeof boostCoreAbi, 'claimFee'>) {
878
- return await readBoostCoreClaimFee(this._config, {
879
- address: this.assertValidAddress(),
880
- args: [],
881
- ...this.optionallyAttachAccount(),
882
- // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
883
- ...(params as any),
884
- });
885
- }
886
-
887
- /**
888
- * Sets the claim fee.
1033
+ * @param {GetTransactionReceiptParameters} params - The parameters required to get the transaction receipt.
1034
+ * @returns {Promise<{ boostId: bigint, incentiveId: bigint, claimer: Address, amount: bigint } | undefined>} The claim information if found, undefined otherwise.
889
1035
  *
890
- * @public
891
- * @async
892
- * @param {bigint} claimFee
893
- * @param {?WriteParams<typeof boostCoreAbi, 'setClaimFee'>} [params]
894
- * @returns {unknown}
895
- */
896
- public async setClaimFee(
897
- claimFee: bigint,
898
- params?: WriteParams<typeof boostCoreAbi, 'setClaimFee'>,
899
- ) {
900
- return await this.awaitResult(this.setClaimFeeRaw(claimFee, params));
901
- }
902
-
903
- /**
904
- * Sets the claim fee.
1036
+ * @description
1037
+ * This method retrieves the transaction receipt using the provided parameters,
1038
+ * then parses the logs to find the 'BoostClaimed' event.
1039
+ * If found, it returns the arguments of the event, which include the boost ID,
1040
+ * incentive ID, claimer address, and claimed amount.
905
1041
  *
906
- * @public
907
- * @async
908
- * @param {bigint} claimFee
909
- * @param {?WriteParams<typeof boostCoreAbi, 'setClaimFee'>} [params]
910
- * @returns {unknown}
1042
+ * @example
1043
+ * ```ts
1044
+ * const claimInfo = await boostCore.getClaimFromTransaction({
1045
+ * hash: '0x...',
1046
+ * chainId: 1
1047
+ * });
1048
+ * if (claimInfo) {
1049
+ * console.log(`Boost ${claimInfo.boostId} claimed by ${claimInfo.claimer}`);
1050
+ * }
1051
+ * ```
911
1052
  */
912
- public async setClaimFeeRaw(
913
- claimFee: bigint,
914
- params?: WriteParams<typeof boostCoreAbi, 'setClaimFee'>,
1053
+ public async getClaimFromTransaction(
1054
+ params: GetTransactionReceiptParameters,
915
1055
  ) {
916
- const { request, result } = await simulateBoostCoreSetClaimFee(
917
- this._config,
918
- {
919
- address: this.assertValidAddress(),
920
- args: [claimFee],
921
- ...this.optionallyAttachAccount(),
922
- // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
923
- ...(params as any),
924
- },
925
- );
926
- const hash = await writeBoostCoreSetClaimFee(this._config, request);
927
- return { hash, result };
1056
+ const receipt = await getTransactionReceipt(this._config, params);
1057
+ const logs = parseEventLogs({
1058
+ abi: boostCoreAbi,
1059
+ eventName: 'BoostClaimed',
1060
+ logs: receipt.logs,
1061
+ });
1062
+ return logs.at(0)?.args;
928
1063
  }
929
1064
 
930
1065
  /**
@@ -1008,6 +1143,24 @@ export class BoostCore extends Deployable<
1008
1143
  // isBase,
1009
1144
  // );
1010
1145
  // }
1146
+ /**
1147
+ * Bound {@link OpenAllowList} constructor that reuses the same configuration as the Boost Core instance.
1148
+ *
1149
+ * @example
1150
+ * ```ts
1151
+ * const list = core.OpenAllowList('0x') // is roughly equivalent to
1152
+ * const list = new OpenAllowList({ config: core._config, account: core._account }, '0x')
1153
+ * ```
1154
+ * @param {?boolean} [isBase]
1155
+ * @returns {OpenAllowList}
1156
+ */
1157
+ OpenAllowList(isBase?: boolean) {
1158
+ return new OpenAllowList(
1159
+ { config: this._config, account: this._account },
1160
+ undefined,
1161
+ isBase,
1162
+ );
1163
+ }
1011
1164
  /**
1012
1165
  * Bound {@link SimpleAllowList} constructor that reuses the same configuration as the Boost Core instance.
1013
1166
  *
@@ -1212,6 +1365,30 @@ export class BoostCore extends Deployable<
1212
1365
  isBase,
1213
1366
  );
1214
1367
  }
1368
+
1369
+ /**
1370
+ * Bound {@link ERC20VariableCriteriaIncentive} constructor that reuses the same configuration as the Boost Core instance.
1371
+ *
1372
+ * @example
1373
+ * ```ts
1374
+ * const validator = core.ERC20VariableCrtieriaIncentive({ ... }) // is roughly equivalent to
1375
+ * const validator = new ERC20VariableCrtieriaIncentive({ config: core._config, account: core._account }, { ... })
1376
+ * ```
1377
+ * @param {DeployablePayloadOrAddress<ERC20VariableCrtieriaIncentivePayload>} options
1378
+ * @param {?boolean} [isBase]
1379
+ * @returns {ERC20VariableCrtieriaIncentive}
1380
+ * */
1381
+ ERC20VariableCriteriaIncentive(
1382
+ options: DeployablePayloadOrAddress<ERC20VariableCriteriaIncentivePayload>,
1383
+ isBase?: boolean,
1384
+ ) {
1385
+ return new ERC20VariableCriteriaIncentive(
1386
+ { config: this._config, account: this._account },
1387
+ options,
1388
+ isBase,
1389
+ );
1390
+ }
1391
+
1215
1392
  /**
1216
1393
  * Bound {@link ERC20VariableIncentive} constructor that reuses the same configuration as the Boost Core instance.
1217
1394
  *