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

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 +77 -77
  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 +111 -1
  48. package/dist/Boost.d.ts.map +1 -1
  49. package/dist/Boost.js +140 -5
  50. package/dist/Boost.js.map +1 -0
  51. package/dist/BoostCore-3-U1xTQN.cjs +3 -0
  52. package/dist/BoostCore-3-U1xTQN.cjs.map +1 -0
  53. package/dist/BoostCore-DVGBUr2y.js +1477 -0
  54. package/dist/BoostCore-DVGBUr2y.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 +166 -43
  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 +64 -23
  64. package/dist/BoostRegistry.d.ts.map +1 -1
  65. package/dist/BoostRegistry.js +162 -88
  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 +78 -188
  76. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  77. package/dist/Budgets/ManagedBudget.js +86 -286
  78. package/dist/Budgets/ManagedBudget.js.map +1 -0
  79. package/dist/Budgets/VestingBudget.d.ts +243 -87
  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-CIPqmAoP.js +1450 -0
  106. package/dist/EventAction-CIPqmAoP.js.map +1 -0
  107. package/dist/EventAction-d-oeqZQs.cjs +2 -0
  108. package/dist/EventAction-d-oeqZQs.cjs.map +1 -0
  109. package/dist/Incentive-Bp8Sez7M.js +298 -0
  110. package/dist/Incentive-Bp8Sez7M.js.map +1 -0
  111. package/dist/Incentive-Djnzseoj.cjs +2 -0
  112. package/dist/Incentive-Djnzseoj.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 +49 -19
  116. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  117. package/dist/Incentives/AllowListIncentive.js +50 -34
  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 +118 -22
  122. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  123. package/dist/Incentives/CGDAIncentive.js +67 -42
  124. package/dist/Incentives/CGDAIncentive.js.map +1 -0
  125. package/dist/Incentives/ERC1155Incentive.d.ts +99 -38
  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 +73 -29
  130. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  131. package/dist/Incentives/ERC20Incentive.js +71 -48
  132. package/dist/Incentives/ERC20Incentive.js.map +1 -0
  133. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +523 -0
  134. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
  135. package/dist/Incentives/ERC20VariableIncentive.d.ts +65 -28
  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 +4 -7
  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 +65 -21
  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-BwfNjRsg.cjs +2 -0
  150. package/dist/SimpleDenyList-BwfNjRsg.cjs.map +1 -0
  151. package/dist/SimpleDenyList-Cn5WpNn0.js +132 -0
  152. package/dist/SimpleDenyList-Cn5WpNn0.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 +12 -10
  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-D09mhzxO.cjs +2 -0
  172. package/dist/componentInterfaces-D09mhzxO.cjs.map +1 -0
  173. package/dist/componentInterfaces-RXBMI5yH.js +14 -0
  174. package/dist/componentInterfaces-RXBMI5yH.js.map +1 -0
  175. package/dist/deployments-BM42vImE.js +43 -0
  176. package/dist/deployments-BM42vImE.js.map +1 -0
  177. package/dist/deployments-CMdF5uEC.cjs +2 -0
  178. package/dist/deployments-CMdF5uEC.cjs.map +1 -0
  179. package/dist/deployments.json +41 -0
  180. package/dist/errors.cjs +2 -1
  181. package/dist/errors.cjs.map +1 -0
  182. package/dist/errors.d.ts +403 -1
  183. package/dist/errors.d.ts.map +1 -1
  184. package/dist/errors.js +285 -39
  185. package/dist/errors.js.map +1 -0
  186. package/dist/generated-B0tk-c9b.cjs +3 -0
  187. package/dist/generated-B0tk-c9b.cjs.map +1 -0
  188. package/dist/{generated-x_abr3Yv.js → generated-B7VaSah4.js} +2058 -2541
  189. package/dist/generated-B7VaSah4.js.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 +143 -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 +1214 -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 +309 -0
  229. package/src/BoostCore.test.ts +827 -0
  230. package/src/BoostCore.ts +1447 -0
  231. package/src/BoostRegistry.ts +543 -0
  232. package/src/Budgets/Budget.test.ts +27 -0
  233. package/src/Budgets/Budget.ts +60 -0
  234. package/src/Budgets/ManagedBudget.test.ts +217 -0
  235. package/src/Budgets/ManagedBudget.ts +534 -0
  236. package/src/Budgets/VestingBudget.test.ts +123 -0
  237. package/src/Budgets/VestingBudget.ts +530 -0
  238. package/src/Deployable/Contract.ts +228 -0
  239. package/src/Deployable/Deployable.ts +250 -0
  240. package/src/Deployable/DeployableTarget.ts +234 -0
  241. package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
  242. package/src/Incentives/AllowListIncentive.test.ts +143 -0
  243. package/src/Incentives/AllowListIncentive.ts +336 -0
  244. package/src/Incentives/CGDAIncentive.test.ts +132 -0
  245. package/src/Incentives/CGDAIncentive.ts +470 -0
  246. package/src/Incentives/ERC1155Incentive.test.ts +87 -0
  247. package/src/Incentives/ERC1155Incentive.ts +465 -0
  248. package/src/Incentives/ERC20Incentive.test.ts +130 -0
  249. package/src/Incentives/ERC20Incentive.ts +484 -0
  250. package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
  251. package/src/Incentives/ERC20VariableCriteriaIncentive.ts +309 -0
  252. package/src/Incentives/ERC20VariableIncentive.test.ts +136 -0
  253. package/src/Incentives/ERC20VariableIncentive.ts +422 -0
  254. package/src/Incentives/Incentive.test.ts +92 -0
  255. package/src/Incentives/Incentive.ts +86 -0
  256. package/src/Incentives/PointsIncentive.test.ts +139 -0
  257. package/src/Incentives/PointsIncentive.ts +367 -0
  258. package/src/Validators/SignerValidator.test.ts +159 -0
  259. package/src/Validators/SignerValidator.ts +683 -0
  260. package/src/Validators/Validator.test.ts +21 -0
  261. package/src/Validators/Validator.ts +55 -0
  262. package/src/claiming.ts +56 -0
  263. package/src/errors.ts +844 -0
  264. package/src/index.test.ts +122 -0
  265. package/src/index.ts +58 -0
  266. package/src/transfers.ts +284 -0
  267. package/src/utils.test.ts +44 -0
  268. package/src/utils.ts +247 -0
  269. package/dist/Budgets/SimpleBudget.d.ts +0 -793
  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(m,w){h.exports=w(m,1),l.LibZip=h.exports.LibZip,l.ERC1967Factory=h.exports.ERC1967Factory})(typeof window<"u"?window:O,function(m,w){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 g(t,r){return parseInt(t.substr(r,2),16)}function S(t){for(var r=[],e=0;e<t.length;e+=2)r.push(g(t,e));return r}function L(t){for(var r="0x",e=0;e<t.length;r+=x(t[e++]));return r}c.flzCompress=function(t){var r=S(b(t)),e=r.length-4,n=[],i=[],a=0,o=2,s=0,f,v,z,p,Z,u,F,j,T,B;function A(d){return r[d]|r[++d]<<8|r[++d]<<16}function D(d){return 2654435769*d>>19&8191}function R(d,H){for(;d>=32;)for(i[s++]=31,f=32;f--;d--)i[s++]=r[H++];if(d)for(i[s++]=d-1;d--;)i[s++]=r[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*=r[j+u]===r[T+u];for(o+=u,--p;u>262;u-=262)i[s++]=224+(p>>8),i[s++]=253,i[s++]=p&255;u<7?(i[s++]=(u<<5)+(p>>8),i[s++]=p&255):(i[s++]=224+(p>>8),i[s++]=u-7,i[s++]=p&255),n[D(A(o))]=o++,n[D(A(o))]=o++,a=o}return R(e+4-a,a),L(i)},c.flzDecompress=function(t){for(var r=S(b(t)),e=0,n=0,i,a,o,s,f=[];e<r.length;)if(o=r[e]>>5)for(a=256*(r[e]&31)+r[e+2-(o=o<7)],i=o?2+(r[e]>>5):9+r[e+1],e=e+3-o,s=n-a-1;i--;)f[n++]=f[s++];else for(i=1+r[e++];i--;)f[n++]=r[e++];return L(f)},c.cdCompress=function(t){t=b(t);var r="0x",e=0,n=0,i=0,a;function o(f){r+=x((r.length<4*2+2)*255^f)}function s(f,v){o(0),o(v-1+f*128)}for(;i<t.length;i+=2){if(a=g(t,i),!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),r},c.cdDecompress=function(t){t=b(t);for(var r="0x",e=0,n,i,a;e<t.length;){if(i=(e<4*2)*255^g(t,e),e+=2,!i){for(i=(e<4*2)*255^g(t,e),a=(i&127)+1,e+=2,n=0;n<a;++n)r+=x((i>>7&&n<32)*255);continue}r+=x(i)}return r};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]+'"'})),w||(m.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.referralFee=l.referralFee||0n,this.maxParticipants=l.maxParticipants||0n,this.owner=l.owner||P.zeroAddress}}function M({budget:h,action:l,validator:m,allowList:w,incentives:y,protocolFee:c=0n,referralFee:b=0n,maxParticipants:x=0n,owner:g}){return U.LibZip.cdCompress(P.encodeAbiParameters(P.parseAbiParameters(["BoostPayload payload","struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint64 referralFee; uint256 maxParticipants; address owner; }","struct Target { bool isBase; address instance; bytes parameters; }"]),[{budget:h,action:l,validator:m,allowList:w,incentives:y,protocolFee:c,referralFee:b,maxParticipants:x,owner:g}]))}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 BoostPayload\n * @typedef {BoostPayload}\n */\nexport interface RawBoost {\n action: Address;\n validator: Address;\n allowList: Address;\n budget: Address;\n incentives: readonly Address[];\n protocolFee: bigint;\n referralFee: bigint;\n maxParticipants: bigint;\n owner: Address;\n}\n\n/**\n * Configuration used to instantiate a `Boost` instance.\n *\n * @export\n * @interface BoostPayload\n * @typedef {BoostPayload}\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 referralFee?: 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 referralFee: 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.referralFee = config.referralFee || 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 * The base referral fee (in bps)\n *\n * @type {?bigint}\n */\n referralFee?: 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.referralFee=0n] - The base referral 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 referralFee = 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; uint64 referralFee; 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 referralFee,\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","i","hexToBytes","a","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","referralFee","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,EAAMI,EAAG,CACxB,OAAO,SAASJ,EAAK,OAAOI,EAAG,CAAC,EAAG,EAAE,CACxC,CAED,SAASC,EAAWL,EAAM,CAEtB,QADIM,EAAI,CAAA,EAAIF,EAAI,EACTA,EAAIJ,EAAK,OAAQI,GAAK,EAAGE,EAAE,KAAKH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OjD,EAAO,OAAA,WACZkD,EAAA,oBACEC,qBAAmB,CACjB,uBACA,kMACA,oEAAA,CACD,EACD,CACE,CACE,OAAAV,EACA,OAAAC,EACA,UAAAC,EACA,UAAAC,EACA,WAAAC,EACA,YAAAC,EACA,YAAAC,EACA,gBAAAC,EACA,MAAAC,CACF,CACF,CACF,CAAA,CAEJ","x_google_ignoreList":[0]}
