@boostxyz/sdk 0.0.0-alpha.2 → 0.0.0-alpha.21

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 (271) hide show
  1. package/dist/Actions/Action.cjs +2 -1
  2. package/dist/Actions/Action.cjs.map +1 -0
  3. package/dist/Actions/Action.d.ts +1 -1
  4. package/dist/Actions/Action.d.ts.map +1 -1
  5. package/dist/Actions/Action.js +14 -12
  6. package/dist/Actions/Action.js.map +1 -0
  7. package/dist/Actions/ContractAction.d.ts +57 -14
  8. package/dist/Actions/ContractAction.d.ts.map +1 -1
  9. package/dist/Actions/ERC721MintAction.d.ts +50 -23
  10. package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
  11. package/dist/Actions/EventAction.cjs +2 -1
  12. package/dist/Actions/EventAction.cjs.map +1 -0
  13. package/dist/Actions/EventAction.d.ts +405 -36
  14. package/dist/Actions/EventAction.d.ts.map +1 -1
  15. package/dist/Actions/EventAction.js +15 -209
  16. package/dist/Actions/EventAction.js.map +1 -0
  17. package/dist/AllowLists/AllowList.cjs +2 -1
  18. package/dist/AllowLists/AllowList.cjs.map +1 -0
  19. package/dist/AllowLists/AllowList.d.ts +6 -5
  20. package/dist/AllowLists/AllowList.d.ts.map +1 -1
  21. package/dist/AllowLists/AllowList.js +46 -22
  22. package/dist/AllowLists/AllowList.js.map +1 -0
  23. package/dist/AllowLists/OpenAllowList.d.ts +423 -0
  24. package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
  25. package/dist/AllowLists/SimpleAllowList.cjs +2 -1
  26. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -0
  27. package/dist/AllowLists/SimpleAllowList.d.ts +124 -40
  28. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
  29. package/dist/AllowLists/SimpleAllowList.js +76 -76
  30. package/dist/AllowLists/SimpleAllowList.js.map +1 -0
  31. package/dist/AllowLists/SimpleDenyList.cjs +2 -1
  32. package/dist/AllowLists/SimpleDenyList.cjs.map +1 -0
  33. package/dist/AllowLists/SimpleDenyList.d.ts +234 -13
  34. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
  35. package/dist/AllowLists/SimpleDenyList.js +12 -200
  36. package/dist/AllowLists/SimpleDenyList.js.map +1 -0
  37. package/dist/Auth/Auth.cjs +1 -0
  38. package/dist/Auth/Auth.cjs.map +1 -0
  39. package/dist/Auth/Auth.js +1 -0
  40. package/dist/Auth/Auth.js.map +1 -0
  41. package/dist/Auth/PassthroughAuth.cjs +2 -1
  42. package/dist/Auth/PassthroughAuth.cjs.map +1 -0
  43. package/dist/Auth/PassthroughAuth.js +5 -4
  44. package/dist/Auth/PassthroughAuth.js.map +1 -0
  45. package/dist/Boost.cjs +2 -1
  46. package/dist/Boost.cjs.map +1 -0
  47. package/dist/Boost.d.ts +105 -14
  48. package/dist/Boost.d.ts.map +1 -1
  49. package/dist/Boost.js +138 -5
  50. package/dist/Boost.js.map +1 -0
  51. package/dist/BoostCore-DolmDuXW.cjs +3 -0
  52. package/dist/BoostCore-DolmDuXW.cjs.map +1 -0
  53. package/dist/BoostCore-Z97KVu4V.js +1448 -0
  54. package/dist/BoostCore-Z97KVu4V.js.map +1 -0
  55. package/dist/BoostCore.cjs +2 -2
  56. package/dist/BoostCore.cjs.map +1 -0
  57. package/dist/BoostCore.d.ts +788 -79
  58. package/dist/BoostCore.d.ts.map +1 -1
  59. package/dist/BoostCore.js +30 -1103
  60. package/dist/BoostCore.js.map +1 -0
  61. package/dist/BoostRegistry.cjs +2 -1
  62. package/dist/BoostRegistry.cjs.map +1 -0
  63. package/dist/BoostRegistry.d.ts +95 -26
  64. package/dist/BoostRegistry.d.ts.map +1 -1
  65. package/dist/BoostRegistry.js +183 -89
  66. package/dist/BoostRegistry.js.map +1 -0
  67. package/dist/Budgets/Budget.cjs +2 -1
  68. package/dist/Budgets/Budget.cjs.map +1 -0
  69. package/dist/Budgets/Budget.d.ts +1 -1
  70. package/dist/Budgets/Budget.d.ts.map +1 -1
  71. package/dist/Budgets/Budget.js +15 -13
  72. package/dist/Budgets/Budget.js.map +1 -0
  73. package/dist/Budgets/ManagedBudget.cjs +2 -1
  74. package/dist/Budgets/ManagedBudget.cjs.map +1 -0
  75. package/dist/Budgets/ManagedBudget.d.ts +112 -192
  76. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  77. package/dist/Budgets/ManagedBudget.js +91 -291
  78. package/dist/Budgets/ManagedBudget.js.map +1 -0
  79. package/dist/Budgets/VestingBudget.d.ts +277 -91
  80. package/dist/Budgets/VestingBudget.d.ts.map +1 -1
  81. package/dist/Deployable/Contract.cjs +2 -1
  82. package/dist/Deployable/Contract.cjs.map +1 -0
  83. package/dist/Deployable/Contract.d.ts +4 -5
  84. package/dist/Deployable/Contract.d.ts.map +1 -1
  85. package/dist/Deployable/Contract.js +7 -8
  86. package/dist/Deployable/Contract.js.map +1 -0
  87. package/dist/Deployable/Deployable.cjs +1 -0
  88. package/dist/Deployable/Deployable.cjs.map +1 -0
  89. package/dist/Deployable/Deployable.d.ts +9 -3
  90. package/dist/Deployable/Deployable.d.ts.map +1 -1
  91. package/dist/Deployable/Deployable.js +10 -5
  92. package/dist/Deployable/Deployable.js.map +1 -0
  93. package/dist/Deployable/DeployableTarget.cjs +2 -1
  94. package/dist/Deployable/DeployableTarget.cjs.map +1 -0
  95. package/dist/Deployable/DeployableTarget.d.ts +16 -15
  96. package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
  97. package/dist/Deployable/DeployableTarget.js +49 -42
  98. package/dist/Deployable/DeployableTarget.js.map +1 -0
  99. package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
  100. package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
  101. package/dist/Deployable/DeployableTargetWithRBAC.d.ts +179 -0
  102. package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
  103. package/dist/Deployable/DeployableTargetWithRBAC.js +222 -0
  104. package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
  105. package/dist/EventAction-CBKzuNoN.cjs +2 -0
  106. package/dist/EventAction-CBKzuNoN.cjs.map +1 -0
  107. package/dist/EventAction-DWuuc_Qy.js +1528 -0
  108. package/dist/EventAction-DWuuc_Qy.js.map +1 -0
  109. package/dist/Incentive-BxzEtN26.js +298 -0
  110. package/dist/Incentive-BxzEtN26.js.map +1 -0
  111. package/dist/Incentive-CrF3-ayL.cjs +2 -0
  112. package/dist/Incentive-CrF3-ayL.cjs.map +1 -0
  113. package/dist/Incentives/AllowListIncentive.cjs +2 -1
  114. package/dist/Incentives/AllowListIncentive.cjs.map +1 -0
  115. package/dist/Incentives/AllowListIncentive.d.ts +65 -21
  116. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  117. package/dist/Incentives/AllowListIncentive.js +52 -36
  118. package/dist/Incentives/AllowListIncentive.js.map +1 -0
  119. package/dist/Incentives/CGDAIncentive.cjs +2 -1
  120. package/dist/Incentives/CGDAIncentive.cjs.map +1 -0
  121. package/dist/Incentives/CGDAIncentive.d.ts +315 -26
  122. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  123. package/dist/Incentives/CGDAIncentive.js +64 -39
  124. package/dist/Incentives/CGDAIncentive.js.map +1 -0
  125. package/dist/Incentives/ERC1155Incentive.d.ts +291 -43
  126. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
  127. package/dist/Incentives/ERC20Incentive.cjs +2 -1
  128. package/dist/Incentives/ERC20Incentive.cjs.map +1 -0
  129. package/dist/Incentives/ERC20Incentive.d.ts +270 -33
  130. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  131. package/dist/Incentives/ERC20Incentive.js +69 -46
  132. package/dist/Incentives/ERC20Incentive.js.map +1 -0
  133. package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +338 -421
  134. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
  135. package/dist/Incentives/ERC20VariableIncentive.d.ts +262 -32
  136. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  137. package/dist/Incentives/Incentive.cjs +2 -1
  138. package/dist/Incentives/Incentive.cjs.map +1 -0
  139. package/dist/Incentives/Incentive.d.ts +5 -8
  140. package/dist/Incentives/Incentive.d.ts.map +1 -1
  141. package/dist/Incentives/Incentive.js +17 -278
  142. package/dist/Incentives/Incentive.js.map +1 -0
  143. package/dist/Incentives/PointsIncentive.cjs +2 -1
  144. package/dist/Incentives/PointsIncentive.cjs.map +1 -0
  145. package/dist/Incentives/PointsIncentive.d.ts +81 -23
  146. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  147. package/dist/Incentives/PointsIncentive.js +57 -36
  148. package/dist/Incentives/PointsIncentive.js.map +1 -0
  149. package/dist/SimpleDenyList-BUR17Tt1.cjs +2 -0
  150. package/dist/SimpleDenyList-BUR17Tt1.cjs.map +1 -0
  151. package/dist/SimpleDenyList-CGaWjuld.js +132 -0
  152. package/dist/SimpleDenyList-CGaWjuld.js.map +1 -0
  153. package/dist/Validators/SignerValidator.cjs +2 -1
  154. package/dist/Validators/SignerValidator.cjs.map +1 -0
  155. package/dist/Validators/SignerValidator.d.ts +310 -17
  156. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  157. package/dist/Validators/SignerValidator.js +165 -36
  158. package/dist/Validators/SignerValidator.js.map +1 -0
  159. package/dist/Validators/Validator.cjs +2 -1
  160. package/dist/Validators/Validator.cjs.map +1 -0
  161. package/dist/Validators/Validator.d.ts +2 -2
  162. package/dist/Validators/Validator.d.ts.map +1 -1
  163. package/dist/Validators/Validator.js +10 -8
  164. package/dist/Validators/Validator.js.map +1 -0
  165. package/dist/claiming.cjs +2 -0
  166. package/dist/claiming.cjs.map +1 -0
  167. package/dist/claiming.d.ts +43 -0
  168. package/dist/claiming.d.ts.map +1 -0
  169. package/dist/claiming.js +17 -0
  170. package/dist/claiming.js.map +1 -0
  171. package/dist/componentInterfaces-BBCFkrZv.js +14 -0
  172. package/dist/componentInterfaces-BBCFkrZv.js.map +1 -0
  173. package/dist/componentInterfaces-DRI_dQ-P.cjs +2 -0
  174. package/dist/componentInterfaces-DRI_dQ-P.cjs.map +1 -0
  175. package/dist/deployments-DVXioW2i.cjs +2 -0
  176. package/dist/deployments-DVXioW2i.cjs.map +1 -0
  177. package/dist/deployments-oykLv3_Z.js +43 -0
  178. package/dist/deployments-oykLv3_Z.js.map +1 -0
  179. package/dist/deployments.json +44 -0
  180. package/dist/errors.cjs +2 -1
  181. package/dist/errors.cjs.map +1 -0
  182. package/dist/errors.d.ts +421 -1
  183. package/dist/errors.d.ts.map +1 -1
  184. package/dist/errors.js +297 -39
  185. package/dist/errors.js.map +1 -0
  186. package/dist/{generated-x_abr3Yv.js → generated-CKt2yCQd.js} +3143 -3002
  187. package/dist/generated-CKt2yCQd.js.map +1 -0
  188. package/dist/generated-CyTNlOwM.cjs +3 -0
  189. package/dist/generated-CyTNlOwM.cjs.map +1 -0
  190. package/dist/index.cjs +2 -1
  191. package/dist/index.cjs.map +1 -0
  192. package/dist/index.d.ts +10 -9
  193. package/dist/index.d.ts.map +1 -1
  194. package/dist/index.js +144 -1353
  195. package/dist/index.js.map +1 -0
  196. package/dist/transfers.cjs +2 -0
  197. package/dist/transfers.cjs.map +1 -0
  198. package/dist/transfers.d.ts +198 -0
  199. package/dist/transfers.d.ts.map +1 -0
  200. package/dist/transfers.js +84 -0
  201. package/dist/transfers.js.map +1 -0
  202. package/dist/utils.cjs +2 -1
  203. package/dist/utils.cjs.map +1 -0
  204. package/dist/utils.d.ts +26 -1350
  205. package/dist/utils.d.ts.map +1 -1
  206. package/dist/utils.js +38 -636
  207. package/dist/utils.js.map +1 -0
  208. package/package.json +37 -11
  209. package/src/Actions/Action.test.ts +79 -0
  210. package/src/Actions/Action.ts +61 -0
  211. package/src/Actions/ContractAction.test.ts +197 -0
  212. package/src/Actions/ContractAction.ts +300 -0
  213. package/src/Actions/ERC721MintAction.test.ts +112 -0
  214. package/src/Actions/ERC721MintAction.ts +291 -0
  215. package/src/Actions/EventAction.test.ts +787 -0
  216. package/src/Actions/EventAction.ts +1218 -0
  217. package/src/AllowLists/AllowList.test.ts +64 -0
  218. package/src/AllowLists/AllowList.ts +62 -0
  219. package/src/AllowLists/OpenAllowList.test.ts +40 -0
  220. package/src/AllowLists/OpenAllowList.ts +45 -0
  221. package/src/AllowLists/SimpleAllowList.test.ts +52 -0
  222. package/src/AllowLists/SimpleAllowList.ts +262 -0
  223. package/src/AllowLists/SimpleDenyList.test.ts +52 -0
  224. package/src/AllowLists/SimpleDenyList.ts +250 -0
  225. package/src/Auth/Auth.ts +11 -0
  226. package/src/Auth/PassthroughAuth.test.ts +12 -0
  227. package/src/Auth/PassthroughAuth.ts +80 -0
  228. package/src/Boost.ts +287 -0
  229. package/src/BoostCore.test.ts +894 -0
  230. package/src/BoostCore.ts +1438 -0
  231. package/src/BoostRegistry.test.ts +53 -0
  232. package/src/BoostRegistry.ts +588 -0
  233. package/src/Budgets/Budget.test.ts +27 -0
  234. package/src/Budgets/Budget.ts +60 -0
  235. package/src/Budgets/ManagedBudget.test.ts +217 -0
  236. package/src/Budgets/ManagedBudget.ts +534 -0
  237. package/src/Budgets/VestingBudget.test.ts +123 -0
  238. package/src/Budgets/VestingBudget.ts +530 -0
  239. package/src/Deployable/Contract.ts +228 -0
  240. package/src/Deployable/Deployable.ts +250 -0
  241. package/src/Deployable/DeployableTarget.ts +234 -0
  242. package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
  243. package/src/Incentives/AllowListIncentive.test.ts +143 -0
  244. package/src/Incentives/AllowListIncentive.ts +336 -0
  245. package/src/Incentives/CGDAIncentive.test.ts +135 -0
  246. package/src/Incentives/CGDAIncentive.ts +476 -0
  247. package/src/Incentives/ERC1155Incentive.test.ts +87 -0
  248. package/src/Incentives/ERC1155Incentive.ts +465 -0
  249. package/src/Incentives/ERC20Incentive.test.ts +133 -0
  250. package/src/Incentives/ERC20Incentive.ts +490 -0
  251. package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
  252. package/src/Incentives/ERC20VariableCriteriaIncentive.ts +309 -0
  253. package/src/Incentives/ERC20VariableIncentive.test.ts +139 -0
  254. package/src/Incentives/ERC20VariableIncentive.ts +428 -0
  255. package/src/Incentives/Incentive.test.ts +95 -0
  256. package/src/Incentives/Incentive.ts +86 -0
  257. package/src/Incentives/PointsIncentive.test.ts +138 -0
  258. package/src/Incentives/PointsIncentive.ts +367 -0
  259. package/src/Validators/SignerValidator.test.ts +159 -0
  260. package/src/Validators/SignerValidator.ts +683 -0
  261. package/src/Validators/Validator.test.ts +21 -0
  262. package/src/Validators/Validator.ts +55 -0
  263. package/src/claiming.ts +56 -0
  264. package/src/errors.ts +866 -0
  265. package/src/index.test.ts +122 -0
  266. package/src/index.ts +58 -0
  267. package/src/transfers.ts +284 -0
  268. package/src/utils.test.ts +44 -0
  269. package/src/utils.ts +247 -0
  270. package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
  271. package/dist/generated-BaaleHW-.cjs +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PassthroughAuth.js","sources":["../../src/Auth/PassthroughAuth.ts"],"sourcesContent":["import {\n passthroughAuthAbi,\n readPassthroughAuthIsAuthorized,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/auth/PassthroughAuth.sol/PassthroughAuth.json';\nimport type { Address, ContractEventName, Hex } from 'viem';\nimport {\n Deployable,\n type DeployableOptions,\n type GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport type { GenericLog, ReadParams } from '../utils';\n\nexport { passthroughAuthAbi };\n\n/**\n * A generic `viem.Log` event with support for `PassthroughAuth` event types.\n *\n * @export\n * @typedef {PassthroughAuthLog}\n * @template {ContractEventName<\n * typeof passthroughAuthAbi\n * >} [event=ContractEventName<typeof passthroughAuthAbi>]\n */\nexport type PassthroughAuthLog<\n event extends ContractEventName<\n typeof passthroughAuthAbi\n > = ContractEventName<typeof passthroughAuthAbi>,\n> = GenericLog<typeof passthroughAuthAbi, event>;\n\n/**\n * A simple implementation of a Validator that verifies a given signature and checks the recovered address against a set of authorized signers\n *\n * @export\n * @class PassthroughAuth\n * @typedef {PassthroughAuth}\n * @extends {DeployableTarget<PassthroughAuthPayload>}\n */\nexport class PassthroughAuth extends Deployable<\n // biome-ignore lint/suspicious/noExplicitAny: takes no parameters\n any,\n typeof passthroughAuthAbi\n> {\n public override readonly abi = passthroughAuthAbi;\n\n public async isAuthorized(\n address: Address,\n params?: ReadParams<typeof passthroughAuthAbi, 'isAuthorized'>,\n ) {\n return await readPassthroughAuthIsAuthorized(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 * @inheritdoc\n *\n * @public\n * @param {?PassthroughAuthPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: never,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [_, options] = this.validateDeploymentConfig({}, _options);\n return {\n abi: passthroughAuthAbi,\n bytecode: bytecode as Hex,\n // biome-ignore lint/suspicious/noExplicitAny: <takes no payload>\n args: [] as any,\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["PassthroughAuth","Deployable","passthroughAuthAbi","address","params","readPassthroughAuthIsAuthorized","_payload","_options","_","options","bytecode"],"mappings":";;;AAuCO,MAAMA,UAAwBC,EAInC;AAAA,EAJK,cAAA;AAAA,UAAA,GAAA,SAAA,GAKL,KAAyB,MAAMC;AAAAA,EAAA;AAAA,EAE/B,MAAa,aACXC,GACAC,GACA;AACO,WAAA,MAAMC,EAAgC,KAAK,SAAS;AAAA,MACzD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACF,CAAO;AAAA;AAAA,MAEd,GAAIC;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUgB,gBACdE,GACAC,GACyB;AACnB,UAAA,CAACC,GAAGC,CAAO,IAAI,KAAK,yBAAyB,CAAA,GAAIF,CAAQ;AACxD,WAAA;AAAA,MACL,KAAKL;AAAAA,MACL,UAAAQ;AAAA;AAAA,MAEA,MAAM,CAAC;AAAA,MACP,GAAG,KAAK,wBAAwBD,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;"}
package/dist/Boost.cjs CHANGED
@@ -1 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("viem");class s{constructor(t){this.id=t.id,this.budget=t.budget,this.action=t.action,this.validator=t.validator,this.allowList=t.allowList,this.incentives=t.incentives,this.protocolFee=t.protocolFee||0n,this.referralFee=t.referralFee||0n,this.maxParticipants=t.maxParticipants||0n,this.owner=t.owner||e.zeroAddress}}exports.Boost=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("viem");var O=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},E={exports:{}};(function(h,l){(function(g,m){h.exports=m(g,1),l.LibZip=h.exports.LibZip,l.ERC1967Factory=h.exports.ERC1967Factory})(typeof window<"u"?window:O,function(g,m){var y={},c={};y.LibZip=c;function b(t){if((typeof t=="string"||t instanceof String)&&(t=t.match(/^[\s\uFEFF\xA0]*(0[Xx])?([0-9A-Fa-f]*)[\s\uFEFF\xA0]*$/))){if(t[2].length%2)throw new Error("Hex string length must be a multiple of 2.");return t[2]}throw new Error("Data must be a hex string.")}function x(t){return(t|256).toString(16).slice(1)}function w(t,i){return parseInt(t.substr(i,2),16)}function S(t){for(var i=[],e=0;e<t.length;e+=2)i.push(w(t,e));return i}function L(t){for(var i="0x",e=0;e<t.length;i+=x(t[e++]));return i}c.flzCompress=function(t){var i=S(b(t)),e=i.length-4,n=[],r=[],a=0,o=2,s=0,f,v,z,p,Z,u,F,j,T,B;function A(d){return i[d]|i[++d]<<8|i[++d]<<16}function D(d){return 2654435769*d>>19&8191}function R(d,H){for(;d>=32;)for(r[s++]=31,f=32;f--;d--)r[s++]=i[H++];if(d)for(r[s++]=d-1;d--;)r[s++]=i[H++]}for(;o<e-9;){do F=n[z=D(v=A(o))]||0,Z=(p=(n[z]=o)-F)<8192?A(F):16777216;while(o<e-9&&o++&&v!=Z);if(o>=e-9)break;for(--o>a&&R(o-a,a),u=0,j=F+3,T=o+3,B=e-T;u<B;u++)B*=i[j+u]===i[T+u];for(o+=u,--p;u>262;u-=262)r[s++]=224+(p>>8),r[s++]=253,r[s++]=p&255;u<7?(r[s++]=(u<<5)+(p>>8),r[s++]=p&255):(r[s++]=224+(p>>8),r[s++]=u-7,r[s++]=p&255),n[D(A(o))]=o++,n[D(A(o))]=o++,a=o}return R(e+4-a,a),L(r)},c.flzDecompress=function(t){for(var i=S(b(t)),e=0,n=0,r,a,o,s,f=[];e<i.length;)if(o=i[e]>>5)for(a=256*(i[e]&31)+i[e+2-(o=o<7)],r=o?2+(i[e]>>5):9+i[e+1],e=e+3-o,s=n-a-1;r--;)f[n++]=f[s++];else for(r=1+i[e++];r--;)f[n++]=i[e++];return L(f)},c.cdCompress=function(t){t=b(t);var i="0x",e=0,n=0,r=0,a;function o(f){i+=x((i.length<4*2+2)*255^f)}function s(f,v){o(0),o(v-1+f*128)}for(;r<t.length;r+=2){if(a=w(t,r),!a){n&&(s(1,n),n=0),++e===128&&(s(0,128),e=0);continue}if(a===255){e&&(s(0,e),e=0),++n===32&&(s(1,32),n=0);continue}n&&(s(1,n),n=0),e&&(s(0,e),e=0),o(a)}return n&&(s(1,n),n=0),e&&(s(0,e),e=0),i},c.cdDecompress=function(t){t=b(t);for(var i="0x",e=0,n,r,a;e<t.length;){if(r=(e<4*2)*255^w(t,e),e+=2,!r){for(r=(e<4*2)*255^w(t,e),a=(r&127)+1,e+=2,n=0;n<a;++n)i+=x((r>>7&&n<32)*255);continue}i+=x(r)}return i};var C={};return y.ERC1967Factory=C,C.address="0x0000000000006396FF2a80c067f99B3d2Ab4Df24",C.abi=JSON.parse('[{0:[],1:"DeploymentFailed"96"SaltDoesNotStartWithCaller"96"Unauthorized"96"UpgradeFailed",2:3959790,9791],1:"AdminChanged",2:10959790,9792,9791],1:"Deployed",2:10959790,9792],1:"Upgraded",2:10},{0:[{90],1:"adminOf",12:[{9199{0:[{90,{91],1:"changeAdmin",12:[],13:"nonpayable",2:15},{0:[{92,{91],1:"deploy",12:[{9098,{0:[{92,{91,{94],1:"deployAndCall",12:[{9098,{0:[{92,{91,{93],1:"deployDeterministic",12:[{9098,{0:[{92,{91,{93,{94],1:"deployDeterministicAndCall",12:[{9098,{0:[],1:"initCodeHash",12:[{6:19,1:"result",2:19}99{0:[{93],1:"predictDeterministicAddress",12:[{6:7,1:"predicted",2:7}99{0:[{90,{92],1:"upgrade",12:[98,{0:[{90,{92,{94],1:"upgradeAndCall",12:[98]'.replace(/9\d/g,function(t){return["6:7,1:8,2:7}","6:7,1:9,2:7}","6:7,1:11,2:7}","6:19,1:20,2:19}","6:17,1:18,2:17}","},{4:false,0:[",",2:3},{0:[],1:","{5:true,","],13:16,2:15}","],13:14,2:15},"][t-90]}).replace(/\d+/g,function(t){return'"'+"inputs,name,type,error,anonymous,indexed,internalType,address,proxy,admin,event,implementation,outputs,stateMutability,view,function,payable,bytes,data,bytes32,salt".split(",")[t]+'"'})),m||(g.solady=y),y})})(E,E.exports);var U=E.exports;class q{constructor(l){this.id=l.id,this.budget=l.budget,this.action=l.action,this.validator=l.validator,this.allowList=l.allowList,this.incentives=l.incentives,this.protocolFee=l.protocolFee||0n,this.maxParticipants=l.maxParticipants||0n,this.owner=l.owner||P.zeroAddress}}function M({budget:h,action:l,validator:g,allowList:m,incentives:y,protocolFee:c=0n,maxParticipants:b=0n,owner:x}){return U.LibZip.cdCompress(P.encodeAbiParameters(P.parseAbiParameters(["BoostPayload payload","struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint256 maxParticipants; address owner; }","struct Target { bool isBase; address instance; bytes parameters; }"]),[{budget:h,action:l,validator:g,allowList:m,incentives:y,protocolFee:c,maxParticipants:b,owner:x}]))}exports.Boost=q;exports.prepareBoostPayload=M;
2
+ //# sourceMappingURL=Boost.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Boost.cjs","sources":["../../../node_modules/.pnpm/solady@0.0.208/node_modules/solady/js/solady.js","../src/Boost.ts"],"sourcesContent":["/**\n * Accompanying JavaScript library for Solady.\n *\n * To install:\n * \n * ```\n * npm install solady\n * ```\n *\n * Module exports:\n * \n * - `LibZip`\n * - `flzCompress(data)`: Compresses hex encoded data with FastLZ.\n * - `flzDecompress(data)`: Decompresses hex encoded data with FastLZ.\n * - `cdCompress(data)`: Compresses hex encoded calldata.\n * - `cdDecompress(data)`: Decompresses hex encoded calldata.\n * \n * - `ERC1967Factory`\n * - `address`: Canonical address of Solady's ERC1967Factory.\n * - `abi`: ABI of Solady's ERC1967Factory.\n *\n * @module solady\n */\n(function(global, factory) {\n\n \"use strict\";\n\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n module.exports = factory(global, 1);\n if (typeof exports === \"object\") {\n exports.LibZip = module.exports.LibZip;\n exports.ERC1967Factory = module.exports.ERC1967Factory;\n }\n } else {\n factory(global);\n }\n\n})(typeof window !== \"undefined\" ? window : this, function(window, noGlobal) {\n\n \"use strict\";\n\n var solady = {};\n\n /*============================================================*/\n /* LibZip Operations */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/LibZip.sol\n\n /**\n * FastLZ and calldata compression / decompression functions.\n * @namespace\n * @alias module:solady.LibZip\n */\n var LibZip = {};\n\n solady.LibZip = LibZip;\n\n function hexString(data) {\n if (typeof data === \"string\" || data instanceof String) {\n if (data = data.match(/^[\\s\\uFEFF\\xA0]*(0[Xx])?([0-9A-Fa-f]*)[\\s\\uFEFF\\xA0]*$/)) {\n if (data[2].length % 2) {\n throw new Error(\"Hex string length must be a multiple of 2.\");\n }\n return data[2];\n }\n }\n throw new Error(\"Data must be a hex string.\");\n }\n\n function byteToString(b) {\n return (b | 0x100).toString(16).slice(1);\n }\n\n function parseByte(data, i) {\n return parseInt(data.substr(i, 2), 16);\n }\n\n function hexToBytes(data) {\n var a = [], i = 0;\n for (; i < data.length; i += 2) a.push(parseByte(data, i));\n return a;\n }\n\n function bytesToHex(a) {\n var o = \"0x\", i = 0;\n for (; i < a.length; o += byteToString(a[i++])) ;\n return o;\n }\n\n /**\n * Compresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.flzCompress = function(data) {\n var ib = hexToBytes(hexString(data)), b = ib.length - 4;\n var ht = [], ob = [], a = 0, i = 2, o = 0, j, s, h, d, c, l, r, p, q, e;\n\n function u24(i) {\n return ib[i] | (ib[++i] << 8) | (ib[++i] << 16);\n }\n\n function hash(x) {\n return ((2654435769 * x) >> 19) & 8191;\n }\n\n function literals(r, s) {\n while (r >= 32) for (ob[o++] = 31, j = 32; j--; r--) ob[o++] = ib[s++];\n if (r) for (ob[o++] = r - 1; r--; ) ob[o++] = ib[s++];\n }\n\n while (i < b - 9) {\n do {\n r = ht[h = hash(s = u24(i))] || 0;\n c = (d = (ht[h] = i) - r) < 8192 ? u24(r) : 0x1000000;\n } while (i < b - 9 && i++ && s != c);\n if (i >= b - 9) break;\n if (--i > a) literals(i - a, a);\n for (l = 0, p = r + 3, q = i + 3, e = b - q; l < e; l++) e *= ib[p + l] === ib[q + l];\n i += l;\n for (--d; l > 262; l -= 262) ob[o++] = 224 + (d >> 8), ob[o++] = 253, ob[o++] = d & 255;\n if (l < 7) ob[o++] = (l << 5) + (d >> 8), ob[o++] = d & 255;\n else ob[o++] = 224 + (d >> 8), ob[o++] = l - 7, ob[o++] = d & 255;\n ht[hash(u24(i))] = i++, ht[hash(u24(i))] = i++, a = i;\n }\n literals(b + 4 - a, a);\n return bytesToHex(ob);\n }\n\n /**\n * Decompresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.flzDecompress = function(data) {\n var ib = hexToBytes(hexString(data)), i = 0, o = 0, l, f, t, r, h, ob = [];\n while (i < ib.length) {\n if (!(t = ib[i] >> 5)) {\n for (l = 1 + ib[i++]; l--;) ob[o++] = ib[i++];\n } else {\n f = 256 * (ib[i] & 31) + ib[i + 2 - (t = t < 7)];\n l = t ? 2 + (ib[i] >> 5) : 9 + ib[i + 1];\n i = i + 3 - t;\n r = o - f - 1;\n while (l--) ob[o++] = ob[r++];\n }\n }\n return bytesToHex(ob);\n }\n\n /**\n * Compresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.cdCompress = function(data) {\n data = hexString(data);\n var o = \"0x\", z = 0, y = 0, i = 0, c;\n\n function pushByte(b) {\n o += byteToString(((o.length < 4 * 2 + 2) * 0xff) ^ b);\n }\n\n function rle(v, d) {\n pushByte(0x00);\n pushByte(d - 1 + v * 0x80);\n }\n\n for (; i < data.length; i += 2) {\n c = parseByte(data, i);\n if (!c) {\n if (y) rle(1, y), y = 0;\n if (++z === 0x80) rle(0, 0x80), z = 0;\n continue;\n }\n if (c === 0xff) {\n if (z) rle(0, z), z = 0;\n if (++y === 0x20) rle(1, 0x20), y = 0;\n continue;\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n pushByte(c);\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n return o;\n }\n\n /**\n * Decompresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.cdDecompress = function(data) {\n data = hexString(data);\n var o = \"0x\", i = 0, j, c, s;\n\n while (i < data.length) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n i += 2;\n if (!c) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n s = (c & 0x7f) + 1;\n i += 2;\n for (j = 0; j < s; ++j) o += byteToString((c >> 7 && j < 32) * 0xff);\n continue;\n }\n o += byteToString(c);\n }\n return o;\n }\n\n /*============================================================*/\n /* ERC1967Factory */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/ERC1967Factory.sol\n\n /**\n * ERC1967Factory canonical address and ABI.\n * @namespace\n * @alias module:solady.ERC1967Factory\n */\n var ERC1967Factory = {};\n\n solady.ERC1967Factory = ERC1967Factory;\n\n /**\n * Canonical address of Solady's ERC1967Factory.\n * @type {string}\n */\n ERC1967Factory.address = \"0x0000000000006396FF2a80c067f99B3d2Ab4Df24\";\n\n /**\n * ABI of Solady's ERC1967Factory.\n * @type {Object}\n */\n ERC1967Factory.abi = JSON.parse('[{0:[],1:\"DeploymentFailed\"96\"SaltDoesNotStartWithCaller\"96\"Unauthorized\"96\"UpgradeFailed\",2:3959790,9791],1:\"AdminChanged\",2:10959790,9792,9791],1:\"Deployed\",2:10959790,9792],1:\"Upgraded\",2:10},{0:[{90],1:\"adminOf\",12:[{9199{0:[{90,{91],1:\"changeAdmin\",12:[],13:\"nonpayable\",2:15},{0:[{92,{91],1:\"deploy\",12:[{9098,{0:[{92,{91,{94],1:\"deployAndCall\",12:[{9098,{0:[{92,{91,{93],1:\"deployDeterministic\",12:[{9098,{0:[{92,{91,{93,{94],1:\"deployDeterministicAndCall\",12:[{9098,{0:[],1:\"initCodeHash\",12:[{6:19,1:\"result\",2:19}99{0:[{93],1:\"predictDeterministicAddress\",12:[{6:7,1:\"predicted\",2:7}99{0:[{90,{92],1:\"upgrade\",12:[98,{0:[{90,{92,{94],1:\"upgradeAndCall\",12:[98]'.replace(/9\\d/g, function (m) { return [\"6:7,1:8,2:7}\",\"6:7,1:9,2:7}\",\"6:7,1:11,2:7}\",\"6:19,1:20,2:19}\",\"6:17,1:18,2:17}\",\"},{4:false,0:[\",\",2:3},{0:[],1:\",\"{5:true,\",\"],13:16,2:15}\",\"],13:14,2:15},\"][m-90] }).replace(/\\d+/g, function (m) { return '\"' + (\"inputs,name,type,error,anonymous,indexed,internalType,address,proxy,admin,event,implementation,outputs,stateMutability,view,function,payable,bytes,data,bytes32,salt\".split(\",\")[m]) + '\"' }));\n\n /*--------------------------- END ----------------------------*/\n\n if (typeof define === \"function\" && define.amd) {\n define(\"solady\", [], function() {\n return solady\n });\n }\n\n if (!noGlobal) {\n window.solady = solady;\n }\n\n return solady;\n});\n","import { LibZip } from 'solady';\nimport {\n type Address,\n type Hex,\n encodeAbiParameters,\n parseAbiParameters,\n zeroAddress,\n} from 'viem';\nimport type { Action } from './Actions/Action';\nimport type { AllowList } from './AllowLists/AllowList';\nimport type { Budget } from './Budgets/Budget';\nimport type { Incentive } from './Incentives/Incentive';\nimport type { Validator } from './Validators/Validator';\n\n/**\n * Interface representing a `BoostLib.Boost` on-chain struct\n *\n * @export\n * @interface RawBoost\n * @typedef {RawBoost}\n */\nexport interface RawBoost {\n action: Address;\n validator: Address;\n allowList: Address;\n budget: Address;\n incentives: readonly Address[];\n protocolFee: bigint;\n maxParticipants: bigint;\n owner: Address;\n}\n\n/**\n * Configuration used to instantiate a `Boost` instance.\n *\n * @export\n * @interface BoostConfig\n * @typedef {BoostConfig}\n */\nexport interface BoostConfig {\n /**\n *\n * @type {bigint}\n */\n id: bigint;\n /**\n *\n * @type {Budget}\n */\n budget: Budget;\n /**\n *\n * @type {Action}\n */\n action: Action;\n /**\n *\n * @type {Validator}\n */\n validator: Validator;\n /**\n *\n * @type {AllowList}\n */\n allowList: AllowList;\n /**\n *\n * @type {Array<Incentive>}\n */\n incentives: Array<Incentive>;\n /**\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n *\n * @type {?Address}\n */\n owner?: Address;\n}\n\n/**\n * A struct representing a single Boost. Typically you would not construct this directly, rather get an instance from `BoostCore.createBoost` or `BoostCore.getBoost`\n *\n * @export\n * @class Boost\n * @typedef {Boost}\n */\nexport class Boost {\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly id: bigint;\n /**\n *\n * @readonly\n * @type {Budget}\n */\n readonly budget: Budget;\n /**\n *\n * @readonly\n * @type {Action}\n */\n readonly action: Action;\n /**\n *\n * @readonly\n * @type {Validator}\n */\n readonly validator: Validator;\n /**\n *\n * @readonly\n * @type {AllowList}\n */\n readonly allowList: AllowList;\n /**\n *\n * @readonly\n * @type {Array<Incentive>}\n */\n readonly incentives: Array<Incentive>;\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly protocolFee: bigint;\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly maxParticipants: bigint;\n /**\n *\n * @readonly\n * @type {Address}\n */\n readonly owner: Address;\n\n /**\n * Creates an instance of Boost.\n *\n * @constructor\n * @param {BoostConfig} config\n */\n constructor(config: BoostConfig) {\n this.id = config.id;\n this.budget = config.budget;\n this.action = config.action;\n this.validator = config.validator;\n this.allowList = config.allowList;\n this.incentives = config.incentives;\n this.protocolFee = config.protocolFee || 0n;\n this.maxParticipants = config.maxParticipants || 0n;\n this.owner = config.owner || zeroAddress;\n }\n}\n\n/**\n * Object representation of `BoostLib.Target` struct. Used for low level Boost creation operations.\n * This is used to pass the base contract and its initialization parameters in an efficient manner\n *\n * @export\n * @typedef {Target}\n */\nexport type Target = {\n isBase: boolean;\n instance: Address;\n parameters: Hex;\n};\n\n/**\n * Object representation of `BoostCore.InitPayload` struct.\n *\n * @export\n * @interface BoostPayload\n * @typedef {BoostPayload}\n */\nexport interface BoostPayload {\n /**\n * Address to valid budget.\n *\n * @type {Address}\n */\n budget: Address;\n /**\n * Target for existing action, or base with initialization payload.\n *\n * @type {Target}\n */\n action: Target;\n /**\n * Target for existing validator, or base with initialization payload.\n *\n * @type {Target}\n */\n validator: Target;\n /**\n * Target for existing allowList, or base with initialization payload.\n *\n * @type {Target}\n */\n allowList: Target;\n /**\n * Targets for new incentives, with initialization payloads.\n *\n * @type {Target[]}\n */\n incentives: Target[];\n /**\n * The base protocol fee (in bps)\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n * Optional maximum amount of participants in the Boost.\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n * The owner of the Boost.\n *\n * @type {Address}\n */\n owner: Address;\n}\n\n/**\n * Given a valid {@link BoostPayload}, properly encode and compress the payload for use with `createBoost`\n *\n * @export\n * @param {BoostPayload} param0\n * @param {Address} param0.budget - Address to valid budget.\n * @param {Target} param0.action - Target for existing action, or base with initialization payload.\n * @param {Target} param0.validator - Target for existing validator, or base with initialization payload.\n * @param {Target} param0.allowList - Target for existing allowList, or base with initialization payload.\n * @param {Target[]} param0.incentives - Targets for new incentives, with initialization payloads.\n * @param {bigint} [param0.protocolFee=0n] - The base protocol fee (in bps)\n * @param {bigint} [param0.maxParticipants=0n] - Optional maximum amount of participants in the Boost.\n * @param {Address} param0.owner - The owner of the Boost.\n * @returns {Hex}\n */\nexport function prepareBoostPayload({\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee = 0n,\n maxParticipants = 0n,\n owner,\n}: BoostPayload): Hex {\n return LibZip.cdCompress(\n encodeAbiParameters(\n parseAbiParameters([\n 'BoostPayload payload',\n 'struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint256 maxParticipants; address owner; }',\n 'struct Target { bool isBase; address instance; bytes parameters; }',\n ]),\n [\n {\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee,\n maxParticipants,\n owner,\n },\n ],\n ),\n ) as Hex;\n}\n"],"names":["global","factory","module","exports","this","window","noGlobal","solady","LibZip","hexString","data","byteToString","b","parseByte","hexToBytes","a","i","bytesToHex","o","ib","ht","ob","j","s","h","d","c","l","r","p","q","e","u24","hash","x","literals","f","t","z","y","pushByte","rle","v","ERC1967Factory","m","Boost","config","zeroAddress","prepareBoostPayload","budget","action","validator","allowList","incentives","protocolFee","maxParticipants","owner","encodeAbiParameters","parseAbiParameters"],"mappings":"wPAuBC,SAASA,EAAQC,EAAS,CAKnBC,UAAiBD,EAAQD,EAAQ,CAAC,EAE9BG,SAAiBD,EAAO,QAAQ,OAChCC,iBAAyBD,EAAO,QAAQ,cAMpD,GAAG,OAAO,OAAW,IAAc,OAASE,EAAM,SAASC,EAAQC,EAAU,CAIzE,IAAIC,EAAS,CAAA,EAaTC,EAAS,CAAA,EAEbD,EAAO,OAASC,EAEhB,SAASC,EAAUC,EAAM,CACrB,IAAI,OAAOA,GAAS,UAAYA,aAAgB,UACxCA,EAAOA,EAAK,MAAM,wDAAwD,GAAG,CAC7E,GAAIA,EAAK,CAAC,EAAE,OAAS,EACjB,MAAM,IAAI,MAAM,4CAA4C,EAEhE,OAAOA,EAAK,CAAC,CAChB,CAEL,MAAM,IAAI,MAAM,4BAA4B,CAC/C,CAED,SAASC,EAAaC,EAAG,CACrB,OAAQA,EAAI,KAAO,SAAS,EAAE,EAAE,MAAM,CAAC,CAC1C,CAED,SAASC,EAAUH,EAAM,EAAG,CACxB,OAAO,SAASA,EAAK,OAAO,EAAG,CAAC,EAAG,EAAE,CACxC,CAED,SAASI,EAAWJ,EAAM,CAEtB,QADIK,EAAI,CAAA,EAAIC,EAAI,EACTA,EAAIN,EAAK,OAAQM,GAAK,EAAGD,EAAE,KAAKF,EAAUH,EAAMM,CAAC,CAAC,EACzD,OAAOD,CACV,CAED,SAASE,EAAWF,EAAG,CAEnB,QADIG,EAAI,KAAMF,EAAI,EACXA,EAAID,EAAE,OAAQG,GAAKP,EAAaI,EAAEC,GAAG,CAAC,EAAG,CAChD,OAAOE,CACV,CAODV,EAAO,YAAc,SAASE,EAAM,CAChC,IAAIS,EAAKL,EAAWL,EAAUC,CAAI,CAAC,EAAGE,EAAIO,EAAG,OAAS,EAClDC,EAAK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B,OAAApC,EAAO,eAAiBoC,EAMxBA,EAAe,QAAU,6CAMzBA,EAAe,IAAM,KAAK,MAAM,iqBAAiqB,QAAQ,OAAQ,SAAUC,EAAG,CAAE,MAAO,CAAC,eAAe,eAAe,gBAAgB,kBAAkB,kBAAkB,iBAAiB,iBAAiB,WAAW,gBAAgB,gBAAgB,EAAEA,EAAE,EAAE,CAAC,CAAE,EAAE,QAAQ,OAAQ,SAAUA,EAAG,CAAE,MAAO,IAAO,uKAAuK,MAAM,GAAG,EAAEA,CAAC,EAAK,GAAK,CAAA,CAAC,EAUxnCtC,IACDD,EAAO,OAASE,GAGbA,CACX,CAAC,iCChKM,MAAMsC,CAAM,CA8DjB,YAAYC,EAAqB,CAC/B,KAAK,GAAKA,EAAO,GACjB,KAAK,OAASA,EAAO,OACrB,KAAK,OAASA,EAAO,OACrB,KAAK,UAAYA,EAAO,UACxB,KAAK,UAAYA,EAAO,UACxB,KAAK,WAAaA,EAAO,WACpB,KAAA,YAAcA,EAAO,aAAe,GACpC,KAAA,gBAAkBA,EAAO,iBAAmB,GAC5C,KAAA,MAAQA,EAAO,OAASC,EAAAA,WAC/B,CACF,CAwFO,SAASC,EAAoB,CAClC,OAAAC,EACA,OAAAC,EACA,UAAAC,EACA,UAAAC,EACA,WAAAC,EACA,YAAAC,EAAc,GACd,gBAAAC,EAAkB,GAClB,MAAAC,CACF,EAAsB,CACpB,OAAOhD,EAAO,OAAA,WACZiD,EAAA,oBACEC,qBAAmB,CACjB,uBACA,8KACA,oEAAA,CACD,EACD,CACE,CACE,OAAAT,EACA,OAAAC,EACA,UAAAC,EACA,UAAAC,EACA,WAAAC,EACA,YAAAC,EACA,gBAAAC,EACA,MAAAC,CACF,CACF,CACF,CAAA,CAEJ","x_google_ignoreList":[0]}
package/dist/Boost.d.ts CHANGED
@@ -1,15 +1,32 @@
1
- import { type Address } from 'viem';
1
+ import { type Address, type Hex } from 'viem';
2
2
  import type { Action } from './Actions/Action';
