@boostxyz/sdk 0.0.0-alpha.10

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 (242) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +7 -0
  3. package/dist/Actions/Action.cjs +2 -0
  4. package/dist/Actions/Action.cjs.map +1 -0
  5. package/dist/Actions/Action.d.ts +31 -0
  6. package/dist/Actions/Action.d.ts.map +1 -0
  7. package/dist/Actions/Action.js +29 -0
  8. package/dist/Actions/Action.js.map +1 -0
  9. package/dist/Actions/ContractAction.d.ts +370 -0
  10. package/dist/Actions/ContractAction.d.ts.map +1 -0
  11. package/dist/Actions/ERC721MintAction.d.ts +513 -0
  12. package/dist/Actions/ERC721MintAction.d.ts.map +1 -0
  13. package/dist/Actions/EventAction.cjs +2 -0
  14. package/dist/Actions/EventAction.cjs.map +1 -0
  15. package/dist/Actions/EventAction.d.ts +694 -0
  16. package/dist/Actions/EventAction.d.ts.map +1 -0
  17. package/dist/Actions/EventAction.js +491 -0
  18. package/dist/Actions/EventAction.js.map +1 -0
  19. package/dist/AllowLists/AllowList.cjs +2 -0
  20. package/dist/AllowLists/AllowList.cjs.map +1 -0
  21. package/dist/AllowLists/AllowList.d.ts +32 -0
  22. package/dist/AllowLists/AllowList.d.ts.map +1 -0
  23. package/dist/AllowLists/AllowList.js +30 -0
  24. package/dist/AllowLists/AllowList.js.map +1 -0
  25. package/dist/AllowLists/SimpleAllowList.cjs +2 -0
  26. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -0
  27. package/dist/AllowLists/SimpleAllowList.d.ts +481 -0
  28. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -0
  29. package/dist/AllowLists/SimpleAllowList.js +154 -0
  30. package/dist/AllowLists/SimpleAllowList.js.map +1 -0
  31. package/dist/AllowLists/SimpleDenyList.cjs +2 -0
  32. package/dist/AllowLists/SimpleDenyList.cjs.map +1 -0
  33. package/dist/AllowLists/SimpleDenyList.d.ts +335 -0
  34. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -0
  35. package/dist/AllowLists/SimpleDenyList.js +115 -0
  36. package/dist/AllowLists/SimpleDenyList.js.map +1 -0
  37. package/dist/Auth/Auth.cjs +2 -0
  38. package/dist/Auth/Auth.cjs.map +1 -0
  39. package/dist/Auth/Auth.d.ts +10 -0
  40. package/dist/Auth/Auth.d.ts.map +1 -0
  41. package/dist/Auth/Auth.js +5 -0
  42. package/dist/Auth/Auth.js.map +1 -0
  43. package/dist/Auth/PassthroughAuth.cjs +2 -0
  44. package/dist/Auth/PassthroughAuth.cjs.map +1 -0
  45. package/dist/Auth/PassthroughAuth.d.ts +51 -0
  46. package/dist/Auth/PassthroughAuth.d.ts.map +1 -0
  47. package/dist/Auth/PassthroughAuth.js +39 -0
  48. package/dist/Auth/PassthroughAuth.js.map +1 -0
  49. package/dist/Boost.cjs +2 -0
  50. package/dist/Boost.cjs.map +1 -0
  51. package/dist/Boost.d.ts +234 -0
  52. package/dist/Boost.d.ts.map +1 -0
  53. package/dist/Boost.js +162 -0
  54. package/dist/Boost.js.map +1 -0
  55. package/dist/BoostCore.cjs +3 -0
  56. package/dist/BoostCore.cjs.map +1 -0
  57. package/dist/BoostCore.d.ts +498 -0
  58. package/dist/BoostCore.d.ts.map +1 -0
  59. package/dist/BoostCore.js +1153 -0
  60. package/dist/BoostCore.js.map +1 -0
  61. package/dist/BoostRegistry.cjs +2 -0
  62. package/dist/BoostRegistry.cjs.map +1 -0
  63. package/dist/BoostRegistry.d.ts +243 -0
  64. package/dist/BoostRegistry.d.ts.map +1 -0
  65. package/dist/BoostRegistry.js +262 -0
  66. package/dist/BoostRegistry.js.map +1 -0
  67. package/dist/Budgets/Budget.cjs +2 -0
  68. package/dist/Budgets/Budget.cjs.map +1 -0
  69. package/dist/Budgets/Budget.d.ts +31 -0
  70. package/dist/Budgets/Budget.d.ts.map +1 -0
  71. package/dist/Budgets/Budget.js +29 -0
  72. package/dist/Budgets/Budget.js.map +1 -0
  73. package/dist/Budgets/ManagedBudget.cjs +2 -0
  74. package/dist/Budgets/ManagedBudget.cjs.map +1 -0
  75. package/dist/Budgets/ManagedBudget.d.ts +1103 -0
  76. package/dist/Budgets/ManagedBudget.d.ts.map +1 -0
  77. package/dist/Budgets/ManagedBudget.js +516 -0
  78. package/dist/Budgets/ManagedBudget.js.map +1 -0
  79. package/dist/Budgets/SimpleBudget.d.ts +824 -0
  80. package/dist/Budgets/SimpleBudget.d.ts.map +1 -0
  81. package/dist/Budgets/VestingBudget.d.ts +778 -0
  82. package/dist/Budgets/VestingBudget.d.ts.map +1 -0
  83. package/dist/Deployable/Contract.cjs +2 -0
  84. package/dist/Deployable/Contract.cjs.map +1 -0
  85. package/dist/Deployable/Contract.d.ts +125 -0
  86. package/dist/Deployable/Contract.d.ts.map +1 -0
  87. package/dist/Deployable/Contract.js +150 -0
  88. package/dist/Deployable/Contract.js.map +1 -0
  89. package/dist/Deployable/Deployable.cjs +2 -0
  90. package/dist/Deployable/Deployable.cjs.map +1 -0
  91. package/dist/Deployable/Deployable.d.ts +161 -0
  92. package/dist/Deployable/Deployable.d.ts.map +1 -0
  93. package/dist/Deployable/Deployable.js +131 -0
  94. package/dist/Deployable/Deployable.js.map +1 -0
  95. package/dist/Deployable/DeployableTarget.cjs +2 -0
  96. package/dist/Deployable/DeployableTarget.cjs.map +1 -0
  97. package/dist/Deployable/DeployableTarget.d.ts +116 -0
  98. package/dist/Deployable/DeployableTarget.d.ts.map +1 -0
  99. package/dist/Deployable/DeployableTarget.js +132 -0
  100. package/dist/Deployable/DeployableTarget.js.map +1 -0
  101. package/dist/Incentives/AllowListIncentive.cjs +2 -0
  102. package/dist/Incentives/AllowListIncentive.cjs.map +1 -0
  103. package/dist/Incentives/AllowListIncentive.d.ts +513 -0
  104. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -0
  105. package/dist/Incentives/AllowListIncentive.js +201 -0
  106. package/dist/Incentives/AllowListIncentive.js.map +1 -0
  107. package/dist/Incentives/CGDAIncentive.cjs +2 -0
  108. package/dist/Incentives/CGDAIncentive.cjs.map +1 -0
  109. package/dist/Incentives/CGDAIncentive.d.ts +644 -0
  110. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -0
  111. package/dist/Incentives/CGDAIncentive.js +271 -0
  112. package/dist/Incentives/CGDAIncentive.js.map +1 -0
  113. package/dist/Incentives/ERC1155Incentive.d.ts +713 -0
  114. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -0
  115. package/dist/Incentives/ERC20Incentive.cjs +2 -0
  116. package/dist/Incentives/ERC20Incentive.cjs.map +1 -0
  117. package/dist/Incentives/ERC20Incentive.d.ts +666 -0
  118. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -0
  119. package/dist/Incentives/ERC20Incentive.js +312 -0
  120. package/dist/Incentives/ERC20Incentive.js.map +1 -0
  121. package/dist/Incentives/ERC20VariableIncentive.d.ts +582 -0
  122. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -0
  123. package/dist/Incentives/Incentive.cjs +2 -0
  124. package/dist/Incentives/Incentive.cjs.map +1 -0
  125. package/dist/Incentives/Incentive.d.ts +36 -0
  126. package/dist/Incentives/Incentive.d.ts.map +1 -0
  127. package/dist/Incentives/Incentive.js +299 -0
  128. package/dist/Incentives/Incentive.js.map +1 -0
  129. package/dist/Incentives/PointsIncentive.cjs +2 -0
  130. package/dist/Incentives/PointsIncentive.cjs.map +1 -0
  131. package/dist/Incentives/PointsIncentive.d.ts +659 -0
  132. package/dist/Incentives/PointsIncentive.d.ts.map +1 -0
  133. package/dist/Incentives/PointsIncentive.js +215 -0
  134. package/dist/Incentives/PointsIncentive.js.map +1 -0
  135. package/dist/Validators/SignerValidator.cjs +2 -0
  136. package/dist/Validators/SignerValidator.cjs.map +1 -0
  137. package/dist/Validators/SignerValidator.d.ts +745 -0
  138. package/dist/Validators/SignerValidator.d.ts.map +1 -0
  139. package/dist/Validators/SignerValidator.js +293 -0
  140. package/dist/Validators/SignerValidator.js.map +1 -0
  141. package/dist/Validators/Validator.cjs +2 -0
  142. package/dist/Validators/Validator.cjs.map +1 -0
  143. package/dist/Validators/Validator.d.ts +31 -0
  144. package/dist/Validators/Validator.d.ts.map +1 -0
  145. package/dist/Validators/Validator.js +27 -0
  146. package/dist/Validators/Validator.js.map +1 -0
  147. package/dist/claiming.cjs +2 -0
  148. package/dist/claiming.cjs.map +1 -0
  149. package/dist/claiming.d.ts +43 -0
  150. package/dist/claiming.d.ts.map +1 -0
  151. package/dist/claiming.js +17 -0
  152. package/dist/claiming.js.map +1 -0
  153. package/dist/componentInterfaces-CKCBwG16.cjs +2 -0
  154. package/dist/componentInterfaces-CKCBwG16.cjs.map +1 -0
  155. package/dist/componentInterfaces-DYkaxBda.js +13 -0
  156. package/dist/componentInterfaces-DYkaxBda.js.map +1 -0
  157. package/dist/errors.cjs +2 -0
  158. package/dist/errors.cjs.map +1 -0
  159. package/dist/errors.d.ts +441 -0
  160. package/dist/errors.d.ts.map +1 -0
  161. package/dist/errors.js +262 -0
  162. package/dist/errors.js.map +1 -0
  163. package/dist/generated-BDeDiaCK.js +4625 -0
  164. package/dist/generated-BDeDiaCK.js.map +1 -0
  165. package/dist/generated-wKBNvm48.cjs +3 -0
  166. package/dist/generated-wKBNvm48.cjs.map +1 -0
  167. package/dist/index.cjs +2 -0
  168. package/dist/index.cjs.map +1 -0
  169. package/dist/index.d.ts +25 -0
  170. package/dist/index.d.ts.map +1 -0
  171. package/dist/index.js +113 -0
  172. package/dist/index.js.map +1 -0
  173. package/dist/transfers.cjs +2 -0
  174. package/dist/transfers.cjs.map +1 -0
  175. package/dist/transfers.d.ts +198 -0
  176. package/dist/transfers.d.ts.map +1 -0
  177. package/dist/transfers.js +84 -0
  178. package/dist/transfers.js.map +1 -0
  179. package/dist/utils.cjs +2 -0
  180. package/dist/utils.cjs.map +1 -0
  181. package/dist/utils.d.ts +116 -0
  182. package/dist/utils.d.ts.map +1 -0
  183. package/dist/utils.js +30 -0
  184. package/dist/utils.js.map +1 -0
  185. package/package.json +211 -0
  186. package/src/Actions/Action.test.ts +75 -0
  187. package/src/Actions/Action.ts +61 -0
  188. package/src/Actions/ContractAction.test.ts +197 -0
  189. package/src/Actions/ContractAction.ts +301 -0
  190. package/src/Actions/ERC721MintAction.test.ts +112 -0
  191. package/src/Actions/ERC721MintAction.ts +292 -0
  192. package/src/Actions/EventAction.test.ts +205 -0
  193. package/src/Actions/EventAction.ts +811 -0
  194. package/src/AllowLists/AllowList.test.ts +64 -0
  195. package/src/AllowLists/AllowList.ts +60 -0
  196. package/src/AllowLists/SimpleAllowList.test.ts +52 -0
  197. package/src/AllowLists/SimpleAllowList.ts +284 -0
  198. package/src/AllowLists/SimpleDenyList.test.ts +52 -0
  199. package/src/AllowLists/SimpleDenyList.ts +227 -0
  200. package/src/Auth/Auth.ts +11 -0
  201. package/src/Auth/PassthroughAuth.test.ts +12 -0
  202. package/src/Auth/PassthroughAuth.ts +80 -0
  203. package/src/Boost.ts +290 -0
  204. package/src/BoostCore.test.ts +773 -0
  205. package/src/BoostCore.ts +1261 -0
  206. package/src/BoostRegistry.ts +467 -0
  207. package/src/Budgets/Budget.test.ts +27 -0
  208. package/src/Budgets/Budget.ts +61 -0
  209. package/src/Budgets/ManagedBudget.test.ts +154 -0
  210. package/src/Budgets/ManagedBudget.ts +796 -0
  211. package/src/Budgets/SimpleBudget.test.ts +152 -0
  212. package/src/Budgets/SimpleBudget.ts +564 -0
  213. package/src/Budgets/VestingBudget.test.ts +123 -0
  214. package/src/Budgets/VestingBudget.ts +602 -0
  215. package/src/Deployable/Contract.ts +229 -0
  216. package/src/Deployable/Deployable.ts +250 -0
  217. package/src/Deployable/DeployableTarget.ts +223 -0
  218. package/src/Incentives/AllowListIncentive.test.ts +143 -0
  219. package/src/Incentives/AllowListIncentive.ts +334 -0
  220. package/src/Incentives/CGDAIncentive.test.ts +132 -0
  221. package/src/Incentives/CGDAIncentive.ts +468 -0
  222. package/src/Incentives/ERC1155Incentive.test.ts +87 -0
  223. package/src/Incentives/ERC1155Incentive.ts +466 -0
  224. package/src/Incentives/ERC20Incentive.test.ts +130 -0
  225. package/src/Incentives/ERC20Incentive.ts +482 -0
  226. package/src/Incentives/ERC20VariableIncentive.test.ts +136 -0
  227. package/src/Incentives/ERC20VariableIncentive.ts +420 -0
  228. package/src/Incentives/Incentive.test.ts +92 -0
  229. package/src/Incentives/Incentive.ts +85 -0
  230. package/src/Incentives/PointsIncentive.test.ts +139 -0
  231. package/src/Incentives/PointsIncentive.ts +365 -0
  232. package/src/Validators/SignerValidator.test.ts +159 -0
  233. package/src/Validators/SignerValidator.ts +681 -0
  234. package/src/Validators/Validator.test.ts +21 -0
  235. package/src/Validators/Validator.ts +55 -0
  236. package/src/claiming.ts +56 -0
  237. package/src/errors.ts +542 -0
  238. package/src/index.test.ts +40 -0
  239. package/src/index.ts +53 -0
  240. package/src/transfers.ts +284 -0
  241. package/src/utils.test.ts +44 -0
  242. package/src/utils.ts +198 -0
