@etherisc/gif-next 0.0.2-f619be3-760 → 0.0.2-f72939c-683

Sign up to get free protection for your applications and to get access to all the features.
Files changed (343) hide show
  1. package/README.md +114 -11
  2. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +4 -0
  3. package/artifacts/contracts/components/{Component.sol/Component.json → BaseComponent.sol/BaseComponent.json} +26 -57
  4. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +4 -0
  5. package/artifacts/contracts/{instance/component/IComponent.sol/IComponentContract.json → components/IBaseComponent.sol/IBaseComponent.json} +26 -57
  6. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +4 -0
  7. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +356 -0
  8. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +4 -0
  9. package/artifacts/contracts/components/{IPool.sol/IPoolComponent.json → IProductComponent.sol/IProductComponent.json} +89 -65
  10. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  11. package/artifacts/contracts/components/Pool.sol/Pool.json +156 -29
  12. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  13. package/artifacts/contracts/components/Product.sol/Product.json +74 -72
  14. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
  15. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
  16. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
  17. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
  18. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
  19. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
  20. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
  21. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
  22. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
  23. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
  24. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
  25. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +2 -2
  26. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
  27. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
  28. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
  29. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +2 -2
  30. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
  31. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +2 -2
  32. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
  33. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
  34. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  35. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +1124 -598
  36. package/artifacts/contracts/instance/IInstanceLinked.sol/IInstanceLinked.dbg.json +4 -0
  37. package/artifacts/contracts/instance/{component/IComponent.sol → IInstanceLinked.sol}/IInstanceLinked.json +1 -1
  38. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  39. package/artifacts/contracts/instance/Instance.sol/Instance.json +1424 -782
  40. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +4 -0
  41. package/artifacts/contracts/instance/{component/ComponentModule.sol/ComponentModule.json → base/ComponentServiceBase.sol/ComponentServiceBase.json} +133 -132
  42. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +4 -0
  43. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +81 -0
  44. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
  45. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.json +560 -0
  46. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +4 -0
  47. package/artifacts/contracts/instance/{lifecycle/ILifecycle.sol/ILifecycleModule.json → base/ILifecycle.sol/ILifecycle.json} +10 -77
  48. package/artifacts/contracts/instance/base/IService.sol/IService.dbg.json +4 -0
  49. package/artifacts/contracts/instance/base/IService.sol/IService.json +300 -0
  50. package/artifacts/contracts/instance/base/InstanceBase.sol/InstanceBase.dbg.json +4 -0
  51. package/artifacts/contracts/instance/base/InstanceBase.sol/InstanceBase.json +344 -0
  52. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
  53. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +710 -0
  54. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +4 -0
  55. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +169 -0
  56. package/artifacts/contracts/instance/base/ModuleBase.sol/ModuleBase.dbg.json +4 -0
  57. package/artifacts/contracts/instance/base/ModuleBase.sol/ModuleBase.json +10 -0
  58. package/artifacts/contracts/instance/base/ServiceBase.sol/ServiceBase.dbg.json +4 -0
  59. package/artifacts/contracts/instance/base/ServiceBase.sol/ServiceBase.json +300 -0
  60. package/artifacts/contracts/instance/module/access/Access.sol/AccessModule.dbg.json +4 -0
  61. package/artifacts/contracts/instance/{access → module/access}/Access.sol/AccessModule.json +85 -152
  62. package/artifacts/contracts/instance/module/access/IAccess.sol/IAccess.dbg.json +4 -0
  63. package/artifacts/contracts/instance/{access → module/access}/IAccess.sol/IAccess.json +1 -1
  64. package/artifacts/contracts/instance/module/access/IAccess.sol/IAccessModule.dbg.json +4 -0
  65. package/artifacts/contracts/instance/{access → module/access}/IAccess.sol/IAccessModule.json +96 -99
  66. package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.dbg.json +4 -0
  67. package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.json +265 -0
  68. package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundle.dbg.json +4 -0
  69. package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundle.json +10 -0
  70. package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.dbg.json +4 -0
  71. package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.json +265 -0
  72. package/artifacts/contracts/instance/module/compensation/CompensationModule.sol/CompensationModule.dbg.json +4 -0
  73. package/artifacts/contracts/instance/module/compensation/CompensationModule.sol/CompensationModule.json +10 -0
  74. package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensation.dbg.json +4 -0
  75. package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensation.json +10 -0
  76. package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensationModule.dbg.json +4 -0
  77. package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensationModule.json +10 -0
  78. package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.dbg.json +4 -0
  79. package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.json +136 -0
  80. package/artifacts/contracts/instance/module/component/IComponent.sol/IComponent.dbg.json +4 -0
  81. package/artifacts/contracts/instance/{component → module/component}/IComponent.sol/IComponent.json +1 -1
  82. package/artifacts/contracts/instance/module/component/IComponent.sol/IComponentModule.dbg.json +4 -0
  83. package/artifacts/contracts/instance/{product/IProductService.sol/IProductService.json → module/component/IComponent.sol/IComponentModule.json} +66 -57
  84. package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicy.dbg.json +4 -0
  85. package/artifacts/contracts/instance/{policy → module/policy}/IPolicy.sol/IPolicy.json +1 -1
  86. package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicyModule.dbg.json +4 -0
  87. package/artifacts/contracts/instance/{policy → module/policy}/IPolicy.sol/IPolicyModule.json +145 -111
  88. package/artifacts/contracts/instance/module/policy/PolicyModule.sol/PolicyModule.dbg.json +4 -0
  89. package/artifacts/contracts/instance/{policy → module/policy}/PolicyModule.sol/PolicyModule.json +146 -112
  90. package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPool.dbg.json +4 -0
  91. package/artifacts/contracts/instance/{pool → module/pool}/IPoolModule.sol/IPool.json +1 -1
  92. package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPoolModule.dbg.json +4 -0
  93. package/artifacts/contracts/instance/{pool → module/pool}/IPoolModule.sol/IPoolModule.json +67 -52
  94. package/artifacts/contracts/instance/module/pool/PoolModule.sol/PoolModule.dbg.json +4 -0
  95. package/artifacts/contracts/instance/{pool → module/pool}/PoolModule.sol/PoolModule.json +51 -62
  96. package/artifacts/contracts/instance/module/risk/IRisk.sol/IRisk.dbg.json +4 -0
  97. package/artifacts/contracts/instance/module/risk/IRisk.sol/IRisk.json +10 -0
  98. package/artifacts/contracts/instance/module/risk/IRisk.sol/IRiskModule.dbg.json +4 -0
  99. package/artifacts/contracts/instance/module/risk/IRisk.sol/IRiskModule.json +132 -0
  100. package/artifacts/contracts/instance/module/risk/RiskModule.sol/RiskModule.dbg.json +4 -0
  101. package/artifacts/contracts/instance/module/risk/RiskModule.sol/RiskModule.json +150 -0
  102. package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasury.dbg.json +4 -0
  103. package/artifacts/contracts/instance/{treasury → module/treasury}/ITreasury.sol/ITreasury.json +1 -1
  104. package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasuryModule.dbg.json +4 -0
  105. package/artifacts/contracts/instance/{treasury → module/treasury}/ITreasury.sol/ITreasuryModule.json +231 -190
  106. package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.dbg.json +4 -0
  107. package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.json +76 -0
  108. package/artifacts/contracts/instance/module/treasury/TreasuryModule.sol/TreasuryModule.dbg.json +4 -0
  109. package/artifacts/contracts/instance/{treasury → module/treasury}/TreasuryModule.sol/TreasuryModule.json +232 -191
  110. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +4 -0
  111. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +523 -0
  112. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +4 -0
  113. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.json +364 -0
  114. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +4 -0
  115. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +376 -0
  116. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +4 -0
  117. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +548 -0
  118. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +4 -0
  119. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +471 -0
  120. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +4 -0
  121. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +744 -0
  122. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  123. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +65 -2
  124. package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +1 -1
  125. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  126. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +147 -30
  127. package/artifacts/contracts/registry/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
  128. package/artifacts/contracts/registry/IRegistryLinked.sol/IRegistryLinked.json +24 -0
  129. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  130. package/artifacts/contracts/registry/Registry.sol/Registry.json +241 -25
  131. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +4 -0
  132. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +35 -0
  133. package/artifacts/contracts/shared/IOwnable.sol/IOwnable.dbg.json +4 -0
  134. package/artifacts/contracts/{registry/IRegistry.sol → shared/IOwnable.sol}/IOwnable.json +1 -1
  135. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +4 -0
  136. package/artifacts/contracts/{registry/IRegistry.sol → shared/IRegisterable.sol}/IRegisterable.json +16 -61
  137. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +4 -0
  138. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +164 -0
  139. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +4 -0
  140. package/artifacts/contracts/{registry/Registry.sol → shared/Registerable.sol}/Registerable.json +16 -61
  141. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +4 -0
  142. package/artifacts/contracts/shared/Versionable.sol/Versionable.json +164 -0
  143. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +4 -0
  144. package/artifacts/contracts/test/TestFee.sol/TestFee.json +119 -0
  145. package/artifacts/contracts/test/TestPool.sol/TestPool.dbg.json +4 -0
  146. package/artifacts/contracts/test/TestPool.sol/TestPool.json +455 -0
  147. package/artifacts/contracts/test/TestProduct.sol/TestProduct.dbg.json +4 -0
  148. package/artifacts/contracts/test/TestProduct.sol/TestProduct.json +479 -0
  149. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +4 -0
  150. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +137 -0
  151. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +4 -0
  152. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +116 -0
  153. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +4 -0
  154. package/artifacts/contracts/test/TestService.sol/TestService.json +379 -0
  155. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +4 -0
  156. package/artifacts/contracts/test/TestToken.sol/TestUsdc.json +338 -0
  157. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +4 -0
  158. package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +218 -0
  159. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +4 -0
  160. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +206 -0
  161. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +4 -0
  162. package/artifacts/contracts/{mock → test}/Usdc.sol/USDC.json +3 -3
  163. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +4 -0
  164. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.json +10 -0
  165. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  166. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  167. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +4 -0
  168. package/artifacts/contracts/types/Fee.sol/FeeLib.json +218 -0
  169. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +4 -0
  170. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +111 -0
  171. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  172. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +65 -4
  173. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +4 -0
  174. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +10 -0
  175. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  176. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
  177. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +4 -0
  178. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +86 -0
  179. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +4 -0
  180. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +30 -0
  181. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  182. package/artifacts/contracts/types/StateId.sol/StateIdLib.json +2 -2
  183. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  184. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +64 -2
  185. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.dbg.json +1 -1
  186. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.json +58 -58
  187. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +4 -0
  188. package/artifacts/contracts/types/Version.sol/VersionLib.json +139 -0
  189. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +4 -0
  190. package/artifacts/contracts/types/Version.sol/VersionPartLib.json +30 -0
  191. package/contracts/components/BaseComponent.sol +94 -0
  192. package/contracts/components/IBaseComponent.sol +19 -0
  193. package/contracts/components/IPoolComponent.sol +57 -0
  194. package/contracts/components/{IProduct.sol → IProductComponent.sol} +9 -6
  195. package/contracts/components/Pool.sol +155 -16
  196. package/contracts/components/Product.sol +116 -24
  197. package/contracts/instance/IInstance.sol +37 -11
  198. package/contracts/instance/IInstanceLinked.sol +8 -0
  199. package/contracts/instance/Instance.sol +48 -49
  200. package/contracts/instance/base/ComponentServiceBase.sol +42 -0
  201. package/contracts/instance/base/IInstanceBase.sol +19 -0
  202. package/contracts/instance/base/IKeyValueStore.sol +50 -0
  203. package/contracts/instance/{lifecycle → base}/ILifecycle.sol +4 -21
  204. package/contracts/instance/base/IService.sol +15 -0
  205. package/contracts/instance/base/InstanceBase.sol +84 -0
  206. package/contracts/instance/base/KeyValueStore.sol +161 -0
  207. package/contracts/instance/base/Lifecycle.sol +100 -0
  208. package/contracts/instance/base/ModuleBase.sol +53 -0
  209. package/contracts/instance/base/ServiceBase.sol +37 -0
  210. package/contracts/instance/module/access/Access.sol +149 -0
  211. package/contracts/instance/module/access/IAccess.sol +53 -0
  212. package/contracts/instance/module/bundle/BundleModule.sol +135 -0
  213. package/contracts/instance/module/bundle/IBundle.sol +51 -0
  214. package/contracts/instance/module/compensation/CompensationModule.sol +17 -0
  215. package/contracts/instance/module/compensation/ICompensation.sol +10 -0
  216. package/contracts/instance/module/component/ComponentModule.sol +81 -0
  217. package/contracts/instance/module/component/IComponent.sol +29 -0
  218. package/contracts/instance/module/policy/IPolicy.sol +62 -0
  219. package/contracts/instance/module/policy/PolicyModule.sol +92 -0
  220. package/contracts/instance/module/pool/IPoolModule.sol +40 -0
  221. package/contracts/instance/module/pool/PoolModule.sol +90 -0
  222. package/contracts/instance/module/risk/IRisk.sol +27 -0
  223. package/contracts/instance/module/risk/RiskModule.sol +70 -0
  224. package/contracts/instance/module/treasury/ITreasury.sol +96 -0
  225. package/contracts/instance/module/treasury/TokenHandler.sol +48 -0
  226. package/contracts/instance/module/treasury/TreasuryModule.sol +171 -0
  227. package/contracts/instance/service/ComponentOwnerService.sol +155 -0
  228. package/contracts/instance/service/IComponentOwnerService.sol +22 -0
  229. package/contracts/instance/service/IPoolService.sol +30 -0
  230. package/contracts/instance/service/IProductService.sol +78 -0
  231. package/contracts/instance/service/PoolService.sol +129 -0
  232. package/contracts/instance/service/ProductService.sol +406 -0
  233. package/contracts/registry/ChainNft.sol +61 -37
  234. package/contracts/registry/IRegistry.sol +24 -34
  235. package/contracts/registry/IRegistryLinked.sol +8 -0
  236. package/contracts/registry/Registry.sol +284 -85
  237. package/contracts/shared/ERC165.sol +21 -0
  238. package/contracts/shared/IOwnable.sol +6 -0
  239. package/contracts/shared/IRegisterable.sol +24 -0
  240. package/contracts/shared/IVersionable.sol +52 -0
  241. package/contracts/shared/Registerable.sol +86 -0
  242. package/contracts/shared/Versionable.sol +89 -0
  243. package/contracts/test/TestFee.sol +25 -0
  244. package/contracts/test/TestPool.sol +24 -0
  245. package/contracts/test/TestProduct.sol +66 -0
  246. package/contracts/test/TestRegisterable.sol +19 -0
  247. package/contracts/test/TestRoleId.sol +14 -0
  248. package/contracts/test/TestService.sol +32 -0
  249. package/contracts/{mock/Dip.sol → test/TestToken.sol} +5 -5
  250. package/contracts/test/TestVersion.sol +44 -0
  251. package/contracts/test/TestVersionable.sol +17 -0
  252. package/contracts/{mock → test}/Usdc.sol +1 -1
  253. package/contracts/types/AddressSet.sol +58 -0
  254. package/contracts/types/Fee.sol +39 -20
  255. package/contracts/types/Key32.sol +45 -0
  256. package/contracts/types/NftId.sol +22 -1
  257. package/contracts/types/NftIdSet.sol +60 -0
  258. package/contracts/types/ObjectType.sol +33 -13
  259. package/contracts/types/RiskId.sol +43 -0
  260. package/contracts/types/RoleId.sol +38 -0
  261. package/contracts/types/StateId.sol +13 -3
  262. package/contracts/types/Timestamp.sol +22 -1
  263. package/contracts/types/UFixed.sol +12 -13
  264. package/contracts/types/Version.sol +95 -0
  265. package/package.json +8 -3
  266. package/artifacts/contracts/components/Component.sol/Component.dbg.json +0 -4
  267. package/artifacts/contracts/components/Component.sol/InstanceLinked.dbg.json +0 -4
  268. package/artifacts/contracts/components/Component.sol/InstanceLinked.json +0 -35
  269. package/artifacts/contracts/components/IPool.sol/IPoolComponent.dbg.json +0 -4
  270. package/artifacts/contracts/components/IProduct.sol/IProductComponent.dbg.json +0 -4
  271. package/artifacts/contracts/components/IProduct.sol/IProductComponent.json +0 -74
  272. package/artifacts/contracts/instance/access/Access.sol/AccessModule.dbg.json +0 -4
  273. package/artifacts/contracts/instance/access/IAccess.sol/IAccess.dbg.json +0 -4
  274. package/artifacts/contracts/instance/access/IAccess.sol/IAccessCheckRole.dbg.json +0 -4
  275. package/artifacts/contracts/instance/access/IAccess.sol/IAccessCheckRole.json +0 -35
  276. package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.dbg.json +0 -4
  277. package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.json +0 -50
  278. package/artifacts/contracts/instance/access/IAccess.sol/IAccessModule.dbg.json +0 -4
  279. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentModule.dbg.json +0 -4
  280. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.dbg.json +0 -4
  281. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.json +0 -202
  282. package/artifacts/contracts/instance/component/IComponent.sol/IComponent.dbg.json +0 -4
  283. package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.dbg.json +0 -4
  284. package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.dbg.json +0 -4
  285. package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.json +0 -217
  286. package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.dbg.json +0 -4
  287. package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.json +0 -141
  288. package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.dbg.json +0 -4
  289. package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycle.dbg.json +0 -4
  290. package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycle.json +0 -134
  291. package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycleModule.dbg.json +0 -4
  292. package/artifacts/contracts/instance/lifecycle/LifecycleModule.sol/LifecycleModule.dbg.json +0 -4
  293. package/artifacts/contracts/instance/lifecycle/LifecycleModule.sol/LifecycleModule.json +0 -221
  294. package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicy.dbg.json +0 -4
  295. package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.dbg.json +0 -4
  296. package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.dbg.json +0 -4
  297. package/artifacts/contracts/instance/pool/IPoolModule.sol/IPool.dbg.json +0 -4
  298. package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.dbg.json +0 -4
  299. package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.dbg.json +0 -4
  300. package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.dbg.json +0 -4
  301. package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.json +0 -75
  302. package/artifacts/contracts/instance/product/IProductService.sol/IProductService.dbg.json +0 -4
  303. package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.dbg.json +0 -4
  304. package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.json +0 -75
  305. package/artifacts/contracts/instance/product/ProductService.sol/ProductService.dbg.json +0 -4
  306. package/artifacts/contracts/instance/product/ProductService.sol/ProductService.json +0 -196
  307. package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasury.dbg.json +0 -4
  308. package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasuryModule.dbg.json +0 -4
  309. package/artifacts/contracts/instance/treasury/TokenHandler.sol/TokenHandler.dbg.json +0 -4
  310. package/artifacts/contracts/instance/treasury/TokenHandler.sol/TokenHandler.json +0 -45
  311. package/artifacts/contracts/instance/treasury/TreasuryModule.sol/TreasuryModule.dbg.json +0 -4
  312. package/artifacts/contracts/mock/Dip.sol/DIP.dbg.json +0 -4
  313. package/artifacts/contracts/mock/Dip.sol/DIP.json +0 -338
  314. package/artifacts/contracts/mock/TestPool.sol/TestPool.dbg.json +0 -4
  315. package/artifacts/contracts/mock/TestPool.sol/TestPool.json +0 -294
  316. package/artifacts/contracts/mock/TestProduct.sol/TestProduct.dbg.json +0 -4
  317. package/artifacts/contracts/mock/TestProduct.sol/TestProduct.json +0 -384
  318. package/artifacts/contracts/mock/Usdc.sol/USDC.dbg.json +0 -4
  319. package/artifacts/contracts/registry/IRegistry.sol/IOwnable.dbg.json +0 -4
  320. package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.dbg.json +0 -4
  321. package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.dbg.json +0 -4
  322. package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.json +0 -49
  323. package/artifacts/contracts/registry/Registry.sol/Registerable.dbg.json +0 -4
  324. package/artifacts/contracts/registry/Registry.sol/RegistryLinked.dbg.json +0 -4
  325. package/artifacts/contracts/registry/Registry.sol/RegistryLinked.json +0 -60
  326. package/contracts/components/Component.sol +0 -77
  327. package/contracts/components/IPool.sol +0 -15
  328. package/contracts/instance/access/Access.sol +0 -165
  329. package/contracts/instance/access/IAccess.sol +0 -63
  330. package/contracts/instance/component/ComponentModule.sol +0 -274
  331. package/contracts/instance/component/IComponent.sol +0 -74
  332. package/contracts/instance/lifecycle/LifecycleModule.sol +0 -88
  333. package/contracts/instance/policy/IPolicy.sol +0 -50
  334. package/contracts/instance/policy/PolicyModule.sol +0 -114
  335. package/contracts/instance/pool/IPoolModule.sol +0 -23
  336. package/contracts/instance/pool/PoolModule.sol +0 -81
  337. package/contracts/instance/product/IProductService.sol +0 -36
  338. package/contracts/instance/product/ProductService.sol +0 -136
  339. package/contracts/instance/treasury/ITreasury.sol +0 -91
  340. package/contracts/instance/treasury/TokenHandler.sol +0 -24
  341. package/contracts/instance/treasury/TreasuryModule.sol +0 -168
  342. package/contracts/mock/TestPool.sol +0 -16
  343. package/contracts/mock/TestProduct.sol +0 -39