3
3
  import type { AllowList } from './AllowLists/AllowList';
4
4
  import type { Budget } from './Budgets/Budget';
5
5
  import type { Incentive } from './Incentives/Incentive';
6
6
  import type { Validator } from './Validators/Validator';
7
+ /**
8
+ * Interface representing a `BoostLib.Boost` on-chain struct
9
+ *
10
+ * @export
11
+ * @interface RawBoost
12
+ * @typedef {RawBoost}
13
+ */
14
+ export interface RawBoost {
15
+ action: Address;
16
+ validator: Address;
17
+ allowList: Address;
18
+ budget: Address;
19
+ incentives: readonly Address[];
20
+ protocolFee: bigint;
21
+ maxParticipants: bigint;
22
+ owner: Address;
23
+ }
7
24
  /**
8
25
  * Configuration used to instantiate a `Boost` instance.
9
26
  *
10
27
  * @export
11
- * @interface BoostPayload
12
- * @typedef {BoostPayload}
28
+ * @interface BoostConfig
29
+ * @typedef {BoostConfig}
13
30
  */
14
31
  export interface BoostConfig {
15
32
  /**
@@ -47,11 +64,6 @@ export interface BoostConfig {
47
64
  * @type {?bigint}
48
65
  */
49
66
  protocolFee?: bigint;
50
- /**
51
- *
52
- * @type {?bigint}
53
- */
54
- referralFee?: bigint;
55
67
  /**
56
68
  *
57
69
  * @type {?bigint}
@@ -113,12 +125,6 @@ export declare class Boost {
113
125
  * @type {bigint}
114
126
  */
115
127
  readonly protocolFee: bigint;
116
- /**
117
- *
118
- * @readonly
119
- * @type {bigint}
120
- */
121
- readonly referralFee: bigint;
122
128
  /**
123
129
  *
124
130
  * @readonly
@@ -139,4 +145,89 @@ export declare class Boost {
139
145
  */
140
146
  constructor(config: BoostConfig);
141
147
  }