package/dist/Boost.d.ts CHANGED
@@ -1,9 +1,27 @@
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 BoostPayload
12
+ * @typedef {BoostPayload}
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
+ referralFee: bigint;
22
+ maxParticipants: bigint;
23
+ owner: Address;
24
+ }
7
25
  /**
8
26
  * Configuration used to instantiate a `Boost` instance.
9
27
  *
@@ -139,4 +157,96 @@ export declare class Boost {
139
157
  */
140
158
  constructor(config: BoostConfig);
141
159
  }
160
+ /**
161
+ * Object representation of `BoostLib.Target` struct. Used for low level Boost creation operations.
162
+ * This is used to pass the base contract and its initialization parameters in an efficient manner
163
+ *
164
+ * @export
165
+ * @typedef {Target}
166
+ */
167
+ export type Target = {
168
+ isBase: boolean;
169
+ instance: Address;
170
+ parameters: Hex;
171
+ };
172
+ /**
173
+ * Object representation of `BoostCore.InitPayload` struct.
174
+ *
175
+ * @export
176
+ * @interface BoostPayload
177
+ * @typedef {BoostPayload}
178
+ */
179
+ export interface BoostPayload {
180
+ /**
181
+ * Address to valid budget.
182
+ *
183
+ * @type {Address}
184
+ */
185
+ budget: Address;
186
+ /**
187
+ * Target for existing action, or base with initialization payload.
188
+ *
189
+ * @type {Target}
190
+ */
191
+ action: Target;
192
+ /**
193
+ * Target for existing validator, or base with initialization payload.
194
+ *
195
+ * @type {Target}
196
+ */
197
+ validator: Target;
198
+ /**
199
+ * Target for existing allowList, or base with initialization payload.
200
+ *
201
+ * @type {Target}
202
+ */
203
+ allowList: Target;
204
+ /**
205
+ * Targets for new incentives, with initialization payloads.
206
+ *
207
+ * @type {Target[]}
208
+ */
209
+ incentives: Target[];
210
+ /**
211
+ * The base protocol fee (in bps)
212
+ *
213
+ * @type {?bigint}
214
+ */
215
+ protocolFee?: bigint;
216
+ /**
217
+ * The base referral fee (in bps)
218
+ *
219
+ * @type {?bigint}
220
+ */
221
+ referralFee?: bigint;
222
+ /**
223
+ * Optional maximum amount of participants in the Boost.
224
+ *
225
+ * @type {?bigint}
226
+ */
227
+ maxParticipants?: bigint;
228
+ /**
229
+ * The owner of the Boost.
230
+ *
231
+ * @type {Address}
232
+ */
233
+ owner: Address;
234
+ }
235
+ /**
236
+ * Given a valid {@link BoostPayload}, properly encode and compress the payload for use with `createBoost`
237
+ *
238
+ * @export
239
+ * @param {BoostPayload} param0
240
+ * @param {Address} param0.budget - Address to valid budget.
241
+ * @param {Target} param0.action - Target for existing action, or base with initialization payload.
242
+ * @param {Target} param0.validator - Target for existing validator, or base with initialization payload.
243
+ * @param {Target} param0.allowList - Target for existing allowList, or base with initialization payload.
244
+ * @param {Target[]} param0.incentives - Targets for new incentives, with initialization payloads.
245
+ * @param {bigint} [param0.protocolFee=0n] - The base protocol fee (in bps)
246
+ * @param {bigint} [param0.referralFee=0n] - The base referral fee (in bps)
247
+ * @param {bigint} [param0.maxParticipants=0n] - Optional maximum amount of participants in the Boost.
248
+ * @param {Address} param0.owner - The owner of the Boost.
249
+ * @returns {Hex}
250
+ */
251
+ export declare function prepareBoostPayload({ budget, action, validator, allowList, incentives, protocolFee, referralFee, maxParticipants, owner, }: BoostPayload): Hex;
142
252
  //# sourceMappingURL=Boost.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Boost.d.ts","sourceRoot":"","sources":["../src/Boost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAe,MAAM,MAAM,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;GAMG;AACH,qBAAa,KAAK;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,SA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OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,GAAG,CAAC;CACjB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,MAAM,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,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,MAAM,EACN,SAAS,EACT,SAAS,EACT,UAAU,EACV,WAAgB,EAChB,WAAgB,EAChB,eAAoB,EACpB,KAAK,GACN,EAAE,YAAY,GAAG,GAAG,CAuBpB"}
