@boostxyz/sdk 0.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +7 -0
  3. package/dist/Actions/Action.cjs +2 -0
  4. package/dist/Actions/Action.cjs.map +1 -0
  5. package/dist/Actions/Action.d.ts +31 -0
  6. package/dist/Actions/Action.d.ts.map +1 -0
  7. package/dist/Actions/Action.js +29 -0
  8. package/dist/Actions/Action.js.map +1 -0
  9. package/dist/Actions/ContractAction.d.ts +370 -0
  10. package/dist/Actions/ContractAction.d.ts.map +1 -0
  11. package/dist/Actions/ERC721MintAction.d.ts +513 -0
  12. package/dist/Actions/ERC721MintAction.d.ts.map +1 -0
  13. package/dist/Actions/EventAction.cjs +2 -0
  14. package/dist/Actions/EventAction.cjs.map +1 -0
  15. package/dist/Actions/EventAction.d.ts +694 -0
  16. package/dist/Actions/EventAction.d.ts.map +1 -0
  17. package/dist/Actions/EventAction.js +491 -0
  18. package/dist/Actions/EventAction.js.map +1 -0
  19. package/dist/AllowLists/AllowList.cjs +2 -0
  20. package/dist/AllowLists/AllowList.cjs.map +1 -0
  21. package/dist/AllowLists/AllowList.d.ts +32 -0
  22. package/dist/AllowLists/AllowList.d.ts.map +1 -0
  23. package/dist/AllowLists/AllowList.js +30 -0
  24. package/dist/AllowLists/AllowList.js.map +1 -0
  25. package/dist/AllowLists/SimpleAllowList.cjs +2 -0
  26. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -0
  27. package/dist/AllowLists/SimpleAllowList.d.ts +481 -0
  28. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -0
  29. package/dist/AllowLists/SimpleAllowList.js +154 -0
  30. package/dist/AllowLists/SimpleAllowList.js.map +1 -0
  31. package/dist/AllowLists/SimpleDenyList.cjs +2 -0
  32. package/dist/AllowLists/SimpleDenyList.cjs.map +1 -0
  33. package/dist/AllowLists/SimpleDenyList.d.ts +335 -0
  34. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -0
  35. package/dist/AllowLists/SimpleDenyList.js +115 -0
  36. package/dist/AllowLists/SimpleDenyList.js.map +1 -0
  37. package/dist/Auth/Auth.cjs +2 -0
  38. package/dist/Auth/Auth.cjs.map +1 -0
  39. package/dist/Auth/Auth.d.ts +10 -0
  40. package/dist/Auth/Auth.d.ts.map +1 -0
  41. package/dist/Auth/Auth.js +5 -0
  42. package/dist/Auth/Auth.js.map +1 -0
  43. package/dist/Auth/PassthroughAuth.cjs +2 -0
  44. package/dist/Auth/PassthroughAuth.cjs.map +1 -0
  45. package/dist/Auth/PassthroughAuth.d.ts +51 -0
  46. package/dist/Auth/PassthroughAuth.d.ts.map +1 -0
  47. package/dist/Auth/PassthroughAuth.js +39 -0
  48. package/dist/Auth/PassthroughAuth.js.map +1 -0
  49. package/dist/Boost.cjs +2 -0
  50. package/dist/Boost.cjs.map +1 -0
  51. package/dist/Boost.d.ts +234 -0
  52. package/dist/Boost.d.ts.map +1 -0
  53. package/dist/Boost.js +162 -0
  54. package/dist/Boost.js.map +1 -0
  55. package/dist/BoostCore.cjs +3 -0
  56. package/dist/BoostCore.cjs.map +1 -0
  57. package/dist/BoostCore.d.ts +498 -0
  58. package/dist/BoostCore.d.ts.map +1 -0
  59. package/dist/BoostCore.js +1153 -0
  60. package/dist/BoostCore.js.map +1 -0
  61. package/dist/BoostRegistry.cjs +2 -0
  62. package/dist/BoostRegistry.cjs.map +1 -0
  63. package/dist/BoostRegistry.d.ts +243 -0
  64. package/dist/BoostRegistry.d.ts.map +1 -0
  65. package/dist/BoostRegistry.js +262 -0
  66. package/dist/BoostRegistry.js.map +1 -0
  67. package/dist/Budgets/Budget.cjs +2 -0
  68. package/dist/Budgets/Budget.cjs.map +1 -0
  69. package/dist/Budgets/Budget.d.ts +31 -0
  70. package/dist/Budgets/Budget.d.ts.map +1 -0
  71. package/dist/Budgets/Budget.js +29 -0
  72. package/dist/Budgets/Budget.js.map +1 -0
  73. package/dist/Budgets/ManagedBudget.cjs +2 -0
  74. package/dist/Budgets/ManagedBudget.cjs.map +1 -0
  75. package/dist/Budgets/ManagedBudget.d.ts +1103 -0
  76. package/dist/Budgets/ManagedBudget.d.ts.map +1 -0
  77. package/dist/Budgets/ManagedBudget.js +516 -0
  78. package/dist/Budgets/ManagedBudget.js.map +1 -0
  79. package/dist/Budgets/SimpleBudget.d.ts +824 -0
  80. package/dist/Budgets/SimpleBudget.d.ts.map +1 -0
  81. package/dist/Budgets/VestingBudget.d.ts +778 -0
  82. package/dist/Budgets/VestingBudget.d.ts.map +1 -0
  83. package/dist/Deployable/Contract.cjs +2 -0
  84. package/dist/Deployable/Contract.cjs.map +1 -0
  85. package/dist/Deployable/Contract.d.ts +125 -0
  86. package/dist/Deployable/Contract.d.ts.map +1 -0
  87. package/dist/Deployable/Contract.js +150 -0
  88. package/dist/Deployable/Contract.js.map +1 -0
  89. package/dist/Deployable/Deployable.cjs +2 -0
  90. package/dist/Deployable/Deployable.cjs.map +1 -0
  91. package/dist/Deployable/Deployable.d.ts +161 -0
  92. package/dist/Deployable/Deployable.d.ts.map +1 -0
  93. package/dist/Deployable/Deployable.js +131 -0
  94. package/dist/Deployable/Deployable.js.map +1 -0
  95. package/dist/Deployable/DeployableTarget.cjs +2 -0
  96. package/dist/Deployable/DeployableTarget.cjs.map +1 -0
  97. package/dist/Deployable/DeployableTarget.d.ts +116 -0
  98. package/dist/Deployable/DeployableTarget.d.ts.map +1 -0
  99. package/dist/Deployable/DeployableTarget.js +132 -0
  100. package/dist/Deployable/DeployableTarget.js.map +1 -0
  101. package/dist/Incentives/AllowListIncentive.cjs +2 -0
  102. package/dist/Incentives/AllowListIncentive.cjs.map +1 -0
  103. package/dist/Incentives/AllowListIncentive.d.ts +513 -0
  104. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -0
  105. package/dist/Incentives/AllowListIncentive.js +201 -0
  106. package/dist/Incentives/AllowListIncentive.js.map +1 -0
  107. package/dist/Incentives/CGDAIncentive.cjs +2 -0
  108. package/dist/Incentives/CGDAIncentive.cjs.map +1 -0
  109. package/dist/Incentives/CGDAIncentive.d.ts +644 -0
  110. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -0
  111. package/dist/Incentives/CGDAIncentive.js +271 -0
  112. package/dist/Incentives/CGDAIncentive.js.map +1 -0
  113. package/dist/Incentives/ERC1155Incentive.d.ts +713 -0
  114. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -0
  115. package/dist/Incentives/ERC20Incentive.cjs +2 -0
  116. package/dist/Incentives/ERC20Incentive.cjs.map +1 -0
  117. package/dist/Incentives/ERC20Incentive.d.ts +666 -0
  118. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -0
  119. package/dist/Incentives/ERC20Incentive.js +312 -0
  120. package/dist/Incentives/ERC20Incentive.js.map +1 -0
  121. package/dist/Incentives/ERC20VariableIncentive.d.ts +582 -0
  122. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -0
  123. package/dist/Incentives/Incentive.cjs +2 -0
  124. package/dist/Incentives/Incentive.cjs.map +1 -0
  125. package/dist/Incentives/Incentive.d.ts +36 -0
  126. package/dist/Incentives/Incentive.d.ts.map +1 -0
  127. package/dist/Incentives/Incentive.js +299 -0
  128. package/dist/Incentives/Incentive.js.map +1 -0
  129. package/dist/Incentives/PointsIncentive.cjs +2 -0
  130. package/dist/Incentives/PointsIncentive.cjs.map +1 -0
  131. package/dist/Incentives/PointsIncentive.d.ts +659 -0
  132. package/dist/Incentives/PointsIncentive.d.ts.map +1 -0
  133. package/dist/Incentives/PointsIncentive.js +215 -0
  134. package/dist/Incentives/PointsIncentive.js.map +1 -0
  135. package/dist/Validators/SignerValidator.cjs +2 -0
  136. package/dist/Validators/SignerValidator.cjs.map +1 -0
  137. package/dist/Validators/SignerValidator.d.ts +745 -0
  138. package/dist/Validators/SignerValidator.d.ts.map +1 -0
  139. package/dist/Validators/SignerValidator.js +293 -0
  140. package/dist/Validators/SignerValidator.js.map +1 -0
  141. package/dist/Validators/Validator.cjs +2 -0
  142. package/dist/Validators/Validator.cjs.map +1 -0
  143. package/dist/Validators/Validator.d.ts +31 -0
  144. package/dist/Validators/Validator.d.ts.map +1 -0
  145. package/dist/Validators/Validator.js +27 -0
  146. package/dist/Validators/Validator.js.map +1 -0
  147. package/dist/claiming.cjs +2 -0
  148. package/dist/claiming.cjs.map +1 -0
  149. package/dist/claiming.d.ts +43 -0
  150. package/dist/claiming.d.ts.map +1 -0
  151. package/dist/claiming.js +17 -0
  152. package/dist/claiming.js.map +1 -0
  153. package/dist/componentInterfaces-CKCBwG16.cjs +2 -0
  154. package/dist/componentInterfaces-CKCBwG16.cjs.map +1 -0
  155. package/dist/componentInterfaces-DYkaxBda.js +13 -0
  156. package/dist/componentInterfaces-DYkaxBda.js.map +1 -0
  157. package/dist/errors.cjs +2 -0
  158. package/dist/errors.cjs.map +1 -0
  159. package/dist/errors.d.ts +441 -0
  160. package/dist/errors.d.ts.map +1 -0
  161. package/dist/errors.js +262 -0
  162. package/dist/errors.js.map +1 -0
  163. package/dist/generated-BDeDiaCK.js +4625 -0
  164. package/dist/generated-BDeDiaCK.js.map +1 -0
  165. package/dist/generated-wKBNvm48.cjs +3 -0
  166. package/dist/generated-wKBNvm48.cjs.map +1 -0
  167. package/dist/index.cjs +2 -0
  168. package/dist/index.cjs.map +1 -0
  169. package/dist/index.d.ts +25 -0
  170. package/dist/index.d.ts.map +1 -0
  171. package/dist/index.js +113 -0
  172. package/dist/index.js.map +1 -0
  173. package/dist/transfers.cjs +2 -0
  174. package/dist/transfers.cjs.map +1 -0
  175. package/dist/transfers.d.ts +198 -0
  176. package/dist/transfers.d.ts.map +1 -0
  177. package/dist/transfers.js +84 -0
  178. package/dist/transfers.js.map +1 -0
  179. package/dist/utils.cjs +2 -0
  180. package/dist/utils.cjs.map +1 -0
  181. package/dist/utils.d.ts +116 -0
  182. package/dist/utils.d.ts.map +1 -0
  183. package/dist/utils.js +30 -0
  184. package/dist/utils.js.map +1 -0
  185. package/package.json +211 -0
  186. package/src/Actions/Action.test.ts +75 -0
  187. package/src/Actions/Action.ts +61 -0
  188. package/src/Actions/ContractAction.test.ts +197 -0
  189. package/src/Actions/ContractAction.ts +301 -0
  190. package/src/Actions/ERC721MintAction.test.ts +112 -0
  191. package/src/Actions/ERC721MintAction.ts +292 -0
  192. package/src/Actions/EventAction.test.ts +205 -0
  193. package/src/Actions/EventAction.ts +811 -0
  194. package/src/AllowLists/AllowList.test.ts +64 -0
  195. package/src/AllowLists/AllowList.ts +60 -0
  196. package/src/AllowLists/SimpleAllowList.test.ts +52 -0
  197. package/src/AllowLists/SimpleAllowList.ts +284 -0
  198. package/src/AllowLists/SimpleDenyList.test.ts +52 -0
  199. package/src/AllowLists/SimpleDenyList.ts +227 -0
  200. package/src/Auth/Auth.ts +11 -0
  201. package/src/Auth/PassthroughAuth.test.ts +12 -0
  202. package/src/Auth/PassthroughAuth.ts +80 -0
  203. package/src/Boost.ts +290 -0
  204. package/src/BoostCore.test.ts +773 -0
  205. package/src/BoostCore.ts +1261 -0
  206. package/src/BoostRegistry.ts +467 -0
  207. package/src/Budgets/Budget.test.ts +27 -0
  208. package/src/Budgets/Budget.ts +61 -0
  209. package/src/Budgets/ManagedBudget.test.ts +154 -0
  210. package/src/Budgets/ManagedBudget.ts +796 -0
  211. package/src/Budgets/SimpleBudget.test.ts +152 -0
  212. package/src/Budgets/SimpleBudget.ts +564 -0
  213. package/src/Budgets/VestingBudget.test.ts +123 -0
  214. package/src/Budgets/VestingBudget.ts +602 -0
  215. package/src/Deployable/Contract.ts +229 -0
  216. package/src/Deployable/Deployable.ts +250 -0
  217. package/src/Deployable/DeployableTarget.ts +223 -0
  218. package/src/Incentives/AllowListIncentive.test.ts +143 -0
  219. package/src/Incentives/AllowListIncentive.ts +334 -0
  220. package/src/Incentives/CGDAIncentive.test.ts +132 -0
  221. package/src/Incentives/CGDAIncentive.ts +468 -0
  222. package/src/Incentives/ERC1155Incentive.test.ts +87 -0
  223. package/src/Incentives/ERC1155Incentive.ts +466 -0
  224. package/src/Incentives/ERC20Incentive.test.ts +130 -0
  225. package/src/Incentives/ERC20Incentive.ts +482 -0
  226. package/src/Incentives/ERC20VariableIncentive.test.ts +136 -0
  227. package/src/Incentives/ERC20VariableIncentive.ts +420 -0
  228. package/src/Incentives/Incentive.test.ts +92 -0
  229. package/src/Incentives/Incentive.ts +85 -0
  230. package/src/Incentives/PointsIncentive.test.ts +139 -0
  231. package/src/Incentives/PointsIncentive.ts +365 -0
  232. package/src/Validators/SignerValidator.test.ts +159 -0
  233. package/src/Validators/SignerValidator.ts +681 -0
  234. package/src/Validators/Validator.test.ts +21 -0
  235. package/src/Validators/Validator.ts +55 -0
  236. package/src/claiming.ts +56 -0
  237. package/src/errors.ts +542 -0
  238. package/src/index.test.ts +40 -0
  239. package/src/index.ts +53 -0
  240. package/src/transfers.ts +284 -0
  241. package/src/utils.test.ts +44 -0
  242. package/src/utils.ts +198 -0