148
+ /**
149
+ * Object representation of `BoostLib.Target` struct. Used for low level Boost creation operations.
150
+ * This is used to pass the base contract and its initialization parameters in an efficient manner
151
+ *
152
+ * @export
153
+ * @typedef {Target}
154
+ */
155
+ export type Target = {
156
+ isBase: boolean;
157
+ instance: Address;
158
+ parameters: Hex;
159
+ };
160
+ /**
161
+ * Object representation of `BoostCore.InitPayload` struct.
162
+ *
163
+ * @export
164
+ * @interface BoostPayload
165
+ * @typedef {BoostPayload}
166
+ */
167
+ export interface BoostPayload {
168
+ /**
169
+ * Address to valid budget.
170
+ *
171
+ * @type {Address}
172
+ */
173
+ budget: Address;
174
+ /**
175
+ * Target for existing action, or base with initialization payload.
176
+ *
177
+ * @type {Target}
178
+ */
179
+ action: Target;
180
+ /**
181
+ * Target for existing validator, or base with initialization payload.
182
+ *
183
+ * @type {Target}
184
+ */
185
+ validator: Target;
186
+ /**
187
+ * Target for existing allowList, or base with initialization payload.
188
+ *
189
+ * @type {Target}
190
+ */
191
+ allowList: Target;
192
+ /**
193
+ * Targets for new incentives, with initialization payloads.
194
+ *
195
+ * @type {Target[]}
196
+ */
197
+ incentives: Target[];
198
+ /**
199
+ * The base protocol fee (in bps)
200
+ *
201
+ * @type {?bigint}
202
+ */
203
+ protocolFee?: bigint;
204
+ /**
205
+ * Optional maximum amount of participants in the Boost.
206
+ *
207
+ * @type {?bigint}
208
+ */
209
+ maxParticipants?: bigint;
210
+ /**
211
+ * The owner of the Boost.
212
+ *
213
+ * @type {Address}
214
+ */
215
+ owner: Address;
216
+ }
217
+ /**
218
+ * Given a valid {@link BoostPayload}, properly encode and compress the payload for use with `createBoost`
219
+ *
220
+ * @export
221
+ * @param {BoostPayload} param0
222
+ * @param {Address} param0.budget - Address to valid budget.
223
+ * @param {Target} param0.action - Target for existing action, or base with initialization payload.
224
+ * @param {Target} param0.validator - Target for existing validator, or base with initialization payload.
225
+ * @param {Target} param0.allowList - Target for existing allowList, or base with initialization payload.
226
+ * @param {Target[]} param0.incentives - Targets for new incentives, with initialization payloads.
227
+ * @param {bigint} [param0.protocolFee=0n] - The base protocol fee (in bps)
228
+ * @param {bigint} [param0.maxParticipants=0n] - Optional maximum amount of participants in the Boost.
229
+ * @param {Address} param0.owner - The owner of the Boost.
230
+ * @returns {Hex}
231
+ */
232
+ export declare function prepareBoostPayload({ budget, action, validator, allowList, incentives, protocolFee, maxParticipants, owner, }: BoostPayload): Hex;
142
233
  //# sourceMappingURL=Boost.d.ts.map