@@ -217,17 +217,17 @@
217
217
  "type": "uint256"
218
218
  },
219
219
  {
220
- "internalType": "uint8",
221
- "name": "rounding",
222
- "type": "uint8"
220
+ "internalType": "UFixed",
221
+ "name": "b",
222
+ "type": "uint256"
223
223
  }
224
224
  ],
225
- "name": "ftoi",
225
+ "name": "gt",
226
226
  "outputs": [
227
227
  {
228
- "internalType": "uint256",
229
- "name": "",
230
- "type": "uint256"
228
+ "internalType": "bool",
229
+ "name": "isGreaterThan",
230
+ "type": "bool"
231
231
  }
232
232
  ],
233
233
  "stateMutability": "pure",
@@ -239,14 +239,19 @@
239
239
  "internalType": "UFixed",
240
240
  "name": "a",
241
241
  "type": "uint256"
242
+ },
243
+ {
244
+ "internalType": "UFixed",
245
+ "name": "b",
246
+ "type": "uint256"
242
247
  }
243
248
  ],
244
- "name": "ftoi",
249
+ "name": "gte",
245
250
  "outputs": [
246
251
  {
247
- "internalType": "uint256",
248
- "name": "",
249
- "type": "uint256"
252
+ "internalType": "bool",
253
+ "name": "isGreaterThan",
254
+ "type": "bool"
250
255
  }
251
256
  ],