@@ -0,0 +1,131 @@
1
+ import { deployContract as i } from "@wagmi/core";
2
+ import { DeployableAlreadyDeployedError as s, DeployableBuildParametersUnspecifiedError as n, DeployableWagmiConfigurationRequiredError as l } from "../errors.js";
3
+ import { getDeployedContractAddress as c } from "../utils.js";
4
+ import { Contract as d } from "./Contract.js";
5
+ class m extends d {
6
+ /**
7
+ * Creates an instance of Deployable.
8
+ *
9
+ * @constructor
10
+ * @param {DeployableOptions} param0
11
+ * @param {?Account} [param0.account]
12
+ * @param {Config} param0.config
13
+ * @param {DeployablePayloadOrAddress<Payload>} payload
14
+ */
15
+ constructor({ account: t, config: o }, a) {
16
+ typeof a == "string" ? super(o, a) : (super(o, void 0), this._payload = a), t && (this._account = t);
17
+ }
18
+ /**
19
+ * Returns the attached deployable payload, if it exists
20
+ *
21
+ * @readonly
22
+ * @type {Payload}
23
+ */
24
+ get payload() {
25
+ return this._payload;
26
+ }
27
+ /**
28
+ * Attaches a new payload for use with this deployable's initialization
29
+ *
30
+ * @public
31
+ * @param {Payload} payload
32
+ * @returns {this}
33
+ */
34
+ withPayload(t) {
35
+ return this._payload = t, this;
36
+ }
37
+ /**
38
+ * High level deployment function to deploy and await the contract address.
39
+ * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,
40
+ * which makes it useless for Boost components.
41
+ * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.
42
+ *
43
+ * @public
44
+ * @async
45
+ * @param {?Payload} [_payload]
46
+ * @param {?DeployableOptions} [_options]
47
+ * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - See [viem.WaitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)
48
+ * @returns {unknown}
49
+ */
50
+ async deploy(t, o, a) {
51
+ const e = (o == null ? void 0 : o.config) || this._config, r = await c(
52
+ e,
53
+ this.deployRaw(t, o),
54
+ a
55
+ );
56
+ return this._address = r, this;
57
+ }
58
+ /**
59
+ * The lower level contract deployment function that does not await for the transaction receipt.
60
+ * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,
61
+ * which makes it useless for Boost components.
62
+ * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.
63
+ *
64
+ * @public
65
+ * @async
66
+ * @param {?Payload} [_payload]
67
+ * @param {?DeployableOptions} [_options]
68
+ * @returns {Promise<Hash>}
69
+ * @throws {@link DeployableAlreadyDeployedError}
70
+ * @throws {@link DeployableWagmiConfigurationRequiredError}
71
+ * @throws {@link DeployableMissingPayloadError}
72
+ */
73
+ async deployRaw(t, o) {
74
+ if (this.address)
75
+ throw new s(this.address);
76
+ const [a, e] = this.validateDeploymentConfig(
77
+ t,
78
+ o
79
+ );
80
+ return await i(e.config, {
81
+ ...this.buildParameters(a),
82
+ ...this.optionallyAttachAccount(e.account)
83
+ });
84
+ }
85
+ /**
86
+ * Internal function to attach the connected account to write methods to avoid manually passing in an account each call.
87
+ *
88
+ * @protected
89
+ * @param {?Account} [account]
90
+ * @returns {({ account: Account; } | { account?: undefined; })}
91
+ */
92
+ optionallyAttachAccount(t) {
93
+ return t ? { account: t } : this._account ? { account: this._account } : {};
94
+ }
95
+ /**
96
+ * Base parameter constructor, should return a partial `viem.deployContract` parameters shape including abi, bytecode, and arguments, if any.
97
+ * Expected to be overridden by protocol contracts.
98
+ *
99
+ * @public
100
+ * @param {?Payload} [_payload]
101
+ * @param {?DeployableOptions} [_options]
102
+ * @returns {GenericDeployableParams}
103
+ */
104
+ buildParameters(t, o) {
105
+ throw new n();
106
+ }
107
+ /**
108
+ * Internal method used to ensure that a Wagmi configuration and payload are always present when deploying.
109
+ *
110
+ * @protected
111
+ * @template [P=Payload]
112
+ * @param {?P} [_payload]
113
+ * @param {?DeployableOptions} [_options]
114
+ * @returns {[P, DeployableOptions]}
115
+ * @throws {@link DeployableWagmiConfigurationRequiredError}
116
+ * @throws {@link DeployableMissingPayloadError}
117
+ */
118
+ validateDeploymentConfig(t, o) {
119
+ const a = o || {
120
+ config: this._config,
121
+ account: this._account
122
+ };
123
+ if (!a)
124
+ throw new l();
125
+ return [t || this._payload, a];
126
+ }
127
+ }
128
+ export {
129
+ m as Deployable
130
+ };
131
+ //# sourceMappingURL=Deployable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Deployable.js","sources":["../../src/Deployable/Deployable.ts"],"sourcesContent":["import { type Config, deployContract } from '@wagmi/core';\nimport type {\n Abi,\n Account,\n Address,\n ContractEventName,\n Hash,\n Hex,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport {\n DeployableAlreadyDeployedError,\n DeployableBuildParametersUnspecifiedError,\n DeployableMissingPayloadError,\n DeployableWagmiConfigurationRequiredError,\n} from '../errors';\nimport { getDeployedContractAddress } from '../utils';\nimport { Contract } from './Contract';\n\n/**\n * A base class representing a deployable contract, contains base implementations for deployment and initialization payload construction.\n *\n * @export\n * @typedef {GenericDeployableParams}\n */\nexport type GenericDeployableParams = Omit<\n Parameters<typeof deployContract>[1],\n 'args' | 'account'\n> & {\n args: [Hex, ...Array<Hex>];\n account?: Account;\n};\n\n/**\n * A generic type that encapsulates either an initialization payload for a contract, or a valid address for a previously deployed contract.\n *\n * @export\n * @typedef {DeployablePayloadOrAddress}\n * @template [Payload=unknown]\n */\nexport type DeployablePayloadOrAddress<Payload = unknown> = Payload | Address;\n\n/**\n * Instantion options for the base deployable.\n *\n * @export\n * @interface DeployableOptions\n * @typedef {DeployableOptions}\n */\nexport interface DeployableOptions {\n /**\n * [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n *\n * @see {@link Config}\n * @type {Config}\n */\n config: Config;\n /**\n * [Viem Local Account](https://viem.sh/docs/accounts/local), required if in a Node environment\n *\n * @see {@link Account}\n * @type {?Account}\n */\n account?: Account;\n}\n\n/**\n * A generic deployable contract that encapsulates common operations related to contract deployment\n *\n * @export\n * @class Deployable\n * @typedef {Deployable}\n * @template [Payload=unknown]\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=ContractEventName<ContractAbi>]\n * @extends {Contract<ContractAbi, ContractEvent>}\n */\nexport class Deployable<\n Payload,\n ContractAbi extends Abi,\n> extends Contract<ContractAbi> {\n /**\n * The deployable payload used either for contract construction or initialization\n *\n * @protected\n * @type {(Payload | undefined)}\n */\n protected _payload: Payload | undefined;\n /**\n * If it exists, [Viem Local Account](https://viem.sh/docs/accounts/local), if in a Node environment\n *\n * @protected\n * @type {?Account}\n */\n protected _account?: Account;\n\n /**\n * Creates an instance of Deployable.\n *\n * @constructor\n * @param {DeployableOptions} param0\n * @param {?Account} [param0.account]\n * @param {Config} param0.config\n * @param {DeployablePayloadOrAddress<Payload>} payload\n */\n constructor(\n { account, config }: DeployableOptions,\n payload?: DeployablePayloadOrAddress<Payload>,\n ) {\n if (typeof payload === 'string') {\n super(config, payload as Address);\n } else {\n super(config, undefined);\n this._payload = payload as Payload;\n }\n if (account) this._account = account;\n }\n\n /**\n * Returns the attached deployable payload, if it exists\n *\n * @readonly\n * @type {Payload}\n */\n get payload() {\n return this._payload;\n }\n\n /**\n * Attaches a new payload for use with this deployable's initialization\n *\n * @public\n * @param {Payload} payload\n * @returns {this}\n */\n public withPayload(payload: Payload) {\n this._payload = payload;\n return this;\n }\n\n /**\n * High level deployment function to deploy and await the contract address.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - See [viem.WaitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n * @returns {unknown}\n */\n protected async deploy(\n _payload?: Payload,\n _options?: DeployableOptions,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n const config = _options?.config || this._config;\n const address = await getDeployedContractAddress(\n config,\n this.deployRaw(_payload, _options),\n waitParams,\n );\n this._address = address;\n return this;\n }\n\n /**\n * The lower level contract deployment function that does not await for the transaction receipt.\n * This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,\n * which makes it useless for Boost components.\n * Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {Promise<Hash>}\n * @throws {@link DeployableAlreadyDeployedError}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected async deployRaw(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): Promise<Hash> {\n if (this.address) throw new DeployableAlreadyDeployedError(this.address);\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return await deployContract(options.config, {\n ...this.buildParameters(payload),\n ...this.optionallyAttachAccount(options.account),\n });\n }\n\n /**\n * Internal function to attach the connected account to write methods to avoid manually passing in an account each call.\n *\n * @protected\n * @param {?Account} [account]\n * @returns {({ account: Account; } | { account?: undefined; })}\n */\n protected optionallyAttachAccount(account?: Account) {\n if (account) return { account };\n return this._account ? { account: this._account } : {};\n }\n\n /**\n * Base parameter constructor, should return a partial `viem.deployContract` parameters shape including abi, bytecode, and arguments, if any.\n * Expected to be overridden by protocol contracts.\n *\n * @public\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n throw new DeployableBuildParametersUnspecifiedError();\n }\n\n /**\n * Internal method used to ensure that a Wagmi configuration and payload are always present when deploying.\n *\n * @protected\n * @template [P=Payload]\n * @param {?P} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {[P, DeployableOptions]}\n * @throws {@link DeployableWagmiConfigurationRequiredError}\n * @throws {@link DeployableMissingPayloadError}\n */\n protected validateDeploymentConfig<P = Payload>(\n _payload?: P,\n _options?: DeployableOptions,\n ) {\n const options = _options || {\n config: this._config,\n account: this._account,\n };\n if (!options) throw new DeployableWagmiConfigurationRequiredError();\n const payload = _payload || this._payload;\n return [payload, options] as [P, DeployableOptions];\n }\n}\n"],"names":["Deployable","Contract","account","config","payload","_payload","_options","waitParams","address","getDeployedContractAddress","DeployableAlreadyDeployedError","options","deployContract","DeployableBuildParametersUnspecifiedError","DeployableWagmiConfigurationRequiredError"],"mappings":";;;;AA6EO,MAAMA,UAGHC,EAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAyB9B,YACE,EAAE,SAAAC,GAAS,QAAAC,EAAA,GACXC,GACA;AACI,IAAA,OAAOA,KAAY,WACrB,MAAMD,GAAQC,CAAkB,KAEhC,MAAMD,GAAQ,MAAS,GACvB,KAAK,WAAWC,IAEdF,MAAS,KAAK,WAAWA;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA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U,yBACRR,GACAC,GACA;AACA,UAAMK,IAAUL,KAAY;AAAA,MAC1B,QAAQ,KAAK;AAAA,MACb,SAAS,KAAK;AAAA,IAAA;AAEhB,QAAI,CAACK;AAAS,YAAM,IAAIG,EAA0C;AAE3D,WAAA,CADST,KAAY,KAAK,UAChBM,CAAO;AAAA,EAC1B;AACF;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../generated-wKBNvm48.cjs"),l=require("@wagmi/core"),i=require("viem"),c=require("../errors.cjs"),u=require("../utils.cjs"),h=require("./Deployable.cjs"),r=class r extends h.Deployable{constructor(s,e,t){super(s,e),this._isBase=!0,typeof e=="string"&&i.isAddress(e)&&e!==this.base&&e!==i.zeroAddress&&(t=!1),t!==void 0&&(this._isBase=t)}get isBase(){return this.address&&this.address!==this.base?!1:this._isBase}get base(){return this.constructor.base}get registryType(){return this.constructor.registryType}async deploy(s,e,t){return await super.deploy(s,e,t),this.assertValidAddress(),this}async deployRaw(s,e){if(this.address)throw new c.DeployableAlreadyDeployedError(this.address);const t=s||this._payload,o=(e==null?void 0:e.config)||this._config,{args:y,...d}=this.buildParameters(t);return await l.deployContract(o,{...d,...this.optionallyAttachAccount(e==null?void 0:e.account),args:[]})}async supportsInterface(s,e){return await n.Xn(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...e,args:[s]})}async getComponentInterface(s){return await n.Kn(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...s,args:[]})}validateDeploymentConfig(s,e){const t=s||this._payload;if(!t)throw new c.DeployableMissingPayloadError;return super.validateDeploymentConfig(t,e)}};r.base=i.zeroAddress,r.registryType=u.RegistryType.ACTION;let a=r;exports.DeployableTarget=a;
2
+ //# sourceMappingURL=DeployableTarget.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeployableTarget.cjs","sources":["../../src/Deployable/DeployableTarget.ts"],"sourcesContent":["import {\n type aCloneableAbi,\n readACloneableGetComponentInterface as readACloneableGetComponentInterface,\n readACloneableSupportsInterface,\n} from '@boostxyz/evm';\nimport { deployContract } from '@wagmi/core';\nimport {\n type Abi,\n type Address,\n type Hash,\n type Hex,\n type WaitForTransactionReceiptParameters,\n isAddress,\n zeroAddress,\n} from 'viem';\nimport {\n DeployableAlreadyDeployedError,\n DeployableMissingPayloadError,\n} from '../errors';\nimport { type ReadParams, RegistryType } from '../utils';\nimport {\n Deployable,\n type DeployableOptions,\n type DeployablePayloadOrAddress,\n} from './Deployable';\n\n/**\n * A base class representing a generic base Boost Protocol target contract, extended by Actions, AllowLists, Budgets, Incentives, and Validators.\n *\n * @export\n * @class DeployableTarget\n * @typedef {DeployableTarget}\n * @template [Payload=unknown]\n * @extends {Deployable<Payload>}\n */\nexport class DeployableTarget<\n Payload,\n ContractAbi extends Abi,\n> extends Deployable<Payload, ContractAbi> {\n /**\n * A static property representing the address of the base implementation on chain, used when cloning base contracts.\n *\n * @static\n * @readonly\n * @type {Address}\n */\n static readonly base: Address = zeroAddress;\n /**\n * The target's registry type.\n *\n * @static\n * @readonly\n * @type {RegistryType}\n */\n static readonly registryType: RegistryType = RegistryType.ACTION;\n /**\n * A property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.\n *\n * @readonly\n * @type {boolean}\n */\n protected _isBase = true;\n get isBase() {\n if (!!this.address && this.address !== this.base) return false;\n return this._isBase;\n }\n\n /**\n * Creates an instance of DeployableTarget.\n *\n * @constructor\n * @param {DeployableOptions} options\n * @param {DeployablePayloadOrAddress<Payload>} payload - Either a given implementation's initialization payload, or an address to an existing on chain target.\n * @param {?boolean} [isBase] - A property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.\n */\n constructor(\n options: DeployableOptions,\n payload: DeployablePayloadOrAddress<Payload>,\n isBase?: boolean,\n ) {\n super(options, payload);\n // if supplying a custom address, safe enough to assume it is not a base address which makes reusing contracts like budgets easier\n if (\n typeof payload === 'string' &&\n isAddress(payload) &&\n payload !== this.base &&\n payload !== zeroAddress\n )\n isBase = false;\n if (isBase !== undefined) this._isBase = isBase;\n }\n\n /**\n * A getter that will return the base implementation's static address\n *\n * @public\n * @readonly\n * @type {Address}\n */\n public get base(): Address {\n return (this.constructor as typeof DeployableTarget).base;\n }\n\n /**\n * A getter that returns the registry type of the base implementation\n *\n * @public\n * @readonly\n * @type {RegistryType}\n */\n public get registryType(): RegistryType {\n return (this.constructor as typeof DeployableTarget).registryType;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @async\n * @param {?Payload} [payload]\n * @param {?DeployableOptions} [options]\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {unknown}\n */\n protected override async deploy(\n payload?: Payload,\n options?: DeployableOptions,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n await super.deploy(payload, options, waitParams);\n this.assertValidAddress();\n return this;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {Promise<Hash>}\n */\n protected override async deployRaw(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): Promise<Hash> {\n if (this.address) throw new DeployableAlreadyDeployedError(this.address);\n const payload = _payload || this._payload;\n const config = _options?.config || this._config;\n const { args, ...deployment } = this.buildParameters(payload);\n return await deployContract(config, {\n ...deployment,\n ...this.optionallyAttachAccount(_options?.account),\n // Deployable targets don't construct with arguments, they initialize with encoded payloads\n args: [],\n });\n }\n\n /**\n * Check if the contract supports the given interface\n *\n * @public\n * @async\n * @param {Hex} interfaceId - The interface identifier\n * @param {?ReadParams<typeof contractActionAbi, 'supportsInterface'>} [params]\n * @returns {unknown} - True if the contract supports the interface\n */\n public async supportsInterface(\n interfaceId: Hex,\n params?: ReadParams<typeof aCloneableAbi, 'supportsInterface'>,\n ) {\n return await readACloneableSupportsInterface(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n args: [interfaceId],\n });\n }\n\n /**\n * Return a cloneable's unique identifier for downstream consumers to differentiate various targets\n * All implementations must override this function\n *\n * @public\n * @async\n * @param {?ReadParams<typeof contractActionAbi, 'getComponentInterface'>} [params]\n * @returns {unknown}\n */\n public async getComponentInterface(\n params?: ReadParams<typeof aCloneableAbi, 'getComponentInterface'>,\n ) {\n return await readACloneableGetComponentInterface(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n args: [],\n });\n }\n\n /**\n * @inheritdoc\n *\n * @protected\n * @template [P=Payload]\n * @param {?P} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {[P, DeployableOptions]}\n */\n protected override validateDeploymentConfig<P = Payload>(\n _payload?: P,\n _options?: DeployableOptions,\n ) {\n const payload = _payload || this._payload;\n if (!payload) throw new DeployableMissingPayloadError();\n return super.validateDeploymentConfig(payload, _options) as [\n P,\n DeployableOptions,\n ];\n }\n}\n"],"names":["_DeployableTarget","Deployable","options","payload","isBase","isAddress","zeroAddress","waitParams","_payload","_options","DeployableAlreadyDeployedError","config","args","deployment","deployContract","interfaceId","params","readACloneableSupportsInterface","readACloneableGetComponentInterface","DeployableMissingPayloadError","RegistryType","DeployableTarget"],"mappings":"2PAmCaA,EAAN,MAAMA,UAGHC,EAAAA,UAAiC,CAqCzC,YACEC,EACAC,EACAC,EACA,CACA,MAAMF,EAASC,CAAO,EAnBxB,KAAU,QAAU,GAsBhB,OAAOA,GAAY,UACnBE,YAAUF,CAAO,GACjBA,IAAY,KAAK,MACjBA,IAAYG,EAAA,cAEHF,EAAA,IACPA,IAAW,SAAW,KAAK,QAAUA,EAC3C,CA5BA,IAAI,QAAS,CACX,OAAM,KAAK,SAAW,KAAK,UAAY,KAAK,KAAa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ableAbi } from '@boostxyz/evm';
2
+ import { type Abi, type Address, type Hash, type Hex, type WaitForTransactionReceiptParameters } from 'viem';
3
+ import { type ReadParams, RegistryType } from '../utils';
4
+ import { Deployable, type DeployableOptions, type DeployablePayloadOrAddress } from './Deployable';
5
+ /**
6
+ * A base class representing a generic base Boost Protocol target contract, extended by Actions, AllowLists, Budgets, Incentives, and Validators.
7
+ *
8
+ * @export
9
+ * @class DeployableTarget
10
+ * @typedef {DeployableTarget}
11
+ * @template [Payload=unknown]
12
+ * @extends {Deployable<Payload>}
13
+ */
14
+ export declare class DeployableTarget<Payload, ContractAbi extends Abi> extends Deployable<Payload, ContractAbi> {
15
+ /**
16
+ * A static property representing the address of the base implementation on chain, used when cloning base contracts.
17
+ *
18
+ * @static
19
+ * @readonly
20
+ * @type {Address}
21
+ */
22
+ static readonly base: Address;
23
+ /**
24
+ * The target's registry type.
25
+ *
26
+ * @static
27
+ * @readonly
28
+ * @type {RegistryType}
29
+ */
30
+ static readonly registryType: RegistryType;
31
+ /**
32
+ * A property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.
33
+ *
34
+ * @readonly
35
+ * @type {boolean}
36
+ */
37
+ protected _isBase: boolean;
38
+ get isBase(): boolean;
39
+ /**
40
+ * Creates an instance of DeployableTarget.
41
+ *
42
+ * @constructor
43
+ * @param {DeployableOptions} options
44
+ * @param {DeployablePayloadOrAddress<Payload>} payload - Either a given implementation's initialization payload, or an address to an existing on chain target.
45
+ * @param {?boolean} [isBase] - A property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.
46
+ */
47
+ constructor(options: DeployableOptions, payload: DeployablePayloadOrAddress<Payload>, isBase?: boolean);
48
+ /**
49
+ * A getter that will return the base implementation's static address
50
+ *
51
+ * @public
52
+ * @readonly
53
+ * @type {Address}
54
+ */
55
+ get base(): Address;
56
+ /**
57
+ * A getter that returns the registry type of the base implementation
58
+ *
59
+ * @public
60
+ * @readonly
61
+ * @type {RegistryType}
62
+ */
63
+ get registryType(): RegistryType;
64
+ /**
65
+ * @inheritdoc
66
+ *
67
+ * @public
68
+ * @async
69
+ * @param {?Payload} [payload]
70
+ * @param {?DeployableOptions} [options]
71
+ * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]
72
+ * @returns {unknown}
73
+ */
74
+ protected deploy(payload?: Payload, options?: DeployableOptions, waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>): Promise<this>;
75
+ /**
76
+ * @inheritdoc
77
+ *
78
+ * @public
79
+ * @async
80
+ * @param {?Payload} [_payload]
81
+ * @param {?DeployableOptions} [_options]
82
+ * @returns {Promise<Hash>}
83
+ */
84
+ protected deployRaw(_payload?: Payload, _options?: DeployableOptions): Promise<Hash>;
85
+ /**
86
+ * Check if the contract supports the given interface
87
+ *
88
+ * @public
89
+ * @async
90
+ * @param {Hex} interfaceId - The interface identifier
91
+ * @param {?ReadParams<typeof contractActionAbi, 'supportsInterface'>} [params]
92
+ * @returns {unknown} - True if the contract supports the interface
93
+ */
94
+ supportsInterface(interfaceId: Hex, params?: ReadParams<typeof aCloneableAbi, 'supportsInterface'>): Promise<boolean>;
95
+ /**
96
+ * Return a cloneable's unique identifier for downstream consumers to differentiate various targets
97
+ * All implementations must override this function
98
+ *
99
+ * @public
100
+ * @async
101
+ * @param {?ReadParams<typeof contractActionAbi, 'getComponentInterface'>} [params]
102
+ * @returns {unknown}
103
+ */
104
+ getComponentInterface(params?: ReadParams<typeof aCloneableAbi, 'getComponentInterface'>): Promise<`0x${string}`>;
105
+ /**
106
+ * @inheritdoc
107
+ *
108
+ * @protected
109
+ * @template [P=Payload]
110
+ * @param {?P} [_payload]
111
+ * @param {?DeployableOptions} [_options]
112
+ * @returns {[P, DeployableOptions]}
113
+ */
114
+ protected validateDeploymentConfig<P = Payload>(_payload?: P, _options?: DeployableOptions): [P, DeployableOptions];
115
+ }
116
+ //# sourceMappingURL=DeployableTarget.d.ts.map
@@ -0,0 +1 @@
1
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C,EAAE,iBAAiB,GAC3B,OAAO,CAAC,IAAI,CAAC;IAahB;;;;;;;;OAQG;IACU,iBAAiB,CAC5B,WAAW,EAAE,GAAG,EAChB,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,aAAa,EAAE,mBAAmB,CAAC;IAWhE;;;;;;;;OAQG;IACU,qBAAqB,CAChC,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,aAAa,EAAE,uBAAuB,CAAC;IAWpE;;;;;;;;OAQG;cACgB,wBAAwB,CAAC,CAAC,GAAG,OAAO,EACrD,QAAQ,CAAC,EAAE,CAAC,EACZ,QAAQ,CAAC,EAAE,iBAAiB;CAS/B"}
@@ -0,0 +1,132 @@
1
+ import { b as d, K as c } from "../generated-BDeDiaCK.js";
2
+ import { deployContract as h } from "@wagmi/core";
3
+ import { isAddress as y, zeroAddress as i } from "viem";
4
+ import { DeployableAlreadyDeployedError as l, DeployableMissingPayloadError as f } from "../errors.js";
5
+ import { RegistryType as u } from "../utils.js";
6
+ import { Deployable as p } from "./Deployable.js";
7
+ const e = class e extends p {
8
+ /**
9
+ * Creates an instance of DeployableTarget.
10
+ *
11
+ * @constructor
12
+ * @param {DeployableOptions} options
13
+ * @param {DeployablePayloadOrAddress<Payload>} payload - Either a given implementation's initialization payload, or an address to an existing on chain target.
14
+ * @param {?boolean} [isBase] - A property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.
15
+ */
16
+ constructor(t, s, r) {
17
+ super(t, s), this._isBase = !0, typeof s == "string" && y(s) && s !== this.base && s !== i && (r = !1), r !== void 0 && (this._isBase = r);
18
+ }
19
+ get isBase() {
20
+ return this.address && this.address !== this.base ? !1 : this._isBase;
21
+ }
22
+ /**
23
+ * A getter that will return the base implementation's static address
24
+ *
25
+ * @public
26
+ * @readonly
27
+ * @type {Address}
28
+ */
29
+ get base() {
30
+ return this.constructor.base;
31
+ }
32
+ /**
33
+ * A getter that returns the registry type of the base implementation
34
+ *
35
+ * @public
36
+ * @readonly
37
+ * @type {RegistryType}
38
+ */
39
+ get registryType() {
40
+ return this.constructor.registryType;
41
+ }
42
+ /**
43
+ * @inheritdoc
44
+ *
45
+ * @public
46
+ * @async
47
+ * @param {?Payload} [payload]
48
+ * @param {?DeployableOptions} [options]
49
+ * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]
50
+ * @returns {unknown}
51
+ */
52
+ async deploy(t, s, r) {
53
+ return await super.deploy(t, s, r), this.assertValidAddress(), this;
54
+ }
55
+ /**
56
+ * @inheritdoc
57
+ *
58
+ * @public
59
+ * @async
60
+ * @param {?Payload} [_payload]
61
+ * @param {?DeployableOptions} [_options]
62
+ * @returns {Promise<Hash>}
63
+ */
64
+ async deployRaw(t, s) {
65
+ if (this.address)
66
+ throw new l(this.address);
67
+ const r = t || this._payload, o = (s == null ? void 0 : s.config) || this._config, { args: g, ...n } = this.buildParameters(r);
68
+ return await h(o, {
69
+ ...n,
70
+ ...this.optionallyAttachAccount(s == null ? void 0 : s.account),
71
+ // Deployable targets don't construct with arguments, they initialize with encoded payloads
72
+ args: []
73
+ });
74
+ }
75
+ /**
76
+ * Check if the contract supports the given interface
77
+ *
78
+ * @public
79
+ * @async
80
+ * @param {Hex} interfaceId - The interface identifier
81
+ * @param {?ReadParams<typeof contractActionAbi, 'supportsInterface'>} [params]
82
+ * @returns {unknown} - True if the contract supports the interface
83
+ */
84
+ async supportsInterface(t, s) {
85
+ return await d(this._config, {
86
+ address: this.assertValidAddress(),
87
+ ...this.optionallyAttachAccount(),
88
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
89
+ ...s,
90
+ args: [t]
91
+ });
92
+ }
93
+ /**
94
+ * Return a cloneable's unique identifier for downstream consumers to differentiate various targets
95
+ * All implementations must override this function
96
+ *
97
+ * @public
98
+ * @async
99
+ * @param {?ReadParams<typeof contractActionAbi, 'getComponentInterface'>} [params]
100
+ * @returns {unknown}
101
+ */
102
+ async getComponentInterface(t) {
103
+ return await c(this._config, {
104
+ address: this.assertValidAddress(),
105
+ ...this.optionallyAttachAccount(),
106
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
107
+ ...t,
108
+ args: []
109
+ });
110
+ }
111
+ /**
112
+ * @inheritdoc
113
+ *
114
+ * @protected
115
+ * @template [P=Payload]
116
+ * @param {?P} [_payload]
117
+ * @param {?DeployableOptions} [_options]
118
+ * @returns {[P, DeployableOptions]}
119
+ */
120
+ validateDeploymentConfig(t, s) {
121
+ const r = t || this._payload;
122
+ if (!r)
123
+ throw new f();
124
+ return super.validateDeploymentConfig(r, s);
125
+ }
126
+ };
127
+ e.base = i, e.registryType = u.ACTION;
128
+ let a = e;
129
+ export {
130
+ a as DeployableTarget
131
+ };
132
+ //# sourceMappingURL=DeployableTarget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeployableTarget.js","sources":["../../src/Deployable/DeployableTarget.ts"],"sourcesContent":["import {\n type aCloneableAbi,\n readACloneableGetComponentInterface as readACloneableGetComponentInterface,\n readACloneableSupportsInterface,\n} from '@boostxyz/evm';\nimport { deployContract } from '@wagmi/core';\nimport {\n type Abi,\n type Address,\n type Hash,\n type Hex,\n type WaitForTransactionReceiptParameters,\n isAddress,\n zeroAddress,\n} from 'viem';\nimport {\n DeployableAlreadyDeployedError,\n DeployableMissingPayloadError,\n} from '../errors';\nimport { type ReadParams, RegistryType } from '../utils';\nimport {\n Deployable,\n type DeployableOptions,\n type DeployablePayloadOrAddress,\n} from './Deployable';\n\n/**\n * A base class representing a generic base Boost Protocol target contract, extended by Actions, AllowLists, Budgets, Incentives, and Validators.\n *\n * @export\n * @class DeployableTarget\n * @typedef {DeployableTarget}\n * @template [Payload=unknown]\n * @extends {Deployable<Payload>}\n */\nexport class DeployableTarget<\n Payload,\n ContractAbi extends Abi,\n> extends Deployable<Payload, ContractAbi> {\n /**\n * A static property representing the address of the base implementation on chain, used when cloning base contracts.\n *\n * @static\n * @readonly\n * @type {Address}\n */\n static readonly base: Address = zeroAddress;\n /**\n * The target's registry type.\n *\n * @static\n * @readonly\n * @type {RegistryType}\n */\n static readonly registryType: RegistryType = RegistryType.ACTION;\n /**\n * A property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.\n *\n * @readonly\n * @type {boolean}\n */\n protected _isBase = true;\n get isBase() {\n if (!!this.address && this.address !== this.base) return false;\n return this._isBase;\n }\n\n /**\n * Creates an instance of DeployableTarget.\n *\n * @constructor\n * @param {DeployableOptions} options\n * @param {DeployablePayloadOrAddress<Payload>} payload - Either a given implementation's initialization payload, or an address to an existing on chain target.\n * @param {?boolean} [isBase] - A property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.\n */\n constructor(\n options: DeployableOptions,\n payload: DeployablePayloadOrAddress<Payload>,\n isBase?: boolean,\n ) {\n super(options, payload);\n // if supplying a custom address, safe enough to assume it is not a base address which makes reusing contracts like budgets easier\n if (\n typeof payload === 'string' &&\n isAddress(payload) &&\n payload !== this.base &&\n payload !== zeroAddress\n )\n isBase = false;\n if (isBase !== undefined) this._isBase = isBase;\n }\n\n /**\n * A getter that will return the base implementation's static address\n *\n * @public\n * @readonly\n * @type {Address}\n */\n public get base(): Address {\n return (this.constructor as typeof DeployableTarget).base;\n }\n\n /**\n * A getter that returns the registry type of the base implementation\n *\n * @public\n * @readonly\n * @type {RegistryType}\n */\n public get registryType(): RegistryType {\n return (this.constructor as typeof DeployableTarget).registryType;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @async\n * @param {?Payload} [payload]\n * @param {?DeployableOptions} [options]\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {unknown}\n */\n protected override async deploy(\n payload?: Payload,\n options?: DeployableOptions,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n await super.deploy(payload, options, waitParams);\n this.assertValidAddress();\n return this;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @async\n * @param {?Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {Promise<Hash>}\n */\n protected override async deployRaw(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): Promise<Hash> {\n if (this.address) throw new DeployableAlreadyDeployedError(this.address);\n const payload = _payload || this._payload;\n const config = _options?.config || this._config;\n const { args, ...deployment } = this.buildParameters(payload);\n return await deployContract(config, {\n ...deployment,\n ...this.optionallyAttachAccount(_options?.account),\n // Deployable targets don't construct with arguments, they initialize with encoded payloads\n args: [],\n });\n }\n\n /**\n * Check if the contract supports the given interface\n *\n * @public\n * @async\n * @param {Hex} interfaceId - The interface identifier\n * @param {?ReadParams<typeof contractActionAbi, 'supportsInterface'>} [params]\n * @returns {unknown} - True if the contract supports the interface\n */\n public async supportsInterface(\n interfaceId: Hex,\n params?: ReadParams<typeof aCloneableAbi, 'supportsInterface'>,\n ) {\n return await readACloneableSupportsInterface(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n args: [interfaceId],\n });\n }\n\n /**\n * Return a cloneable's unique identifier for downstream consumers to differentiate various targets\n * All implementations must override this function\n *\n * @public\n * @async\n * @param {?ReadParams<typeof contractActionAbi, 'getComponentInterface'>} [params]\n * @returns {unknown}\n */\n public async getComponentInterface(\n params?: ReadParams<typeof aCloneableAbi, 'getComponentInterface'>,\n ) {\n return await readACloneableGetComponentInterface(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n args: [],\n });\n }\n\n /**\n * @inheritdoc\n *\n * @protected\n * @template [P=Payload]\n * @param {?P} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {[P, DeployableOptions]}\n */\n protected override validateDeploymentConfig<P = Payload>(\n _payload?: P,\n _options?: DeployableOptions,\n ) {\n const payload = _payload || this._payload;\n if (!payload) throw new DeployableMissingPayloadError();\n return super.validateDeploymentConfig(payload, _options) as [\n P,\n DeployableOptions,\n ];\n }\n}\n"],"names":["_DeployableTarget","Deployable","options","payload","isBase","isAddress","zeroAddress","waitParams","_payload","_options","DeployableAlreadyDeployedError","config","args","deployment","deployContract","interfaceId","params","readACloneableSupportsInterface","readACloneableGetComponentInterface","DeployableMissingPayloadError","RegistryType","DeployableTarget"],"mappings":";;;;;;AAmCO,MAAMA,IAAN,MAAMA,UAGHC,EAAiC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqCzC,YACEC,GACAC,GACAC,GACA;AACA,UAAMF,GAASC,CAAO,GAnBxB,KAAU,UAAU,IAsBhB,OAAOA,KAAY,YACnBE,EAAUF,CAAO,KACjBA,MAAY,KAAK,QACjBA,MAAYG,MAEHF,IAAA,KACPA,MAAW,WAAW,KAAK,UAAUA;AAAA,EAC3C;AAAA,EA5BA,IAAI,SAAS;AACX,WAAM,KAAK,WAAW,KAAK,YAAY,KAAK,OAAa,KAClD,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkCA,IAAW,OAAgB;AACzB,WAAQ,KAAK,YAAwC;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,IAAW,eAA6B;AACtC,WAAQ,KAAK,YAAwC;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAyB,OACvBD,GACAD,GACAK,GACA;AACA,iBAAM,MAAM,OAAOJ,GAASD,GAASK,CAAU,GAC/C,KAAK,mBAAmB,GACjB;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAyB,UACvBC,GACAC,GACe;AACf,QAA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strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../generated-wKBNvm48.cjs"),n=require("viem");require("@wagmi/core");const l=require("../AllowLists/SimpleAllowList.cjs");require("../AllowLists/SimpleDenyList.cjs");const o=require("../Deployable/DeployableTarget.cjs"),t=require("../claiming.cjs"),u=require("../utils.cjs"),h="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611791806100bd5f395ff3fe60806040526004361061011e575f3560e01c806387b9d25c1161009f578063db09da1211610063578063db09da1214610390578063dcc59b6f146103cc578063f04e283e146103f6578063f2fde38b14610412578063fee81cf41461042e5761011e565b806387b9d25c1461029a5780638da5cb5b146102c4578063a4d66daf146102ee578063bb1757cf14610318578063c884ef83146103545761011e565b8063439fab91116100e6578063439fab91146101e6578063474f5a441461020e5780634e7165a21461024a57806354d1f13d14610286578063715018a6146102905761011e565b806301ffc9a71461012257806307621eca1461015e578063228cb7331461018857806325692962146101b257806328d6183b146101bc575b5f80fd5b34801561012d575f80fd5b5061014860048036038101906101439190610fa9565b61046a565b6040516101559190610fee565b60405180910390f35b348015610169575f80fd5b506101726104e3565b60405161017f919061101f565b60405180910390f35b348015610193575f80fd5b5061019c6104ec565b6040516101a9919061101f565b60405180910390f35b6101ba6104f2565b005b3480156101c7575f80fd5b506101d0610543565b6040516101dd9190611047565b60405180910390f35b3480156101f1575f80fd5b5061020c600480360381019061020791906110c1565b61056a565b005b348015610219575f80fd5b50610234600480360381019061022f91906110c1565b61064a565b6040516102419190610fee565b60405180910390f35b348015610255575f80fd5b50610270600480360381019061026b91906110c1565b61067d565b60405161027d919061117c565b60405180910390f35b61028e6106d4565b005b61029861070d565b005b3480156102a5575f80fd5b506102ae610720565b6040516102bb9190611216565b60405180910390f35b3480156102cf575f80fd5b506102d8610745565b6040516102e5919061124f565b60405180910390f35b3480156102f9575f80fd5b5061030261076d565b60405161030f919061101f565b60405180910390f35b348015610323575f80fd5b5061033e60048036038101906103399190611292565b610773565b60405161034b9190610fee565b60405180910390f35b34801561035f575f80fd5b5061037a600480360381019061037591906112ef565b610918565b6040516103879190610fee565b60405180910390f35b34801561039b575f80fd5b506103b660048036038101906103b19190611292565b610935565b6040516103c39190610fee565b60405180910390f35b3480156103d7575f80fd5b506103e0610a3a565b6040516103ed919061101f565b60405180910390f35b610410600480360381019061040b91906112ef565b610a3f565b005b61042c600480360381019061042791906112ef565b610a7d565b005b348015610439575f80fd5b50610454600480360381019061044f91906112ef565b610aa6565b604051610461919061101f565b60405180910390f35b5f7f0a466e6f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806104dc57506104db82610abf565b5b9050919050565b5f600154905090565b60015481565b5f6104fb610b38565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f0a466e6f00000000000000000000000000000000000000000000000000000000905090565b5f610573610b42565b905080546003825580156105a55760018160011c14303b1061059c5763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f83838101906105b69190611448565b90506105c133610b6b565b805f015160035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060200151600481905550508015610645576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f6040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60605f67ffffffffffffffff8111156106995761069861131e565b5b6040519080825280601f01601f1916602001820160405280156106cb5781602001600182028036833780820191505090505b50905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610715610c41565b61071e5f610c78565b565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60045481565b5f61077c610c41565b6004545f80815480929190610790906114a0565b919050551015806107e7575060025f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff165b1561081e576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160025f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f8061087e86610d3e565b9150915060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633abb060483836040518363ffffffff1660e01b81526004016108de929190611655565b5f604051808303815f87803b1580156108f5575f80fd5b505af1158015610907573d5f803e3d5ffd5b505050506001925050509392505050565b6002602052805f5260405f205f915054906101000a900460ff1681565b5f6004545f5410801561098f575060025f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b8015610a31575060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e3f756de856040518263ffffffff1660e01b81526004016109f091906116ad565b602060405180830381865afa158015610a0b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a2f9190611703565b155b90509392505050565b5f5481565b610a47610c41565b63389a75e1600c52805f526020600c208054421115610a6d57636f5e88185f526004601cfd5b5f815550610a7a81610c78565b50565b610a85610c41565b8060601b610a9a57637448fbae5f526004601cfd5b610aa381610c78565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f5970a689000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610b315750610b3082610e5d565b5b9050919050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610b73610ed6565b15610beb577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415610bad57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350610c3e565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610c76576382b429005f526004601cfd5b565b610c80610ed6565b15610ce5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550610d3b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b6060805f600167ffffffffffffffff811115610d5d57610d5c61131e565b5b604051908082528060200260200182016040528015610d8b5781602001602082028036833780820191505090505b5090505f600167ffffffffffffffff811115610daa57610da961131e565b5b604051908082528060200260200182016040528015610dd85781602001602082028036833780820191505090505b50905084825f81518110610def57610dee61172e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001815f81518110610e3e57610e3d61172e565b5b6020026020010190151590811515815250508181935093505050915091565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610ecf5750610ece82610eda565b5b9050919050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610f8881610f54565b8114610f92575f80fd5b50565b5f81359050610fa381610f7f565b92915050565b5f60208284031215610fbe57610fbd610f4c565b5b5f610fcb84828501610f95565b91505092915050565b5f8115159050919050565b610fe881610fd4565b82525050565b5f6020820190506110015f830184610fdf565b92915050565b5f819050919050565b61101981611007565b82525050565b5f6020820190506110325f830184611010565b92915050565b61104181610f54565b82525050565b5f60208201905061105a5f830184611038565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261108157611080611060565b5b8235905067ffffffffffffffff81111561109e5761109d611064565b5b6020830191508360018202830111156110ba576110b9611068565b5b9250929050565b5f80602083850312156110d7576110d6610f4c565b5b5f83013567ffffffffffffffff8111156110f4576110f3610f50565b5b6111008582860161106c565b92509250509250929050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61114e8261110c565b6111588185611116565b9350611168818560208601611126565b61117181611134565b840191505092915050565b5f6020820190508181035f8301526111948184611144565b905092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f6111de6111d96111d48461119c565b6111bb565b61119c565b9050919050565b5f6111ef826111c4565b9050919050565b5f611200826111e5565b9050919050565b611210816111f6565b82525050565b5f6020820190506112295f830184611207565b92915050565b5f6112398261119c565b9050919050565b6112498161122f565b82525050565b5f6020820190506112625f830184611240565b92915050565b6112718161122f565b811461127b575f80fd5b50565b5f8135905061128c81611268565b92915050565b5f805f604084860312156112a9576112a8610f4c565b5b5f6112b68682870161127e565b935050602084013567ffffffffffffffff8111156112d7576112d6610f50565b5b6112e38682870161106c565b92509250509250925092565b5f6020828403121561130457611303610f4c565b5b5f6113118482850161127e565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61135482611134565b810181811067ffffffffffffffff821117156113735761137261131e565b5b80604052505050565b5f611385610f43565b9050611391828261134b565b919050565b5f6113a08261122f565b9050919050565b6113b081611396565b81146113ba575f80fd5b50565b5f813590506113cb816113a7565b92915050565b6113da81611007565b81146113e4575f80fd5b50565b5f813590506113f5816113d1565b92915050565b5f604082840312156114105761140f61131a565b5b61141a604061137c565b90505f611429848285016113bd565b5f83015250602061143c848285016113e7565b60208301525092915050565b5f6040828403121561145d5761145c610f4c565b5b5f61146a848285016113fb565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6114aa82611007565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036114dc576114db611473565b5b600182019050919050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6115198161122f565b82525050565b5f61152a8383611510565b60208301905092915050565b5f602082019050919050565b5f61154c826114e7565b61155681856114f1565b935061156183611501565b805f5b83811015611591578151611578888261151f565b975061158383611536565b925050600181019050611564565b5085935050505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6115d081610fd4565b82525050565b5f6115e183836115c7565b60208301905092915050565b5f602082019050919050565b5f6116038261159e565b61160d81856115a8565b9350611618836115b8565b805f5b8381101561164857815161162f88826115d6565b975061163a836115ed565b92505060018101905061161b565b5085935050505092915050565b5f6040820190508181035f83015261166d8185611542565b9050818103602083015261168181846115f9565b90509392505050565b50565b5f6116985f83611116565b91506116a38261168a565b5f82019050919050565b5f6040820190506116c05f830184611240565b81810360208301526116d18161168d565b905092915050565b6116e281610fd4565b81146116ec575f80fd5b50565b5f815190506116fd816116d9565b92915050565b5f6020828403121561171857611717610f4c565b5b5f611725848285016116ef565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffdfea26469706673582212208bc630e11c065de18b61496283ea93bb882211261a2de5178b91a410f78a5c9a64736f6c634300081a0033",e=class e extends o.DeployableTarget{constructor(){super(...arguments),this.abi=b.A}async owner(f){return await b.ju(this._config,{address:this.assertValidAddress(),args:[],...f})}async claims(f){return await b.Pu(this._config,{address:this.assertValidAddress(),args:[],...f})}async reward(f){return await b.Ju(this._config,{address:this.assertValidAddress(),args:[],...f})}async claimed(f,a){return await b.Du(this._config,{address:this.assertValidAddress(),args:[f],...a})}async allowList(f){const a=await b.ku(this._config,{address:this.assertValidAddress(),...f});return new l.SimpleAllowList({config:this._config,account:this._account},a)}async limit(f){return await b.$u(this._config,{address:this.assertValidAddress(),...f})}async claim(f,a){return await this.awaitResult(this.claimRaw(f,a))}async claimRaw(f,a){const{request:d,result:c}=await b.pl(this._config,{address:this.assertValidAddress(),args:[t.prepareClaimPayload(f)],...this.optionallyAttachAccount(),...a});return{hash:await b.el(this._config,d),result:c}}async isClaimable(f,a){return await b.Zu(this._config,{address:this.assertValidAddress(),args:[t.prepareClaimPayload(f)],...a})}buildParameters(f,a){const[d,c]=this.validateDeploymentConfig(f,a);return{abi:b.A,bytecode:h,args:[i(d)],...this.optionallyAttachAccount(c.account)}}};e.base="0x8d80dfac4927387E6819B76b850aF50d2E29835a",e.registryType=u.RegistryType.INCENTIVE;let s=e;const i=({allowList:r,limit:f})=>n.encodeAbiParameters([{type:"address",name:"allowList"},{type:"uint256",name:"limit"}],[r,f]);exports.allowListIncentiveAbi=b.A;exports.AllowListIncentive=s;exports.prepareAllowListIncentivePayload=i;
2
+ //# sourceMappingURL=AllowListIncentive.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AllowListIncentive.cjs","sources":["../../src/Incentives/AllowListIncentive.ts"],"sourcesContent":["import {\n allowListIncentiveAbi,\n readAllowListIncentiveAllowList,\n readAllowListIncentiveClaimed,\n readAllowListIncentiveClaims,\n readAllowListIncentiveIsClaimable,\n readAllowListIncentiveLimit,\n readAllowListIncentiveOwner,\n readAllowListIncentiveReward,\n simulateAllowListIncentiveClaim,\n writeAllowListIncentiveClaim,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/AllowListIncentive.sol/AllowListIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n} from 'viem';\nimport { SimpleAllowList } from '../AllowLists/AllowList';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { allowListIncentiveAbi };\n\n/**\n * The object representation of a `AllowListIncentive.InitPayload`\n *\n * @export\n * @interface AllowListIncentivePayload\n * @typedef {AllowListIncentivePayload}\n */\nexport interface AllowListIncentivePayload {\n /**\n * The address to the allowlist to add claimers to.\n *\n * @type {Address}\n */\n allowList: Address;\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * A generic `viem.Log` event with support for `AllowListIncentive` event types.\n *\n * @export\n * @typedef {AllowListIncentiveLog}\n * @template {ContractEventName<\n * typeof allowListIncentiveAbi\n * >} [event=ContractEventName<typeof allowListIncentiveAbi>]\n */\nexport type AllowListIncentiveLog<\n event extends ContractEventName<\n typeof allowListIncentiveAbi\n > = ContractEventName<typeof allowListIncentiveAbi>,\n> = GenericLog<typeof allowListIncentiveAbi, event>;\n\n/**\n * An incentive implementation that grants the claimer a slot on an {SimpleAllowList}\n * In order for any claim to be successful:\n * - The claimer must not already be on the allow list; and\n * - The maximum number of claims must not have been reached; and\n * - This contract must be authorized to modify the allow list\n *\n * @export\n * @class AllowListIncentive\n * @typedef {AllowListIncentive}\n * @extends {DeployableTarget<AllowListIncentivePayload>}\n */\nexport class AllowListIncentive extends DeployableTarget<\n AllowListIncentivePayload,\n typeof allowListIncentiveAbi\n> {\n public override readonly abi = allowListIncentiveAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env\n .VITE_ALLOWLIST_INCENTIVE_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the allowList\n *\n * @public\n * @async\n * @param {?ReadParams<typeof allowListIncentiveAbi, 'owner'>} [params]\n * @returns {unknown}\n */\n public async owner(\n params?: ReadParams<typeof allowListIncentiveAbi, 'owner'>,\n ) {\n return await readAllowListIncentiveOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams<typeof allowListIncentiveAbi, 'claims'>} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(\n params?: ReadParams<typeof allowListIncentiveAbi, 'claims'>,\n ) {\n return await readAllowListIncentiveClaims(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams<typeof allowListIncentiveAbi, 'reward'>} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(\n params?: ReadParams<typeof allowListIncentiveAbi, 'reward'>,\n ) {\n return await readAllowListIncentiveReward(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the claim status for a user\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams<typeof allowListIncentiveAbi, 'claimed'>} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(\n address: Address,\n params?: ReadParams<typeof allowListIncentiveAbi, 'claimed'>,\n ) {\n return await readAllowListIncentiveClaimed(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The {@link SimpleAllowList} contract\n *\n * @public\n * @async\n * @param {?ReadParams<typeof allowListIncentiveAbi, 'allowList'>} [params]\n * @returns {Promise<SimpleAllowList>}\n */\n public async allowList(\n params?: ReadParams<typeof allowListIncentiveAbi, 'allowList'>,\n ): Promise<SimpleAllowList> {\n const address = await readAllowListIncentiveAllowList(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n return new SimpleAllowList(\n { config: this._config, account: this._account },\n address,\n );\n }\n\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @public\n * @async\n * @param {?ReadParams<typeof allowListIncentiveAbi, 'limit'>} [params]\n * @returns {unknown}\n */\n public async limit(\n params?: ReadParams<typeof allowListIncentiveAbi, 'limit'>,\n ) {\n return await readAllowListIncentiveLimit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim a slot on the {@link SimpleAllowList}\n *\n * @public\n * @async\n * @param {Pick<ClaimPayload, 'target'>} payload\n * @param {?WriteParams<typeof allowListIncentiveAbi, 'claim'>} [params]\n * @returns {Promise<true>} - return true if successful, otherwise revert\n */\n protected async claim(\n payload: Pick<ClaimPayload, 'target'>,\n params?: WriteParams<typeof allowListIncentiveAbi, 'claim'>,\n ) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim a slot on the {@link SimpleAllowList}\n *\n * @public\n * @async\n * @param {Pick<ClaimPayload, 'target'>} payload\n * @param {?WriteParams<typeof allowListIncentiveAbi, 'claim'>} [params]\n * @returns {Promise<true>} - return true if successful, otherwise revert\n */\n protected async claimRaw(\n payload: Pick<ClaimPayload, 'target'>,\n params?: WriteParams<typeof allowListIncentiveAbi, 'claim'>,\n ) {\n const { request, result } = await simulateAllowListIncentiveClaim(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeAllowListIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable\n *\n * @public\n * @async\n * @param {Pick<ClaimPayload, 'target'>} payload\n * @param {?ReadParams<typeof allowListIncentiveAbi, 'isClaimable'>} [params]\n * @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload\n */\n public async isClaimable(\n payload: Pick<ClaimPayload, 'target'>,\n params?: ReadParams<typeof allowListIncentiveAbi, 'isClaimable'>,\n ) {\n return await readAllowListIncentiveIsClaimable(this._config, {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?AllowListIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: AllowListIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: allowListIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [prepareAllowListIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link AllowListIncentivePayload}, properly encode a `AllowListIncentive.InitPayload` for use with {@link AllowListIncentive} initialization.\n *\n * @param {AllowListIncentivePayload} param0\n * @param {Address} param0.allowList - The address to the allowlist to add claimers to.\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @returns {Hex}\n */\nexport const prepareAllowListIncentivePayload = ({\n allowList,\n limit,\n}: AllowListIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'allowList' },\n { type: 'uint256', name: 'limit' },\n ],\n [allowList, limit],\n );\n};\n"],"names":["_AllowListIncentive","DeployableTarget","allowListIncentiveAbi","params","readAllowListIncentiveOwner","readAllowListIncentiveClaims","readAllowListIncentiveReward","address","readAllowListIncentiveClaimed","readAllowListIncentiveAllowList","SimpleAllowList","readAllowListIncentiveLimit","payload","request","result","simulateAllowListIncentiveClaim","prepareClaimPayload","writeAllowListIncentiveClaim","readAllowListIncentiveIsClaimable","_payload","_options","options","bytecode","prepareAllowListIncentivePayload","RegistryType","AllowListIncentive","allowList","limit","encodeAbiParameters"],"mappings":"uhZAoFaA,EAAN,MAAMA,UAA2BC,EAAAA,gBAGtC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA2B/B,MAAa,MACXC,EACA,CACO,OAAA,MAAMC,EAAAA,GAA4B,KAAK,QAAS,CACrD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAID,CAAA,CACL,CACH,CAUA,MAAa,OACXA,EACA,CACO,OAAA,MAAME,EAAAA,GAA6B,KAAK,QAAS,CACtD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIF,CAAA,CACL,CACH,CAUA,MAAa,OACXA,EACA,CACO,OAAA,MAAMG,EAAAA,GAA6B,KAAK,QAAS,CACtD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,EAEP,GAAIH,CAAA,CACL,CACH,CAWA,MAAa,QACXI,EACAJ,EACA,CACO,OAAA,MAAMK,EAAAA,GAA8B,KAAK,QAAS,CACvD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACD,CAAO,EAEd,GAAIJ,CAAA,CACL,CACH,CAUA,MAAa,UACXA,EAC0B,CAC1B,MAAMI,EAAU,MAAME,KAAgC,KAAK,QAAS,CAClE,QAAS,K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