package/dist/Boost.js CHANGED
@@ -1,15 +1,150 @@
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(g, w) {
5
+ h.exports = w(g, 1), l.LibZip = h.exports.LibZip, l.ERC1967Factory = h.exports.ERC1967Factory;
6
+ })(typeof window < "u" ? window : O, function(g, w) {
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 m(t, r) {
21
+ return parseInt(t.substr(r, 2), 16);
22
+ }
23
+ function L(t) {
24
+ for (var r = [], e = 0; e < t.length; e += 2) r.push(m(t, e));
25
+ return r;
26
+ }
27
+ function P(t) {
28
+ for (var r = "0x", e = 0; e < t.length; r += b(t[e++])) ;
29
+ return r;
30
+ }
31
+ c.flzCompress = function(t) {
32
+ var r = L(x(t)), e = r.length - 4, n = [], i = [], a = 0, o = 2, s = 0, f, v, S, p, z, u, F, Z, T, D;
33
+ function A(d) {
34
+ return r[d] | r[++d] << 8 | r[++d] << 16;
35
+ }
36
+ function B(d) {
37
+ return 2654435769 * d >> 19 & 8191;
38
+ }
39
+ function R(d, j) {
40
+ for (; d >= 32; ) for (i[s++] = 31, f = 32; f--; d--) i[s++] = r[j++];
41
+ if (d) for (i[s++] = d - 1; d--; ) i[s++] = r[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 *= r[Z + u] === r[T + u];
49
+ for (o += u, --p; u > 262; u -= 262) i[s++] = 224 + (p >> 8), i[s++] = 253, i[s++] = p & 255;
50
+ u < 7 ? (i[s++] = (u << 5) + (p >> 8), i[s++] = p & 255) : (i[s++] = 224 + (p >> 8), i[s++] = u - 7, i[s++] = p & 255), n[B(A(o))] = o++, n[B(A(o))] = o++, a = o;
51
+ }
52
+ return R(e + 4 - a, a), P(i);
53
+ }, c.flzDecompress = function(t) {
54
+ for (var r = L(x(t)), e = 0, n = 0, i, a, o, s, f = []; e < r.length; )
55
+ if (o = r[e] >> 5)
56
+ for (a = 256 * (r[e] & 31) + r[e + 2 - (o = o < 7)], i = o ? 2 + (r[e] >> 5) : 9 + r[e + 1], e = e + 3 - o, s = n - a - 1; i--; ) f[n++] = f[s++];
57
+ else
58
+ for (i = 1 + r[e++]; i--; ) f[n++] = r[e++];
59
+ return P(f);
60
+ }, c.cdCompress = function(t) {
61
+ t = x(t);
62
+ var r = "0x", e = 0, n = 0, i = 0, a;
63
+ function o(f) {
64
+ r += b((r.length < 4 * 2 + 2) * 255 ^ f);
65
+ }
66
+ function s(f, v) {
67
+ o(0), o(v - 1 + f * 128);
68
+ }
69
+ for (; i < t.length; i += 2) {
70
+ if (a = m(t, i), !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), r;
81
+ }, c.cdDecompress = function(t) {
82
+ t = x(t);
83
+ for (var r = "0x", e = 0, n, i, a; e < t.length; ) {
84
+ if (i = (e < 4 * 2) * 255 ^ m(t, e), e += 2, !i) {
85
+ for (i = (e < 4 * 2) * 255 ^ m(t, e), a = (i & 127) + 1, e += 2, n = 0; n < a; ++n) r += b((i >> 7 && n < 32) * 255);
86
+ continue;
87
+ }
88
+ r += b(i);
89
+ }
90
+ return r;
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
+ })), w || (g.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.referralFee = l.referralFee || 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: g,
116
+ allowList: w,
117
+ incentives: y,
118
+ protocolFee: c = 0n,
119
+ referralFee: x = 0n,
120
+ maxParticipants: b = 0n,
121
+ owner: m
122
+ }) {
123
+ return k.LibZip.cdCompress(
124
+ U(
125
+ N([
126
+ "BoostPayload payload",
127
+ "struct BoostPayload { address budget; Target action; Target validator; Target allowList; Target[] incentives; uint64 protocolFee; uint64 referralFee; uint256 maxParticipants; address owner; }",
128
+ "struct Target { bool isBase; address instance; bytes parameters; }"
129
+ ]),
130
+ [
131
+ {
132
+ budget: h,
133
+ action: l,
134
+ validator: g,
135
+ allowList: w,
136
+ incentives: y,
137
+ protocolFee: c,
138
+ referralFee: x,
139
+ maxParticipants: b,
140
+ owner: m
141
+ }
142
+ ]
143
+ )
144
+ );
145
+ }
13
146
  export {
14
- i as Boost
147
+ G as Boost,
148
+ I as prepareBoostPayload
15
149
  };
150
+ //# 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 BoostPayload\n * @typedef {BoostPayload}\n */\nexport interface RawBoost {\n action: Address;\n validator: Address;\n allowList: Address;\n budget: Address;\n incentives: readonly Address[];\n protocolFee: bigint;\n referralFee: bigint;\n maxParticipants: bigint;\n owner: Address;\n}\n\n/**\n * Configuration used to instantiate a `Boost` instance.\n *\n * @export\n * @interface BoostPayload\n * @typedef {BoostPayload}\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 referralFee?: 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 referralFee: 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.referralFee = config.referralFee || 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 * The base referral fee (in bps)\n *\n * @type {?bigint}\n */\n referralFee?: 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.referralFee=0n] - The base referral 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 referralFee = 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; uint64 referralFee; 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 referralFee,\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","i","hexToBytes","a","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","referralFee","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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GAAG,EAAEA,CAAC,IAAK;AAAA,IAAK,CAAA,CAAC,GAUxnCtC,MACDD,EAAO,SAASE,IAGbA;AAAA,EACX,CAAC;;;AC1JM,MAAMsC,EAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoEjB,YAAYC,GAAqB;AAC/B,SAAK,KAAKA,EAAO,IACjB,KAAK,SAASA,EAAO,QACrB,KAAK,SAASA,EAAO,QACrB,KAAK,YAAYA,EAAO,WACxB,KAAK,YAAYA,EAAO,WACxB,KAAK,aAAaA,EAAO,YACpB,KAAA,cAAcA,EAAO,eAAe,IACpC,KAAA,cAAcA,EAAO,eAAe,IACpC,KAAA,kBAAkBA,EAAO,mBAAmB,IAC5C,KAAA,QAAQA,EAAO,SAASC;AAAA,EAC/B;AACF;AA+FO,SAASC,EAAoB;AAAA,EAClC,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,aAAAC,IAAc;AAAA,EACd,iBAAAC,IAAkB;AAAA,EAClB,OAAAC;AACF,GAAsB;AACpB,SAAOjD,EAAO,OAAA;AAAA,IACZkD;AAAA,MACEC,EAAmB;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,MAAA,CACD;AAAA,MACD;AAAA,QACE;AAAA,UACE,QAAAV;AAAA,UACA,QAAAC;AAAA,UACA,WAAAC;AAAA,UACA,WAAAC;AAAA,UACA,YAAAC;AAAA,UACA,aAAAC;AAAA,UACA,aAAAC;AAAA,UACA,iBAAAC;AAAA,UACA,OAAAC;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAEJ;","x_google_ignoreList":[0]}
@@ -0,0 +1,3 @@
1
+ "use strict";const o=require("./generated-B0tk-c9b.cjs"),B=require("@wagmi/core"),s=require("viem"),N=require("./deployments-CMdF5uEC.cjs"),df=require("./Actions/Action.cjs"),_=require("./EventAction-d-oeqZQs.cjs"),U=require("./AllowLists/AllowList.cjs"),nf=require("./AllowLists/SimpleAllowList.cjs"),sf=require("./SimpleDenyList-BwfNjRsg.cjs"),rf=require("./Auth/PassthroughAuth.cjs"),z=require("./Boost.cjs"),of=require("./Budgets/Budget.cjs"),uf=require("./Budgets/ManagedBudget.cjs"),lf=require("./Deployable/Deployable.cjs"),hf=require("./Incentives/AllowListIncentive.cjs"),gf=require("./Incentives/CGDAIncentive.cjs"),wf=require("./Incentives/ERC20Incentive.cjs"),yf=require("./Deployable/DeployableTarget.cjs"),g=require("./errors.cjs"),k=require("./Incentive-Djnzseoj.cjs"),Cf=require("./Incentives/PointsIncentive.cjs"),Af=require("./Validators/SignerValidator.cjs"),vf=require("./Validators/Validator.cjs"),h=require("./utils.cjs"),Q=require("viem/actions"),W=require("viem/utils"),If="0x60806040526544364c5bb0006004556103e860055f6101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506103e8600560086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555034801561006e575f80fd5b506040516137463803806137468339818101604052810190610090919061029f565b61009f3361012660201b60201c565b8160015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506102dd565b61013461020260201b60201c565b156101ac577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392780541561016e57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3506101ff565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b5f90565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6102338261020a565b9050919050565b5f61024482610229565b9050919050565b6102548161023a565b811461025e575f80fd5b50565b5f8151905061026f8161024b565b92915050565b61027e81610229565b8114610288575f80fd5b50565b5f8151905061029981610275565b92915050565b5f80604083850312156102b5576102b4610206565b5b5f6102c285828601610261565b92505060206102d38582860161028b565b9150509250929050565b61345c806102ea5f395ff3fe60806040526004361061014a575f3560e01c8063892b97f8116100b5578063d73792a91161006e578063d73792a9146103d0578063e21ff731146103fa578063eccc19a614610436578063f04e283e1461045e578063f2fde38b1461047a578063fee81cf4146104965761014a565b8063892b97f8146102e45780638da5cb5b1461030c5780638fe4f5231461033657806399d32fc414610352578063a92647dc1461037c578063b0e21e8a146103a65761014a565b806354d1f13d1161010757806354d1f13d146102365780635edb9eb014610240578063715018a61461026a578063730f9c57146102745780637b1039991461029057806384ae2bc6146102ba5761014a565b806313c8e2de1461014e578063256929621461018a5780632e75ab501461019457806339a51be5146101bc57806343bc42d3146101e657806346877b1a1461020e575b5f80fd5b348015610159575f80fd5b50610174600480360381019061016f91906124b0565b6104d2565b60405161018191906127a1565b60405180910390f35b6101926107ac565b005b34801561019f575f80fd5b506101ba60048036038101906101b591906124b0565b6107fd565b005b3480156101c7575f80fd5b506101d061080f565b6040516101dd91906127d0565b60405180910390f35b3480156101f1575f80fd5b5061020c60048036038101906102079190612813565b610834565b005b348015610219575f80fd5b50610234600480360381019061022f9190612868565b610867565b005b61023e6108b2565b005b34801561024b575f80fd5b506102546108eb565b60405161026191906128a2565b60405180910390f35b6102726108f6565b005b61028e6004803603810190610289919061291c565b610909565b005b34801561029b575f80fd5b506102a4610cc3565b6040516102b191906129d2565b60405180910390f35b3480156102c5575f80fd5b506102ce610ce8565b6040516102db91906129fa565b60405180910390f35b3480156102ef575f80fd5b5061030a60048036038101906103059190612813565b610d02565b005b348015610317575f80fd5b50610320610d36565b60405161032d91906127d0565b60405180910390f35b610350600480360381019061034b9190612a13565b610d5e565b005b34801561035d575f80fd5b50610366610d73565b60405161037391906128a2565b60405180910390f35b348015610387575f80fd5b50610390610d79565b60405161039d9190612ab7565b60405180910390f35b3480156103b1575f80fd5b506103ba610d9e565b6040516103c791906129fa565b60405180910390f35b3480156103db575f80fd5b506103e4610db7565b6040516103f191906129fa565b60405180910390f35b348015610405575f80fd5b50610420600480360381019061041b9190612ad0565b610dbd565b60405161042d91906127a1565b60405180910390f35b348015610441575f80fd5b5061045c60048036038101906104579190612868565b61182d565b005b61047860048036038101906104739190612868565b611878565b005b610494600480360381019061048f9190612868565b6118b6565b005b3480156104a1575f80fd5b506104bc60048036038101906104b79190612868565b6118df565b6040516104c991906128a2565b60405180910390f35b6104da612304565b5f82815481106104ed576104ec612b1b565b5b905f5260205f209060080201604051806101200160405290815f82015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600382015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482018054806020026020016040519081016040528092919081815260200182805480156106da57602002820191905f5260205f20905b815f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610691575b50505050508152602001600582015f9054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016005820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160068201548152602001600782015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815250509050919050565b5f6107b56118f8565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b610805611902565b8060048190555050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61083c611902565b8060055f6101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555050565b61086f611902565b8060035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b5f8080549050905090565b6108fe611902565b6109075f611939565b565b3068929eee149b4bd2126854036109275763ab143c065f526004601cfd5b3068929eee149b4bd21268555f80878154811061094757610946612b1b565b5b905f5260205f20906008020190506004543410156109a2575f346004546040517f5c54305e00000000000000000000000000000000000000000000000000000000815260040161099993929190612b48565b60405180910390fd5b6109ac81866119ff565b806002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e3f756de8386866040518463ffffffff1660e01b8152600401610a0c93929190612bd7565b602060405180830381865afa158015610a27573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a4b9190612c3c565b610a81576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663703b690088888588886040518663ffffffff1660e01b8152600401610ae5959493929190612c67565b6020604051808303815f875af1158015610b01573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b259190612c3c565b610b5b576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806004018681548110610b7157610b70612b1b565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bb1757cf8386866040518463ffffffff1660e01b8152600401610bd593929190612bd7565b6020604051808303815f875af1158015610bf1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c159190612c3c565b610c5a578184846040517f4139d81d000000000000000000000000000000000000000000000000000000008152600401610c5193929190612bd7565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1686887f0f29bbf4ce25d2346bbeb8a898e24e5d6d7d1d19bb895e71faecac833b259547888888604051610ca693929190612bd7565b60405180910390a4503868929eee149b4bd2126855505050505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560089054906101000a900467ffffffffffffffff1681565b610d0a611902565b80600560086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b610d6c858585858533610909565b5050505050565b60045481565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055f9054906101000a900467ffffffffffffffff1681565b61271081565b610dc5612304565b335f73ffffffffffffffffffffffffffffffffffffffff1660025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614158015610eb9575060025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fe9fbb80826040518263ffffffff1660e01b8152600401610e7891906127d0565b602060405180830381865afa158015610e93573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610eb79190612c3c565b155b15610ef0576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3068929eee149b4bd212685403610f0e5763ab143c065f526004601cfd5b3068929eee149b4bd21268555f610f6785858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f82011690508083019250505050505050611b6d565b806020019051810190610f7a9190613113565b9050610f88815f0151611c06565b5f8060018160018154018082558091505003905f5260205f2090600802019050816101000151816007015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550815f0151816003015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160a0015160055f9054906101000a900467ffffffffffffffff166110599190613187565b816005015f6101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508160c00151600560089054906101000a900467ffffffffffffffff166110a89190613187565b8160050160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508160e00151816006018190555061110f7fe67157950000000000000000000000000000000000000000000000000000000083602001516001611ce1565b815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117f7fe2089f790000000000000000000000000000000000000000000000000000000083606001516001611ce1565b816002015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506111d18260800151835f0151611d03565b8160040190805190602001906111e89291906123ca565b505f73ffffffffffffffffffffffffffffffffffffffff1682604001516020015173ffffffffffffffffffffffffffffffffffffffff1614611259576112547f5912b89c0000000000000000000000000000000000000000000000000000000083604001516001611ce1565b611342565b805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301ffc9a77f5912b89c000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b81526004016112d491906131fc565b602060405180830381865afa1580156112ef573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113139190612c3c565b61131d575f611341565b805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff165b5b816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f73ffffffffffffffffffffffffffffffffffffffff16816001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603611438577f5912b89c000000000000000000000000000000000000000000000000000000005f6040517fe1c4444800000000000000000000000000000000000000000000000000000000815260040161142f929190613215565b60405180910390fd5b805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816007015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660015f805490506114bc919061323c565b7f116812d3ad4507d72f2c428b63246d594ca055a1dc119394285504c23d1f34cd8460040180549050856001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16876003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051611561949392919061326f565b60405180910390a480604051806101200160405290815f82015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600382015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016004820180548060200260200160405190810160405280929190818152602001828054801561174b57602002820191905f5260205f20905b815f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611702575b50505050508152602001600582015f9054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016005820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160068201548152602001600782015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050935050503868929eee149b4bd21268555092915050565b611835611902565b8060025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611880611902565b63389a75e1600c52805f526020600c2080544211156118a657636f5e88185f526004601cfd5b5f8155506118b381611939565b50565b6118be611902565b8060601b6118d357637448fbae5f526004601cfd5b6118dc81611939565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f6202a300905090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611937576382b429005f526004601cfd5b565b6119416120cd565b156119a6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506119fc565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f6004540315611b69575f60045490505f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611ac5575f61271067ffffffffffffffff168460050160089054906101000a900467ffffffffffffffff1667ffffffffffffffff16600454611a8091906132b2565b611a8a9190613320565b90508082611a98919061323c565b9150611ac3818473ffffffffffffffffffffffffffffffffffffffff166120d190919063ffffffff16565b505b611b1d600282611ad59190613320565b846007015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166120d190919063ffffffff16565b611b674760035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166120d190919063ffffffff16565b505b5050565b6060815115611c015760405190506020810160048301805184518501811983525b80861015611be7576001860195508551601f1a80611bd7576001870196508651601f1a5f198652607f8111611bc557600181013887395b6001607f821601860195505050611be2565b808553600185019450505b611b8e565b81835260208501840385525f845260208401604052505050505b919050565b611c307f579cba4400000000000000000000000000000000000000000000000000000000826120ee565b8073ffffffffffffffffffffffffffffffffffffffff1663fe9fbb80336040518263ffffffff1660e01b8152600401611c6991906127d0565b602060405180830381865afa158015611c84573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ca89190612c3c565b611cde576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b5f611cf08484602001516120ee565b611cfa83836121e5565b90509392505050565b6060825167ffffffffffffffff811115611d2057611d1f612cb7565b5b604051908082528060200260200182016040528015611d4e5781602001602082028036833780820191505090505b5090505f5b83518110156120c657611da47f91f4490a00000000000000000000000000000000000000000000000000000000858381518110611d9357611d92612b1b565b5b6020026020010151602001516120ee565b838181518110611db757611db6612b1b565b5b60200260200101515f0151611e43577f91f4490a00000000000000000000000000000000000000000000000000000000848281518110611dfa57611df9612b1b565b5b6020026020010151602001516040517fe1c44448000000000000000000000000000000000000000000000000000000008152600401611e3a929190613215565b60405180910390fd5b611e887f91f4490a00000000000000000000000000000000000000000000000000000000858381518110611e7a57611e79612b1b565b5b60200260200101515f611ce1565b828281518110611e9b57611e9a612b1b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505f828281518110611ee957611ee8612b1b565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16634e7165a2868481518110611f1f57611f1e612b1b565b5b6020026020010151604001516040518263ffffffff1660e01b8152600401611f479190613392565b5f60405180830381865afa158015611f61573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190611f8991906133b2565b90505f81511461201a578373ffffffffffffffffffffffffffffffffffffffff1663fa4ca9b1826040518263ffffffff1660e01b8152600401611fcc9190613392565b6020604051808303815f875af1158015611fe8573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061200c9190612c3c565b612019576120186133f9565b5b5b82828151811061202d5761202c612b1b565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1663439fab9186848151811061206357612062612b1b565b5b6020026020010151604001516040518263ffffffff1660e01b815260040161208b9190613392565b5f604051808303815f87803b1580156120a2575f80fd5b505af11580156120b4573d5f803e3d5ffd5b50505050508080600101915050611d53565b5092915050565b5f90565b5f385f3884865af16120ea5763b12d13eb5f526004601cfd5b5050565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16148061219d57508073ffffffffffffffffffffffffffffffffffffffff166301ffc9a7836040518263ffffffff1660e01b815260040161215c91906131fc565b602060405180830381865afa158015612177573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061219b9190612c3c565b155b156121e15781816040517fe1c444480000000000000000000000000000000000000000000000000000000081526004016121d8929190613215565b60405180910390fd5b5050565b5f825f01516121f857826020015161221c565b61221b836020015173ffffffffffffffffffffffffffffffffffffffff166122a1565b5b9050825f0151801561222b5750815b1561229b578073ffffffffffffffffffffffffffffffffffffffff1663439fab9184604001516040518263ffffffff1660e01b815260040161226d9190613392565b5f604051808303815f87803b158015612284575f80fd5b505af1158015612296573d5f803e3d5ffd5b505050505b92915050565b5f6122ac5f836122b3565b9050919050565b5f6c5af43d3d93803e602a57fd5bf36021528160145273602c3d8160093d39f33d3d3d3d363d3d37363d735f526035600c84f09050806122fa5763301164255f526004601cfd5b5f60215292915050565b6040518061012001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff168152602001606081526020015f67ffffffffffffffff1681526020015f67ffffffffffffffff1681526020015f81526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b828054828255905f5260205f20908101928215612440579160200282015b8281111561243f578251825f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906123e8565b5b50905061244d9190612451565b5090565b5b80821115612468575f815f905550600101612452565b5090565b5f604051905090565b5f80fd5b5f80fd5b5f819050919050565b61248f8161247d565b8114612499575f80fd5b50565b5f813590506124aa81612486565b92915050565b5f602082840312156124c5576124c4612475565b5b5f6124d28482850161249c565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f61251d612518612513846124db565b6124fa565b6124db565b9050919050565b5f61252e82612503565b9050919050565b5f61253f82612524565b9050919050565b61254f81612535565b82525050565b5f61255f82612524565b9050919050565b61256f81612555565b82525050565b5f61257f82612524565b9050919050565b61258f81612575565b82525050565b5f61259f82612503565b9050919050565b5f6125b082612595565b9050919050565b6125c0816125a6565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f6125f982612524565b9050919050565b612609816125ef565b82525050565b5f61261a8383612600565b60208301905092915050565b5f602082019050919050565b5f61263c826125c6565b61264681856125d0565b9350612651836125e0565b805f5b83811015612681578151612668888261260f565b975061267383612626565b925050600181019050612654565b5085935050505092915050565b5f67ffffffffffffffff82169050919050565b6126aa8161268e565b82525050565b6126b98161247d565b82525050565b5f6126c9826124db565b9050919050565b6126d9816126bf565b82525050565b5f61012083015f8301516126f55f860182612546565b5060208301516127086020860182612566565b50604083015161271b6040860182612586565b50606083015161272e60608601826125b7565b50608083015184820360808601526127468282612632565b91505060a083015161275b60a08601826126a1565b5060c083015161276e60c08601826126a1565b5060e083015161278160e08601826126b0565b506101008301516127966101008601826126d0565b508091505092915050565b5f6020820190508181035f8301526127b981846126df565b905092915050565b6127ca816126bf565b82525050565b5f6020820190506127e35f8301846127c1565b92915050565b6127f28161268e565b81146127fc575f80fd5b50565b5f8135905061280d816127e9565b92915050565b5f6020828403121561282857612827612475565b5b5f612835848285016127ff565b91505092915050565b612847816126bf565b8114612851575f80fd5b50565b5f813590506128628161283e565b92915050565b5f6020828403121561287d5761287c612475565b5b5f61288a84828501612854565b91505092915050565b61289c8161247d565b82525050565b5f6020820190506128b55f830184612893565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126128dc576128db6128bb565b5b8235905067ffffffffffffffff8111156128f9576128f86128bf565b5b602083019150836001820283011115612915576129146128c3565b5b9250929050565b5f805f805f8060a0878903121561293657612935612475565b5b5f61294389828a0161249c565b965050602061295489828a0161249c565b955050604061296589828a01612854565b945050606087013567ffffffffffffffff81111561298657612985612479565b5b61299289828a016128c7565b935093505060806129a589828a01612854565b9150509295509295509295565b5f6129bc82612524565b9050919050565b6129cc816129b2565b82525050565b5f6020820190506129e55f8301846129c3565b92915050565b6129f48161268e565b82525050565b5f602082019050612a0d5f8301846129eb565b92915050565b5f805f805f60808688031215612a2c57612a2b612475565b5b5f612a398882890161249c565b9550506020612a4a8882890161249c565b9450506040612a5b88828901612854565b935050606086013567ffffffffffffffff811115612a7c57612a7b612479565b5b612a88888289016128c7565b92509250509295509295909350565b5f612aa182612524565b9050919050565b612ab181612a97565b82525050565b5f602082019050612aca5f830184612aa8565b92915050565b5f8060208385031215612ae657612ae5612475565b5b5f83013567ffffffffffffffff811115612b0357612b02612479565b5b612b0f858286016128c7565b92509250509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f606082019050612b5b5f8301866127c1565b612b686020830185612893565b612b756040830184612893565b949350505050565b5f82825260208201905092915050565b828183375f83830152505050565b5f601f19601f8301169050919050565b5f612bb68385612b7d565b9350612bc3838584612b8d565b612bcc83612b9b565b840190509392505050565b5f604082019050612bea5f8301866127c1565b8181036020830152612bfd818486612bab565b9050949350505050565b5f8115159050919050565b612c1b81612c07565b8114612c25575f80fd5b50565b5f81519050612c3681612c12565b92915050565b5f60208284031215612c5157612c50612475565b5b5f612c5e84828501612c28565b91505092915050565b5f608082019050612c7a5f830188612893565b612c876020830187612893565b612c9460408301866127c1565b8181036060830152612ca7818486612bab565b90509695505050505050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b612ced82612b9b565b810181811067ffffffffffffffff82111715612d0c57612d0b612cb7565b5b80604052505050565b5f612d1e61246c565b9050612d2a8282612ce4565b919050565b5f80fd5b5f612d3d826124db565b9050919050565b5f612d4e82612d33565b9050919050565b612d5e81612d44565b8114612d68575f80fd5b50565b5f81519050612d7981612d55565b92915050565b5f81519050612d8d8161283e565b92915050565b5f80fd5b5f67ffffffffffffffff821115612db157612db0612cb7565b5b612dba82612b9b565b9050602081019050919050565b8281835e5f83830152505050565b5f612de7612de284612d97565b612d15565b905082815260208101848484011115612e0357612e02612d93565b5b612e0e848285612dc7565b509392505050565b5f82601f830112612e2a57612e296128bb565b5b8151612e3a848260208601612dd5565b91505092915050565b5f60608284031215612e5857612e57612cb3565b5b612e626060612d15565b90505f612e7184828501612c28565b5f830152506020612e8484828501612d7f565b602083015250604082015167ffffffffffffffff811115612ea857612ea7612d2f565b5b612eb484828501612e16565b60408301525092915050565b5f67ffffffffffffffff821115612eda57612ed9612cb7565b5b602082029050602081019050919050565b5f612efd612ef884612ec0565b612d15565b90508083825260208201905060208402830185811115612f2057612f1f6128c3565b5b835b81811015612f6757805167ffffffffffffffff811115612f4557612f446128bb565b5b808601612f528982612e43565b85526020850194505050602081019050612f22565b5050509392505050565b5f82601f830112612f8557612f846128bb565b5b8151612f95848260208601612eeb565b91505092915050565b5f81519050612fac816127e9565b92915050565b5f81519050612fc081612486565b92915050565b5f6101208284031215612fdc57612fdb612cb3565b5b612fe7610120612d15565b90505f612ff684828501612d6b565b5f83015250602082015167ffffffffffffffff81111561301957613018612d2f565b5b61302584828501612e43565b602083015250604082015167ffffffffffffffff81111561304957613048612d2f565b5b61305584828501612e43565b604083015250606082015167ffffffffffffffff81111561307957613078612d2f565b5b61308584828501612e43565b606083015250608082015167ffffffffffffffff8111156130a9576130a8612d2f565b5b6130b584828501612f71565b60808301525060a06130c984828501612f9e565b60a08301525060c06130dd84828501612f9e565b60c08301525060e06130f184828501612fb2565b60e08301525061010061310684828501612d7f565b6101008301525092915050565b5f6020828403121561312857613127612475565b5b5f82015167ffffffffffffffff81111561314557613144612479565b5b61315184828501612fc6565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6131918261268e565b915061319c8361268e565b9250828201905067ffffffffffffffff8111156131bc576131bb61315a565b5b92915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6131f6816131c2565b82525050565b5f60208201905061320f5f8301846131ed565b92915050565b5f6040820190506132285f8301856131ed565b61323560208301846127c1565b9392505050565b5f6132468261247d565b91506132518361247d565b92508282039050818111156132695761326861315a565b5b92915050565b5f6080820190506132825f830187612893565b61328f60208301866127c1565b61329c60408301856127c1565b6132a960608301846127c1565b95945050505050565b5f6132bc8261247d565b91506132c78361247d565b92508282026132d58161247d565b915082820484148315176132ec576132eb61315a565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61332a8261247d565b91506133358361247d565b925082613345576133446132f3565b5b828204905092915050565b5f81519050919050565b5f61336482613350565b61336e8185612b7d565b935061337e818560208601612dc7565b61338781612b9b565b840191505092915050565b5f6020820190508181035f8301526133aa818461335a565b905092915050565b5f602082840312156133c7576133c6612475565b5b5f82015167ffffffffffffffff8111156133e4576133e3612479565b5b6133f084828501612e16565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52600160045260245ffdfea26469706673582212204eaf66ccca943bbd41336b4d6a869ce92b2897eab45b2c64f5ada1cf3f319bca64736f6c634300081a0033";function K(t){const e=t.state.current,f=t.state.connections.get(e),b=f==null?void 0:f.accounts,a=b==null?void 0:b[0],c=t.chains.find(i=>i.id===(f==null?void 0:f.chainId)),d=t.state.status;switch(d){case"connected":return{address:a,addresses:b,chain:c,chainId:f==null?void 0:f.chainId,connector:f==null?void 0:f.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:d};case"reconnecting":return{address:a,addresses:b,chain:c,chainId:f==null?void 0:f.chainId,connector:f==null?void 0:f.connector,isConnected:!!a,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:d};case"connecting":return{address:a,addresses:b,chain:c,chainId:f==null?void 0:f.chainId,connector:f==null?void 0:f.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:d};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:d}}}function _f(t){return t.state.chainId}function X(t,e,f){const b=t[e.name];if(typeof b=="function")return b;const a=t[f];return typeof a=="function"?a:c=>e(t,c)}const Bf="2.13.8",Ef=()=>`@wagmi/core@${Bf}`;var Y=function(t,e,f,b){if(f==="a"&&!b)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!b:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?b:f==="a"?b.call(t):b?b.value:e.get(t)},F,Z;class v extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Ef()}constructor(e,f={}){var c;super(),F.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const b=f.cause instanceof v?f.cause.details:(c=f.cause)!=null&&c.message?f.cause.message:f.details,a=f.cause instanceof v&&f.cause.docsPath||f.docsPath;this.message=[e||"An error occurred.","",...f.metaMessages?[...f.metaMessages,""]:[],...a?[`Docs: ${this.docsBaseUrl}${a}.html${f.docsSlug?`#${f.docsSlug}`:""}`]:[],...b?[`Details: ${b}`]:[],`Version: ${this.version}`].join(`
2
+ `),f.cause&&(this.cause=f.cause),this.details=b,this.docsPath=a,this.metaMessages=f.metaMessages,this.shortMessage=e}walk(e){return Y(this,F,"m",Z).call(this,this,e)}}F=new WeakSet,Z=function t(e,f){return f!=null&&f(e)?e:e.cause?Y(this,F,"m",t).call(this,e.cause,f):e};class mf extends v{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Pf extends v{constructor({address:e,connector:f}){super(`Account "${e}" not found for connector "${f.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class Rf extends v{constructor({connectionChainId:e,connectorChainId:f}){super(`The current chain of the connector (id: ${f}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${f}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class pf extends v{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uuid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function ff(t,e={}){let f;if(e.connector){const{connector:n}=e;if(t.state.status==="reconnecting"&&!n.getAccounts&&!n.getChainId)throw new pf({connector:n});const[u,w]=await Promise.all([n.getAccounts(),n.getChainId()]);f={accounts:u,chainId:w,connector:n}}else f=t.state.connections.get(t.state.current);if(!f)throw new mf;const b=e.chainId??f.chainId,a=await f.connector.getChainId();if(a!==f.chainId)throw new Rf({connectionChainId:f.chainId,connectorChainId:a});const c=f.connector;if(c.getClient)return c.getClient({chainId:b});const d=W.parseAccount(e.account??f.accounts[0]);if(d.address=W.getAddress(d.address),e.account&&!f.accounts.some(n=>n.toLowerCase()===d.address.toLowerCase()))throw new Pf({address:d.address,connector:c});const i=t.chains.find(n=>n.id===b),r=await f.connector.getProvider({chainId:b});return s.createClient({account:d,chain:i,name:"Connector Client",transport:n=>s.custom(r)({...n,retryCount:0})})}async function Ff(t,e){const{abi:f,chainId:b,connector:a,...c}=e;let d;e.account?d=e.account:d=(await ff(t,{chainId:b,connector:a})).account;const i=t.getClient({chainId:b}),r=X(i,Q.simulateContract,"simulateContract"),{result:n,request:u}=await r({...c,abi:f,account:d});return{chainId:i.chain.id,result:n,request:{__mode:"prepared",...u,chainId:b}}}async function J(t,e){const{account:f,chainId:b,connector:a,__mode:c,...d}=e;let i;typeof f=="object"&&f.type==="local"?i=t.getClient({chainId:b}):i=await ff(t,{account:f,chainId:b,connector:a});const{connector:r}=K(t);let n;if(c==="prepared"||r!=null&&r.supportsSimulation)n=d;else{const{request:A}=await Ff(t,{...d,account:f,chainId:b});n=A}return await X(i,Q.writeContract,"writeContract")({...n,...f?{account:f}:{},chain:b?{id:b}:null})}function Df(t){return t.address!==void 0&&typeof t.address=="object"?(e,f)=>{var d;const b=_f(e),a=K(e);let c;return f.chainId?c=f.chainId:f.account&&f.account===a.address||f.account===void 0?c=a.chainId:c=b,J(e,{...f,...t.functionName?{functionName:t.functionName}:{},address:c?(d=t.address)==null?void 0:d[c]:void 0,abi:t.abi})}:(e,f)=>J(e,{...f,...t.address?{address:t.address}:{},...t.functionName?{functionName:t.functionName}:{},abi:t.abi})}const qf="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6120ec806100bd5f395ff3fe60806040526004361061013f575f3560e01c806377548687116100b5578063d54ad2a11161006e578063d54ad2a114610408578063db09da1214610432578063dcc59b6f1461046e578063f04e283e14610498578063f2fde38b146104b4578063fee81cf4146104d05761013f565b806377548687146102e55780638da5cb5b14610312578063a4d66daf1461033c578063a871ced214610366578063bb1757cf14610390578063c884ef83146103cc5761013f565b806338d52e0f1161010757806338d52e0f14610207578063439fab9114610231578063474f5a44146102595780634e7165a21461029557806354d1f13d146102d1578063715018a6146102db5761013f565b806301ffc9a71461014357806307621eca1461017f578063228cb733146101a957806325692962146101d357806328d6183b146101dd575b5f80fd5b34801561014e575f80fd5b50610169600480360381019061016491906113a5565b61050c565b60405161017691906113ea565b60405180910390f35b34801561018a575f80fd5b50610193610585565b6040516101a0919061141b565b60405180910390f35b3480156101b4575f80fd5b506101bd61058e565b6040516101ca919061141b565b60405180910390f35b6101db610594565b005b3480156101e8575f80fd5b506101f16105e5565b6040516101fe9190611443565b60405180910390f35b348015610212575f80fd5b5061021b61060c565b604051610228919061149b565b60405180910390f35b34801561023c575f80fd5b5061025760048036038101906102529190611515565b610631565b005b348015610264575f80fd5b5061027f600480360381019061027a9190611515565b61089a565b60405161028c91906113ea565b60405180910390f35b3480156102a0575f80fd5b506102bb60048036038101906102b69190611515565b6109db565b6040516102c891906115d0565b60405180910390f35b6102d9610aac565b005b6102e3610ae5565b005b3480156102f0575f80fd5b506102f9610af8565b6040516103099493929190611696565b60405180910390f35b34801561031d575f80fd5b50610326610b4d565b604051610333919061149b565b60405180910390f35b348015610347575f80fd5b50610350610b75565b60405161035d919061141b565b60405180910390f35b348015610371575f80fd5b5061037a610b7b565b6040516103879190611768565b60405180910390f35b34801561039b575f80fd5b506103b660048036038101906103b191906117ab565b610c4a565b6040516103c391906113ea565b60405180910390f35b3480156103d7575f80fd5b506103f260048036038101906103ed9190611808565b610e42565b6040516103ff91906113ea565b60405180910390f35b348015610413575f80fd5b5061041c610e5f565b604051610429919061141b565b60405180910390f35b34801561043d575f80fd5b50610458600480360381019061045391906117ab565b610e65565b60405161046591906113ea565b60405180910390f35b348015610479575f80fd5b50610482610e78565b60405161048f919061141b565b60405180910390f35b6104b260048036038101906104ad9190611808565b610e7d565b005b6104ce60048036038101906104c99190611808565b610ebb565b005b3480156104db575f80fd5b506104f660048036038101906104f19190611808565b610ee4565b604051610503919061141b565b60405180910390f35b5f7fa8e4af1e000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061057e575061057d82610efd565b5b9050919050565b5f600154905090565b60015481565b5f61059d610f76565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7fa8e4af1e00000000000000000000000000000000000000000000000000000000905090565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f61063a610f80565b9050805460038255801561066c5760018160011c14303b106106635763f92ee8a95f526004601cfd5b818160ff1b1b91505b5061067633610fa9565b5f83838101906106869190611a3e565b90505f815f015190505f826020015190505f836040015190505f846060015190505f82036106e0576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61070a308673ffffffffffffffffffffffffffffffffffffffff1661107f90919063ffffffff16565b90508281101561075857855f015181846040517f5c54305e00000000000000000000000000000000000000000000000000000000815260040161074f93929190611a69565b60405180910390fd5b8460035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600181905550826004819055505f6005819055508160065f820151815f015f6101000a81548160ff021916908360018111156107d8576107d76115f0565b5b0217905550602082015181600101556040820151816002015f6101000a81548160ff021916908360ff16021790555060608201518160020160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090505061085a33610fa9565b5050505050508015610895576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f6108a36110b2565b5f83838101906108b39190611bb7565b90505f81602001518060200190518101906108ce9190611c12565b90508060045f8282546108e19190611c6a565b92505081905550610937825f01518260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e99092919063ffffffff16565b815f015173ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16845f0151846040516020016109ab93929190611d02565b6040516020818303038152906040526040516109c791906115d0565b60405180910390a260019250505092915050565b60605f805f85858101906109ef9190611d79565b925092509250604051806080016040528060016002811115610a1457610a136115f0565b5b81526020018473ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001604051806020016040528084815250604051602001610a709190611df2565b604051602081830303815290604052815250604051602001610a929190611ef9565b604051602081830303815290604052935050505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610aed6110b2565b610af65f611132565b565b6006805f015f9054906101000a900460ff1690806001015490806002015f9054906101000a900460ff16908060020160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b60045481565b610b836112ed565b60066040518060800160405290815f82015f9054906101000a900460ff166001811115610bb357610bb26115f0565b5b6001811115610bc557610bc46115f0565b5b815260200160018201548152602001600282015f9054906101000a900460ff1660ff1660ff1681526020016002820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f610c536110b2565b5f8383810190610c639190611f9e565b90505f8160200151806020019051810190610c7e9190611c12565b90505f610c8a876111f8565b610cc0576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60015403610cd157819050610cf5565b670de0b6b3a764000082600154610ce89190611fe5565b610cf29190612053565b90505b60045481600554610d069190612083565b1115610d3e576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f828254610d4f9190612083565b92505081905550610da2878260035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e99092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff167f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d360035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168984604051602001610e1093929190611d02565b604051602081830303815290604052604051610e2c91906115d0565b60405180910390a2600193505050509392505050565b6002602052805f5260405f205f915054906101000a900460ff1681565b60055481565b5f610e6f846111f8565b90509392505050565b5f5481565b610e856110b2565b63389a75e1600c52805f526020600c208054421115610eab57636f5e88185f526004601cfd5b5f815550610eb881611132565b50565b610ec36110b2565b8060601b610ed857637448fbae5f526004601cfd5b610ee181611132565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7f91f4490a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610f6f5750610f6e82611207565b5b9050919050565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610fb1611280565b15611029577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415610feb57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061107c565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146110e7576382b429005f526004601cfd5b565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611129576390b8ec185f526004601cfd5b5f603452505050565b61113a611280565b1561119f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506111f5565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f600454600554109050919050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611279575061127882611284565b5b9050919050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60405180608001604052805f600181111561130b5761130a6115f0565b5b81526020015f80191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61138481611350565b811461138e575f80fd5b50565b5f8135905061139f8161137b565b92915050565b5f602082840312156113ba576113b9611348565b5b5f6113c784828501611391565b91505092915050565b5f8115159050919050565b6113e4816113d0565b82525050565b5f6020820190506113fd5f8301846113db565b92915050565b5f819050919050565b61141581611403565b82525050565b5f60208201905061142e5f83018461140c565b92915050565b61143d81611350565b82525050565b5f6020820190506114565f830184611434565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6114858261145c565b9050919050565b6114958161147b565b82525050565b5f6020820190506114ae5f83018461148c565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126114d5576114d46114b4565b5b8235905067ffffffffffffffff8111156114f2576114f16114b8565b5b60208301915083600182028301111561150e5761150d6114bc565b5b9250929050565b5f806020838503121561152b5761152a611348565b5b5f83013567ffffffffffffffff8111156115485761154761134c565b5b611554858286016114c0565b92509250509250929050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6115a282611560565b6115ac818561156a565b93506115bc81856020860161157a565b6115c581611588565b840191505092915050565b5f6020820190508181035f8301526115e88184611598565b905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061162e5761162d6115f0565b5b50565b5f81905061163e8261161d565b919050565b5f61164d82611631565b9050919050565b61165d81611643565b82525050565b5f819050919050565b61167581611663565b82525050565b5f60ff82169050919050565b6116908161167b565b82525050565b5f6080820190506116a95f830187611654565b6116b6602083018661166c565b6116c36040830185611687565b6116d0606083018461148c565b95945050505050565b6116e281611643565b82525050565b6116f181611663565b82525050565b6117008161167b565b82525050565b61170f8161147b565b82525050565b608082015f8201516117295f8501826116d9565b50602082015161173c60208501826116e8565b50604082015161174f60408501826116f7565b5060608201516117626060850182611706565b50505050565b5f60808201905061177b5f830184611715565b92915050565b61178a8161147b565b8114611794575f80fd5b50565b5f813590506117a581611781565b92915050565b5f805f604084860312156117c2576117c1611348565b5b5f6117cf86828701611797565b935050602084013567ffffffffffffffff8111156117f0576117ef61134c565b5b6117fc868287016114c0565b92509250509250925092565b5f6020828403121561181d5761181c611348565b5b5f61182a84828501611797565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61186d82611588565b810181811067ffffffffffffffff8211171561188c5761188b611837565b5b80604052505050565b5f61189e61133f565b90506118aa8282611864565b919050565b5f80fd5b6118bc81611403565b81146118c6575f80fd5b50565b5f813590506118d7816118b3565b92915050565b600281106118e9575f80fd5b50565b5f813590506118fa816118dd565b92915050565b61190981611663565b8114611913575f80fd5b50565b5f8135905061192481611900565b92915050565b6119338161167b565b811461193d575f80fd5b50565b5f8135905061194e8161192a565b92915050565b5f6080828403121561196957611968611833565b5b6119736080611895565b90505f611982848285016118ec565b5f83015250602061199584828501611916565b60208301525060406119a984828501611940565b60408301525060606119bd84828501611797565b60608301525092915050565b5f60e082840312156119de576119dd611833565b5b6119e86080611895565b90505f6119f784828501611797565b5f830152506020611a0a848285016118c9565b6020830152506040611a1e848285016118c9565b6040830152506060611a3284828501611954565b60608301525092915050565b5f60e08284031215611a5357611a52611348565b5b5f611a60848285016119c9565b91505092915050565b5f606082019050611a7c5f83018661148c565b611a89602083018561140c565b611a96604083018461140c565b949350505050565b5f80fd5b5f67ffffffffffffffff821115611abc57611abb611837565b5b611ac582611588565b9050602081019050919050565b828183375f83830152505050565b5f611af2611aed84611aa2565b611895565b905082815260208101848484011115611b0e57611b0d611a9e565b5b611b19848285611ad2565b509392505050565b5f82601f830112611b3557611b346114b4565b5b8135611b45848260208601611ae0565b91505092915050565b5f60408284031215611b6357611b62611833565b5b611b6d6040611895565b90505f611b7c84828501611797565b5f83015250602082013567ffffffffffffffff811115611b9f57611b9e6118af565b5b611bab84828501611b21565b60208301525092915050565b5f60208284031215611bcc57611bcb611348565b5b5f82013567ffffffffffffffff811115611be957611be861134c565b5b611bf584828501611b4e565b91505092915050565b5f81519050611c0c816118b3565b92915050565b5f60208284031215611c2757611c26611348565b5b5f611c3484828501611bfe565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611c7482611403565b9150611c7f83611403565b9250828203905081811115611c9757611c96611c3d565b5b92915050565b5f8160601b9050919050565b5f611cb382611c9d565b9050919050565b5f611cc482611ca9565b9050919050565b611cdc611cd78261147b565b611cba565b82525050565b5f819050919050565b611cfc611cf782611403565b611ce2565b82525050565b5f611d0d8286611ccb565b601482019150611d1d8285611ccb565b601482019150611d2d8284611ceb565b602082019150819050949350505050565b5f611d488261145c565b9050919050565b611d5881611d3e565b8114611d62575f80fd5b50565b5f81359050611d7381611d4f565b92915050565b5f805f60608486031215611d9057611d8f611348565b5b5f611d9d86828701611d65565b9350506020611dae868287016118c9565b9250506040611dbf868287016118c9565b9150509250925092565b611dd281611403565b82525050565b602082015f820151611dec5f850182611dc9565b50505050565b5f602082019050611e055f830184611dd8565b92915050565b60038110611e1c57611e1b6115f0565b5b50565b5f819050611e2c82611e0b565b919050565b5f611e3b82611e1f565b9050919050565b611e4b81611e31565b82525050565b5f82825260208201905092915050565b5f611e6b82611560565b611e758185611e51565b9350611e8581856020860161157a565b611e8e81611588565b840191505092915050565b5f608083015f830151611eae5f860182611e42565b506020830151611ec16020860182611706565b506040830151611ed46040860182611706565b5060608301518482036060860152611eec8282611e61565b9150508091505092915050565b5f6020820190508181035f830152611f118184611e99565b905092915050565b5f60408284031215611f2e57611f2d611833565b5b611f386040611895565b90505f82013567ffffffffffffffff811115611f5757611f566118af565b5b611f6384828501611b21565b5f83015250602082013567ffffffffffffffff811115611f8657611f856118af565b5b611f9284828501611b21565b60208301525092915050565b5f60208284031215611fb357611fb2611348565b5b5f82013567ffffffffffffffff811115611fd057611fcf61134c565b5b611fdc84828501611f19565b91505092915050565b5f611fef82611403565b9150611ffa83611403565b925082820261200881611403565b9150828204841483151761201f5761201e611c3d565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61205d82611403565b915061206883611403565b92508261207857612077612026565b5b828204905092915050565b5f61208d82611403565b915061209883611403565b92508282019050808211156120b0576120af611c3d565b5b9291505056fea26469706673582212201017df038f8aa27029890c981ccc56a5992ab2ef1c76a4865d226eb03eec71bd64736f6c634300081a0033",$=class $ extends yf.DeployableTarget{constructor(){super(...arguments),this.abi=o.N}async getIncentiveCriteria(){try{return await o.rv(this._config,{address:this.assertValidAddress()})}catch(e){throw new g.IncentiveCriteriaNotFoundError(e)}}async getIncentiveScalar({hash:e}){var a;const f=await this.getIncentiveCriteria(),b=await B.getTransaction(this._config,{hash:e});if(f.criteriaType===_.SignatureType.EVENT){const d=(await B.getTransactionReceipt(this._config,{hash:e})).logs;if(d.length===0)throw new g.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);try{const i=_.events.abi[f.signature],r=s.parseEventLogs({abi:[i],logs:d});if(r==null||r.length===0)throw new g.NoMatchingLogsError(`No logs found for event signature ${f.signature}`);const n=((a=r[0])==null?void 0:a.args)[f.fieldIndex];if(n===void 0)throw new g.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(n)}catch(i){throw new g.DecodedArgsError(`Failed to decode event log for signature ${f.signature}: ${i.message}`)}}else if(f.criteriaType===_.SignatureType.FUNC)try{const c=_.functions.abi[f.signature],i=s.decodeFunctionData({abi:[c],data:b.input}).args[f.fieldIndex];if(i==null)throw new g.DecodedArgsError(`Decoded argument at index ${f.fieldIndex} is undefined`);return BigInt(i)}catch(c){throw new g.DecodedArgsError(`Failed to decode function data for signature ${f.signature}: ${c.message}`)}else throw new g.InvalidCriteriaTypeError(`Invalid criteria type ${f.criteriaType}`)}buildParameters(e,f){const[b,a]=this.validateDeploymentConfig(e,f);return{abi:o.N,bytecode:qf,args:[ef(b)],...this.optionallyAttachAccount(a.account)}}};$.bases={...N.ERC20VariableCriteriaIncentive};let D=$;function ef({asset:t,reward:e,limit:f,criteria:b}){return s.encodeAbiParameters([{type:"tuple",name:"initPayloadExtended",components:[{type:"address",name:"asset"},{type:"uint256",name:"reward"},{type:"uint256",name:"limit"},{type:"tuple",name:"criteria",components:[{type:"uint8",name:"criteriaType"},{type:"bytes32",name:"signature"},{type:"uint8",name:"fieldIndex"},{type:"address",name:"targetContract"}]}]}],[{asset:t,reward:e,limit:f,criteria:{criteriaType:b.criteriaType,signature:b.signature,fieldIndex:b.fieldIndex,targetContract:b.targetContract}}])}const Vf=s.parseEther("0.000075"),Sf=N.BoostCore[11155111],T={...N.BoostCore,31337:void 0};function Of(t){return t.address}function Lf(t){return t.registryAddress&&t.protocolFeeReceiver}const M=class M extends lf.Deployable{get addresses(){return this.constructor.addresses}constructor({config:e,account:f,...b}){if(Of(b)&&b.address)super({account:f,config:e},b.address);else if(Lf(b))super({account:f,config:e},[b.registryAddress,b.protocolFeeReceiver]);else{const{address:a}=h.assertValidAddressByChainId(e,T);super({account:f,config:e},a)}this.abi=o.b}async createBoost(e,f){var j,G;const[b,a]=this.validateDeploymentConfig(e,f),c=((j=f==null?void 0:f.chain)==null?void 0:j.id)||(f==null?void 0:f.chainId),{chainId:d,address:i}=h.assertValidAddressByChainId(a.config,this.addresses,c);let{budget:r,action:n,validator:u,allowList:w,incentives:A,protocolFee:q=0n,referralFee:V=0n,maxParticipants:S=0n,owner:I}=b;const bf=Df({abi:o.b,functionName:"createBoost",address:i});if(!I&&(I=((G=this._account)==null?void 0:G.address)||B.getAccount(a.config).address||s.zeroAddress,I===s.zeroAddress))throw new g.DeployableUnknownOwnerProvidedError;u||(u=this.SignerValidator({signers:[I],validatorCaller:i}));let H=s.zeroAddress;if(r.address){if(H=r.address,!await r.isAuthorized(i))throw new g.BudgetMustAuthorizeBoostCore(i)}else throw new g.MustInitializeBudgetError;let E={instance:s.zeroAddress,isBase:!0,parameters:s.zeroHash};if(n.address){const l=n.isBase;E={isBase:l,instance:n.address,parameters:l&&n.buildParameters(void 0,a).args.at(0)||s.zeroHash}}else E.parameters=n.buildParameters(void 0,a).args.at(0)||s.zeroHash,E.instance=h.assertValidAddressByChainId(a.config,n.bases,d).address;let m={instance:s.zeroAddress,isBase:!0,parameters:s.zeroHash};if(u.address){const l=u.isBase;m={isBase:l,instance:u.address,parameters:l&&u.buildParameters(void 0,a).args.at(0)||s.zeroHash}}else m.parameters=u.buildParameters(void 0,a).args.at(0)||s.zeroHash,m.instance=h.assertValidAddressByChainId(a.config,u.bases,d).address;let P={instance:s.zeroAddress,isBase:!0,parameters:s.zeroHash};if(w.address){const l=w.isBase;P={isBase:l,instance:w.address,parameters:s.zeroHash}}else P.parameters=w.buildParameters(void 0,a).args.at(0)||s.zeroHash,P.instance=h.assertValidAddressByChainId(a.config,w.bases,d).address;const R=A.map(()=>({instance:s.zeroAddress,isBase:!0,parameters:s.zeroHash}));for(let l=0;l<A.length;l++){const C=A.at(l);if(C.address){const L=C.isBase;if(!L)throw new g.IncentiveNotCloneableError(C);R[l]={isBase:L,instance:C.address,parameters:L&&C.buildParameters(void 0,a).args.at(0)||s.zeroHash}}else R[l].parameters=C.buildParameters(void 0,a).args.at(0)||s.zeroHash,R[l].instance=h.assertValidAddressByChainId(a.config,C.bases,d).address}const af={budget:H,action:E,validator:m,allowList:P,incentives:R,protocolFee:q,referralFee:V,maxParticipants:S,owner:I},tf=await bf(a.config,{...this.optionallyAttachAccount(a.account),...f,chainId:d,args:[z.prepareBoostPayload(af)]}),cf=await B.waitForTransactionReceipt(a.config,{hash:tf}),p=s.parseEventLogs({abi:o.b,eventName:"BoostCreated",logs:cf.logs}).at(0);let O=0n;if(!p)throw new g.BoostCoreNoIdentifierEmitted;O=p==null?void 0:p.args.boostIndex;const y=await this.readBoost(O);return new z.Boost({id:O,budget:r.at(y.budget),action:n.at(y.action),validator:u.at(y.validator),allowList:w.at(y.allowList),incentives:A.map((l,C)=>l.at(y.incentives.at(C))),protocolFee:y.protocolFee,referralFee:y.referralFee,maxParticipants:y.maxParticipants,owner:y.owner})}async claimIncentive(e,f,b,a,c){return await this.awaitResult(this.claimIncentiveRaw(e,f,b,a,c))}async claimIncentiveRaw(e,f,b,a,c){var n;const{request:d,result:i}=await o.Qd(this._config,{...h.assertValidAddressByChainId(this._config,this.addresses,((n=c==null?void 0:c.chain)==null?void 0:n.id)||(c==null?void 0:c.chainId)),args:[e,f,b,a],...this.optionallyAttachAccount(),...c});return{hash:await o.Ld(this._config,d),result:i}}async claimIncentiveFor(e,f,b,a,c,d){return await this.awaitResult(this.claimIncentiveForRaw(e,f,b,a,c,d))}async claimIncentiveForRaw(e,f,b,a,c,d){var u;const{request:i,result:r}=await o.Jd(this._config,{...h.assertValidAddressByChainId(this._config,this.addresses,((u=d==null?void 0:d.chain)==null?void 0:u.id)||(d==null?void 0:d.chainId)),args:[e,f,b,a,c],...this.optionallyAttachAccount(),...d});return{hash:await o.Vd(this._config,i),result:r}}async readBoost(e,f){return await o.Od(this._config,{address:this.assertValidAddress(),args:[e],...this.optionallyAttachAccount(),...f})}async getBoost(e,f){let b;typeof e=="string"?b=BigInt(e):b=e;const{protocolFee:a,referralFee:c,maxParticipants:d,owner:i,...r}=await this.readBoost(b,f),n={config:this._config,account:this._account},[u,w,A,q,V]=await Promise.all([df.actionFromAddress(n,r.action),of.budgetFromAddress(n,r.budget),vf.validatorFromAddress(n,r.validator),U.allowListFromAddress(n,r.allowList),Promise.all(r.incentives.map(S=>k.incentiveFromAddress(n,S)))]);return new z.Boost({id:b,action:u,budget:w,validator:A,allowList:q,incentives:V,protocolFee:a,referralFee:c,maxParticipants:d,owner:i})}async getBoostCount(e){return await o.Md(this._config,{...h.assertValidAddressByChainId(this._config,this.addresses,e==null?void 0:e.chainId),args:[],...this.optionallyAttachAccount(),...e})}async isAuthorized(e,f){const b=await this.createBoostAuth(f);return o.JT(this._config,{address:b,args:[e],...this.optionallyAttachAccount(),...f})}async createBoostAuth(e){return await o.gd(this._config,{...h.assertValidAddressByChainId(this._config,this.addresses,e==null?void 0:e.chainId),args:[],...this.optionallyAttachAccount(),...e})}async setCreateBoostAuth(e,f){return await this.awaitResult(this.setCreateBoostAuthRaw(e.assertValidAddress(),{...f}))}async setCreateBoostAuthRaw(e,f){const{request:b,result:a}=await o.nc(this._config,{...h.assertValidAddressByChainId(this._config,this.addresses,f==null?void 0:f.chainId),args:[e],...this.optionallyAttachAccount(),...f});return{hash:await o.qd(this._config,b),result:a}}async protocolFee(e){return await o.Ed(this._config,{...h.assertValidAddressByChainId(this._config,this.addresses,e==null?void 0:e.chainId),args:[],...this.optionallyAttachAccount(),...e})}async protocolFeeReceiver(e){return await o.zd(this._config,{...h.assertValidAddressByChainId(this._config,this.addresses,e==null?void 0:e.chainId),args:[],...this.optionallyAttachAccount(),...e})}async setProcolFeeReceiver(e,f){return await this.awaitResult(this.setProcolFeeReceiverRaw(e,{...f}))}async setProcolFeeReceiverRaw(e,f){const{request:b,result:a}=await o.ic(this._config,{...h.assertValidAddressByChainId(this._config,this.addresses,f==null?void 0:f.chainId),args:[e],...this.optionallyAttachAccount(),...f});return{hash:await o.Gd(this._config,b),result:a}}async claimFee(e){return await o.Nd(this._config,{...h.assertValidAddressByChainId(this._config,this.addresses,e==null?void 0:e.chainId),args:[],...this.optionallyAttachAccount(),...e})}async setClaimFee(e,f){return await this.awaitResult(this.setClaimFeeRaw(e,f))}async setClaimFeeRaw(e,f){const{request:b,result:a}=await o.tc(this._config,{...h.assertValidAddressByChainId(this._config,this.addresses,f==null?void 0:f.chainId),args:[e],...this.optionallyAttachAccount(),...f});return{hash:await o.Pd(this._config,b),result:a}}async getClaimFromTransaction(e){var a;const f=await B.getTransactionReceipt(this._config,e);return(a=s.parseEventLogs({abi:o.b,eventName:"BoostClaimed",logs:f.logs}).at(0))==null?void 0:a.args}PassthroughAuth(e){return new rf.PassthroughAuth({config:this._config,account:this._account},e)}EventAction(e,f){return new _.EventAction({config:this._config,account:this._account},e,f)}OpenAllowList(e){return new U.OpenAllowList({config:this._config,account:this._account},void 0,e)}SimpleAllowList(e,f){return new nf.SimpleAllowList({config:this._config,account:this._account},e,f)}SimpleDenyList(e,f){return new sf.SimpleDenyList({config:this._config,account:this._account},e,f)}ManagedBudget(e){return new uf.ManagedBudget({config:this._config,account:this._account},e)}AllowListIncentive(e){return new hf.AllowListIncentive({config:this._config,account:this._account},e)}CGDAIncentive(e){return new gf.CGDAIncentive({config:this._config,account:this._account},e)}ERC20Incentive(e){return new wf.ERC20Incentive({config:this._config,account:this._account},e)}PointsIncentive(e){return new Cf.PointsIncentive({config:this._config,account:this._account},e)}SignerValidator(e,f){return new Af.SignerValidator({config:this._config,account:this._account},e,f)}ERC20VariableCriteriaIncentive(e,f){return new D({config:this._config,account:this._account},e,f)}ERC20VariableIncentive(e,f){return new k.ERC20VariableIncentive({config:this._config,account:this._account},e,f)}buildParameters(e,f){const[b,a]=this.validateDeploymentConfig(e,f);return{abi:o.b,bytecode:If,args:b,...this.optionallyAttachAccount(a.account)}}};M.addresses=T;let x=M;exports.BOOST_CORE_ADDRESS=Sf;exports.BOOST_CORE_ADDRESSES=T;exports.BOOST_CORE_CLAIM_FEE=Vf;exports.BoostCore=x;exports.ERC20VariableCriteriaIncentive=D;exports.prepareERC20VariableCriteriaIncentivePayload=ef;
3
+ //# sourceMappingURL=BoostCore-3-U1xTQN.cjs.map