@@ -0,0 +1,262 @@
1
+ import { h as n, I as o, N as l, d as h, g as t, i as y, m as i, e as u } from "./generated-BDeDiaCK.js";
2
+ import { isAddress as g } from "viem";
3
+ import { Deployable as A } from "./Deployable/Deployable.js";
4
+ const p = "0x6080604052348015600e575f80fd5b50611b4e8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610086575f3560e01c8063acc83fc811610059578063acc83fc81461014a578063d12dd4811461017a578063f166879214610196578063fd97064b146101c657610086565b806301ffc9a71461008a5780633aaf1626146100ba578063792aa01c146100ea57806383f388591461011a575b5f80fd5b6100a4600480360381019061009f9190610e0e565b6101f6565b6040516100b19190610e53565b60405180910390f35b6100d460048036038101906100cf9190610e9f565b61025f565b6040516100e191906110a7565b60405180910390f35b61010460048036038101906100ff91906110f1565b610471565b60405161011191906111d3565b60405180910390f35b610134600480360381019061012f9190610e9f565b610504565b6040516101419190611202565b60405180910390f35b610164600480360381019061015f919061129f565b6105ac565b6040516101719190611332565b60405180910390f35b610194600480360381019061018f919061134b565b6105ee565b005b6101b060048036038101906101ab91906113bc565b610818565b6040516101bd9190611332565b60405180910390f35b6101e060048036038101906101db919061146e565b610854565b6040516101ed9190611202565b60405180910390f35b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b610267610d4e565b60015f8381526020019081526020015f206040518060800160405290815f82015f9054906101000a900460ff1660048111156102a6576102a5610eca565b5b60048111156102b8576102b7610eca565b5b81526020015f820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820180546103769061153e565b80601f01602080910402602001604051908101604052809291908181526020018280546103a29061153e565b80156103ed5780601f106103c4576101008083540402835291602001916103ed565b820191905f5260205f20905b8154815290600101906020018083116103d057829003601f168201915b50505050508152505090505f73ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff160361046c57816040517f8cc00d160000000000000000000000000000000000000000000000000000000081526004016104639190611332565b60405180910390fd5b919050565b606060025f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208054806020026020016040519081016040528092919081815260200182805480156104f857602002820191905f5260205f20905b8154815260200190600101908083116104e4575b50505050509050919050565b5f805f8381526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036105a757816040517f8cc00d1600000000000000000000000000000000000000000000000000000000815260040161059e9190611332565b60405180910390fd5b919050565b5f6105e386868686866040516020016105c894939291906115ef565b60405160208183030381529060405280519060200120610c1c565b905095945050505050565b808073ffffffffffffffffffffffffffffffffffffffff166301ffc9a77f6ab67a0d000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b81526004016106489190611638565b602060405180830381865afa158015610663573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610687919061167b565b6106c857806040517f903b13fd0000000000000000000000000000000000000000000000000000000081526004016106bf91906116b5565b60405180910390fd5b5f6106d4868686610818565b90505f73ffffffffffffffffffffffffffffffffffffffff165f808381526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107775785816040517f96b5684c00000000000000000000000000000000000000000000000000000000815260040161076e9291906116dd565b60405180910390fd5b825f808381526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808660048111156107d9576107d8610eca565b5b7f660d31df25c96b8a337fcf12a56b7363e5a997639db853d5dbaec7c01f31bd808560405161080891906116b5565b60405180910390a3505050505050565b5f61084b848484604051602001610830929190611704565b60405160208183030381529060405280519060200120610c1c565b90509392505050565b5f3068929eee149b4bd2126854036108735763ab143c065f526004601cfd5b3068929eee149b4bd212685561091b878787873360405160200161089b959493929190611750565b6040516020818303038152906040528051906020012084848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f820116905080830192505050505050508873ffffffffffffffffffffffffffffffffffffffff16610c4e9092919063ffffffff16565b90505f61092b88883389896105ac565b90505f73ffffffffffffffffffffffffffffffffffffffff1660015f8381526020019081526020015f205f0160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109d25787816040517f96b5684c0000000000000000000000000000000000000000000000000000000081526004016109c99291906116dd565b60405180910390fd5b60025f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081908060018154018082558091505060019003905f5260205f20015f90919091909150556040518060800160405280896004811115610a5157610a50610eca565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505081525060015f8381526020019081526020015f205f820151815f015f6101000a81548160ff02191690836004811115610b0e57610b0d610eca565b5b02179055506020820151815f0160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506060820151816002019081610bb49190611965565b5090505080886004811115610bcc57610bcb610eca565b5b7f2348fcdb9847b17a183e53aa32c0c5c76afdef8fcb14bb51f216c6611701ab1a8985604051610bfd929190611a34565b60405180910390a3503868929eee149b4bd21268559695505050505050565b5f8282604051602001610c30929190611a7b565b60405160208183030381529060405280519060200120905092915050565b5f610c78838573ffffffffffffffffffffffffffffffffffffffff16610ce790919063ffffffff16565b90508073ffffffffffffffffffffffffffffffffffffffff1663439fab91836040518263ffffffff1660e01b8152600401610cb39190611af8565b5f604051808303815f87803b158015610cca575f80fd5b505af1158015610cdc573d5f803e3d5ffd5b505050509392505050565b5f610cf35f8484610cfb565b905092915050565b5f6c5af43d3d93803e602a57fd5bf36021528260145273602c3d8160093d39f33d3d3d3d363d3d37363d735f52816035600c86f5905080610d435763301164255f526004601cfd5b5f6021529392505050565b60405180608001604052805f6004811115610d6c57610d6b610eca565b5b81526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff168152602001606081525090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610ded81610db9565b8114610df7575f80fd5b50565b5f81359050610e0881610de4565b92915050565b5f60208284031215610e2357610e22610db1565b5b5f610e3084828501610dfa565b91505092915050565b5f8115159050919050565b610e4d81610e39565b82525050565b5f602082019050610e665f830184610e44565b92915050565b5f819050919050565b610e7e81610e6c565b8114610e88575f80fd5b50565b5f81359050610e9981610e75565b92915050565b5f60208284031215610eb457610eb3610db1565b5b5f610ec184828501610e8b565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60058110610f0857610f07610eca565b5b50565b5f819050610f1882610ef7565b919050565b5f610f2782610f0b565b9050919050565b610f3781610f1d565b82525050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f610f7f610f7a610f7584610f3d565b610f5c565b610f3d565b9050919050565b5f610f9082610f65565b9050919050565b5f610fa182610f86565b9050919050565b610fb181610f97565b82525050565b5f610fc182610f3d565b9050919050565b610fd181610fb7565b82525050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61101982610fd7565b6110238185610fe1565b9350611033818560208601610ff1565b61103c81610fff565b840191505092915050565b5f608083015f83015161105c5f860182610f2e565b50602083015161106f6020860182610fa8565b5060408301516110826040860182610fc8565b506060830151848203606086015261109a828261100f565b9150508091505092915050565b5f6020820190508181035f8301526110bf8184611047565b905092915050565b6110d081610fb7565b81146110da575f80fd5b50565b5f813590506110eb816110c7565b92915050565b5f6020828403121561110657611105610db1565b5b5f611113848285016110dd565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b61114e81610e6c565b82525050565b5f61115f8383611145565b60208301905092915050565b5f602082019050919050565b5f6111818261111c565b61118b8185611126565b935061119683611136565b805f5b838110156111c65781516111ad8882611154565b97506111b88361116b565b925050600181019050611199565b5085935050505092915050565b5f6020820190508181035f8301526111eb8184611177565b905092915050565b6111fc81610f97565b82525050565b5f6020820190506112155f8301846111f3565b92915050565b60058110611227575f80fd5b50565b5f813590506112388161121b565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261125f5761125e61123e565b5b8235905067ffffffffffffffff81111561127c5761127b611242565b5b60208301915083600182028301111561129857611297611246565b5b9250929050565b5f805f805f608086880312156112b8576112b7610db1565b5b5f6112c58882890161122a565b95505060206112d6888289016110dd565b94505060406112e7888289016110dd565b935050606086013567ffffffffffffffff81111561130857611307610db5565b5b6113148882890161124a565b92509250509295509295909350565b61132c81610e6c565b82525050565b5f6020820190506113455f830184611323565b92915050565b5f805f806060858703121561136357611362610db1565b5b5f6113708782880161122a565b945050602085013567ffffffffffffffff81111561139157611390610db5565b5b61139d8782880161124a565b935093505060406113b0878288016110dd565b91505092959194509250565b5f805f604084860312156113d3576113d2610db1565b5b5f6113e08682870161122a565b935050602084013567ffffffffffffffff81111561140157611400610db5565b5b61140d8682870161124a565b92509250509250925092565b5f8083601f84011261142e5761142d61123e565b5b8235905067ffffffffffffffff81111561144b5761144a611242565b5b60208301915083600182028301111561146757611466611246565b5b9250929050565b5f805f805f806080878903121561148857611487610db1565b5b5f61149589828a0161122a565b96505060206114a689828a016110dd565b955050604087013567ffffffffffffffff8111156114c7576114c6610db5565b5b6114d389828a0161124a565b9450945050606087013567ffffffffffffffff8111156114f6576114f5610db5565b5b61150289828a01611419565b92509250509295509295509295565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061155557607f821691505b60208210810361156857611567611511565b5b50919050565b5f8160601b9050919050565b5f6115848261156e565b9050919050565b5f6115958261157a565b9050919050565b6115ad6115a882610fb7565b61158b565b82525050565b5f81905092915050565b828183375f83830152505050565b5f6115d683856115b3565b93506115e38385846115bd565b82840190509392505050565b5f6115fa828761159c565b60148201915061160a828661159c565b60148201915061161b8284866115cb565b915081905095945050505050565b61163281610db9565b82525050565b5f60208201905061164b5f830184611629565b92915050565b61165a81610e39565b8114611664575f80fd5b50565b5f8151905061167581611651565b92915050565b5f602082840312156116905761168f610db1565b5b5f61169d84828501611667565b91505092915050565b6116af81610fb7565b82525050565b5f6020820190506116c85f8301846116a6565b92915050565b6116d781610f1d565b82525050565b5f6040820190506116f05f8301856116ce565b6116fd6020830184611323565b9392505050565b5f6117108284866115cb565b91508190509392505050565b5f8160f81b9050919050565b5f6117328261171c565b9050919050565b61174a61174582610f1d565b611728565b82525050565b5f61175b8288611739565b60018201915061176b828761159c565b60148201915061177c8285876115cb565b9150611788828461159c565b6014820191508190509695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026118247fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826117e9565b61182e86836117e9565b95508019841693508086168417925050509392505050565b5f819050919050565b5f61186961186461185f84611846565b610f5c565b611846565b9050919050565b5f819050919050565b6118828361184f565b61189661188e82611870565b8484546117f5565b825550505050565b5f90565b6118aa61189e565b6118b5818484611879565b505050565b5b818110156118d8576118cd5f826118a2565b6001810190506118bb565b5050565b601f82111561191d576118ee816117c8565b6118f7846117da565b81016020851015611906578190505b61191a611912856117da565b8301826118ba565b50505b505050565b5f82821c905092915050565b5f61193d5f1984600802611922565b1980831691505092915050565b5f611955838361192e565b9150826002028217905092915050565b61196e82610fd7565b67ffffffffffffffff8111156119875761198661179b565b5b611991825461153e565b61199c8282856118dc565b5f60209050601f8311600181146119cd575f84156119bb578287015190505b6119c5858261194a565b865550611a2c565b601f1984166119db866117c8565b5f5b82811015611a02578489015182556001820191506020850194506020810190506119dd565b86831015611a1f5784890151611a1b601f89168261192e565b8355505b6001600288020188555050505b505050505050565b5f604082019050611a475f8301856116a6565b611a5460208301846111f3565b9392505050565b5f819050919050565b611a75611a7082610e6c565b611a5b565b82525050565b5f611a868285611739565b600182019150611a968284611a64565b6020820191508190509392505050565b5f81519050919050565b5f82825260208201905092915050565b5f611aca82611aa6565b611ad48185611ab0565b9350611ae4818560208601610ff1565b611aed81610fff565b840191505092915050565b5f6020820190508181035f830152611b108184611ac0565b90509291505056fea264697066735822122031d8b5092c0648488ea4f8c739d0ff5d8c5debf32ebfcd2f52c823a98c8a410064736f6c634300081a0033", w = "0x6659255D4Aa39a975c7C841D5d898969fc3F75aa";
5
+ function _(d) {
6
+ return d.address && g(d.address);
7
+ }
8
+ function m(d) {
9
+ return d.address === null;
10
+ }
11
+ class V extends A {
12
+ /**
13
+ * Creates an instance of BoostRegistry.
14
+ *
15
+ * @see {@link BoostRegistryConfig}
16
+ * @constructor
17
+ * @param {BoostRegistryConfig} param0
18
+ * @param {Config} param0.config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)
19
+ * @param {?Account} [param0.account] - [Viem Local Account](https://viem.sh/docs/accounts/local)
20
+ * @param {({ address?: Address; } | {})} param0....options
21
+ */
22
+ constructor({ config: b, account: f, ...a }) {
23
+ _(a) && a.address ? super({ account: f, config: b }, a.address) : m(a) ? super({ account: f, config: b }, []) : super({ account: f, config: b }, w);
24
+ }
25
+ /**
26
+ * Register a new base implementation of a given type
27
+ *
28
+ * @public
29
+ * @async
30
+ * @param {RegistryType} registryType - The base type for the implementation
31
+ * @param {string} name - A name for the implementation (must be unique within the given type)
32
+ * @param {Address} implementation - The address of the implementation contract
33
+ * @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params] - Optional params to provide the underlying Viem contract call
34
+ * @returns {unknown}
35
+ * @example
36
+ * ```ts
37
+ * await registry.register(ContractAction.registryType, 'ContractAction', ContractAction.base)
38
+ * ```
39
+ */
40
+ async register(b, f, a, e) {
41
+ return await this.awaitResult(
42
+ this.registerRaw(b, f, a, e)
43
+ );
44
+ }
45
+ /**
46
+ * @see {@link register}
47
+ * @public
48
+ * @async
49
+ * @param {RegistryType} registryType
50
+ * @param {string} name
51
+ * @param {Address} implementation
52
+ * @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params]
53
+ * @returns {unknown}
54
+ */
55
+ async registerRaw(b, f, a, e) {
56
+ const { request: c, result: s } = await n(
57
+ this._config,
58
+ {
59
+ address: this.assertValidAddress(),
60
+ args: [b, f, a],
61
+ ...this.optionallyAttachAccount(),
62
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
63
+ ...e
64
+ }
65
+ );
66
+ return { hash: await o(this._config, c), result: s };
67
+ }
68
+ /**
69
+ * Initialize a new instance of a registered base implementation, returning the provided target with a new address set on it.
70
+ * This method is the same as `clone`, but serves to make its function more obvious as to why you'd need to use it.
71
+ *
72
+ * @public
73
+ * @async
74
+ * @template {DeployableTarget} Target
75
+ * @param {string} displayName - The display name for the clone
76
+ * @param {Target} target - An instance of a target contract to clone and initialize
77
+ * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
78
+ * @returns {Target} - The provided instance, but with a new address attached.
79
+ * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
80
+ */
81
+ initialize(b, f, a) {
82
+ return this.clone(b, f, a);
83
+ }
84
+ /**
85
+ * Deploy a new instance of a registered base implementation, returning the provided target with a new address set on it.
86
+ *
87
+ * @public
88
+ * @async
89
+ * @template {DeployableTarget} Target
90
+ * @param {string} displayName - The display name for the clone
91
+ * @param {Target} target - An instance of a target contract to clone and initialize
92
+ * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
93
+ * @returns {Target} - The provided instance, but with a new address attached.
94
+ * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
95
+ */
96
+ async clone(b, f, a) {
97
+ const e = await this.deployClone(b, f, a);
98
+ return f.at(e);
99
+ }
100
+ /**
101
+ *
102
+ * @see {@link clone}
103
+ * @public
104
+ * @async
105
+ * @template {DeployableTarget} Target
106
+ * @param {string} displayName
107
+ * @param {Target} target
108
+ * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
109
+ * @returns {Target}
110
+ * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
111
+ */
112
+ async deployClone(b, f, a) {
113
+ return await this.awaitResult(
114
+ this.deployCloneRaw(b, f, a)
115
+ );
116
+ }
117
+ /**
118
+ * @see {@link clone}
119
+ * @public
120
+ * @async
121
+ * @param {string} displayName
122
+ * @param {DeployableTarget} target
123
+ * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
124
+ * @returns {unknown} - The transaction hash
125
+ * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
126
+ */
127
+ async deployCloneRaw(b, f, a) {
128
+ const e = f.buildParameters(void 0, {
129
+ config: this._config,
130
+ account: this._account
131
+ }), { request: c, result: s } = await l(
132
+ this._config,
133
+ {
134
+ address: this.assertValidAddress(),
135
+ args: [f.registryType, f.base, b, e.args[0]],
136
+ ...this.optionallyAttachAccount(),
137
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
138
+ ...a
139
+ }
140
+ );
141
+ return { hash: await h(this._config, c), result: s };
142
+ }
143
+ /**
144
+ * Get the address of a registered base implementation.
145
+ * This function will revert if the implementation is not registered
146
+ *
147
+ * @public
148
+ * @async
149
+ * @param {Hex} identifier - The unique identifier for the implementation (see {getIdentifier})
150
+ * @param {?ReadParams<typeof boostRegistryAbi, 'getBaseImplementation'>} [params]
151
+ * @returns {unknown} - The address of the implementation
152
+ */
153
+ async getBaseImplementation(b, f) {
154
+ return await t(this._config, {
155
+ address: this.assertValidAddress(),
156
+ args: [b],
157
+ ...this.optionallyAttachAccount(),
158
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
159
+ ...f
160
+ });
161
+ }
162
+ /**
163
+ * Get the address of a deployed clone by its identifier
164
+ *
165
+ * @public
166
+ * @async
167
+ * @param {Hex} identifier - The unique identifier for the deployed clone (see {getCloneIdentifier})
168
+ * @param {?ReadParams<typeof boostRegistryAbi, 'getClone'>} [params]
169
+ * @returns {Promise<Address>} - The address of the deployed clone
170
+ */
171
+ async getClone(b, f) {
172
+ return await t(this._config, {
173
+ address: this.assertValidAddress(),
174
+ args: [b],
175
+ ...this.optionallyAttachAccount(),
176
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
177
+ ...f
178
+ });
179
+ }
180
+ /**
181
+ * Get the list of identifiers of deployed clones for a given deployer
182
+ *
183
+ * @public
184
+ * @async
185
+ * @param {Address} deployer - The address of the deployer
186
+ * @param {?ReadParams<typeof boostRegistryAbi, 'getClones'>} [params]
187
+ * @returns {Promise<Hex[]>} - The list of deployed clones for the given deployer
188
+ */
189
+ async getClones(b, f) {
190
+ return await y(this._config, {
191
+ address: this.assertValidAddress(),
192
+ args: [b],
193
+ ...this.optionallyAttachAccount(),
194
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
195
+ ...f
196
+ });
197
+ }
198
+ /**
199
+ * Build the identifier for a clone of a base implementation
200
+ *
201
+ * @public
202
+ * @async
203
+ * @param {RegistryType} registryType - The base type for the implementation
204
+ * @param {Address} base - The address of the base implementation
205
+ * @param {Address} deployer - The address of the deployer
206
+ * @param {string} displayName - The display name of the clone
207
+ * @param {?ReadParams<typeof boostRegistryAbi, 'getCloneIdentifier'>} [params]
208
+ * @returns {Promise<Hex>} - The unique identifier for the clone
209
+ */
210
+ async getCloneIdentifier(b, f, a, e, c) {
211
+ return await i(this._config, {
212
+ address: this.assertValidAddress(),
213
+ args: [b, f, a, e],
214
+ ...this.optionallyAttachAccount(),
215
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
216
+ ...c
217
+ });
218
+ }
219
+ /**
220
+ * Build the identifier for a base implementation
221
+ *
222
+ * @public
223
+ * @async
224
+ * @param {RegistryType} registryType - The base type for the implementation
225
+ * @param {string} displayName - The name of the implementation
226
+ * @param {?ReadParams<typeof boostRegistryAbi, 'getIdentifier'>} [params]
227
+ * @returns {Promise<Hex>} - The unique identifier for the implementation
228
+ */
229
+ async getIdentifier(b, f, a) {
230
+ return await i(this._config, {
231
+ address: this.assertValidAddress(),
232
+ args: [b, f],
233
+ ...this.optionallyAttachAccount(),
234
+ // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
235
+ ...a
236
+ });
237
+ }
238
+ /**
239
+ * @inheritdoc
240
+ *
241
+ * @public
242
+ * @param {?never[]} [_payload]
243
+ * @param {?DeployableOptions} [_options]
244
+ * @returns {GenericDeployableParams}
245
+ */
246
+ buildParameters(b, f) {
247
+ const [, a] = this.validateDeploymentConfig([], f);
248
+ return {
249
+ abi: u,
250
+ bytecode: p,
251
+ // biome-ignore lint/suspicious/noExplicitAny: Registry doesn't construct or initialize
252
+ args: [],
253
+ ...this.optionallyAttachAccount(a.account)
254
+ };
255
+ }
256
+ }
257
+ export {
258
+ w as BOOST_REGISTRY_ADDRESS,
259
+ V as BoostRegistry,
260
+ u as boostRegistryAbi
261
+ };
262
+ //# sourceMappingURL=BoostRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoostRegistry.js","sources":["../src/BoostRegistry.ts"],"sourcesContent":["import {\n boostRegistryAbi,\n readBoostRegistryGetBaseImplementation,\n readBoostRegistryGetCloneIdentifier,\n readBoostRegistryGetClones,\n simulateBoostRegistryDeployClone,\n simulateBoostRegistryRegister,\n writeBoostRegistryDeployClone,\n writeBoostRegistryRegister,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/BoostRegistry.sol/BoostRegistry.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n isAddress,\n} from 'viem';\nimport {\n Deployable,\n type DeployableOptions,\n type GenericDeployableParams,\n} from './Deployable/Deployable';\nimport type { DeployableTarget } from './Deployable/DeployableTarget';\nimport type {\n GenericLog,\n HashAndSimulatedResult,\n ReadParams,\n RegistryType,\n WriteParams,\n} from './utils';\n\nexport { boostRegistryAbi };\n\n/**\n * The fixed address for the Boost Registry.\n * By default, `new BoostRegistry` will use this address if not otherwise provided.\n *\n * @type {Address}\n */\nexport const BOOST_REGISTRY_ADDRESS: Address = import.meta.env\n .VITE_BOOST_REGISTRY_ADDRESS;\n\n/**\n * A record of `BoostRegistry` event names to `AbiEvent` objects for use with `getLogs`\n *\n * @export\n * @typedef {BoostRegistryLog}\n * @template {ContractEventName<typeof boostRegistryAbi>} [event=ContractEventName<\n * typeof boostRegistryAbi\n * >]\n */\nexport type BoostRegistryLog<\n event extends ContractEventName<typeof boostRegistryAbi> = ContractEventName<\n typeof boostRegistryAbi\n >,\n> = GenericLog<typeof boostRegistryAbi, event>;\n\n/**\n * Instantiation options for a previously deployed Boost Registry\n *\n * @export\n * @interface BoostRegistryDeployedOptions\n * @typedef {BoostRegistryDeployedOptions}\n * @extends {DeployableOptions}\n */\nexport interface BoostRegistryDeployedOptions extends DeployableOptions {\n /**\n * The address for a Boost Registry, if different than `BOOST_REGISTRY_ADDRESS`\n *\n * @type {?Address}\n */\n address?: Address;\n}\n\n/**\n * A typeguard to determine if instantiation is using a custom address.\n *\n * @param {*} opts\n * @returns {opts is BoostRegistryDeployedOptions}\n */\nfunction isBoostRegistryDeployed(\n // biome-ignore lint/suspicious/noExplicitAny: type guard\n opts: any,\n): opts is BoostRegistryDeployedOptions {\n return opts.address && isAddress(opts.address);\n}\n\n/**\n * The Boost Registry does not take any construction arguments, so if you'd like to deploy a new Boost Registry, pass an explicit null to the `address` field.\n *\n * @export\n * @interface BoostRegistryOptionsWithPayload\n * @typedef {BoostRegistryOptionsWithPayload}\n * @extends {DeployableOptions}\n */\nexport interface BoostRegistryOptionsWithPayload extends DeployableOptions {\n /**\n *\n * @type {null}\n */\n address: null;\n}\n\n/**\n * A typeguard to determine if the user is intending to deploy a new Boost Registry before usage\n *\n * @param {*} opts\n * @returns {opts is BoostRegistryOptionsWithPayload}\n */\nfunction isBoostRegistryDeployable(\n // biome-ignore lint/suspicious/noExplicitAny: type guard\n opts: any,\n): opts is BoostRegistryOptionsWithPayload {\n return opts.address === null;\n}\n\n/**\n * Instantiation options for a Boost Registry.\n *\n * @example\n * To target Boost's Registry, omit the address field.\n * Otherwise, supply a custom address to a previously deployed custom Boost Registry.\n * You can also pass `{ address: null }` if you are intending to deploy a new Boost Registry.\n * ```ts\n * let registry = new BoostRegistry({ config, account })\n * // or\n * registry = new BoostRegistry({ config, account, address: CUSTOM_ADDRESS })\n * // or\n * registry = new BoostRegistry({ config, account, address: null })\n * await registry.deploy()\n * ```\n *\n * @export\n * @typedef {BoostRegistryConfig}\n */\nexport type BoostRegistryConfig =\n | BoostRegistryDeployedOptions\n | BoostRegistryOptionsWithPayload;\n\n/**\n * Constructs a new Boost Registry. A registry for base implementations and cloned instances.\n * This contract is used to register base implementations and deploy new instances of those implementations for use within the Boost protocol.\n *\n * @see {@link BoostRegistryConfig}\n * @export\n * @class BoostRegistry\n * @typedef {BoostRegistry}\n * @extends {Deployable<never[]>}\n */\nexport class BoostRegistry extends Deployable<\n never[],\n typeof boostRegistryAbi\n> {\n /**\n * Creates an instance of BoostRegistry.\n *\n * @see {@link BoostRegistryConfig}\n * @constructor\n * @param {BoostRegistryConfig} param0\n * @param {Config} param0.config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @param {?Account} [param0.account] - [Viem Local Account](https://viem.sh/docs/accounts/local)\n * @param {({ address?: Address; } | {})} param0....options\n */\n constructor({ config, account, ...options }: BoostRegistryConfig) {\n if (isBoostRegistryDeployed(options) && options.address) {\n super({ account, config }, options.address);\n } else if (isBoostRegistryDeployable(options)) {\n super({ account, config }, []);\n } else {\n super({ account, config }, BOOST_REGISTRY_ADDRESS);\n }\n }\n\n /**\n * Register a new base implementation of a given type\n *\n * @public\n * @async\n * @param {RegistryType} registryType - The base type for the implementation\n * @param {string} name - A name for the implementation (must be unique within the given type)\n * @param {Address} implementation - The address of the implementation contract\n * @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params] - Optional params to provide the underlying Viem contract call\n * @returns {unknown}\n * @example\n * ```ts\n * await registry.register(ContractAction.registryType, 'ContractAction', ContractAction.base)\n * ```\n */\n public async register(\n registryType: RegistryType,\n name: string,\n implementation: Address,\n params?: WriteParams<typeof boostRegistryAbi, 'register'>,\n ) {\n return await this.awaitResult(\n this.registerRaw(registryType, name, implementation, params),\n );\n }\n\n /**\n * @see {@link register}\n * @public\n * @async\n * @param {RegistryType} registryType\n * @param {string} name\n * @param {Address} implementation\n * @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params]\n * @returns {unknown}\n */\n public async registerRaw(\n registryType: RegistryType,\n name: string,\n implementation: Address,\n params?: WriteParams<typeof boostRegistryAbi, 'register'>,\n ) {\n const { request, result } = await simulateBoostRegistryRegister(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [registryType, name, implementation],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeBoostRegistryRegister(this._config, request);\n return { hash, result };\n }\n\n /**\n * Initialize a new instance of a registered base implementation, returning the provided target with a new address set on it.\n * This method is the same as `clone`, but serves to make its function more obvious as to why you'd need to use it.\n *\n * @public\n * @async\n * @template {DeployableTarget} Target\n * @param {string} displayName - The display name for the clone\n * @param {Target} target - An instance of a target contract to clone and initialize\n * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]\n * @returns {Target} - The provided instance, but with a new address attached.\n * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice\n */\n public initialize<Target extends DeployableTarget<any, any>>(\n displayName: string,\n target: Target,\n params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>,\n ): Promise<Target> {\n return this.clone(displayName, target, params);\n }\n\n /**\n * Deploy a new instance of a registered base implementation, returning the provided target with a new address set on it.\n *\n * @public\n * @async\n * @template {DeployableTarget} Target\n * @param {string} displayName - The display name for the clone\n * @param {Target} target - An instance of a target contract to clone and initialize\n * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]\n * @returns {Target} - The provided instance, but with a new address attached.\n * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice\n */\n public async clone<Target extends DeployableTarget<any, any>>(\n displayName: string,\n target: Target,\n params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>,\n ): Promise<Target> {\n const instance = await this.deployClone(displayName, target, params);\n return target.at(instance);\n }\n\n /**\n *\n * @see {@link clone}\n * @public\n * @async\n * @template {DeployableTarget} Target\n * @param {string} displayName\n * @param {Target} target\n * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]\n * @returns {Target}\n * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice\n */\n public async deployClone<Target extends DeployableTarget<any, any>>(\n displayName: string,\n target: Target,\n params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>,\n ): Promise<Address> {\n return await this.awaitResult(\n this.deployCloneRaw(displayName, target, params),\n );\n }\n\n /**\n * @see {@link clone}\n * @public\n * @async\n * @param {string} displayName\n * @param {DeployableTarget} target\n * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]\n * @returns {unknown} - The transaction hash\n * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice\n */\n public async deployCloneRaw<Target extends DeployableTarget<any, any>>(\n displayName: string,\n target: Target,\n params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>,\n ): Promise<HashAndSimulatedResult<Address>> {\n const payload = target.buildParameters(undefined, {\n config: this._config,\n account: this._account,\n });\n const { request, result } = await simulateBoostRegistryDeployClone(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [target.registryType, target.base, displayName, payload.args[0]],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeBoostRegistryDeployClone(this._config, request);\n return { hash, result };\n }\n\n /**\n * Get the address of a registered base implementation.\n * This function will revert if the implementation is not registered\n *\n * @public\n * @async\n * @param {Hex} identifier - The unique identifier for the implementation (see {getIdentifier})\n * @param {?ReadParams<typeof boostRegistryAbi, 'getBaseImplementation'>} [params]\n * @returns {unknown} - The address of the implementation\n */\n public async getBaseImplementation(\n identifier: Hex,\n params?: ReadParams<typeof boostRegistryAbi, 'getBaseImplementation'>,\n ) {\n return await readBoostRegistryGetBaseImplementation(this._config, {\n address: this.assertValidAddress(),\n args: [identifier],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the address of a deployed clone by its identifier\n *\n * @public\n * @async\n * @param {Hex} identifier - The unique identifier for the deployed clone (see {getCloneIdentifier})\n * @param {?ReadParams<typeof boostRegistryAbi, 'getClone'>} [params]\n * @returns {Promise<Address>} - The address of the deployed clone\n */\n public async getClone(\n identifier: Hex,\n params?: ReadParams<typeof boostRegistryAbi, 'getClone'>,\n ) {\n return await readBoostRegistryGetBaseImplementation(this._config, {\n address: this.assertValidAddress(),\n args: [identifier],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the list of identifiers of deployed clones for a given deployer\n *\n * @public\n * @async\n * @param {Address} deployer - The address of the deployer\n * @param {?ReadParams<typeof boostRegistryAbi, 'getClones'>} [params]\n * @returns {Promise<Hex[]>} - The list of deployed clones for the given deployer\n */\n public async getClones(\n deployer: Address,\n params?: ReadParams<typeof boostRegistryAbi, 'getClones'>,\n ) {\n return await readBoostRegistryGetClones(this._config, {\n address: this.assertValidAddress(),\n args: [deployer],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Build the identifier for a clone of a base implementation\n *\n * @public\n * @async\n * @param {RegistryType} registryType - The base type for the implementation\n * @param {Address} base - The address of the base implementation\n * @param {Address} deployer - The address of the deployer\n * @param {string} displayName - The display name of the clone\n * @param {?ReadParams<typeof boostRegistryAbi, 'getCloneIdentifier'>} [params]\n * @returns {Promise<Hex>} - The unique identifier for the clone\n */\n public async getCloneIdentifier(\n registryType: RegistryType,\n base: Address,\n deployer: Address,\n displayName: string,\n params?: ReadParams<typeof boostRegistryAbi, 'getCloneIdentifier'>,\n ) {\n return await readBoostRegistryGetCloneIdentifier(this._config, {\n address: this.assertValidAddress(),\n args: [registryType, base, deployer, displayName],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Build the identifier for a base implementation\n *\n * @public\n * @async\n * @param {RegistryType} registryType - The base type for the implementation\n * @param {string} displayName - The name of the implementation\n * @param {?ReadParams<typeof boostRegistryAbi, 'getIdentifier'>} [params]\n * @returns {Promise<Hex>} - The unique identifier for the implementation\n */\n public async getIdentifier(\n registryType: RegistryType,\n displayName: string,\n params?: ReadParams<typeof boostRegistryAbi, 'getIdentifier'>,\n ) {\n return await readBoostRegistryGetCloneIdentifier(this._config, {\n address: this.assertValidAddress(),\n args: [registryType, displayName],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?never[]} [_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: boostRegistryAbi,\n bytecode: bytecode as Hex,\n // biome-ignore lint/suspicious/noExplicitAny: Registry doesn't construct or initialize\n args: [] as any,\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["BOOST_REGISTRY_ADDRESS","isBoostRegistryDeployed","opts","isAddress","isBoostRegistryDeployable","BoostRegistry","Deployable","config","account","options","registryType","name","implementation","params","request","result","simulateBoostRegistryRegister","writeBoostRegistryRegister","displayName","target","instance","payload","simulateBoostRegistryDeployClone","writeBoostRegistryDeployClone","identifier","readBoostRegistryGetBaseImplementation","deployer","readBoostRegistryGetClones","base","readBoostRegistryGetCloneIdentifier","_payload","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cACXH,GACAQ,GACAL,GACA;AACO,WAAA,MAAMgB,EAAoC,KAAK,SAAS;AAAA,MAC7D,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACnB,GAAcQ,CAAW;AAAA,MAChC,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAIL;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUgB,gBACdiB,GACAC,GACyB;AACnB,UAAA,CAAA,EAAGtB,CAAO,IAAI,KAAK,yBAAyB,CAAA,GAAIsB,CAAQ;AACvD,WAAA;AAAA,MACL,KAAKC;AAAAA,MACL,UAAAC;AAAA;AAAA,MAEA,MAAM,CAAC;AAAA,MACP,GAAG,KAAK,wBAAwBxB,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../generated-wKBNvm48.cjs"),d=require("../componentInterfaces-CKCBwG16.cjs"),u=require("@wagmi/core"),g=require("../errors.cjs"),a=require("./ManagedBudget.cjs"),e={[d.AManagedBudget]:a.ManagedBudget};async function i(t,n){const r=await u.readContract(t.config,{abi:c.z,functionName:"getComponentInterface",address:n}),o=e[r];if(!o)throw new g.InvalidComponentInterfaceError(Object.keys(e),r);return new o(t,n)}exports.ManagedBudget=a.ManagedBudget;exports.BudgetByComponentInterface=e;exports.budgetFromAddress=i;
2
+ //# sourceMappingURL=Budget.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Budget.cjs","sources":["../../src/Budgets/Budget.ts"],"sourcesContent":["import { aBudgetAbi } from '@boostxyz/evm';\nimport { AManagedBudget } from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport type { Address, Hex } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport { ManagedBudget } from './ManagedBudget';\n\nexport {\n // SimpleBudget,\n // VestingBudget,\n ManagedBudget,\n};\n\n/**\n * A union type representing all valid protocol Budget implementations\n *\n * @export\n * @typedef {Budget}\n */\nexport type Budget = ManagedBudget; // | SimpleBudget | VestingBudget\n\n/**\n * A map of Budget component interfaces to their constructors.\n *\n * @type {{ \"0xa0109882\": typeof ManagedBudget; }}\n */\nexport const BudgetByComponentInterface = {\n // ['0x64683da1']: VestingBudget,\n // ['0x2929d19c']: SimpleBudget,\n [AManagedBudget as Hex]: ManagedBudget,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Promise<ManagedBudget>}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function budgetFromAddress(\n options: DeployableOptions,\n address: Address,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aBudgetAbi,\n functionName: 'getComponentInterface',\n address,\n })) as keyof typeof BudgetByComponentInterface;\n const Ctor = BudgetByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(BudgetByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n"],"names":["BudgetByComponentInterface","AManagedBudget","ManagedBudget","budgetFromAddress","options","address","interfaceId","readContract","aBudgetAbi","Ctor","InvalidComponentInterfaceError"],"mappings":"mQA2BaA,EAA6B,CAGxC,CAACC,EAAqB,cAAA,EAAGC,EAAA,aAC3B,EAYsB,eAAAC,EACpBC,EACAC,EACA,CACA,MAAMC,EAAe,MAAMC,eAAaH,EAAQ,OAAQ,CACtD,IAAKI,EAAA,EACL,aAAc,wBACd,QAAAH,CAAA,CACD,EACKI,EAAOT,EAA2BM,CAAW,EACnD,GAAI,CAACG,EACH,MAAM,IAAIC,EAAA,+BACR,OAAO,KAAKV,CAA0B,EACtCM,CAAA,EAGG,OAAA,IAAIG,EAAKL,EAASC,CAAO,CAClC"}
@@ -0,0 +1,31 @@
1
+ import type { Address } from 'viem';
2
+ import type { DeployableOptions } from '../Deployable/Deployable';
3
+ import { ManagedBudget } from './ManagedBudget';
4
+ export { ManagedBudget, };
5
+ /**
6
+ * A union type representing all valid protocol Budget implementations
7
+ *
8
+ * @export
9
+ * @typedef {Budget}
10
+ */
11
+ export type Budget = ManagedBudget;
12
+ /**
13
+ * A map of Budget component interfaces to their constructors.
14
+ *
15
+ * @type {{ "0xa0109882": typeof ManagedBudget; }}
16
+ */
17
+ export declare const BudgetByComponentInterface: {
18
+ [x: string]: typeof ManagedBudget;
19
+ };
20
+ /**
21
+ * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.
22
+ *
23
+ * @export
24
+ * @async
25
+ * @param {DeployableOptions} options
26
+ * @param {Address} address
27
+ * @returns {Promise<ManagedBudget>}
28
+ * @throws {@link InvalidComponentInterfaceError}
29
+ */
30
+ export declare function budgetFromAddress(options: DeployableOptions, address: Address): Promise<ManagedBudget>;
31
+ //# sourceMappingURL=Budget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Budget.d.ts","sourceRoot":"","sources":["../../src/Budgets/Budget.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAGL,aAAa,GACd,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,aAAa,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,0BAA0B;;CAItC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,OAAO,0BAejB"}
@@ -0,0 +1,29 @@
1
+ import { a } from "../generated-BDeDiaCK.js";
2
+ import { c as m } from "../componentInterfaces-DYkaxBda.js";
3
+ import { readContract as c } from "@wagmi/core";
4
+ import { InvalidComponentInterfaceError as f } from "../errors.js";
5
+ import { ManagedBudget as i } from "./ManagedBudget.js";
6
+ const r = {
7
+ // ['0x64683da1']: VestingBudget,
8
+ // ['0x2929d19c']: SimpleBudget,
9
+ [m]: i
10
+ };
11
+ async function C(t, e) {
12
+ const o = await c(t.config, {
13
+ abi: a,
14
+ functionName: "getComponentInterface",
15
+ address: e
16
+ }), n = r[o];
17
+ if (!n)
18
+ throw new f(
19
+ Object.keys(r),
20
+ o
21
+ );
22
+ return new n(t, e);
23
+ }
24
+ export {
25
+ r as BudgetByComponentInterface,
26
+ i as ManagedBudget,
27
+ C as budgetFromAddress
28
+ };
29
+ //# sourceMappingURL=Budget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Budget.js","sources":["../../src/Budgets/Budget.ts"],"sourcesContent":["import { aBudgetAbi } from '@boostxyz/evm';\nimport { AManagedBudget } from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport type { Address, Hex } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport { ManagedBudget } from './ManagedBudget';\n\nexport {\n // SimpleBudget,\n // VestingBudget,\n ManagedBudget,\n};\n\n/**\n * A union type representing all valid protocol Budget implementations\n *\n * @export\n * @typedef {Budget}\n */\nexport type Budget = ManagedBudget; // | SimpleBudget | VestingBudget\n\n/**\n * A map of Budget component interfaces to their constructors.\n *\n * @type {{ \"0xa0109882\": typeof ManagedBudget; }}\n */\nexport const BudgetByComponentInterface = {\n // ['0x64683da1']: VestingBudget,\n // ['0x2929d19c']: SimpleBudget,\n [AManagedBudget as Hex]: ManagedBudget,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Promise<ManagedBudget>}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function budgetFromAddress(\n options: DeployableOptions,\n address: Address,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aBudgetAbi,\n functionName: 'getComponentInterface',\n address,\n })) as keyof typeof BudgetByComponentInterface;\n const Ctor = BudgetByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(BudgetByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n"],"names":["BudgetByComponentInterface","AManagedBudget","ManagedBudget","budgetFromAddress","options","address","interfaceId","readContract","aBudgetAbi","Ctor","InvalidComponentInterfaceError"],"mappings":";;;;;AA2BO,MAAMA,IAA6B;AAAA;AAAA;AAAA,EAGxC,CAACC,CAAqB,GAAGC;AAC3B;AAYsB,eAAAC,EACpBC,GACAC,GACA;AACA,QAAMC,IAAe,MAAMC,EAAaH,EAAQ,QAAQ;AAAA,IACtD,KAAKI;AAAAA,IACL,cAAc;AAAA,IACd,SAAAH;AAAA,EAAA,CACD,GACKI,IAAOT,EAA2BM,CAAW;AACnD,MAAI,CAACG;AACH,UAAM,IAAIC;AAAA,MACR,OAAO,KAAKV,CAA0B;AAAA,MACtCM;AAAA,IAAA;AAGG,SAAA,IAAIG,EAAKL,GAASC,CAAO;AAClC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../generated-wKBNvm48.cjs"),y=require("@wagmi/core"),n=require("viem"),p=require("../Deployable/DeployableTarget.cjs"),u=require("../errors.cjs"),l=require("../transfers.cjs"),R=require("../utils.cjs"),_="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6134c9806100bd5f395ff3fe608060405260043610610207575f3560e01c806361400c9911610117578063ec87621c1161009f578063f8724aba1161006e578063f8724aba1461076e578063f9a802c3146107aa578063fa4ca9b1146107e6578063fe9fbb8014610822578063fee81cf41461085e5761020e565b8063ec87621c146106d0578063f04e283e146106fa578063f23a6e6114610716578063f2fde38b146107525761020e565b806380fd6005116100e657806380fd6005146105de5780638da5cb5b14610606578063bc197c8114610630578063d2514e841461066c578063e6670829146106a85761020e565b806361400c9914610532578063715018a61461056e57806375b238fc14610578578063774c33ab146105a25761020e565b80634359d28a1161019a5780634a4ee7b1116101695780634a4ee7b114610464578063514e62fc1461048057806354d1f13d146104bc578063578bcf35146104c65780635aef467a146105025761020e565b80634359d28a1461039c578063439fab91146103c4578063451cc191146103ec578063474f5a44146104285761020e565b80631cd64df4116101d65780631cd64df4146102f0578063256929621461032c57806328d6183b146103365780632de94807146103605761020e565b806301ffc9a71461024057806310098ad51461027c578063183a4f6e146102b85780631c10893f146102d45761020e565b3661020e57005b6040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b34801561024b575f80fd5b50610266600480360381019061026191906124b2565b61089a565b60405161027391906124f7565b60405180910390f35b348015610287575f80fd5b506102a2600480360381019061029d919061256a565b6109e3565b6040516102af91906125ad565b60405180910390f35b6102d260048036038101906102cd91906125f0565b610a4e565b005b6102ee60048036038101906102e9919061261b565b610a5b565b005b3480156102fb575f80fd5b506103166004803603810190610311919061261b565b610a71565b60405161032391906124f7565b60405180910390f35b610334610a87565b005b348015610341575f80fd5b5061034a610ad8565b6040516103579190612668565b60405180910390f35b34801561036b575f80fd5b506103866004803603810190610381919061256a565b610aff565b60405161039391906125ad565b60405180910390f35b3480156103a7575f80fd5b506103c260048036038101906103bd9190612737565b610b18565b005b3480156103cf575f80fd5b506103ea60048036038101906103e5919061280a565b610c26565b005b3480156103f7575f80fd5b50610412600480360381019061040d919061280a565b610d1e565b60405161041f91906125ad565b60405180910390f35b348015610433575f80fd5b5061044e6004803603810190610449919061280a565b610d25565b60405161045b91906124f7565b60405180910390f35b61047e6004803603810190610479919061261b565b610f0f565b005b34801561048b575f80fd5b506104a660048036038101906104a1919061261b565b610f25565b6040516104b391906124f7565b60405180910390f35b6104c4610f3c565b005b3480156104d1575f80fd5b506104ec60048036038101906104e7919061256a565b610f75565b6040516104f991906125ad565b60405180910390f35b61051c6004803603810190610517919061280a565b610fba565b60405161052991906124f7565b60405180910390f35b34801561053d575f80fd5b50610558600480360381019061055391906128aa565b61132a565b60405161056591906124f7565b60405180910390f35b61057661138e565b005b348015610583575f80fd5b5061058c6113a1565b60405161059991906125ad565b60405180910390f35b3480156105ad575f80fd5b506105c860048036038101906105c3919061261b565b6113a6565b6040516105d591906125ad565b60405180910390f35b3480156105e9575f80fd5b5061060460048036038101906105ff919061294a565b6113fc565b005b348015610611575f80fd5b5061061a6114b2565b60405161062791906129d7565b60405180910390f35b34801561063b575f80fd5b50610656600480360381019061065191906129f0565b6114da565b6040516106639190612668565b60405180910390f35b348015610677575f80fd5b50610692600480360381019061068d919061256a565b6114f1565b60405161069f91906125ad565b60405180910390f35b3480156106b3575f80fd5b506106ce60048036038101906106c9919061294a565b611549565b005b3480156106db575f80fd5b506106e46115ff565b6040516106f191906125ad565b60405180910390f35b610714600480360381019061070f919061256a565b611604565b005b348015610721575f80fd5b5061073c60048036038101906107379190612ac7565b611642565b6040516107499190612668565b60405180910390f35b61076c6004803603810190610767919061256a565b611657565b005b348015610779575f80fd5b50610794600480360381019061078f919061261b565b611680565b6040516107a191906125ad565b60405180910390f35b3480156107b5575f80fd5b506107d060048036038101906107cb919061261b565b611702565b6040516107dd91906125ad565b60405180910390f35b3480156107f1575f80fd5b5061080c6004803603810190610807919061280a565b6117db565b60405161081991906124f7565b60405180910390f35b34801561082d575f80fd5b506108486004803603810190610843919061256a565b611a57565b60405161085591906124f7565b60405180910390f35b348015610869575f80fd5b50610884600480360381019061087f919061256a565b611aaa565b60405161089191906125ad565b60405180910390f35b5f7fa0109882000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061096457507f4e2312e0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806109cc57507f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806109dc57506109db82611ac3565b5b9050919050565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610a4557610a40308373ffffffffffffffffffffffffffffffffffffffff16611b3c90919063ffffffff16565b610a47565b475b9050919050565b610a583382611b6f565b50565b610a63611b7e565b610a6d8282611bb5565b5050565b5f8182610a7d85610aff565b1614905092915050565b5f610a90611bc5565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7fa010988200000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b6002610b2381611bcf565b828290508585905014610b62576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b85859050811015610c1e575f848483818110610b8357610b82612b5d565b5b9050602002016020810190610b989190612bb4565b90506001151581151503610bdd57610bd8878784818110610bbc57610bbb612b5d565b5b9050602002016020810190610bd1919061256a565b6001611bb5565b610c10565b610c0f878784818110610bf357610bf2612b5d565b5b9050602002016020810190610c08919061256a565b6001611b6f565b5b508080600101915050610b64565b505050505050565b5f610c2f611c04565b90508054600382558015610c615760018160011c14303b10610c585763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f8383810190610c729190612e88565b9050610c80815f0151611c2d565b5f5b816020015151811015610ce257610cd582602001518281518110610ca957610ca8612b5d565b5b602002602001015183604001518381518110610cc857610cc7612b5d565b5b6020026020010151611d03565b8080600101915050610c82565b50508015610d19576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f92915050565b5f6002610d3181611bcf565b5f8484810190610d419190613033565b90505f6002811115610d5657610d5561307a565b5b815f01516002811115610d6c57610d6b61307a565b5b1480610d9f575060016002811115610d8757610d8661307a565b5b815f01516002811115610d9d57610d9c61307a565b5b145b15610df8575f8160600151806020019051810190610dbd91906130f4565b9050610df2826020015183604001515f845f015114610ddf57835f0151610ded565b610dec85602001516109e3565b5b611d44565b50610f02565b600280811115610e0b57610e0a61307a565b5b815f01516002811115610e2157610e2061307a565b5b03610ef8575f8160600151806020019051810190610e3f9190613218565b9050610ef282602001518360400151835f01515f856020015114610e67578460200151610ee8565b856020015173ffffffffffffffffffffffffffffffffffffffff1662fdd58e30875f01516040518363ffffffff1660e01b8152600401610ea892919061325f565b602060405180830381865afa158015610ec3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ee79190613286565b5b8560400151611f5c565b50610f01565b5f925050610f08565b5b60019250505b5092915050565b610f17611b7e565b610f218282611b6f565b5050565b5f8082610f3185610aff565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b5f808383810190610fcb9190613033565b90505f6002811115610fe057610fdf61307a565b5b815f01516002811115610ff657610ff561307a565b5b0361106c575f816060015180602001905181019061101491906130f4565b9050805f01513414611066578160200151815f01516040517fcece04c500000000000000000000000000000000000000000000000000000000815260040161105d92919061325f565b60405180910390fd5b5061131e565b600160028111156110805761107f61307a565b5b815f015160028111156110965761109561307a565b5b03611171575f81606001518060200190518101906110b491906130f4565b90506110ee826040015130835f0151856020015173ffffffffffffffffffffffffffffffffffffffff16612188909392919063ffffffff16565b805f015161111f30846020015173ffffffffffffffffffffffffffffffffffffffff16611b3c90919063ffffffff16565b101561116b578160200151815f01516040517fcece04c500000000000000000000000000000000000000000000000000000000815260040161116292919061325f565b60405180910390fd5b5061131d565b6002808111156111845761118361307a565b5b815f0151600281111561119a5761119961307a565b5b03611313575f81606001518060200190518101906111b89190613218565b9050816020015173ffffffffffffffffffffffffffffffffffffffff1663f242432a836040015130845f0151856020015186604001516040518663ffffffff1660e01b815260040161120e959493929190613303565b5f604051808303815f87803b158015611225575f80fd5b505af1158015611237573d5f803e3d5ffd5b505050508060200151826020015173ffffffffffffffffffffffffffffffffffffffff1662fdd58e30845f01516040518363ffffffff1660e01b815260040161128192919061325f565b602060405180830381865afa15801561129c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112c09190613286565b101561130d57816020015181602001516040517fcece04c500000000000000000000000000000000000000000000000000000000815260040161130492919061325f565b60405180910390fd5b5061131c565b5f915050611324565b5b5b60019150505b92915050565b5f805f90505b838390508110156113825761136884848381811061135157611350612b5d565b5b90506020028101906113639190613367565b6117db565b611375575f915050611388565b8080600101915050611330565b50600190505b92915050565b611396611b7e565b61139f5f6121e2565b565b600281565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8381526020019081526020015f2054905092915050565b600261140781611bcf565b828290508585905014611446576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156114aa5761149d86868381811061146957611468612b5d565b5b905060200201602081019061147e919061256a565b85858481811061149157611490612b5d565b5b90506020020135611b6f565b8080600101915050611448565b505050505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b5f63bc197c8160e01b905098975050505050505050565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054611538836109e3565b61154291906133f6565b9050919050565b600261155481611bcf565b828290508585905014611593576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858590508110156115f7576115ea8686838181106115b6576115b5612b5d565b5b90506020020160208101906115cb919061256a565b8585848181106115de576115dd612b5d565b5b90506020020135611bb5565b8080600101915050611595565b505050505050565b600181565b61160c611b7e565b63389a75e1600c52805f526020600c20805442111561163257636f5e88185f526004601cfd5b5f81555061163f816121e2565b50565b5f63f23a6e6160e01b90509695505050505050565b61165f611b7e565b8060601b61167457637448fbae5f526004601cfd5b61167d816121e2565b50565b5f8273ffffffffffffffffffffffffffffffffffffffff1662fdd58e30846040518363ffffffff1660e01b81526004016116bb92919061325f565b602060405180830381865afa1580156116d6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116fa9190613286565b905092915050565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8381526020019081526020015f20548373ffffffffffffffffffffffffffffffffffffffff1662fdd58e30856040518363ffffffff1660e01b815260040161178a92919061325f565b602060405180830381865afa1580156117a5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117c99190613286565b6117d391906133f6565b905092915050565b5f60016002176117ea81611bcf565b5f84848101906117fa9190613033565b9050600160028111156118105761180f61307a565b5b815f015160028111156118265761182561307a565b5b148061185857505f60028111156118405761183f61307a565b5b815f015160028111156118565761185561307a565b5b145b156118f8575f816060015180602001905181019061187691906130f4565b90505f61188683602001516109e3565b905080825f015111156118db57826020015181835f01516040517f5c54305e0000000000000000000000000000000000000000000000000000000081526004016118d293929190613429565b60405180910390fd5b6118f183602001518460400151845f0151611d44565b5050611a4a565b60028081111561190b5761190a61307a565b5b815f015160028111156119215761192061307a565b5b03611a40575f816060015180602001905181019061193f9190613218565b90505f826020015173ffffffffffffffffffffffffffffffffffffffff1662fdd58e30845f01516040518363ffffffff1660e01b815260040161198392919061325f565b602060405180830381865afa15801561199e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119c29190613286565b90508082602001511115611a195782602001518183602001516040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401611a1093929190613429565b60405180910390fd5b611a3983602001518460400151845f015185602001518660400151611f5c565b5050611a49565b5f925050611a50565b5b60019250505b5092915050565b5f8173ffffffffffffffffffffffffffffffffffffffff16611a776114b2565b73ffffffffffffffffffffffffffffffffffffffff161480611aa35750611aa2826002600117610f25565b5b9050919050565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fea5ad34e000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611b355750611b34826122a8565b5b9050919050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b611b7a82825f612321565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314611bb3576382b429005f526004601cfd5b565b611bc182826001612321565b5050565b5f6202a300905090565b638b78c6d819543314611c0157638b78c6d8600c52335f52806020600c205416611c00576382b429005f526004601cfd5b5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b611c35612379565b15611cad577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415611c6f57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350611d00565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b3068929eee149b4bd212685403611d625763ab143c065f526004601cfd5b3068929eee149b4bd21268555f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611de2578282826040517fbf182be8000000000000000000000000000000000000000000000000000000008152600401611dd99392919061345e565b60405180910390fd5b611deb836109e3565b811115611e3b5782611dfc846109e3565b826040517f5c54305e000000000000000000000000000000000000000000000000000000008152600401611e3293929190613429565b60405180910390fd5b805f808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f828254611e8691906133f6565b925050819055505f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611ecf57611eca828261237d565b611efb565b611efa82828573ffffffffffffffffffffffffffffffffffffffff1661239a9092919063ffffffff16565b5b8273ffffffffffffffffffffffffffffffffffffffff167fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd435428383604051611f4392919061325f565b60405180910390a23868929eee149b4bd2126855505050565b3068929eee149b4bd212685403611f7a5763ab143c065f526004601cfd5b3068929eee149b4bd21268555f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611ffa578484836040517fbf182be8000000000000000000000000000000000000000000000000000000008152600401611ff19392919061345e565b60405180910390fd5b6120048584611680565b82111561205557846120168685611680565b836040517f5c54305e00000000000000000000000000000000000000000000000000000000815260040161204c93929190613429565b60405180910390fd5b8160015f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8581526020019081526020015f205f8282546120b091906133f6565b925050819055508473ffffffffffffffffffffffffffffffffffffffff1663f242432a30868686866040518663ffffffff1660e01b81526004016120f8959493929190613303565b5f604051808303815f87803b15801561210f575f80fd5b505af1158015612121573d5f803e3d5ffd5b505050508473ffffffffffffffffffffffffffffffffffffffff167fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd43542858460405161216d92919061325f565b60405180910390a23868929eee149b4bd21268555050505050565b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f511417166121d357637939f4245f526004601cfd5b5f606052806040525050505050565b6121ea612379565b1561224f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b82178155506122a5565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061231a5750612319826123e3565b5b9050919050565b638b78c6d8600c52825f526020600c2080548381178361234357848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f385f3884865af16123965763b12d13eb5f526004601cfd5b5050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166123da576390b8ec185f526004601cfd5b5f603452505050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6124918161245d565b811461249b575f80fd5b50565b5f813590506124ac81612488565b92915050565b5f602082840312156124c7576124c6612455565b5b5f6124d48482850161249e565b91505092915050565b5f8115159050919050565b6124f1816124dd565b82525050565b5f60208201905061250a5f8301846124e8565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61253982612510565b9050919050565b6125498161252f565b8114612553575f80fd5b50565b5f8135905061256481612540565b92915050565b5f6020828403121561257f5761257e612455565b5b5f61258c84828501612556565b91505092915050565b5f819050919050565b6125a781612595565b82525050565b5f6020820190506125c05f83018461259e565b92915050565b6125cf81612595565b81146125d9575f80fd5b50565b5f813590506125ea816125c6565b92915050565b5f6020828403121561260557612604612455565b5b5f612612848285016125dc565b91505092915050565b5f806040838503121561263157612630612455565b5b5f61263e85828601612556565b925050602061264f858286016125dc565b9150509250929050565b6126628161245d565b82525050565b5f60208201905061267b5f830184612659565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126126a2576126a1612681565b5b8235905067ffffffffffffffff8111156126bf576126be612685565b5b6020830191508360208202830111156126db576126da612689565b5b9250929050565b5f8083601f8401126126f7576126f6612681565b5b8235905067ffffffffffffffff81111561271457612713612685565b5b6020830191508360208202830111156127305761272f612689565b5b9250929050565b5f805f806040858703121561274f5761274e612455565b5b5f85013567ffffffffffffffff81111561276c5761276b612459565b5b6127788782880161268d565b9450945050602085013567ffffffffffffffff81111561279b5761279a612459565b5b6127a7878288016126e2565b925092505092959194509250565b5f8083601f8401126127ca576127c9612681565b5b8235905067ffffffffffffffff8111156127e7576127e6612685565b5b60208301915083600182028301111561280357612802612689565b5b9250929050565b5f80602083850312156128205761281f612455565b5b5f83013567ffffffffffffffff81111561283d5761283c612459565b5b612849858286016127b5565b92509250509250929050565b5f8083601f84011261286a57612869612681565b5b8235905067ffffffffffffffff81111561288757612886612685565b5b6020830191508360208202830111156128a3576128a2612689565b5b9250929050565b5f80602083850312156128c0576128bf612455565b5b5f83013567ffffffffffffffff8111156128dd576128dc612459565b5b6128e985828601612855565b92509250509250929050565b5f8083601f84011261290a57612909612681565b5b8235905067ffffffffffffffff81111561292757612926612685565b5b60208301915083602082028301111561294357612942612689565b5b9250929050565b5f805f806040858703121561296257612961612455565b5b5f85013567ffffffffffffffff81111561297f5761297e612459565b5b61298b8782880161268d565b9450945050602085013567ffffffffffffffff8111156129ae576129ad612459565b5b6129ba878288016128f5565b925092505092959194509250565b6129d18161252f565b82525050565b5f6020820190506129ea5f8301846129c8565b92915050565b5f805f805f805f8060a0898b031215612a0c57612a0b612455565b5b5f612a198b828c01612556565b9850506020612a2a8b828c01612556565b975050604089013567ffffffffffffffff811115612a4b57612a4a612459565b5b612a578b828c016128f5565b9650965050606089013567ffffffffffffffff811115612a7a57612a79612459565b5b612a868b828c016128f5565b9450945050608089013567ffffffffffffffff811115612aa957612aa8612459565b5b612ab58b828c016127b5565b92509250509295985092959890939650565b5f805f805f8060a08789031215612ae157612ae0612455565b5b5f612aee89828a01612556565b9650506020612aff89828a01612556565b9550506040612b1089828a016125dc565b9450506060612b2189828a016125dc565b935050608087013567ffffffffffffffff811115612b4257612b41612459565b5b612b4e89828a016127b5565b92509250509295509295509295565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b612b93816124dd565b8114612b9d575f80fd5b50565b5f81359050612bae81612b8a565b92915050565b5f60208284031215612bc957612bc8612455565b5b5f612bd684828501612ba0565b91505092915050565b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b612c2982612be3565b810181811067ffffffffffffffff82111715612c4857612c47612bf3565b5b80604052505050565b5f612c5a61244c565b9050612c668282612c20565b919050565b5f80fd5b5f67ffffffffffffffff821115612c8957612c88612bf3565b5b602082029050602081019050919050565b5f612cac612ca784612c6f565b612c51565b90508083825260208201905060208402830185811115612ccf57612cce612689565b5b835b81811015612cf85780612ce48882612556565b845260208401935050602081019050612cd1565b5050509392505050565b5f82601f830112612d1657612d15612681565b5b8135612d26848260208601612c9a565b91505092915050565b5f67ffffffffffffffff821115612d4957612d48612bf3565b5b602082029050602081019050919050565b5f612d6c612d6784612d2f565b612c51565b90508083825260208201905060208402830185811115612d8f57612d8e612689565b5b835b81811015612db85780612da488826125dc565b845260208401935050602081019050612d91565b5050509392505050565b5f82601f830112612dd657612dd5612681565b5b8135612de6848260208601612d5a565b91505092915050565b5f60608284031215612e0457612e03612bdf565b5b612e0e6060612c51565b90505f612e1d84828501612556565b5f83015250602082013567ffffffffffffffff811115612e4057612e3f612c6b565b5b612e4c84828501612d02565b602083015250604082013567ffffffffffffffff811115612e7057612e6f612c6b565b5b612e7c84828501612dc2565b60408301525092915050565b5f60208284031215612e9d57612e9c612455565b5b5f82013567ffffffffffffffff811115612eba57612eb9612459565b5b612ec684828501612def565b91505092915050565b60038110612edb575f80fd5b50565b5f81359050612eec81612ecf565b92915050565b5f80fd5b5f67ffffffffffffffff821115612f1057612f0f612bf3565b5b612f1982612be3565b9050602081019050919050565b828183375f83830152505050565b5f612f46612f4184612ef6565b612c51565b905082815260208101848484011115612f6257612f61612ef2565b5b612f6d848285612f26565b509392505050565b5f82601f830112612f8957612f88612681565b5b8135612f99848260208601612f34565b91505092915050565b5f60808284031215612fb757612fb6612bdf565b5b612fc16080612c51565b90505f612fd084828501612ede565b5f830152506020612fe384828501612556565b6020830152506040612ff784828501612556565b604083015250606082013567ffffffffffffffff81111561301b5761301a612c6b565b5b61302784828501612f75565b60608301525092915050565b5f6020828403121561304857613047612455565b5b5f82013567ffffffffffffffff81111561306557613064612459565b5b61307184828501612fa2565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f815190506130b5816125c6565b92915050565b5f602082840312156130d0576130cf612bdf565b5b6130da6020612c51565b90505f6130e9848285016130a7565b5f8301525092915050565b5f6020828403121561310957613108612455565b5b5f613116848285016130bb565b91505092915050565b8281835e5f83830152505050565b5f61313f61313a84612ef6565b612c51565b90508281526020810184848401111561315b5761315a612ef2565b5b61316684828561311f565b509392505050565b5f82601f83011261318257613181612681565b5b815161319284826020860161312d565b91505092915050565b5f606082840312156131b0576131af612bdf565b5b6131ba6060612c51565b90505f6131c9848285016130a7565b5f8301525060206131dc848285016130a7565b602083015250604082015167ffffffffffffffff811115613200576131ff612c6b565b5b61320c8482850161316e565b60408301525092915050565b5f6020828403121561322d5761322c612455565b5b5f82015167ffffffffffffffff81111561324a57613249612459565b5b6132568482850161319b565b91505092915050565b5f6040820190506132725f8301856129c8565b61327f602083018461259e565b9392505050565b5f6020828403121561329b5761329a612455565b5b5f6132a8848285016130a7565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f6132d5826132b1565b6132df81856132bb565b93506132ef81856020860161311f565b6132f881612be3565b840191505092915050565b5f60a0820190506133165f8301886129c8565b61332360208301876129c8565b613330604083018661259e565b61333d606083018561259e565b818103608083015261334f81846132cb565b90509695505050505050565b5f80fd5b5f80fd5b5f80fd5b5f80833560016020038436030381126133835761338261335b565b5b80840192508235915067ffffffffffffffff8211156133a5576133a461335f565b5b6020830192506001820236038313156133c1576133c0613363565b5b509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61340082612595565b915061340b83612595565b9250828201905080821115613423576134226133c9565b5b92915050565b5f60608201905061343c5f8301866129c8565b613449602083018561259e565b613456604083018461259e565b949350505050565b5f6060820190506134715f8301866129c8565b61347e60208301856129c8565b61348b604083018461259e565b94935050505056fea2646970667358221220c1bfb1478642fd79fec67a73804426335fe572337323b77d0ae5af9397dc0e4c64736f6c634300081a0033",o={MANAGER:1n,ADMIN:2n};function w(s){return s.tokenId===void 0}function g(s){return s.tokenId!==void 0}function r(s){if(w(s))return l.prepareFungibleTransfer(s);if(g(s))return l.prepareERC1155Transfer(s);throw new u.UnknownTransferPayloadSupplied(s)}const i=class i extends p.DeployableTarget{constructor(){super(...arguments),this.abi=e.p}async allocate(f,b){return await this.awaitResult(this.allocateRaw(f,b))}async allocateRaw(f,b){const{request:a,result:d}=await e.Xw(this._config,{address:this.assertValidAddress(),args:[r(f)],...this.optionallyAttachAccount(),...b});return{hash:await e._w(this._config,a),result:d}}async clawback(f,b){return await this.awaitResult(this.clawbackRaw(f,b))}async clawbackRaw(f,b){const{request:a,result:d}=await e.eT(this._config,{address:this.assertValidAddress(),args:[r(f)],...this.optionallyAttachAccount(),...b});return{hash:await e.Lw(this._config,a),result:d}}async disburse(f,b){return await this.awaitResult(this.disburseRaw(f,b))}async disburseRaw(f,b){const{request:a,result:d}=await e.nT(this._config,{address:this.assertValidAddress(),args:[r(f)],...this.optionallyAttachAccount(),...b});return{hash:await e.Dw(this._config,a),result:d}}async disburseBatch(f,b){return await this.awaitResult(this.disburseBatchRaw(f,b))}async disburseBatchRaw(f,b){const{request:a,result:d}=await e.aT(this._config,{address:this.assertValidAddress(),args:[f.map(r)],...this.optionallyAttachAccount(),...b});return{hash:await e.Pw(this._config,a),result:d}}async setAuthorized(f,b,a){return await this.awaitResult(this.setAuthorizedRaw(f,b,a))}async setAuthorizedRaw(f,b,a){const{request:d,result:c}=await e.yT(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a});return{hash:await e.Qw(this._config,d),result:c}}async grantRoles(f,b,a){return await this.awaitResult(this.grantRolesRaw(f,b,a))}async grantRolesRaw(f,b,a){const{request:d,result:c}=await e.iT(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a});return{hash:await e.qw(this._config,d),result:c}}async revokeRoles(f,b,a){return await this.awaitResult(this.revokeRolesRaw(f,b,a))}async revokeRolesRaw(f,b,a){const{request:d,result:c}=await e.lT(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a});return{hash:await e.Ww(this._config,d),result:c}}async rolesOf(f,b){const a=await e.xw(this._config,{address:this.assertValidAddress(),args:[f],...this.optionallyAttachAccount(),...b});return[o.MANAGER,o.ADMIN].filter(d=>(a&d)===d)}hasAnyRole(f,b,a){return e.Ow(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a})}hasAllRoles(f,b,a){return e.Mw(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...a})}isAuthorized(f,b){return e.Cw(this._config,{address:this.assertValidAddress(),args:[f],...this.optionallyAttachAccount(),...b})}owner(f){return e.zw(this._config,{address:this.assertValidAddress(),args:[],...f})}total(f,b,a){return e.Hw(this._config,{address:this.assertValidAddress(),args:b?[f,b]:[f],...a})}available(f,b,a){return e.Nw(this._config,{address:this.assertValidAddress(),args:b?[f,b]:[f],...a})}distributed(f,b,a){return e.hw(this._config,{address:this.assertValidAddress(),args:b?[f,b]:[f],...a})}buildParameters(f,b){var c;const[a,d]=this.validateDeploymentConfig(f,b);if(!a.owner||a.owner===n.zeroAddress){const t=d.account?d.account.address:d.config?y.getAccount(d.config).address:(c=this._account)==null?void 0:c.address;if(t)a.owner=t;else throw new u.DeployableUnknownOwnerProvidedError}return{abi:e.p,bytecode:_,args:[A(a)],...this.optionallyAttachAccount(d.account)}}};i.base="0xC7091Ca16F98C661F3B64b4fA0D85ffFFE93f5BD",i.registryType=R.RegistryType.BUDGET;let h=i;const A=({owner:s,authorized:f,roles:b})=>n.encodeAbiParameters(n.parseAbiParameters(["ManagedBudgetPayload payload","struct ManagedBudgetPayload { address owner; address[] authorized; uint256[] roles; }"]),[{owner:s,authorized:f,roles:b}]);exports.managedBudgetAbi=e.p;exports.ManagedBudget=h;exports.ManagedBudgetRoles=o;exports.isERC1155TransferPayload=g;exports.isFungibleTransfer=w;exports.prepareManagedBudgetPayload=A;exports.prepareTransfer=r;
2
+ //# sourceMappingURL=ManagedBudget.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManagedBudget.cjs","sources":["../../src/Budgets/ManagedBudget.ts"],"sourcesContent":["import {\n managedBudgetAbi,\n readManagedBudgetAvailable,\n readManagedBudgetDistributed,\n readManagedBudgetHasAllRoles,\n readManagedBudgetHasAnyRole,\n readManagedBudgetIsAuthorized,\n readManagedBudgetOwner,\n readManagedBudgetRolesOf,\n readManagedBudgetTotal,\n simulateManagedBudgetAllocate,\n simulateManagedBudgetClawback,\n simulateManagedBudgetDisburse,\n simulateManagedBudgetDisburseBatch,\n simulateManagedBudgetGrantRoles,\n simulateManagedBudgetRevokeRoles,\n simulateManagedBudgetSetAuthorized,\n writeManagedBudgetAllocate,\n writeManagedBudgetClawback,\n writeManagedBudgetDisburse,\n writeManagedBudgetDisburseBatch,\n writeManagedBudgetGrantRoles,\n writeManagedBudgetRevokeRoles,\n writeManagedBudgetSetAuthorized,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/budgets/ManagedBudget.sol/ManagedBudget.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n parseAbiParameters,\n zeroAddress,\n} from 'viem';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n DeployableUnknownOwnerProvidedError,\n UnknownTransferPayloadSupplied,\n} from '../errors';\nimport {\n type ERC1155TransferPayload,\n type FungibleTransferPayload,\n prepareERC1155Transfer,\n prepareFungibleTransfer,\n} from '../transfers';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { managedBudgetAbi };\nexport type { ERC1155TransferPayload, FungibleTransferPayload };\n\n/**\n * The object representation of a `ManagedBudgetPayload.InitPayload`\n *\n * @export\n * @interface ManagedBudgetPayload\n * @typedef {ManagedBudgetPayload}\n */\nexport interface ManagedBudgetPayload {\n /**\n * The budget's owner\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n *\n * @type {Address[]}\n */\n authorized: Address[];\n /**\n * List of roles to assign to the corresponding account by index.\n *\n * @type {bigint[]}\n */\n roles: bigint[];\n}\n\n/**\n * Enum representing available roles for use in the `ManagedBudget`.\n * `MANAGER` can disburse funds.\n * `ADMIN` can additionally manage authorized users on the budget.\n *\n * @type {{ readonly MANAGER: 1n; readonly ADMIN_ROLE: 2n; }}\n */\nexport const ManagedBudgetRoles = {\n MANAGER: 1n,\n ADMIN: 2n,\n} as const;\n\n/**\n * A generic `viem.Log` event with support for `ManagedBudget` event types.\n *\n * @export\n * @typedef {ManagedBudgetLog}\n * @template {ContractEventName<typeof managedBudgetAbi>} [event=ContractEventName<\n * typeof managedBudgetAbi\n * >]\n */\nexport type ManagedBudgetLog<\n event extends ContractEventName<typeof managedBudgetAbi> = ContractEventName<\n typeof managedBudgetAbi\n >,\n> = GenericLog<typeof managedBudgetAbi, event>;\n\n/**\n * Typeguard to determine if a transfer payload is a Fungible Transfer\n *\n * @export\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @returns {transfer is FungibleTransferPayload}\n */\nexport function isFungibleTransfer(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n): transfer is FungibleTransferPayload {\n return (transfer as ERC1155TransferPayload).tokenId === undefined;\n}\n\n/**\n * Typeguard to determine if a transfer payload is an ERC1155 Transfer\n *\n * @export\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @returns {transfer is ERC1155TransferPayload}\n */\nexport function isERC1155TransferPayload(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n): transfer is ERC1155TransferPayload {\n return (transfer as ERC1155TransferPayload).tokenId !== undefined;\n}\n\n/**\n * Given either a Fungible transfer, or ERC1155 transfer, will properly encode parameters for transfers, claims, disbursements, allocations, etc.\n *\n * @export\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @returns {*}\n * @throws {@link UnknownTransferPayloadSupplied}\n */\nexport function prepareTransfer(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n) {\n if (isFungibleTransfer(transfer)) {\n return prepareFungibleTransfer(transfer);\n } else if (isERC1155TransferPayload(transfer)) {\n return prepareERC1155Transfer(transfer);\n } else throw new UnknownTransferPayloadSupplied(transfer);\n}\n\n/**\n * A minimal budget implementation that simply holds and distributes tokens (ERC20-like and native)\n * This type of budget supports ETH, ERC20, and ERC1155 assets only\n *\n * @export\n * @class ManagedBudget\n * @typedef {ManagedBudget}\n * @extends {DeployableTarget<ManagedBudgetPayload>}\n */\nexport class ManagedBudget extends DeployableTarget<\n ManagedBudgetPayload,\n typeof managedBudgetAbi\n> {\n /**\n * @inheritdoc\n *\n * @public\n * @readonly\n * @type {*}\n */\n public override readonly abi = managedBudgetAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env\n .VITE_MANAGED_BUDGET_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.BUDGET;\n\n /**\n * Allocates assets to the budget.\n * The caller must have already approved the contract to transfer the asset\n * If the asset transfer fails, the allocation will revert\n *\n * @public\n * @async\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @param {?WriteParams<typeof managedBudgetAbi, 'allocate'>} [params]\n * @returns {Promise<boolean>} - True if the allocation was successful\n */\n public async allocate(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n params?: WriteParams<typeof managedBudgetAbi, 'allocate'>,\n ) {\n return await this.awaitResult(this.allocateRaw(transfer, params));\n }\n\n /**\n * Allocates assets to the budget.\n * The caller must have already approved the contract to transfer the asset\n * If the asset transfer fails, the allocation will revert\n *\n * @public\n * @async\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @param {?WriteParams<typeof managedBudgetAbi, 'allocate'>} [params]\n * @returns {Promise<boolean>} - True if the allocation was successful\n */\n public async allocateRaw(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n params?: WriteParams<typeof managedBudgetAbi, 'allocate'>,\n ) {\n const { request, result } = await simulateManagedBudgetAllocate(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareTransfer(transfer)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeManagedBudgetAllocate(this._config, request);\n return { hash, result };\n }\n\n /**\n * Clawbacks assets from the budget.\n * Only the owner can directly clawback assets from the budget\n * If the amount is zero, the entire balance of the asset will be transferred to the receiver\n * If the asset transfer fails, the reclamation will revert\n *\n * @public\n * @async\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @param {?WriteParams<typeof managedBudgetAbi, 'clawback'>} [params]\n * @returns {Promise<boolean>} - True if the request was successful\n */\n public async clawback(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n params?: WriteParams<typeof managedBudgetAbi, 'clawback'>,\n ) {\n return await this.awaitResult(this.clawbackRaw(transfer, params));\n }\n\n /**\n * Clawbacks assets from the budget.\n * Only the owner can directly clawback assets from the budget\n * If the amount is zero, the entire balance of the asset will be transferred to the receiver\n * If the asset transfer fails, the reclamation will revert\n *\n * @public\n * @async\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @param {?WriteParams<typeof managedBudgetAbi, 'clawback'>} [params]\n * @returns {Promise<boolean>} - True if the request was successful\n */\n public async clawbackRaw(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n params?: WriteParams<typeof managedBudgetAbi, 'clawback'>,\n ) {\n const { request, result } = await simulateManagedBudgetClawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareTransfer(transfer)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeManagedBudgetClawback(this._config, request);\n return { hash, result };\n }\n\n /**\n * Disburses assets from the budget to a single recipient\n * If the asset transfer fails, the disbursement will revert\n *\n * @public\n * @async\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @param {?WriteParams<typeof managedBudgetAbi, 'disburse'>} [params]\n * @returns {Promise<boolean>} - True if the disbursement was successful\n */\n public async disburse(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n params?: WriteParams<typeof managedBudgetAbi, 'disburse'>,\n ) {\n return await this.awaitResult(this.disburseRaw(transfer, params));\n }\n\n /**\n * Disburses assets from the budget to a single recipient\n * If the asset transfer fails, the disbursement will revert\n *\n * @public\n * @async\n * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer\n * @param {?WriteParams<typeof managedBudgetAbi, 'disburse'>} [params]\n * @returns {Promise<boolean>} - True if the disbursement was successful\n */\n public async disburseRaw(\n transfer: FungibleTransferPayload | ERC1155TransferPayload,\n params?: WriteParams<typeof managedBudgetAbi, 'disburse'>,\n ) {\n const { request, result } = await simulateManagedBudgetDisburse(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareTransfer(transfer)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeManagedBudgetDisburse(this._config, request);\n return { hash, result };\n }\n\n /**\n * Disburses assets from the budget to multiple recipients\n *\n * @public\n * @async\n * @param {Array<FungibleTransferPayload | ERC1155TransferPayload>} transfers\n * @param {?WriteParams<typeof managedBudgetAbi, 'disburseBatch'>} [params]\n * @returns {Promise<boolean>} - True if all disbursements were successful\n */\n public async disburseBatch(\n transfers: Array<FungibleTransferPayload | ERC1155TransferPayload>,\n params?: WriteParams<typeof managedBudgetAbi, 'disburseBatch'>,\n ) {\n return await this.awaitResult(this.disburseBatchRaw(transfers, params));\n }\n\n /**\n * Disburses assets from the budget to multiple recipients\n *\n * @public\n * @async\n * @param {Array<FungibleTransferPayload | ERC1155TransferPayload>} transfers\n * @param {?WriteParams<typeof managedBudgetAbi, 'disburseBatch'>} [params]\n * @returns {Promise<boolean>} - True if all disbursements were successful\n */\n public async disburseBatchRaw(\n transfers: Array<FungibleTransferPayload | ERC1155TransferPayload>,\n params?: WriteParams<typeof managedBudgetAbi, 'disburseBatch'>,\n ) {\n const { request, result } = await simulateManagedBudgetDisburseBatch(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [transfers.map(prepareTransfer)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeManagedBudgetDisburseBatch(this._config, request);\n return { hash, result };\n }\n\n /**\n * Set the authorized status of the given accounts\n * The mechanism for managing authorization is left to the implementing contract\n *\n * @public\n * @async\n * @param {Address[]} addresses - The accounts to authorize or deauthorize\n * @param {boolean[]} allowed - The authorization status for the given accounts\n * @param {?WriteParams<typeof managedBudgetAbi, 'setAuthorized'>} [params]\n * @returns {Promise<void>}\n */\n public async setAuthorized(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof managedBudgetAbi, 'setAuthorized'>,\n ) {\n return await this.awaitResult(\n this.setAuthorizedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the authorized status of the given accounts\n * The mechanism for managing authorization is left to the implementing contract\n *\n * @public\n * @async\n * @param {Address[]} addresses - The accounts to authorize or deauthorize\n * @param {boolean[]} allowed - The authorization status for the given accounts\n * @param {?WriteParams<typeof managedBudgetAbi, 'setAuthorized'>} [params]\n * @returns {Promise<void>}\n */\n public async setAuthorizedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof managedBudgetAbi, 'setAuthorized'>,\n ) {\n const { request, result } = await simulateManagedBudgetSetAuthorized(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeManagedBudgetSetAuthorized(this._config, request);\n return { hash, result };\n }\n\n /**\n * Grant many accounts permissions on the budget.\n *\n * @example\n * ```ts\n * await budget.grantRoles(['0xfoo', '0xbar], [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN])\n * ```\n * @public\n * @async\n * @param {Address[]} addresses\n * @param {bigint[]} roles\n * @param {?WriteParams<typeof managedBudgetAbi, 'grantRoles'>} [params]\n * @returns {unknown}\n */\n public async grantRoles(\n addresses: Address[],\n roles: bigint[],\n params?: WriteParams<typeof managedBudgetAbi, 'grantRoles'>,\n ) {\n return await this.awaitResult(this.grantRolesRaw(addresses, roles, params));\n }\n\n /**\n * Grant many accounts permissions on the budget.\n *\n * @example\n * ```ts\n * await budget.grantRoles(['0xfoo', '0xbar], [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN])\n *\n * @public\n * @async\n * @param {Address[]} addresses\n * @param {bigint[]} roles\n * @param {?WriteParams<typeof managedBudgetAbi, 'grantRoles'>} [params]\n * @returns {unknown}\n */\n public async grantRolesRaw(\n addresses: Address[],\n roles: bigint[],\n params?: WriteParams<typeof managedBudgetAbi, 'grantRoles'>,\n ) {\n const { request, result } = await simulateManagedBudgetGrantRoles(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, roles],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeManagedBudgetGrantRoles(\n this._config,\n // biome-ignore lint/suspicious/noExplicitAny: negligible low level lack of type intersection\n request as any,\n );\n return { hash, result };\n }\n\n /**\n * Revoke many accounts' permissions on the budget.\n *\n * @example\n * ```ts\n * await budget.revokeRoles(['0xfoo', '0xbar], [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN])\n *\n * @public\n * @async\n * @param {Address[]} addresses\n * @param {bigint[]} roles\n * @param {?WriteParams<typeof managedBudgetAbi, 'revokeRoles'>} [params]\n * @returns {unknown}\n */\n public async revokeRoles(\n addresses: Address[],\n roles: bigint[],\n params?: WriteParams<typeof managedBudgetAbi, 'revokeRoles'>,\n ) {\n return await this.awaitResult(\n this.revokeRolesRaw(addresses, roles, params),\n );\n }\n\n /**\n * Revoke many accounts' permissions on the budget.\n *\n * @example\n * ```ts\n * await budget.revokeRoles(['0xfoo', '0xbar], [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN])\n * @public\n * @async\n * @param {Address[]} addresses\n * @param {bigint[]} roles\n * @param {?WriteParams<typeof managedBudgetAbi, 'revokeRoles'>} [params]\n * @returns {unknown}\n */\n public async revokeRolesRaw(\n addresses: Address[],\n roles: bigint[],\n params?: WriteParams<typeof managedBudgetAbi, 'revokeRoles'>,\n ) {\n const { request, result } = await simulateManagedBudgetRevokeRoles(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, roles],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeManagedBudgetRevokeRoles(\n this._config,\n // biome-ignore lint/suspicious/noExplicitAny: negligible low level lack of type intersection\n request as any,\n );\n return { hash, result };\n }\n\n /**\n * Return an array of the roles assigned to the given account.\n * @example\n * ```ts\n * (await budget.rolesOf(0xfoo)).includes(ManagedBudgetRoles.ADMIN)\n * @public\n * @param {Address} account\n * @param {?ReadParams<typeof managedBudgetAbi, 'rolesOf'>} [params]\n * @returns {Promise<Array<bigint>>}\n */\n public async rolesOf(\n account: Address,\n params?: ReadParams<typeof managedBudgetAbi, 'rolesOf'>,\n ) {\n const roles = await readManagedBudgetRolesOf(this._config, {\n address: this.assertValidAddress(),\n args: [account],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n return [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN].filter(\n (role) => (roles & role) === role,\n );\n }\n\n /**\n * Returns whether given account has any of the provided roles bitmap.\n *\n * @example\n * ```ts\n * await budget.hasAnyRole(0xfoo, ManagedBudgetRoles.ADMIN | ManagedBudgetRoles.MANAGER)\n * @public\n * @param {Address} account\n * @param {bigint} roles\n * @param {?ReadParams<typeof managedBudgetAbi, 'hasAnyRole'>} [params]\n * @returns {Promise<boolean>}\n */\n public hasAnyRole(\n account: Address,\n roles: bigint,\n params?: ReadParams<typeof managedBudgetAbi, 'hasAnyRole'>,\n ) {\n return readManagedBudgetHasAnyRole(this._config, {\n address: this.assertValidAddress(),\n args: [account, roles],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Returns whether given account has all of the provided roles bitmap.\n *\n * @example\n * ```ts\n * await budget.hasAllRoles(0xfoo, ManagedBudgetRoles.ADMIN & ManagedBudgetRoles.MANAGER)\n *\n * @public\n * @param {Address} account\n * @param {bigint} roles\n * @param {?ReadParams<typeof managedBudgetAbi, 'hasAllRoles'>} [params]\n * @returns {*}\n */\n public hasAllRoles(\n account: Address,\n roles: bigint,\n params?: ReadParams<typeof managedBudgetAbi, 'hasAllRoles'>,\n ) {\n return readManagedBudgetHasAllRoles(this._config, {\n address: this.assertValidAddress(),\n args: [account, roles],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Check if the given account is authorized to use the budget\n *\n * @public\n * @param {Address} account\n * @param {?ReadParams<typeof managedBudgetAbi, 'isAuthorized'>} [params]\n * @returns {Promise<boolean>} - True if the account is authorized\n */\n public isAuthorized(\n account: Address,\n params?: ReadParams<typeof managedBudgetAbi, 'isAuthorized'>,\n ) {\n return readManagedBudgetIsAuthorized(this._config, {\n address: this.assertValidAddress(),\n args: [account],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the owner of the budget\n *\n * @public\n * @param {?ReadParams<typeof managedBudgetAbi, 'owner'>} [params]\n * @returns {Promise<Address>}\n */\n public owner(params?: ReadParams<typeof managedBudgetAbi, 'owner'>) {\n return readManagedBudgetOwner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the total amount of assets allocated to the budget, including any that have been distributed\n * If a tokenId is provided, get the total amount of ERC1155 assets allocated to the budget, including any that have been distributed\n *\n * @public\n * @param {Address} asset - The address of the asset\n * @param {?(bigint | undefined)} [tokenId] - The ID of the token\n * @param {?ReadParams<typeof managedBudgetAbi, 'total'>} [params]\n * @returns {Promise<bigint>} - The total amount of assets\n */\n public total(\n asset: Address,\n tokenId?: bigint | undefined,\n params?: ReadParams<typeof managedBudgetAbi, 'total'>,\n ) {\n return readManagedBudgetTotal(this._config, {\n address: this.assertValidAddress(),\n args: tokenId ? [asset, tokenId] : [asset],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the amount of assets available for distribution from the budget.\n * If a tokenId is provided, get the amount of ERC1155 assets available for distribution from the budget\n *\n * @public\n * @param {Address} asset\n * @param {?(bigint | undefined)} [tokenId]\n * @param {?ReadParams<typeof managedBudgetAbi, 'available'>} [params]\n * @returns {Promise<bigint>} - The amount of assets available\n */\n public available(\n asset: Address,\n tokenId?: bigint | undefined,\n params?: ReadParams<typeof managedBudgetAbi, 'available'>,\n ) {\n return readManagedBudgetAvailable(this._config, {\n address: this.assertValidAddress(),\n args: tokenId ? [asset, tokenId] : [asset],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Get the amount of assets that have been distributed from the budget.\n * If a tokenId is provided, get the amount of ERC1155 assets that have been distributed from the budget\n *\n * @public\n * @param {Address} asset\n * @param {?(bigint | undefined)} [tokenId]\n * @param {?ReadParams<typeof managedBudgetAbi, 'distributed'>} [params]\n * @returns {Promise<bigint>} - The amount of assets distributed\n */\n public distributed(\n asset: Address,\n tokenId?: bigint | undefined,\n params?: ReadParams<typeof managedBudgetAbi, 'distributed'>,\n ) {\n return readManagedBudgetDistributed(this._config, {\n address: this.assertValidAddress(),\n args: tokenId ? [asset, tokenId] : [asset],\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 {?ManagedBudgetPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ManagedBudgetPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: managedBudgetAbi,\n bytecode: bytecode as Hex,\n args: [prepareManagedBudgetPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link ManagedBudgetPayload}, properly encode a `ManagedBudget.InitPayload` for use with {@link ManagedBudget} initialization.\n *\n * @param {ManagedBudgetPayload} param0\n * @param {Address} param0.owner - The budget's owner\n * @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.\n * @param {{}} param0.roles - List of roles to assign to the corresponding account by index.\n * @returns {*}\n */\nexport const prepareManagedBudgetPayload = ({\n owner,\n authorized,\n roles,\n}: ManagedBudgetPayload) => {\n return encodeAbiParameters(\n parseAbiParameters([\n 'ManagedBudgetPayload payload',\n 'struct ManagedBudgetPayload { address owner; address[] authorized; uint256[] roles; }',\n ]),\n [{ owner, authorized, roles }],\n );\n};\n"],"names":["ManagedBudgetRoles","isFungibleTransfer","transfer","isERC1155TransferPayload","prepareTransfer","prepareFungibleTransfer","prepareERC1155Transfer","UnknownTransferPayloadSupplied","_ManagedBudget","DeployableTarget","managedBudgetAbi","params","request","result","simulateManagedBudgetAllocate","writeManagedBudgetAllocate","simulateManagedBudgetClawback","writeManagedBudgetClawback","simulateManagedBudgetDisburse","writeManagedBudgetDisburse","transfers","simulateManagedBudgetDisburseBatch","writeManagedBudgetDisburseBatch","addresses","allowed","simulateManagedBudgetSetAuthorized","writeManagedBudgetSetAuthorized","roles","simulateManagedBudgetGrantRoles","writeManagedBudgetGrantRoles","simulateManagedBudgetRevokeRoles","writeManagedBudgetRevokeRoles","account","readManagedBudgetRolesOf","role","readManagedBudgetHasAnyRole","readManagedBudgetHasAllRoles","readManagedBudgetIsAuthorized","readManagedBudgetOwner","asset","tokenId","readManagedBudgetTotal","readManagedBudgetAvailable","readManagedBudgetDistributed","_payload","_options","payload","options","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareManagedBudgetPayload","RegistryType","ManagedBudget","authorized","encodeAbiParameters","parseAbiParameters"],"mappings":"8j2BA+FaA,EAAqB,CAChC,QAAS,GACT,MAAO,EACT,EAwBO,SAASC,EACdC,EACqC,CACrC,OAAQA,EAAoC,UAAY,MAC1D,CASO,SAASC,EACdD,EACoC,CACpC,OAAQA,EAAoC,UAAY,MAC1D,CAUO,SAASE,EACdF,EACA,CACI,GAAAD,EAAmBC,CAAQ,EAC7B,OAAOG,EAAAA,wBAAwBH,CAAQ,EACzC,GAAWC,EAAyBD,CAAQ,EAC1C,OAAOI,EAAAA,uBAAuBJ,CAAQ,EAC3B,MAAA,IAAIK,EAAAA,+BAA+BL,CAAQ,CAC1D,CAWO,MAAMM,EAAN,MAAMA,UAAsBC,EAAAA,gBAGjC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAWL,KAAyB,IAAMC,GAAA,CA8B/B,MAAa,SACXR,EACAS,EACA,CACA,OAAO,MAAM,KAAK,YAAY,KAAK,YAAYT,EAAUS,CAAM,CAAC,CAClE,CAaA,MAAa,YACXT,EACAS,EACA,CACA,KAAM,CAAE,QAAAC,EAAS,OAAAC,CAAO,EAAI,MAAMC,EAAA,GAChC,KAAK,QACL,CACE,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACV,EAAgBF,CAAQ,CAAC,EAChC,GAAG,KAAK,wBAAwB,EAEhC,GAAIS,CACN,CAAA,EAGK,MAAA,CAAE,KADI,MAAMI,EAA2B,GAAA,KAAK,QAASH,CAAO,EACpD,OAAAC,EACjB,CAcA,MAAa,SACXX,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