@@ -1 +1 @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AM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,MAAM,EACN,SAAS,EACT,SAAS,EACT,UAAU,EACV,WAAgB,EAChB,eAAoB,EACpB,KAAK,GACN,EAAE,YAAY,GAAG,GAAG,CAsBpB"}
package/dist/Boost.js CHANGED
@@ -1,15 +1,148 @@
1
- import { zeroAddress as e } from "viem";
2
- class i {
1
+ import { zeroAddress as H, encodeAbiParameters as U, parseAbiParameters as N } from "viem";
2
+ var O = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, E = { exports: {} };
3
+ (function(h, l) {
4
+ (function(m, g) {
5
+ h.exports = g(m, 1), l.LibZip = h.exports.LibZip, l.ERC1967Factory = h.exports.ERC1967Factory;
6
+ })(typeof window < "u" ? window : O, function(m, g) {
7
+ var y = {}, c = {};
8
+ y.LibZip = c;
9
+ function x(t) {
10
+ if ((typeof t == "string" || t instanceof String) && (t = t.match(/^[\s\uFEFF\xA0]*(0[Xx])?([0-9A-Fa-f]*)[\s\uFEFF\xA0]*$/))) {
11
+ if (t[2].length % 2)
12
+ throw new Error("Hex string length must be a multiple of 2.");
13
+ return t[2];
14
+ }
15
+ throw new Error("Data must be a hex string.");
16
+ }
17
+ function b(t) {
18
+ return (t | 256).toString(16).slice(1);
19
+ }
20
+ function w(t, i) {
21
+ return parseInt(t.substr(i, 2), 16);
22
+ }
23
+ function L(t) {
24
+ for (var i = [], e = 0; e < t.length; e += 2) i.push(w(t, e));
25
+ return i;
26
+ }
27
+ function P(t) {
28
+ for (var i = "0x", e = 0; e < t.length; i += b(t[e++])) ;
29
+ return i;
30
+ }
31
+ c.flzCompress = function(t) {
32
+ var i = L(x(t)), e = i.length - 4, n = [], r = [], a = 0, o = 2, s = 0, f, v, S, p, z, u, F, Z, T, D;
33
+ function A(d) {
34
+ return i[d] | i[++d] << 8 | i[++d] << 16;
35
+ }
36
+ function B(d) {
37
+ return 2654435769 * d >> 19 & 8191;
38
+ }
39
+ function R(d, j) {
40
+ for (; d >= 32; ) for (r[s++] = 31, f = 32; f--; d--) r[s++] = i[j++];
41
+ if (d) for (r[s++] = d - 1; d--; ) r[s++] = i[j++];
42
+ }
43
+ for (; o < e - 9; ) {
44
+ do
45
+ F = n[S = B(v = A(o))] || 0, z = (p = (n[S] = o) - F) < 8192 ? A(F) : 16777216;
46
+ while (o < e - 9 && o++ && v != z);
47
+ if (o >= e - 9) break;
48
+ for (--o > a && R(o - a, a), u = 0, Z = F + 3, T = o + 3, D = e - T; u < D; u++) D *= i[Z + u] === i[T + u];
49
+ for (o += u, --p; u > 262; u -= 262) r[s++] = 224 + (p >> 8), r[s++] = 253, r[s++] = p & 255;
50
+ u < 7 ? (r[s++] = (u << 5) + (p >> 8), r[s++] = p & 255) : (r[s++] = 224 + (p >> 8), r[s++] = u - 7, r[s++] = p & 255), n[B(A(o))] = o++, n[B(A(o))] = o++, a = o;
51
+ }
52
+ return R(e + 4 - a, a), P(r);
53
+ }, c.flzDecompress = function(t) {
54
+ for (var i = L(x(t)), e = 0, n = 0, r, a, o, s, f = []; e < i.length; )
55
+ if (o = i[e] >> 5)
56
+ for (a = 256 * (i[e] & 31) + i[e + 2 - (o = o < 7)], r = o ? 2 + (i[e] >> 5) : 9 + i[e + 1], e = e + 3 - o, s = n - a - 1; r--; ) f[n++] = f[s++];
57
+ else
58
+ for (r = 1 + i[e++]; r--; ) f[n++] = i[e++];
59
+ return P(f);
60
+ }, c.cdCompress = function(t) {
61
+ t = x(t);
62
+ var i = "0x", e = 0, n = 0, r = 0, a;
63
+ function o(f) {
64
+ i += b((i.length < 4 * 2 + 2) * 255 ^ f);
65
+ }
66
+ function s(f, v) {
67
+ o(0), o(v - 1 + f * 128);
68
+ }
69
+ for (; r < t.length; r += 2) {
70
+ if (a = w(t, r), !a) {
71
+ n && (s(1, n), n = 0), ++e === 128 && (s(0, 128), e = 0);
72
+ continue;
73
+ }
74
+ if (a === 255) {
75
+ e && (s(0, e), e = 0), ++n === 32 && (s(1, 32), n = 0);
76
+ continue;
77
+ }
78
+ n && (s(1, n), n = 0), e && (s(0, e), e = 0), o(a);
79
+ }
80
+ return n && (s(1, n), n = 0), e && (s(0, e), e = 0), i;
81
+ }, c.cdDecompress = function(t) {
82
+ t = x(t);
83
+ for (var i = "0x", e = 0, n, r, a; e < t.length; ) {
84
+ if (r = (e < 4 * 2) * 255 ^ w(t, e), e += 2, !r) {
85
+ for (r = (e < 4 * 2) * 255 ^ w(t, e), a = (r & 127) + 1, e += 2, n = 0; n < a; ++n) i += b((r >> 7 && n < 32) * 255);
86
+ continue;
87
+ }
88
+ i += b(r);
89
+ }
90
+ return i;
91
+ };
92
+ var C = {};
93
+ return y.ERC1967Factory = C, C.address = "0x0000000000006396FF2a80c067f99B3d2Ab4Df24", C.abi = JSON.parse('[{0:[],1:"DeploymentFailed"96"SaltDoesNotStartWithCaller"96"Unauthorized"96"UpgradeFailed",2:3959790,9791],1:"AdminChanged",2:10959790,9792,9791],1:"Deployed",2:10959790,9792],1:"Upgraded",2:10},{0:[{90],1:"adminOf",12:[{9199{0:[{90,{91],1:"changeAdmin",12:[],13:"nonpayable",2:15},{0:[{92,{91],1:"deploy",12:[{9098,{0:[{92,{91,{94],1:"deployAndCall",12:[{9098,{0:[{92,{91,{93],1:"deployDeterministic",12:[{9098,{0:[{92,{91,{93,{94],1:"deployDeterministicAndCall",12:[{9098,{0:[],1:"initCodeHash",12:[{6:19,1:"result",2:19}99{0:[{93],1:"predictDeterministicAddress",12:[{6:7,1:"predicted",2:7}99{0:[{90,{92],1:"upgrade",12:[98,{0:[{90,{92,{94],1:"upgradeAndCall",12:[98]'.replace(/9\d/g, function(t) {
94
+ return ["6:7,1:8,2:7}", "6:7,1:9,2:7}", "6:7,1:11,2:7}", "6:19,1:20,2:19}", "6:17,1:18,2:17}", "},{4:false,0:[", ",2:3},{0:[],1:", "{5:true,", "],13:16,2:15}", "],13:14,2:15},"][t - 90];
95
+ }).replace(/\d+/g, function(t) {
96
+ return '"' + "inputs,name,type,error,anonymous,indexed,internalType,address,proxy,admin,event,implementation,outputs,stateMutability,view,function,payable,bytes,data,bytes32,salt".split(",")[t] + '"';
97
+ })), g || (m.solady = y), y;
98
+ });
99
+ })(E, E.exports);
100
+ var k = E.exports;
101
+ class G {
3
102
  /**
4
103
  * Creates an instance of Boost.
5
104
  *
6
105
  * @constructor
7
106
  * @param {BoostConfig} config
8
107
  */
9
- constructor(t) {
10
- this.id = t.id, this.budget = t.budget, this.action = t.action, this.validator = t.validator, this.allowList = t.allowList, this.incentives = t.incentives, this.protocolFee = t.protocolFee || 0n, this.referralFee = t.referralFee || 0n, this.maxParticipants = t.maxParticipants || 0n, this.owner = t.owner || e;
108
+ constructor(l) {
109
+ this.id = l.id, this.budget = l.budget, this.action = l.action, this.validator = l.validator, this.allowList = l.allowList, this.incentives = l.incentives, this.protocolFee = l.protocolFee || 0n, this.maxParticipants = l.maxParticipants || 0n, this.owner = l.owner || H;
11
110
  }
12
111
  }
112
+ function I({
113
+ budget: h,
114
+ action: l,
115
+ validator: m,
116
+ allowList: g,
117
+ incentives: y,
118
+ protocolFee: c = 0n,
119
+ maxParticipants: x = 0n,
120
+ owner: b
121
+ }) {
122
+ return k.LibZip.cdCompress(
123
+ U(
124
+ N([
125
+ "BoostPayload payload",
126
+ "struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint256 maxParticipants; address owner; }",
127
+ "struct Target { bool isBase; address instance; bytes parameters; }"
128
+ ]),
129
+ [
130
+ {
131
+ budget: h,
132
+ action: l,
133
+ validator: m,
134
+ allowList: g,
135
+ incentives: y,
136
+ protocolFee: c,
137
+ maxParticipants: x,
138
+ owner: b
139
+ }
140
+ ]
141
+ )
142
+ );
143
+ }
13
144
  export {
14
- i as Boost
145
+ G as Boost,
146
+ I as prepareBoostPayload
15
147
  };
148
+ //# sourceMappingURL=Boost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Boost.js","sources":["../../../node_modules/.pnpm/solady@0.0.208/node_modules/solady/js/solady.js","../src/Boost.ts"],"sourcesContent":["/**\n * Accompanying JavaScript library for Solady.\n *\n * To install:\n * \n * ```\n * npm install solady\n * ```\n *\n * Module exports:\n * \n * - `LibZip`\n * - `flzCompress(data)`: Compresses hex encoded data with FastLZ.\n * - `flzDecompress(data)`: Decompresses hex encoded data with FastLZ.\n * - `cdCompress(data)`: Compresses hex encoded calldata.\n * - `cdDecompress(data)`: Decompresses hex encoded calldata.\n * \n * - `ERC1967Factory`\n * - `address`: Canonical address of Solady's ERC1967Factory.\n * - `abi`: ABI of Solady's ERC1967Factory.\n *\n * @module solady\n */\n(function(global, factory) {\n\n \"use strict\";\n\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n module.exports = factory(global, 1);\n if (typeof exports === \"object\") {\n exports.LibZip = module.exports.LibZip;\n exports.ERC1967Factory = module.exports.ERC1967Factory;\n }\n } else {\n factory(global);\n }\n\n})(typeof window !== \"undefined\" ? window : this, function(window, noGlobal) {\n\n \"use strict\";\n\n var solady = {};\n\n /*============================================================*/\n /* LibZip Operations */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/LibZip.sol\n\n /**\n * FastLZ and calldata compression / decompression functions.\n * @namespace\n * @alias module:solady.LibZip\n */\n var LibZip = {};\n\n solady.LibZip = LibZip;\n\n function hexString(data) {\n if (typeof data === \"string\" || data instanceof String) {\n if (data = data.match(/^[\\s\\uFEFF\\xA0]*(0[Xx])?([0-9A-Fa-f]*)[\\s\\uFEFF\\xA0]*$/)) {\n if (data[2].length % 2) {\n throw new Error(\"Hex string length must be a multiple of 2.\");\n }\n return data[2];\n }\n }\n throw new Error(\"Data must be a hex string.\");\n }\n\n function byteToString(b) {\n return (b | 0x100).toString(16).slice(1);\n }\n\n function parseByte(data, i) {\n return parseInt(data.substr(i, 2), 16);\n }\n\n function hexToBytes(data) {\n var a = [], i = 0;\n for (; i < data.length; i += 2) a.push(parseByte(data, i));\n return a;\n }\n\n function bytesToHex(a) {\n var o = \"0x\", i = 0;\n for (; i < a.length; o += byteToString(a[i++])) ;\n return o;\n }\n\n /**\n * Compresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.flzCompress = function(data) {\n var ib = hexToBytes(hexString(data)), b = ib.length - 4;\n var ht = [], ob = [], a = 0, i = 2, o = 0, j, s, h, d, c, l, r, p, q, e;\n\n function u24(i) {\n return ib[i] | (ib[++i] << 8) | (ib[++i] << 16);\n }\n\n function hash(x) {\n return ((2654435769 * x) >> 19) & 8191;\n }\n\n function literals(r, s) {\n while (r >= 32) for (ob[o++] = 31, j = 32; j--; r--) ob[o++] = ib[s++];\n if (r) for (ob[o++] = r - 1; r--; ) ob[o++] = ib[s++];\n }\n\n while (i < b - 9) {\n do {\n r = ht[h = hash(s = u24(i))] || 0;\n c = (d = (ht[h] = i) - r) < 8192 ? u24(r) : 0x1000000;\n } while (i < b - 9 && i++ && s != c);\n if (i >= b - 9) break;\n if (--i > a) literals(i - a, a);\n for (l = 0, p = r + 3, q = i + 3, e = b - q; l < e; l++) e *= ib[p + l] === ib[q + l];\n i += l;\n for (--d; l > 262; l -= 262) ob[o++] = 224 + (d >> 8), ob[o++] = 253, ob[o++] = d & 255;\n if (l < 7) ob[o++] = (l << 5) + (d >> 8), ob[o++] = d & 255;\n else ob[o++] = 224 + (d >> 8), ob[o++] = l - 7, ob[o++] = d & 255;\n ht[hash(u24(i))] = i++, ht[hash(u24(i))] = i++, a = i;\n }\n literals(b + 4 - a, a);\n return bytesToHex(ob);\n }\n\n /**\n * Decompresses hex encoded data with the FastLZ LZ77 algorithm.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.flzDecompress = function(data) {\n var ib = hexToBytes(hexString(data)), i = 0, o = 0, l, f, t, r, h, ob = [];\n while (i < ib.length) {\n if (!(t = ib[i] >> 5)) {\n for (l = 1 + ib[i++]; l--;) ob[o++] = ib[i++];\n } else {\n f = 256 * (ib[i] & 31) + ib[i + 2 - (t = t < 7)];\n l = t ? 2 + (ib[i] >> 5) : 9 + ib[i + 1];\n i = i + 3 - t;\n r = o - f - 1;\n while (l--) ob[o++] = ob[r++];\n }\n }\n return bytesToHex(ob);\n }\n\n /**\n * Compresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the original data.\n * @returns {string} The compressed result as a hex encoded string.\n */\n LibZip.cdCompress = function(data) {\n data = hexString(data);\n var o = \"0x\", z = 0, y = 0, i = 0, c;\n\n function pushByte(b) {\n o += byteToString(((o.length < 4 * 2 + 2) * 0xff) ^ b);\n }\n\n function rle(v, d) {\n pushByte(0x00);\n pushByte(d - 1 + v * 0x80);\n }\n\n for (; i < data.length; i += 2) {\n c = parseByte(data, i);\n if (!c) {\n if (y) rle(1, y), y = 0;\n if (++z === 0x80) rle(0, 0x80), z = 0;\n continue;\n }\n if (c === 0xff) {\n if (z) rle(0, z), z = 0;\n if (++y === 0x20) rle(1, 0x20), y = 0;\n continue;\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n pushByte(c);\n }\n if (y) rle(1, y), y = 0;\n if (z) rle(0, z), z = 0;\n return o;\n }\n\n /**\n * Decompresses hex encoded calldata.\n * @param {string} data A hex encoded string representing the compressed data.\n * @returns {string} The decompressed result as a hex encoded string.\n */\n LibZip.cdDecompress = function(data) {\n data = hexString(data);\n var o = \"0x\", i = 0, j, c, s;\n\n while (i < data.length) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n i += 2;\n if (!c) {\n c = ((i < 4 * 2) * 0xff) ^ parseByte(data, i);\n s = (c & 0x7f) + 1;\n i += 2;\n for (j = 0; j < s; ++j) o += byteToString((c >> 7 && j < 32) * 0xff);\n continue;\n }\n o += byteToString(c);\n }\n return o;\n }\n\n /*============================================================*/\n /* ERC1967Factory */\n /*============================================================*/\n\n // See: https://github.com/vectorized/solady/blob/main/src/utils/ERC1967Factory.sol\n\n /**\n * ERC1967Factory canonical address and ABI.\n * @namespace\n * @alias module:solady.ERC1967Factory\n */\n var ERC1967Factory = {};\n\n solady.ERC1967Factory = ERC1967Factory;\n\n /**\n * Canonical address of Solady's ERC1967Factory.\n * @type {string}\n */\n ERC1967Factory.address = \"0x0000000000006396FF2a80c067f99B3d2Ab4Df24\";\n\n /**\n * ABI of Solady's ERC1967Factory.\n * @type {Object}\n */\n ERC1967Factory.abi = JSON.parse('[{0:[],1:\"DeploymentFailed\"96\"SaltDoesNotStartWithCaller\"96\"Unauthorized\"96\"UpgradeFailed\",2:3959790,9791],1:\"AdminChanged\",2:10959790,9792,9791],1:\"Deployed\",2:10959790,9792],1:\"Upgraded\",2:10},{0:[{90],1:\"adminOf\",12:[{9199{0:[{90,{91],1:\"changeAdmin\",12:[],13:\"nonpayable\",2:15},{0:[{92,{91],1:\"deploy\",12:[{9098,{0:[{92,{91,{94],1:\"deployAndCall\",12:[{9098,{0:[{92,{91,{93],1:\"deployDeterministic\",12:[{9098,{0:[{92,{91,{93,{94],1:\"deployDeterministicAndCall\",12:[{9098,{0:[],1:\"initCodeHash\",12:[{6:19,1:\"result\",2:19}99{0:[{93],1:\"predictDeterministicAddress\",12:[{6:7,1:\"predicted\",2:7}99{0:[{90,{92],1:\"upgrade\",12:[98,{0:[{90,{92,{94],1:\"upgradeAndCall\",12:[98]'.replace(/9\\d/g, function (m) { return [\"6:7,1:8,2:7}\",\"6:7,1:9,2:7}\",\"6:7,1:11,2:7}\",\"6:19,1:20,2:19}\",\"6:17,1:18,2:17}\",\"},{4:false,0:[\",\",2:3},{0:[],1:\",\"{5:true,\",\"],13:16,2:15}\",\"],13:14,2:15},\"][m-90] }).replace(/\\d+/g, function (m) { return '\"' + (\"inputs,name,type,error,anonymous,indexed,internalType,address,proxy,admin,event,implementation,outputs,stateMutability,view,function,payable,bytes,data,bytes32,salt\".split(\",\")[m]) + '\"' }));\n\n /*--------------------------- END ----------------------------*/\n\n if (typeof define === \"function\" && define.amd) {\n define(\"solady\", [], function() {\n return solady\n });\n }\n\n if (!noGlobal) {\n window.solady = solady;\n }\n\n return solady;\n});\n","import { LibZip } from 'solady';\nimport {\n type Address,\n type Hex,\n encodeAbiParameters,\n parseAbiParameters,\n zeroAddress,\n} from 'viem';\nimport type { Action } from './Actions/Action';\nimport type { AllowList } from './AllowLists/AllowList';\nimport type { Budget } from './Budgets/Budget';\nimport type { Incentive } from './Incentives/Incentive';\nimport type { Validator } from './Validators/Validator';\n\n/**\n * Interface representing a `BoostLib.Boost` on-chain struct\n *\n * @export\n * @interface RawBoost\n * @typedef {RawBoost}\n */\nexport interface RawBoost {\n action: Address;\n validator: Address;\n allowList: Address;\n budget: Address;\n incentives: readonly Address[];\n protocolFee: bigint;\n maxParticipants: bigint;\n owner: Address;\n}\n\n/**\n * Configuration used to instantiate a `Boost` instance.\n *\n * @export\n * @interface BoostConfig\n * @typedef {BoostConfig}\n */\nexport interface BoostConfig {\n /**\n *\n * @type {bigint}\n */\n id: bigint;\n /**\n *\n * @type {Budget}\n */\n budget: Budget;\n /**\n *\n * @type {Action}\n */\n action: Action;\n /**\n *\n * @type {Validator}\n */\n validator: Validator;\n /**\n *\n * @type {AllowList}\n */\n allowList: AllowList;\n /**\n *\n * @type {Array<Incentive>}\n */\n incentives: Array<Incentive>;\n /**\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n *\n * @type {?Address}\n */\n owner?: Address;\n}\n\n/**\n * A struct representing a single Boost. Typically you would not construct this directly, rather get an instance from `BoostCore.createBoost` or `BoostCore.getBoost`\n *\n * @export\n * @class Boost\n * @typedef {Boost}\n */\nexport class Boost {\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly id: bigint;\n /**\n *\n * @readonly\n * @type {Budget}\n */\n readonly budget: Budget;\n /**\n *\n * @readonly\n * @type {Action}\n */\n readonly action: Action;\n /**\n *\n * @readonly\n * @type {Validator}\n */\n readonly validator: Validator;\n /**\n *\n * @readonly\n * @type {AllowList}\n */\n readonly allowList: AllowList;\n /**\n *\n * @readonly\n * @type {Array<Incentive>}\n */\n readonly incentives: Array<Incentive>;\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly protocolFee: bigint;\n /**\n *\n * @readonly\n * @type {bigint}\n */\n readonly maxParticipants: bigint;\n /**\n *\n * @readonly\n * @type {Address}\n */\n readonly owner: Address;\n\n /**\n * Creates an instance of Boost.\n *\n * @constructor\n * @param {BoostConfig} config\n */\n constructor(config: BoostConfig) {\n this.id = config.id;\n this.budget = config.budget;\n this.action = config.action;\n this.validator = config.validator;\n this.allowList = config.allowList;\n this.incentives = config.incentives;\n this.protocolFee = config.protocolFee || 0n;\n this.maxParticipants = config.maxParticipants || 0n;\n this.owner = config.owner || zeroAddress;\n }\n}\n\n/**\n * Object representation of `BoostLib.Target` struct. Used for low level Boost creation operations.\n * This is used to pass the base contract and its initialization parameters in an efficient manner\n *\n * @export\n * @typedef {Target}\n */\nexport type Target = {\n isBase: boolean;\n instance: Address;\n parameters: Hex;\n};\n\n/**\n * Object representation of `BoostCore.InitPayload` struct.\n *\n * @export\n * @interface BoostPayload\n * @typedef {BoostPayload}\n */\nexport interface BoostPayload {\n /**\n * Address to valid budget.\n *\n * @type {Address}\n */\n budget: Address;\n /**\n * Target for existing action, or base with initialization payload.\n *\n * @type {Target}\n */\n action: Target;\n /**\n * Target for existing validator, or base with initialization payload.\n *\n * @type {Target}\n */\n validator: Target;\n /**\n * Target for existing allowList, or base with initialization payload.\n *\n * @type {Target}\n */\n allowList: Target;\n /**\n * Targets for new incentives, with initialization payloads.\n *\n * @type {Target[]}\n */\n incentives: Target[];\n /**\n * The base protocol fee (in bps)\n *\n * @type {?bigint}\n */\n protocolFee?: bigint;\n /**\n * Optional maximum amount of participants in the Boost.\n *\n * @type {?bigint}\n */\n maxParticipants?: bigint;\n /**\n * The owner of the Boost.\n *\n * @type {Address}\n */\n owner: Address;\n}\n\n/**\n * Given a valid {@link BoostPayload}, properly encode and compress the payload for use with `createBoost`\n *\n * @export\n * @param {BoostPayload} param0\n * @param {Address} param0.budget - Address to valid budget.\n * @param {Target} param0.action - Target for existing action, or base with initialization payload.\n * @param {Target} param0.validator - Target for existing validator, or base with initialization payload.\n * @param {Target} param0.allowList - Target for existing allowList, or base with initialization payload.\n * @param {Target[]} param0.incentives - Targets for new incentives, with initialization payloads.\n * @param {bigint} [param0.protocolFee=0n] - The base protocol fee (in bps)\n * @param {bigint} [param0.maxParticipants=0n] - Optional maximum amount of participants in the Boost.\n * @param {Address} param0.owner - The owner of the Boost.\n * @returns {Hex}\n */\nexport function prepareBoostPayload({\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee = 0n,\n maxParticipants = 0n,\n owner,\n}: BoostPayload): Hex {\n return LibZip.cdCompress(\n encodeAbiParameters(\n parseAbiParameters([\n 'BoostPayload payload',\n 'struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint256 maxParticipants; address owner; }',\n 'struct Target { bool isBase; address instance; bytes parameters; }',\n ]),\n [\n {\n budget,\n action,\n validator,\n allowList,\n incentives,\n protocolFee,\n maxParticipants,\n owner,\n },\n ],\n ),\n ) as Hex;\n}\n"],"names":["global","factory","module","exports","this","window","noGlobal","solady","LibZip","hexString","data","byteToString","b","parseByte","hexToBytes","a","i","bytesToHex","o","ib","ht","ob","j","s","h","d","c","l","r","p","q","e","u24","hash","x","literals","f","t","z","y","pushByte","rle","v","ERC1967Factory","m","Boost","config","zeroAddress","prepareBoostPayload","budget","action","validator","allowList","incentives","protocolFee","maxParticipants","owner","encodeAbiParameters","parseAbiParameters"],"mappings":";;;AAuBA,GAAC,SAASA,GAAQC,GAAS;AAKnB,IAAAC,YAAiBD,EAAQD,GAAQ,CAAC,GAE9BG,WAAiBD,EAAO,QAAQ,QAChCC,mBAAyBD,EAAO,QAAQ;AAAA,EAMpD,GAAG,OAAO,SAAW,MAAc,SAASE,GAAM,SAASC,GAAQC,GAAU;AAIzE,QAAIC,IAAS,CAAA,GAaTC,IAAS,CAAA;AAEb,IAAAD,EAAO,SAASC;AAEhB,aAASC,EAAUC,GAAM;AACrB,WAAI,OAAOA,KAAS,YAAYA,aAAgB,YACxCA,IAAOA,EAAK,MAAM,wDAAwD,IAAG;AAC7E,YAAIA,EAAK,CAAC,EAAE,SAAS;AACjB,gBAAM,IAAI,MAAM,4CAA4C;AAEhE,eAAOA,EAAK,CAAC;AAAA,MAChB;AAEL,YAAM,IAAI,MAAM,4BAA4B;AAAA,IAC/C;AAED,aAASC,EAAaC,GAAG;AACrB,cAAQA,IAAI,KAAO,SAAS,EAAE,EAAE,MAAM,CAAC;AAAA,IAC1C;AAED,aAASC,EAAUH,GAAM,GAAG;AACxB,aAAO,SAASA,EAAK,OAAO,GAAG,CAAC,GAAG,EAAE;AAAA,IACxC;AAED,aAASI,EAAWJ,GAAM;AAEtB,eADIK,IAAI,CAAA,GAAIC,IAAI,GACTA,IAAIN,EAAK,QAAQM,KAAK,EAAG,CAAAD,EAAE,KAAKF,EAAUH,GAAMM,CAAC,CAAC;AACzD,aAAOD;AAAA,IACV;AAED,aAASE,EAAWF,GAAG;AAEnB,eADIG,IAAI,MAAMF,IAAI,GACXA,IAAID,EAAE,QAAQG,KAAKP,EAAaI,EAAEC,GAAG,CAAC,EAAG;AAChD,aAAOE;AAAA,IACV;AAOD,IAAAV,EAAO,cAAc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