252
257
  "stateMutability": "pure",
@@ -258,18 +263,13 @@
258
263
  "internalType": "UFixed",
259
264
  "name": "a",
260
265
  "type": "uint256"
261
- },
262
- {
263
- "internalType": "UFixed",
264
- "name": "b",
265
- "type": "uint256"
266
266
  }
267
267
  ],
268
- "name": "gt",
268
+ "name": "gtz",
269
269
  "outputs": [
270
270
  {
271
271
  "internalType": "bool",
272
- "name": "isGreaterThan",
272
+ "name": "isZero",
273
273
  "type": "bool"
274
274
  }
275
275
  ],
@@ -289,7 +289,7 @@
289
289
  "type": "uint256"
290
290
  }
291
291
  ],
292
- "name": "gte",
292
+ "name": "lt",
293
293
  "outputs": [
294
294
  {
295
295
  "internalType": "bool",
@@ -306,13 +306,18 @@
306
306
  "internalType": "UFixed",
307
307
  "name": "a",
308
308
  "type": "uint256"
309
+ },
310
+ {
311
+ "internalType": "UFixed",
312
+ "name": "b",
313
+ "type": "uint256"
309
314
  }
310
315
  ],
311
- "name": "gtz",
316
+ "name": "lte",
312
317
  "outputs": [
313
318
  {
314
319
  "internalType": "bool",
315
- "name": "isZero",
320
+ "name": "isGreaterThan",
316
321
  "type": "bool"
317
322
  }
318
323
  ],
@@ -322,12 +327,17 @@
322
327
  {
323
328
  "inputs": [
324
329
  {
325
- "internalType": "uint256",
330
+ "internalType": "UFixed",
326
331
  "name": "a",
327
332
  "type": "uint256"
333
+ },
334
+ {
335
+ "internalType": "UFixed",
336
+ "name": "b",
337
+ "type": "uint256"
328
338
  }
329
339
  ],
330
- "name": "itof",
340
+ "name": "mul",
331
341
  "outputs": [
332
342
  {
333
343
  "internalType": "UFixed",
@@ -341,17 +351,17 @@
341
351
  {
342
352
  "inputs": [
343
353
  {
344
- "internalType": "uint256",
354
+ "internalType": "UFixed",
345
355
  "name": "a",
346
356
  "type": "uint256"
347
357
  },
348
358
  {
349
- "internalType": "int8",
350
- "name": "exp",
351
- "type": "int8"
359
+ "internalType": "UFixed",
360
+ "name": "b",
361
+ "type": "uint256"
352
362
  }
353
363
  ],
354
- "name": "itof",
364
+ "name": "sub",
355
365
  "outputs": [
356
366
  {
357
367
  "internalType": "UFixed",
@@ -368,19 +378,14 @@
368
378
  "internalType": "UFixed",
369
379
  "name": "a",
370
380
  "type": "uint256"
371
- },
372
- {
373
- "internalType": "UFixed",
374
- "name": "b",
375
- "type": "uint256"
376
381
  }
377
382
  ],
378
- "name": "lt",
383
+ "name": "toInt",
379
384
  "outputs": [
380
385
  {
381
- "internalType": "bool",
382
- "name": "isGreaterThan",
383
- "type": "bool"
386
+ "internalType": "uint256",
387
+ "name": "",
388
+ "type": "uint256"
384
389
  }
385
390
  ],
386
391
  "stateMutability": "pure",
@@ -394,17 +399,17 @@
394
399
  "type": "uint256"
395
400
  },
396
401
  {
397
- "internalType": "UFixed",
398
- "name": "b",
399
- "type": "uint256"
402
+ "internalType": "uint8",
403
+ "name": "rounding",
404
+ "type": "uint8"
400
405
  }
401
406
  ],
402
- "name": "lte",
407
+ "name": "toIntWithRounding",
403
408
  "outputs": [
404
409
  {
405
- "internalType": "bool",
406
- "name": "isGreaterThan",
407
- "type": "bool"
410
+ "internalType": "uint256",
411
+ "name": "",
412
+ "type": "uint256"
408
413
  }
409
414
  ],
410
415
  "stateMutability": "pure",
@@ -413,17 +418,17 @@
413
418
  {
414
419
  "inputs": [
415
420
  {
416
- "internalType": "UFixed",
421
+ "internalType": "uint256",
417
422
  "name": "a",
418
423
  "type": "uint256"
419
424
  },
420
425
  {
421
- "internalType": "UFixed",
422
- "name": "b",
423
- "type": "uint256"
426
+ "internalType": "int8",
427
+ "name": "exp",
428
+ "type": "int8"
424
429
  }
425
430
  ],
426
- "name": "mul",
431
+ "name": "toUFixed",
427
432
  "outputs": [
428
433
  {
429
434
  "internalType": "UFixed",
@@ -437,17 +442,12 @@
437
442
  {
438
443
  "inputs": [
439
444
  {
440
- "internalType": "UFixed",
445
+ "internalType": "uint256",
441
446
  "name": "a",
442
447
  "type": "uint256"
443
- },
444
- {
445
- "internalType": "UFixed",
446
- "name": "b",
447
- "type": "uint256"
448
448
  }
449
449
  ],
450
- "name": "sub",
450
+ "name": "toUFixed",
451
451
  "outputs": [
452
452
  {
453
453
  "internalType": "UFixed",
@@ -472,8 +472,8 @@
472
472
  "type": "function"
473
473
  }
474
474
  ],
475
- "bytecode": "0x610a2d61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106101625760003560e01c806393aa8725116100cd578063c8a4ac9c11610086578063c8a4ac9c146102af578063cc8b7b73146102c2578063d05b0452146102d5578063dd45daa1146102e8578063ea6515c4146102fb578063eb646d711461030e57600080fd5b806393aa872514610261578063a391c15b14610268578063b47733291461027b578063b67d77c51461028e578063bc1b392d146102a1578063bdbb4630146102a857600080fd5b8063753b14a51161011f578063753b14a5146101ed578063771602f7146102005780637a858b971461021357806389fa8ed7146102265780638f24f6011461023b57806392ae8ce01461024e57600080fd5b8063059f8b1614610167578063118fc88c146101825780631a12cd47146101a557806321e5749b146101c0578063313ce567146101d357806332148d73146101da575b600080fd5b61016f610316565b6040519081526020015b60405180910390f35b61019561019036600461079a565b610325565b6040519015158152602001610179565b6101ad601281565b60405160009190910b8152602001610179565b6101956101ce36600461079a565b610334565b601261016f565b6101956101e836600461079a565b61033e565b6101956101fb3660046107bc565b610348565b61016f61020e36600461079a565b610351565b6101956102213660046107bc565b61035d565b60025b60405160ff9091168152602001610179565b61016f6102493660046107d5565b610367565b61016f61025c3660046107bc565b6103e9565b6000610229565b61016f61027636600461079a565b610401565b61019561028936600461079a565b61040d565b61016f61029c36600461079a565b610418565b600061016f565b6001610229565b61016f6102bd36600461079a565b610424565b61016f6102d036600461079a565b610430565b61016f6102e33660046107bc565b61043c565b61016f6102f636600461080b565b610449565b61019561030936600461079a565b61052b565b61016f610536565b6103226012600a610930565b81565b60008282115b90505b92915050565b600082821061032b565b600081831461032b565b6000811561032e565b600061032b838361054e565b600081151561032e565b600060011960ff8316016103b6576103af60026103866012600a610930565b6103909190610952565b61039a9085610974565b60016103a86012600a610930565b600061055a565b905061032e565b60ff82166103d0576103af8360016103a86012600a610930565b6103af8360016103e26012600a610930565b600161055a565b60006103f76012600a610930565b61032e9083610987565b600061032b83836105b7565b60008282111561032b565b600061032b838361061b565b600061032b8383610677565b600061032b838361068c565b600061032e826002610367565b60008061045783601261099e565b60000b12156104ad5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031303a4558504f4e454e545f544f4f5f534d414c4c0060448201526064015b60405180910390fd5b60406104ba83601261099e565b60000b131561050b5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031313a4558504f4e454e545f544f4f5f4c415247450060448201526064016104a4565b61051682601261099e565b61052190600a6109bf565b61032b9084610987565b60008282101561032b565b60026105446012600a610930565b6103229190610952565b600061032b8284610974565b6000806105688686866106aa565b9050600183600281111561057e5761057e6109ce565b14801561059b5750600084806105965761059661093c565b868809115b156105ae576105ab600182610974565b90505b95945050505050565b60008082116106085760405162461bcd60e51b815260206004820152601a60248201527f4552524f523a55464d2d3032303a44495649534f525f5a45524f00000000000060448201526064016104a4565b61032b83670de0b6b3a7640000846106aa565b60008282111561066d5760405162461bcd60e51b815260206004820152601d60248201527f4552524f523a55464d2d3031303a4e454741544956455f524553554c5400000060448201526064016104a4565b61032b82846109e4565b600061032b8383670de0b6b3a76400006106aa565b6000828210156106a0576103af838361061b565b61032b828461061b565b60008080600019858709858702925082811083820303915050806000036106e4578382816106da576106da61093c565b0492505050610793565b80841161072b5760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b60448201526064016104a4565b600084868809851960019081018716968790049682860381900495909211909303600082900391909104909201919091029190911760038402600290811880860282030280860282030280860282030280860282030280860282030280860290910302029150505b9392505050565b600080604083850312156107ad57600080fd5b50508035926020909101359150565b6000602082840312156107ce57600080fd5b5035919050565b600080604083850312156107e857600080fd5b82359150602083013560ff8116811461080057600080fd5b809150509250929050565b6000806040838503121561081e57600080fd5b8235915060208301358060000b811461080057600080fd5b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561088757816000190482111561086d5761086d610836565b8085161561087a57918102915b93841c9390800290610851565b509250929050565b60008261089e5750600161032e565b816108ab5750600061032e565b81600181146108c157600281146108cb576108e7565b600191505061032e565b60ff8411156108dc576108dc610836565b50506001821b61032e565b5060208310610133831016604e8410600b841016171561090a575081810a61032e565b610914838361084c565b806000190482111561092857610928610836565b029392505050565b600061032b838361088f565b634e487b7160e01b600052601260045260246000fd5b60008261096f57634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561032e5761032e610836565b808202811582820484141761032e5761032e610836565b600081810b9083900b01607f8113607f198212171561032e5761032e610836565b600061032b60ff84168361088f565b634e487b7160e01b600052602160045260246000fd5b8181038181111561032e5761032e61083656fea2646970667358221220a5d86e098c418522257789f942a85f958c24134c3527e49c06970e7022704f0964736f6c63430008140033",
476
- "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106101625760003560e01c806393aa8725116100cd578063c8a4ac9c11610086578063c8a4ac9c146102af578063cc8b7b73146102c2578063d05b0452146102d5578063dd45daa1146102e8578063ea6515c4146102fb578063eb646d711461030e57600080fd5b806393aa872514610261578063a391c15b14610268578063b47733291461027b578063b67d77c51461028e578063bc1b392d146102a1578063bdbb4630146102a857600080fd5b8063753b14a51161011f578063753b14a5146101ed578063771602f7146102005780637a858b971461021357806389fa8ed7146102265780638f24f6011461023b57806392ae8ce01461024e57600080fd5b8063059f8b1614610167578063118fc88c146101825780631a12cd47146101a557806321e5749b146101c0578063313ce567146101d357806332148d73146101da575b600080fd5b61016f610316565b6040519081526020015b60405180910390f35b61019561019036600461079a565b610325565b6040519015158152602001610179565b6101ad601281565b60405160009190910b8152602001610179565b6101956101ce36600461079a565b610334565b601261016f565b6101956101e836600461079a565b61033e565b6101956101fb3660046107bc565b610348565b61016f61020e36600461079a565b610351565b6101956102213660046107bc565b61035d565b60025b60405160ff9091168152602001610179565b61016f6102493660046107d5565b610367565b61016f61025c3660046107bc565b6103e9565b6000610229565b61016f61027636600461079a565b610401565b61019561028936600461079a565b61040d565b61016f61029c36600461079a565b610418565b600061016f565b6001610229565b61016f6102bd36600461079a565b610424565b61016f6102d036600461079a565b610430565b61016f6102e33660046107bc565b61043c565b61016f6102f636600461080b565b610449565b61019561030936600461079a565b61052b565b61016f610536565b6103226012600a610930565b81565b60008282115b90505b92915050565b600082821061032b565b600081831461032b565b6000811561032e565b600061032b838361054e565b600081151561032e565b600060011960ff8316016103b6576103af60026103866012600a610930565b6103909190610952565b61039a9085610974565b60016103a86012600a610930565b600061055a565b905061032e565b60ff82166103d0576103af8360016103a86012600a610930565b6103af8360016103e26012600a610930565b600161055a565b60006103f76012600a610930565b61032e9083610987565b600061032b83836105b7565b60008282111561032b565b600061032b838361061b565b600061032b8383610677565b600061032b838361068c565b600061032e826002610367565b60008061045783601261099e565b60000b12156104ad5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031303a4558504f4e454e545f544f4f5f534d414c4c0060448201526064015b60405180910390fd5b60406104ba83601261099e565b60000b131561050b5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031313a4558504f4e454e545f544f4f5f4c415247450060448201526064016104a4565b61051682601261099e565b61052190600a6109bf565b61032b9084610987565b60008282101561032b565b60026105446012600a610930565b6103229190610952565b600061032b8284610974565b6000806105688686866106aa565b9050600183600281111561057e5761057e6109ce565b14801561059b5750600084806105965761059661093c565b868809115b156105ae576105ab600182610974565b90505b95945050505050565b60008082116106085760405162461bcd60e51b815260206004820152601a60248201527f4552524f523a55464d2d3032303a44495649534f525f5a45524f00000000000060448201526064016104a4565b61032b83670de0b6b3a7640000846106aa565b60008282111561066d5760405162461bcd60e51b815260206004820152601d60248201527f4552524f523a55464d2d3031303a4e454741544956455f524553554c5400000060448201526064016104a4565b61032b82846109e4565b600061032b8383670de0b6b3a76400006106aa565b6000828210156106a0576103af838361061b565b61032b828461061b565b60008080600019858709858702925082811083820303915050806000036106e4578382816106da576106da61093c565b0492505050610793565b80841161072b5760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b60448201526064016104a4565b600084868809851960019081018716968790049682860381900495909211909303600082900391909104909201919091029190911760038402600290811880860282030280860282030280860282030280860282030280860282030280860290910302029150505b9392505050565b600080604083850312156107ad57600080fd5b50508035926020909101359150565b6000602082840312156107ce57600080fd5b5035919050565b600080604083850312156107e857600080fd5b82359150602083013560ff8116811461080057600080fd5b809150509250929050565b6000806040838503121561081e57600080fd5b8235915060208301358060000b811461080057600080fd5b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561088757816000190482111561086d5761086d610836565b8085161561087a57918102915b93841c9390800290610851565b509250929050565b60008261089e5750600161032e565b816108ab5750600061032e565b81600181146108c157600281146108cb576108e7565b600191505061032e565b60ff8411156108dc576108dc610836565b50506001821b61032e565b5060208310610133831016604e8410600b841016171561090a575081810a61032e565b610914838361084c565b806000190482111561092857610928610836565b029392505050565b600061032b838361088f565b634e487b7160e01b600052601260045260246000fd5b60008261096f57634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561032e5761032e610836565b808202811582820484141761032e5761032e610836565b600081810b9083900b01607f8113607f198212171561032e5761032e610836565b600061032b60ff84168361088f565b634e487b7160e01b600052602160045260246000fd5b8181038181111561032e5761032e61083656fea2646970667358221220a5d86e098c418522257789f942a85f958c24134c3527e49c06970e7022704f0964736f6c63430008140033",
475
+ "bytecode": "0x610a2a61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106101625760003560e01c80637a858b97116100cd578063bc1b392d11610086578063bc1b392d146102c7578063bdbb4630146102ce578063c8a4ac9c146102d5578063cc8b7b73146102e8578063ea6515c4146102fb578063eb646d711461030e57600080fd5b80637a858b971461025f57806389fa8ed71461027257806393aa872514610287578063a391c15b1461028e578063b4773329146102a1578063b67d77c5146102b457600080fd5b8063313ce5671161011f578063313ce567146101f957806332148d731461020057806344aa68361461021357806345ebb61e14610226578063753b14a514610239578063771602f71461024c57600080fd5b8063059f8b161461016757806308c76ec414610182578063118fc88c146101955780631488c845146101b85780631a12cd47146101cb57806321e5749b146101e6575b600080fd5b61016f610316565b6040519081526020015b60405180910390f35b61016f610190366004610797565b610325565b6101a86101a33660046107cd565b6103ad565b6040519015158152602001610179565b61016f6101c63660046107ef565b6103ba565b6101d3601281565b60405160009190910b8152602001610179565b6101a86101f43660046107cd565b61049c565b601261016f565b6101a861020e3660046107cd565b6104a6565b61016f61022136600461081a565b6104b0565b61016f61023436600461081a565b6104bd565b6101a861024736600461081a565b6104d5565b61016f61025a3660046107cd565b6104de565b6101a861026d36600461081a565b6104ea565b60025b60405160ff9091168152602001610179565b6000610275565b61016f61029c3660046107cd565b6104f4565b6101a86102af3660046107cd565b610500565b61016f6102c23660046107cd565b61050b565b600061016f565b6001610275565b61016f6102e33660046107cd565b610517565b61016f6102f63660046107cd565b610523565b6101a86103093660046107cd565b61052f565b61016f61053a565b6103226012600a61092d565b81565b600060011960ff8316016103745761036d60026103446012600a61092d565b61034e919061094f565b6103589085610971565b60016103666012600a61092d565b6000610552565b90506103a7565b60ff821661038e5761036d8360016103666012600a61092d565b61036d8360016103a06012600a61092d565b6001610552565b92915050565b60008282115b9392505050565b6000806103c8836012610984565b60000b121561041e5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031303a4558504f4e454e545f544f4f5f534d414c4c0060448201526064015b60405180910390fd5b604061042b836012610984565b60000b131561047c5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031313a4558504f4e454e545f544f4f5f4c41524745006044820152606401610415565b610487826012610984565b61049290600a6109a5565b6103b390846109b4565b60008282106103b3565b60008183146103b3565b60006103a7826002610325565b60006104cb6012600a61092d565b6103a790836109b4565b600081156103a7565b60006103b383836105af565b60008115156103a7565b60006103b383836105bb565b6000828211156103b3565b60006103b3838361061f565b60006103b3838361067b565b60006103b38383610690565b6000828210156103b3565b60026105486012600a61092d565b610322919061094f565b6000806105608686866106ae565b90506001836002811115610576576105766109cb565b14801561059357506000848061058e5761058e610939565b868809115b156105a6576105a3600182610971565b90505b95945050505050565b60006103b38284610971565b600080821161060c5760405162461bcd60e51b815260206004820152601a60248201527f4552524f523a55464d2d3032303a44495649534f525f5a45524f0000000000006044820152606401610415565b6103b383670de0b6b3a7640000846106ae565b6000828211156106715760405162461bcd60e51b815260206004820152601d60248201527f4552524f523a55464d2d3031303a4e454741544956455f524553554c540000006044820152606401610415565b6103b382846109e1565b60006103b38383670de0b6b3a76400006106ae565b6000828210156106a45761036d838361061f565b6103b3828461061f565b60008080600019858709858702925082811083820303915050806000036106e8578382816106de576106de610939565b04925050506103b3565b80841161072f5760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b6044820152606401610415565b600084868809600260036001881981018916988990049182028318808302840302808302840302808302840302808302840302808302840302918202909203026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080604083850312156107aa57600080fd5b82359150602083013560ff811681146107c257600080fd5b809150509250929050565b600080604083850312156107e057600080fd5b50508035926020909101359150565b6000806040838503121561080257600080fd5b8235915060208301358060000b81146107c257600080fd5b60006020828403121561082c57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561088457816000190482111561086a5761086a610833565b8085161561087757918102915b93841c939080029061084e565b509250929050565b60008261089b575060016103a7565b816108a8575060006103a7565b81600181146108be57600281146108c8576108e4565b60019150506103a7565b60ff8411156108d9576108d9610833565b50506001821b6103a7565b5060208310610133831016604e8410600b8410161715610907575081810a6103a7565b6109118383610849565b806000190482111561092557610925610833565b029392505050565b60006103b3838361088c565b634e487b7160e01b600052601260045260246000fd5b60008261096c57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156103a7576103a7610833565b600081810b9083900b01607f8113607f19821217156103a7576103a7610833565b60006103b360ff84168361088c565b80820281158282048414176103a7576103a7610833565b634e487b7160e01b600052602160045260246000fd5b818103818111156103a7576103a761083356fea2646970667358221220fb084aab1469254041156892d0f0d9cc43b94e6c38b151c477083dab1d1e70aa64736f6c63430008140033",
476
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106101625760003560e01c80637a858b97116100cd578063bc1b392d11610086578063bc1b392d146102c7578063bdbb4630146102ce578063c8a4ac9c146102d5578063cc8b7b73146102e8578063ea6515c4146102fb578063eb646d711461030e57600080fd5b80637a858b971461025f57806389fa8ed71461027257806393aa872514610287578063a391c15b1461028e578063b4773329146102a1578063b67d77c5146102b457600080fd5b8063313ce5671161011f578063313ce567146101f957806332148d731461020057806344aa68361461021357806345ebb61e14610226578063753b14a514610239578063771602f71461024c57600080fd5b8063059f8b161461016757806308c76ec414610182578063118fc88c146101955780631488c845146101b85780631a12cd47146101cb57806321e5749b146101e6575b600080fd5b61016f610316565b6040519081526020015b60405180910390f35b61016f610190366004610797565b610325565b6101a86101a33660046107cd565b6103ad565b6040519015158152602001610179565b61016f6101c63660046107ef565b6103ba565b6101d3601281565b60405160009190910b8152602001610179565b6101a86101f43660046107cd565b61049c565b601261016f565b6101a861020e3660046107cd565b6104a6565b61016f61022136600461081a565b6104b0565b61016f61023436600461081a565b6104bd565b6101a861024736600461081a565b6104d5565b61016f61025a3660046107cd565b6104de565b6101a861026d36600461081a565b6104ea565b60025b60405160ff9091168152602001610179565b6000610275565b61016f61029c3660046107cd565b6104f4565b6101a86102af3660046107cd565b610500565b61016f6102c23660046107cd565b61050b565b600061016f565b6001610275565b61016f6102e33660046107cd565b610517565b61016f6102f63660046107cd565b610523565b6101a86103093660046107cd565b61052f565b61016f61053a565b6103226012600a61092d565b81565b600060011960ff8316016103745761036d60026103446012600a61092d565b61034e919061094f565b6103589085610971565b60016103666012600a61092d565b6000610552565b90506103a7565b60ff821661038e5761036d8360016103666012600a61092d565b61036d8360016103a06012600a61092d565b6001610552565b92915050565b60008282115b9392505050565b6000806103c8836012610984565b60000b121561041e5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031303a4558504f4e454e545f544f4f5f534d414c4c0060448201526064015b60405180910390fd5b604061042b836012610984565b60000b131561047c5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031313a4558504f4e454e545f544f4f5f4c41524745006044820152606401610415565b610487826012610984565b61049290600a6109a5565b6103b390846109b4565b60008282106103b3565b60008183146103b3565b60006103a7826002610325565b60006104cb6012600a61092d565b6103a790836109b4565b600081156103a7565b60006103b383836105af565b60008115156103a7565b60006103b383836105bb565b6000828211156103b3565b60006103b3838361061f565b60006103b3838361067b565b60006103b38383610690565b6000828210156103b3565b60026105486012600a61092d565b610322919061094f565b6000806105608686866106ae565b90506001836002811115610576576105766109cb565b14801561059357506000848061058e5761058e610939565b868809115b156105a6576105a3600182610971565b90505b95945050505050565b60006103b38284610971565b600080821161060c5760405162461bcd60e51b815260206004820152601a60248201527f4552524f523a55464d2d3032303a44495649534f525f5a45524f0000000000006044820152606401610415565b6103b383670de0b6b3a7640000846106ae565b6000828211156106715760405162461bcd60e51b815260206004820152601d60248201527f4552524f523a55464d2d3031303a4e454741544956455f524553554c540000006044820152606401610415565b6103b382846109e1565b60006103b38383670de0b6b3a76400006106ae565b6000828210156106a45761036d838361061f565b6103b3828461061f565b60008080600019858709858702925082811083820303915050806000036106e8578382816106de576106de610939565b04925050506103b3565b80841161072f5760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b6044820152606401610415565b600084868809600260036001881981018916988990049182028318808302840302808302840302808302840302808302840302808302840302918202909203026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080604083850312156107aa57600080fd5b82359150602083013560ff811681146107c257600080fd5b809150509250929050565b600080604083850312156107e057600080fd5b50508035926020909101359150565b6000806040838503121561080257600080fd5b8235915060208301358060000b81146107c257600080fd5b60006020828403121561082c57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561088457816000190482111561086a5761086a610833565b8085161561087757918102915b93841c939080029061084e565b509250929050565b60008261089b575060016103a7565b816108a8575060006103a7565b81600181146108be57600281146108c8576108e4565b60019150506103a7565b60ff8411156108d9576108d9610833565b50506001821b6103a7565b5060208310610133831016604e8410600b8410161715610907575081810a6103a7565b6109118383610849565b806000190482111561092557610925610833565b029392505050565b60006103b3838361088c565b634e487b7160e01b600052601260045260246000fd5b60008261096c57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156103a7576103a7610833565b600081810b9083900b01607f8113607f19821217156103a7576103a7610833565b60006103b360ff84168361088c565b80820281158282048414176103a7576103a7610833565b634e487b7160e01b600052602160045260246000fd5b818103818111156103a7576103a761083356fea2646970667358221220fb084aab1469254041156892d0f0d9cc43b94e6c38b151c477083dab1d1e70aa64736f6c63430008140033",
477
477
  "linkReferences": {},
478
478
  "deployedLinkReferences": {}
479
479
  }
@@ -0,0 +1,4 @@
1
+ {
2
+ "_format": "hh-sol-dbg-1",
3
+ "buildInfo": "../../../build-info/01797c1a22420f170e92428a4c013a0c.json"
4
+ }
@@ -0,0 +1,139 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "VersionLib",
4
+ "sourceName": "contracts/types/Version.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "Version",
10
+ "name": "version",
11
+ "type": "uint24"
12
+ }
13
+ ],
14
+ "name": "toInt",
15
+ "outputs": [
16
+ {
17
+ "internalType": "uint256",
18
+ "name": "",
19
+ "type": "uint256"
20
+ }
21
+ ],
22
+ "stateMutability": "pure",
23
+ "type": "function"
24
+ },
25
+ {
26
+ "inputs": [
27
+ {
28
+ "internalType": "Version",
29
+ "name": "version",
30
+ "type": "uint24"
31
+ }
32
+ ],
33
+ "name": "toMajorPart",
34
+ "outputs": [
35
+ {
36
+ "internalType": "VersionPart",
37
+ "name": "major",
38
+ "type": "uint8"
39
+ }
40
+ ],
41
+ "stateMutability": "pure",
42
+ "type": "function"
43
+ },
44
+ {
45
+ "inputs": [
46
+ {
47
+ "internalType": "uint256",
48
+ "name": "major",
49
+ "type": "uint256"
50
+ },
51
+ {
52
+ "internalType": "uint256",
53
+ "name": "minor",
54
+ "type": "uint256"
55
+ },
56
+ {
57
+ "internalType": "uint256",
58
+ "name": "patch",
59
+ "type": "uint256"
60
+ }
61
+ ],
62
+ "name": "toVersion",
63
+ "outputs": [
64
+ {
65
+ "internalType": "Version",
66
+ "name": "",
67
+ "type": "uint24"
68
+ }
69
+ ],
70
+ "stateMutability": "pure",
71
+ "type": "function"
72
+ },
73
+ {
74
+ "inputs": [
75
+ {
76
+ "internalType": "uint256",
77
+ "name": "versionPart",
78
+ "type": "uint256"
79
+ }
80
+ ],
81
+ "name": "toVersionPart",
82
+ "outputs": [
83
+ {
84
+ "internalType": "VersionPart",
85
+ "name": "",
86
+ "type": "uint8"
87
+ }
88
+ ],
89
+ "stateMutability": "pure",
90
+ "type": "function"
91
+ },
92
+ {
93
+ "inputs": [
94
+ {
95
+ "internalType": "Version",
96
+ "name": "version",
97
+ "type": "uint24"
98
+ }
99
+ ],
100
+ "name": "toVersionParts",
101
+ "outputs": [
102
+ {
103
+ "internalType": "VersionPart",
104
+ "name": "major",
105
+ "type": "uint8"
106
+ },
107
+ {
108
+ "internalType": "VersionPart",
109
+ "name": "minor",
110
+ "type": "uint8"
111
+ },
112
+ {
113
+ "internalType": "VersionPart",
114
+ "name": "patch",
115
+ "type": "uint8"
116
+ }
117
+ ],
118
+ "stateMutability": "pure",
119
+ "type": "function"
120
+ },
121
+ {
122
+ "inputs": [],
123
+ "name": "zeroVersion",
124
+ "outputs": [
125
+ {
126
+ "internalType": "Version",
127
+ "name": "",
128
+ "type": "uint24"
129
+ }
130
+ ],
131
+ "stateMutability": "pure",
132
+ "type": "function"
133
+ }
134
+ ],
135
+ "bytecode": "0x61030c61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c806304b8f6c5146100715780632efe01131461008d57806349a7111a146100a057806355601007146100d75780638e4ad86c146100fb578063c9e66e291461011e575b600080fd5b60005b60405162ffffff90911681526020015b60405180910390f35b61007461009b366004610213565b610135565b6100b36100ae36600461023f565b6101d6565b6040805160ff94851681529284166020840152921691810191909152606001610084565b6100ed6100e536600461023f565b62ffffff1690565b604051908152602001610084565b61010c61010936600461026b565b90565b60405160ff9091168152602001610084565b61010c61012c36600461023f565b60101c60ff1690565b600061010084108015610149575061010083105b8015610156575061010082105b6101b15760405162461bcd60e51b815260206004820152602260248201527f4552524f523a5652532d3031303a56455253494f4e5f504152545f544f4f5f42604482015261494760f01b606482015260840160405180910390fd5b816101c4600885901b601087901b61029a565b6101ce919061029a565b949350505050565b600080808360ff601082901c166101ed83836102b3565b915061ffff600883901c16600061020481856102b3565b92989197509195509350505050565b60008060006060848603121561022857600080fd5b505081359360208301359350604090920135919050565b60006020828403121561025157600080fd5b813562ffffff8116811461026457600080fd5b9392505050565b60006020828403121561027d57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156102ad576102ad610284565b92915050565b62ffffff8281168282160390808211156102cf576102cf610284565b509291505056fea2646970667358221220ba37649b9b622a7a14f84638f29a11cfa2b93f381baaceb770e1fea23e6fae7964736f6c63430008140033",
136
+ "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c806304b8f6c5146100715780632efe01131461008d57806349a7111a146100a057806355601007146100d75780638e4ad86c146100fb578063c9e66e291461011e575b600080fd5b60005b60405162ffffff90911681526020015b60405180910390f35b61007461009b366004610213565b610135565b6100b36100ae36600461023f565b6101d6565b6040805160ff94851681529284166020840152921691810191909152606001610084565b6100ed6100e536600461023f565b62ffffff1690565b604051908152602001610084565b61010c61010936600461026b565b90565b60405160ff9091168152602001610084565b61010c61012c36600461023f565b60101c60ff1690565b600061010084108015610149575061010083105b8015610156575061010082105b6101b15760405162461bcd60e51b815260206004820152602260248201527f4552524f523a5652532d3031303a56455253494f4e5f504152545f544f4f5f42604482015261494760f01b606482015260840160405180910390fd5b816101c4600885901b601087901b61029a565b6101ce919061029a565b949350505050565b600080808360ff601082901c166101ed83836102b3565b915061ffff600883901c16600061020481856102b3565b92989197509195509350505050565b60008060006060848603121561022857600080fd5b505081359360208301359350604090920135919050565b60006020828403121561025157600080fd5b813562ffffff8116811461026457600080fd5b9392505050565b60006020828403121561027d57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156102ad576102ad610284565b92915050565b62ffffff8281168282160390808211156102cf576102cf610284565b509291505056fea2646970667358221220ba37649b9b622a7a14f84638f29a11cfa2b93f381baaceb770e1fea23e6fae7964736f6c63430008140033",
137
+ "linkReferences": {},
138
+ "deployedLinkReferences": {}
139
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "_format": "hh-sol-dbg-1",
3
+ "buildInfo": "../../../build-info/01797c1a22420f170e92428a4c013a0c.json"
4
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "VersionPartLib",
4
+ "sourceName": "contracts/types/Version.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "VersionPart",
10
+ "name": "x",
11
+ "type": "uint8"
12
+ }
13
+ ],
14
+ "name": "toInt",
15
+ "outputs": [
16
+ {
17
+ "internalType": "uint256",
18
+ "name": "",
19
+ "type": "uint256"
20
+ }
21
+ ],
22
+ "stateMutability": "pure",
23
+ "type": "function"
24
+ }
25
+ ],
26
+ "bytecode": "0x60b9610039600b82828239805160001a60731461002c57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361060335760003560e01c8063ac43d834146038575b600080fd5b60496043366004605b565b60ff1690565b60405190815260200160405180910390f35b600060208284031215606c57600080fd5b813560ff81168114607c57600080fd5b939250505056fea2646970667358221220f9eff042249ef4290a2228b4a1d7046915ad93d6defe14b8c405ef07df444fa264736f6c63430008140033",
27
+ "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361060335760003560e01c8063ac43d834146038575b600080fd5b60496043366004605b565b60ff1690565b60405190815260200160405180910390f35b600060208284031215606c57600080fd5b813560ff81168114607c57600080fd5b939250505056fea2646970667358221220f9eff042249ef4290a2228b4a1d7046915ad93d6defe14b8c405ef07df444fa264736f6c63430008140033",
28
+ "linkReferences": {},
29
+ "deployedLinkReferences": {}
30
+ }
@@ -0,0 +1,94 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.19;
3
+
4
+ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
5
+
6
+ import {IRegisterable} from "../shared/IRegisterable.sol";
7
+ import {Registerable} from "../shared/Registerable.sol";
8
+
9
+ import {IRegistry} from "../registry/IRegistry.sol";
10
+ import {IInstance} from "../instance/IInstance.sol";
11
+
12
+ import {IInstance} from "../instance/IInstance.sol";
13
+ import {IComponent, IComponentModule} from "../instance/module/component/IComponent.sol";
14
+ import {IComponentOwnerService} from "../instance/service/IComponentOwnerService.sol";
15
+ import {IBaseComponent} from "./IBaseComponent.sol";
16
+ import {Fee, FeeLib} from "../types/Fee.sol";
17
+ import {NftId} from "../types/NftId.sol";
18
+
19
+ abstract contract BaseComponent is
20
+ Registerable,
21
+ IBaseComponent
22
+ {
23
+ IComponentOwnerService internal _componentOwnerService;
24
+
25
+ address internal _deployer;
26
+ address internal _wallet;
27
+ IERC20Metadata internal _token;
28
+ IInstance internal _instance;
29
+ bool internal _isRegistered;
30
+ Fee internal _zeroFee;
31
+
32
+ constructor(
33
+ address registry,
34
+ NftId instanceNftId,
35
+ address token
36
+ )
37
+ Registerable(registry, instanceNftId)
38
+ {
39
+ IRegistry.ObjectInfo memory instanceInfo = _registry.getObjectInfo(instanceNftId);
40
+ _instance = IInstance(instanceInfo.objectAddress);
41
+ require(
42
+ _instance.supportsInterface(type(IInstance).interfaceId),
43
+ ""
44
+ );
45
+
46
+ _componentOwnerService = _instance.getComponentOwnerService();
47
+ _wallet = address(this);
48
+ _token = IERC20Metadata(token);
49
+ _isRegistered = false;
50
+ _zeroFee = FeeLib.zeroFee();
51
+ }
52
+
53
+ // from registerable
54
+ function register() public override(IRegisterable, Registerable) returns (NftId componentId) {
55
+ require(msg.sender == getOwner(), "");
56
+ require(
57
+ address(_registry) != address(0),
58
+ "ERROR:COB-001:REGISTRY_ZERO"
59
+ );
60
+ require(
61
+ _registry.isRegistered(address(_instance)),
62
+ "ERROR:COB:INSTANCE_NOT_REGISTERED"
63
+ );
64
+
65
+ _isRegistered = true;
66
+ return _componentOwnerService.register(this);
67
+ }
68
+
69
+ // from component contract
70
+ function lock() external onlyOwner override {
71
+ _componentOwnerService.lock(this);
72
+ }
73
+
74
+ function unlock() external onlyOwner override {
75
+ _componentOwnerService.unlock(this);
76
+ }
77
+
78
+ function getWallet()
79
+ external
80
+ view
81
+ override
82
+ returns (address walletAddress)
83
+ {
84
+ return _wallet;
85
+ }
86
+
87
+ function getToken() external view override returns (IERC20Metadata token) {
88
+ return _token;
89
+ }
90
+
91
+ function getInstance() external view override returns (IInstance instance) {
92
+ return _instance;
93
+ }
94
+ }
@@ -0,0 +1,19 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.19;
3
+
4
+ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
5
+
6
+ import {IRegisterable} from "../shared/IRegisterable.sol";
7
+ import {IInstanceLinked} from "../instance/IInstanceLinked.sol";
8
+
9
+ interface IBaseComponent is IRegisterable, IInstanceLinked {
10
+
11
+ function lock() external;
12
+
13
+ function unlock() external;
14
+
15
+ function getToken() external view returns (IERC20Metadata token);
16
+
17
+ function getWallet() external view returns (address walletAddress);
18
+
19
+ }
@@ -0,0 +1,57 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.19;
3
+
4
+ import {NftId} from "../types/NftId.sol";
5
+ import {Fee} from "../types/Fee.sol";
6
+ import {UFixed} from "../types/UFixed.sol";
7
+ import {IBaseComponent} from "./IBaseComponent.sol";
8
+
9
+ interface IPoolComponent is IBaseComponent {
10
+
11
+ event LogUnderwrittenByPool(NftId policyNftId, uint256 collateralizationAmount, address pool);
12
+
13
+ /**
14
+ * @dev creates a new bundle for this pool.
15
+ */
16
+ function createBundle(
17
+ uint256 initialAmount,
18
+ uint256 lifetime,
19
+ bytes memory filter
20
+ ) external returns(NftId bundleNftId);
21
+
22
+ /**
23
+ * @dev this is a callback function that is called by the product service when underwriting a policy.
24
+ * the pool has the option to check the details and object to underwriting by reverting.
25
+ * the function is only called for "active" pools that ask to be involved/notified
26
+ * by product related state changes.
27
+ */
28
+ function underwrite(
29
+ NftId policyNftId,
30
+ bytes memory policyData,
31
+ bytes memory bundleFilter,
32
+ uint256 collateralizationAmount
33
+ ) external;
34
+
35
+ /**
36
+ * @dev returns true iff the policy application data in policyData matches
37
+ * with the bundle filter criteria encoded in bundleFilter.
38
+ */
39
+ function policyMatchesBundle(
40
+ bytes memory policyData,
41
+ bytes memory bundleFilter
42
+ )
43
+ external
44
+ view
45
+ returns (bool isMatching);
46
+
47
+ function isVerifying() external view returns (bool verifying);
48
+
49
+ function getCollateralizationLevel() external view returns (UFixed collateralizationLevel);
50
+
51
+ function getStakingFee() external view returns (Fee memory stakingFee);
52
+
53
+ function getPerformanceFee()
54
+ external
55
+ view
56
+ returns (Fee memory performanceFee);
57
+ }
@@ -3,14 +3,17 @@ pragma solidity ^0.8.19;
3
3
 
4
4
  import {NftId} from "../types/NftId.sol";
5
5
  import {Fee} from "../types/Fee.sol";
6
+ import {IBaseComponent} from "./IBaseComponent.sol";
6
7
 
7
- interface IProductComponent {
8
- function getPoolNftId() external view returns (NftId poolNftId);
8
+ interface IProductComponent is IBaseComponent {
9
+ function setFees(
10
+ Fee memory policyFee,
11
+ Fee memory processingFee
12
+ ) external;
9
13
 
14
+ function getPoolNftId() external view returns (NftId poolNftId);
15
+
10
16
  function getPolicyFee() external view returns (Fee memory policyFee);
11
17
 
12
- function getProcessingFee()
13
- external
14
- view
15
- returns (Fee memory processingFee);
18
+ function getProcessingFee() external view returns (Fee memory processingFee);
16
19
  }