@etherisc/gif-next 0.0.2-efdb520-159 → 0.0.2-f02157b-803

Sign up to get free protection for your applications and to get access to all the features.
Files changed (361) hide show
  1. package/README.md +176 -11
  2. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +1 -1
  3. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +168 -28
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +4 -0
  5. package/artifacts/contracts/components/Distribution.sol/Distribution.json +610 -0
  6. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +1 -1
  7. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +121 -28
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +4 -0
  9. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +152 -0
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  11. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +74 -181
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  13. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +55 -177
  14. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  15. package/artifacts/contracts/components/Pool.sol/Pool.json +447 -60
  16. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  17. package/artifacts/contracts/components/Product.sol/Product.json +519 -70
  18. package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +4 -0
  19. package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.json +66 -0
  20. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +4 -0
  21. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.json +24 -0
  22. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +4 -0
  23. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.json +42 -0
  24. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
  25. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
  26. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
  27. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
  28. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
  29. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
  30. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
  31. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
  32. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
  33. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
  34. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
  35. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +2 -2
  36. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
  37. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
  38. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
  39. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +2 -2
  40. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
  41. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +2 -2
  42. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
  43. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
  44. package/artifacts/contracts/instance/AccessManagedSimple.sol/AccessManagedSimple.dbg.json +4 -0
  45. package/artifacts/contracts/instance/AccessManagedSimple.sol/AccessManagedSimple.json +101 -0
  46. package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.dbg.json +4 -0
  47. package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.json +1119 -0
  48. package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +4 -0
  49. package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.json +1082 -0
  50. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  51. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +240 -1911
  52. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +4 -0
  53. package/artifacts/contracts/instance/{service/ServiceBase.sol/ServiceBase.json → IInstanceService.sol/IInstanceService.json} +187 -66
  54. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  55. package/artifacts/contracts/instance/Instance.sol/Instance.json +2329 -1158
  56. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +4 -0
  57. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +917 -0
  58. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +4 -0
  59. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +1257 -0
  60. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +4 -0
  61. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +703 -0
  62. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +4 -0
  63. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +424 -0
  64. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +4 -0
  65. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.json +481 -0
  66. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +4 -0
  67. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +113 -0
  68. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
  69. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.json +429 -0
  70. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +4 -0
  71. package/artifacts/contracts/instance/{module/lifecycle/ILifecycle.sol/ILifecycleModule.json → base/ILifecycle.sol/ILifecycle.json} +10 -77
  72. package/artifacts/contracts/instance/base/IService.sol/IService.dbg.json +4 -0
  73. package/artifacts/contracts/instance/{service → base}/IService.sol/IService.json +180 -59
  74. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
  75. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +502 -0
  76. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +4 -0
  77. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +169 -0
  78. package/artifacts/contracts/instance/base/ServiceBase.sol/ServiceBase.dbg.json +4 -0
  79. package/artifacts/contracts/instance/{InstanceBase.sol/InstanceBase.json → base/ServiceBase.sol/ServiceBase.json} +225 -70
  80. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +4 -0
  81. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +211 -0
  82. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +4 -0
  83. package/artifacts/contracts/instance/module/{bundle/IBundle.sol → IBundle.sol}/IBundle.json +1 -1
  84. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +4 -0
  85. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.json +10 -0
  86. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +4 -0
  87. package/artifacts/contracts/instance/module/{policy/IPolicy.sol → IPolicy.sol}/IPolicy.json +1 -1
  88. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +4 -0
  89. package/artifacts/contracts/instance/module/{access/IAccess.sol/IAccess.json → IRisk.sol/IRisk.json} +2 -2
  90. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +4 -0
  91. package/artifacts/contracts/instance/module/{pool/IPoolModule.sol/IPool.json → ISetup.sol/ISetup.json} +2 -2
  92. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +4 -0
  93. package/artifacts/contracts/instance/module/{treasury/ITreasury.sol → ITreasury.sol}/ITreasury.json +1 -1
  94. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +1 -1
  95. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +393 -85
  96. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +1 -1
  97. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.json +182 -80
  98. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +4 -0
  99. package/artifacts/contracts/instance/service/{ComponentServiceBase.sol/ComponentServiceBase.json → IDistributionService.sol/IDistributionService.json} +209 -63
  100. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  101. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +240 -55
  102. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  103. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +330 -56
  104. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  105. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +186 -12
  106. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  107. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +190 -51
  108. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +4 -0
  109. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +872 -0
  110. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +4 -0
  111. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +34 -0
  112. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  113. package/artifacts/contracts/registry/Registry.sol/Registry.json +380 -139
  114. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +4 -0
  115. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +1261 -0
  116. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +4 -0
  117. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +504 -0
  118. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +4 -0
  119. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.json +107 -0
  120. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  121. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +2 -2
  122. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +4 -0
  123. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +127 -0
  124. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  125. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +117 -37
  126. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  127. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +60 -19
  128. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +4 -0
  129. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +158 -0
  130. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +4 -0
  131. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +349 -0
  132. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  133. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +190 -37
  134. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +4 -0
  135. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +96 -0
  136. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
  137. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
  138. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  139. package/artifacts/contracts/shared/Versionable.sol/Versionable.json +83 -19
  140. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  141. package/artifacts/contracts/test/TestFee.sol/TestFee.json +30 -6
  142. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  143. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +204 -36
  144. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  145. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +44 -10
  146. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  147. package/artifacts/contracts/test/TestService.sol/TestService.json +277 -84
  148. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  149. package/artifacts/contracts/test/TestToken.sol/TestUsdc.json +91 -53
  150. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  151. package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +14 -18
  152. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  153. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +106 -50
  154. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +4 -0
  155. package/artifacts/contracts/test/Usdc.sol/USDC.json +376 -0
  156. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  157. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  158. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  159. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +4 -0
  160. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +104 -0
  161. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +4 -0
  162. package/artifacts/contracts/types/Fee.sol/FeeLib.json +257 -0
  163. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +4 -0
  164. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +125 -0
  165. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  166. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +65 -4
  167. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  168. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
  169. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +4 -0
  170. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.json +100 -0
  171. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  172. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
  173. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +4 -0
  174. package/artifacts/contracts/types/Referral.sol/ReferralLib.json +123 -0
  175. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +4 -0
  176. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +86 -0
  177. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +4 -0
  178. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +156 -0
  179. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  180. package/artifacts/contracts/types/StateId.sol/StateIdLib.json +2 -2
  181. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  182. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +15 -2
  183. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +4 -0
  184. package/artifacts/contracts/types/UFixed.sol/MathLib.json +10 -0
  185. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +4 -0
  186. package/artifacts/contracts/types/UFixed.sol/UFixedLib.json +479 -0
  187. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  188. package/artifacts/contracts/types/Version.sol/VersionLib.json +101 -2
  189. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  190. package/artifacts/contracts/types/Version.sol/VersionPartLib.json +2 -2
  191. package/contracts/components/BaseComponent.sol +20 -23
  192. package/contracts/components/Distribution.sol +166 -0
  193. package/contracts/components/IBaseComponent.sol +8 -3
  194. package/contracts/components/IDistributionComponent.sol +43 -0
  195. package/contracts/components/IPoolComponent.sol +14 -9
  196. package/contracts/components/IProductComponent.sol +25 -9
  197. package/contracts/components/Pool.sol +115 -30
  198. package/contracts/components/Product.sol +212 -32
  199. package/contracts/experiment/cloning/Cloner.sol +47 -0
  200. package/contracts/instance/AccessManagedSimple.sol +114 -0
  201. package/contracts/instance/AccessManagerSimple.sol +682 -0
  202. package/contracts/instance/IAccessManagerSimple.sol +391 -0
  203. package/contracts/instance/IInstance.sol +17 -39
  204. package/contracts/instance/IInstanceService.sol +17 -0
  205. package/contracts/instance/Instance.sol +420 -46
  206. package/contracts/instance/InstanceAccessManager.sol +288 -0
  207. package/contracts/instance/InstanceReader.sol +280 -0
  208. package/contracts/instance/InstanceService.sol +102 -0
  209. package/contracts/instance/InstanceServiceManager.sol +56 -0
  210. package/contracts/instance/{service → base}/ComponentServiceBase.sol +13 -5
  211. package/contracts/instance/base/IInstanceBase.sol +23 -0
  212. package/contracts/instance/base/IKeyValueStore.sol +49 -0
  213. package/contracts/instance/base/ILifecycle.sol +30 -0
  214. package/contracts/instance/base/KeyValueStore.sol +172 -0
  215. package/contracts/instance/{module/lifecycle/LifecycleModule.sol → base/Lifecycle.sol} +51 -40
  216. package/contracts/instance/base/ServiceBase.sol +44 -0
  217. package/contracts/instance/module/IAccess.sol +38 -0
  218. package/contracts/instance/module/IBundle.sol +19 -0
  219. package/contracts/instance/module/IDistribution.sol +39 -0
  220. package/contracts/instance/module/IPolicy.sol +45 -0
  221. package/contracts/instance/module/IRisk.sol +11 -0
  222. package/contracts/instance/module/ISetup.sol +43 -0
  223. package/contracts/instance/module/ITreasury.sol +23 -0
  224. package/contracts/instance/service/ComponentOwnerService.sol +245 -102
  225. package/contracts/instance/service/IComponentOwnerService.sol +1 -3
  226. package/contracts/instance/service/IDistributionService.sol +12 -0
  227. package/contracts/instance/service/IPoolService.sol +8 -1
  228. package/contracts/instance/service/IProductService.sol +56 -7
  229. package/contracts/registry/ChainNft.sol +80 -37
  230. package/contracts/registry/IRegistry.sol +28 -28
  231. package/contracts/registry/IRegistryService.sol +35 -0
  232. package/contracts/registry/ITransferInterceptor.sol +6 -0
  233. package/contracts/registry/Registry.sol +315 -273
  234. package/contracts/registry/RegistryService.sol +439 -0
  235. package/contracts/registry/RegistryServiceManager.sol +64 -0
  236. package/contracts/shared/ContractDeployerLib.sol +72 -0
  237. package/contracts/shared/INftOwnable.sol +22 -0
  238. package/contracts/shared/IRegisterable.sol +8 -15
  239. package/contracts/shared/IVersionable.sol +56 -12
  240. package/contracts/shared/NftOwnable.sol +136 -0
  241. package/contracts/shared/ProxyManager.sol +94 -0
  242. package/contracts/shared/Registerable.sol +62 -59
  243. package/contracts/shared/TokenHandler.sol +27 -0
  244. package/contracts/shared/UpgradableProxyWithAdmin.sol +16 -0
  245. package/contracts/shared/Versionable.sol +112 -57
  246. package/contracts/test/TestFee.sol +4 -4
  247. package/contracts/test/TestRegisterable.sol +5 -6
  248. package/contracts/test/TestRoleId.sol +2 -2
  249. package/contracts/test/TestService.sol +7 -16
  250. package/contracts/test/TestVersion.sol +4 -7
  251. package/contracts/test/TestVersionable.sol +2 -5
  252. package/contracts/test/Usdc.sol +26 -0
  253. package/contracts/types/DistributorType.sol +55 -0
  254. package/contracts/types/Fee.sol +44 -20
  255. package/contracts/types/Key32.sol +50 -0
  256. package/contracts/types/NftId.sol +16 -1
  257. package/contracts/types/NumberId.sol +52 -0
  258. package/contracts/types/ObjectType.sol +51 -14
  259. package/contracts/types/Referral.sol +85 -0
  260. package/contracts/types/RiskId.sol +43 -0
  261. package/contracts/types/RoleId.sol +57 -11
  262. package/contracts/types/StateId.sol +8 -2
  263. package/contracts/types/Timestamp.sol +7 -3
  264. package/contracts/types/UFixed.sol +144 -25
  265. package/contracts/types/Version.sol +38 -25
  266. package/package.json +4 -3
  267. package/artifacts/contracts/instance/IInstanceLinked.sol/IInstanceLinked.dbg.json +0 -4
  268. package/artifacts/contracts/instance/IInstanceLinked.sol/IInstanceLinked.json +0 -24
  269. package/artifacts/contracts/instance/IServiceLinked.sol/IServiceLinked.dbg.json +0 -4
  270. package/artifacts/contracts/instance/IServiceLinked.sol/IServiceLinked.json +0 -50
  271. package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +0 -4
  272. package/artifacts/contracts/instance/module/access/Access.sol/AccessModule.dbg.json +0 -4
  273. package/artifacts/contracts/instance/module/access/Access.sol/AccessModule.json +0 -333
  274. package/artifacts/contracts/instance/module/access/IAccess.sol/IAccess.dbg.json +0 -4
  275. package/artifacts/contracts/instance/module/access/IAccess.sol/IAccessModule.dbg.json +0 -4
  276. package/artifacts/contracts/instance/module/access/IAccess.sol/IAccessModule.json +0 -333
  277. package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.dbg.json +0 -4
  278. package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.json +0 -276
  279. package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundle.dbg.json +0 -4
  280. package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.dbg.json +0 -4
  281. package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.json +0 -276
  282. package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.dbg.json +0 -4
  283. package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.json +0 -188
  284. package/artifacts/contracts/instance/module/component/IComponent.sol/IComponent.dbg.json +0 -4
  285. package/artifacts/contracts/instance/module/component/IComponent.sol/IComponent.json +0 -10
  286. package/artifacts/contracts/instance/module/component/IComponent.sol/IComponentModule.dbg.json +0 -4
  287. package/artifacts/contracts/instance/module/component/IComponent.sol/IComponentModule.json +0 -188
  288. package/artifacts/contracts/instance/module/lifecycle/ILifecycle.sol/ILifecycle.dbg.json +0 -4
  289. package/artifacts/contracts/instance/module/lifecycle/ILifecycle.sol/ILifecycle.json +0 -134
  290. package/artifacts/contracts/instance/module/lifecycle/ILifecycle.sol/ILifecycleModule.dbg.json +0 -4
  291. package/artifacts/contracts/instance/module/lifecycle/LifecycleModule.sol/LifecycleModule.dbg.json +0 -4
  292. package/artifacts/contracts/instance/module/lifecycle/LifecycleModule.sol/LifecycleModule.json +0 -221
  293. package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicy.dbg.json +0 -4
  294. package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicyModule.dbg.json +0 -4
  295. package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicyModule.json +0 -261
  296. package/artifacts/contracts/instance/module/policy/PolicyModule.sol/PolicyModule.dbg.json +0 -4
  297. package/artifacts/contracts/instance/module/policy/PolicyModule.sol/PolicyModule.json +0 -261
  298. package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPool.dbg.json +0 -4
  299. package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPoolModule.dbg.json +0 -4
  300. package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPoolModule.json +0 -149
  301. package/artifacts/contracts/instance/module/pool/PoolModule.sol/PoolModule.dbg.json +0 -4
  302. package/artifacts/contracts/instance/module/pool/PoolModule.sol/PoolModule.json +0 -149
  303. package/artifacts/contracts/instance/module/product/IProductModule.sol/IProductModule.dbg.json +0 -4
  304. package/artifacts/contracts/instance/module/product/IProductModule.sol/IProductModule.json +0 -10
  305. package/artifacts/contracts/instance/module/product/ProductModule.sol/ProductModule.dbg.json +0 -4
  306. package/artifacts/contracts/instance/module/product/ProductModule.sol/ProductModule.json +0 -10
  307. package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasury.dbg.json +0 -4
  308. package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasuryModule.dbg.json +0 -4
  309. package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasuryModule.json +0 -538
  310. package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.dbg.json +0 -4
  311. package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.json +0 -76
  312. package/artifacts/contracts/instance/module/treasury/TreasuryModule.sol/TreasuryModule.dbg.json +0 -4
  313. package/artifacts/contracts/instance/module/treasury/TreasuryModule.sol/TreasuryModule.json +0 -538
  314. package/artifacts/contracts/instance/service/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
  315. package/artifacts/contracts/instance/service/IService.sol/IService.dbg.json +0 -4
  316. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +0 -4
  317. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +0 -499
  318. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +0 -4
  319. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +0 -685
  320. package/artifacts/contracts/instance/service/ServiceBase.sol/ServiceBase.dbg.json +0 -4
  321. package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +0 -4
  322. package/artifacts/contracts/registry/IChainNft.sol/IChainNft.json +0 -452
  323. package/artifacts/contracts/registry/IRegistryLinked.sol/IRegistryLinked.dbg.json +0 -4
  324. package/artifacts/contracts/registry/IRegistryLinked.sol/IRegistryLinked.json +0 -24
  325. package/artifacts/contracts/shared/IOwnable.sol/IOwnable.dbg.json +0 -4
  326. package/artifacts/contracts/shared/IOwnable.sol/IOwnable.json +0 -24
  327. package/artifacts/contracts/test/TestPool.sol/TestPool.dbg.json +0 -4
  328. package/artifacts/contracts/test/TestPool.sol/TestPool.json +0 -387
  329. package/artifacts/contracts/test/TestProduct.sol/TestProduct.dbg.json +0 -4
  330. package/artifacts/contracts/test/TestProduct.sol/TestProduct.json +0 -393
  331. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.dbg.json +0 -4
  332. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.json +0 -453
  333. package/contracts/experiment/statemachine/README.md +0 -112
  334. package/contracts/instance/IInstanceLinked.sol +0 -8
  335. package/contracts/instance/IServiceLinked.sol +0 -12
  336. package/contracts/instance/InstanceBase.sol +0 -74
  337. package/contracts/instance/module/access/Access.sol +0 -149
  338. package/contracts/instance/module/access/IAccess.sol +0 -53
  339. package/contracts/instance/module/bundle/BundleModule.sol +0 -228
  340. package/contracts/instance/module/bundle/IBundle.sol +0 -53
  341. package/contracts/instance/module/component/ComponentModule.sol +0 -104
  342. package/contracts/instance/module/component/IComponent.sol +0 -53
  343. package/contracts/instance/module/lifecycle/ILifecycle.sol +0 -47
  344. package/contracts/instance/module/policy/IPolicy.sol +0 -60
  345. package/contracts/instance/module/policy/PolicyModule.sol +0 -84
  346. package/contracts/instance/module/pool/IPoolModule.sol +0 -41
  347. package/contracts/instance/module/pool/PoolModule.sol +0 -87
  348. package/contracts/instance/module/product/IProductModule.sol +0 -6
  349. package/contracts/instance/module/product/ProductModule.sol +0 -8
  350. package/contracts/instance/module/treasury/ITreasury.sol +0 -104
  351. package/contracts/instance/module/treasury/TokenHandler.sol +0 -48
  352. package/contracts/instance/module/treasury/TreasuryModule.sol +0 -148
  353. package/contracts/instance/service/PoolService.sol +0 -98
  354. package/contracts/instance/service/ProductService.sol +0 -358
  355. package/contracts/instance/service/ServiceBase.sol +0 -39
  356. package/contracts/registry/IChainNft.sol +0 -21
  357. package/contracts/registry/IRegistryLinked.sol +0 -8
  358. package/contracts/shared/IOwnable.sol +0 -6
  359. package/contracts/test/TestPool.sol +0 -22
  360. package/contracts/test/TestProduct.sol +0 -44
  361. /package/contracts/instance/{service → base}/IService.sol +0 -0
@@ -1,453 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "UFixedMathLib",
4
- "sourceName": "contracts/types/UFixed.sol",
5
- "abi": [
6
- {
7
- "inputs": [],
8
- "name": "EXP",
9
- "outputs": [
10
- {
11
- "internalType": "int8",
12
- "name": "",
13
- "type": "int8"
14
- }
15
- ],
16
- "stateMutability": "view",
17
- "type": "function"
18
- },
19
- {
20
- "inputs": [],
21
- "name": "MULTIPLIER",
22
- "outputs": [
23
- {
24
- "internalType": "uint256",
25
- "name": "",
26
- "type": "uint256"
27
- }
28
- ],
29
- "stateMutability": "view",
30
- "type": "function"
31
- },
32
- {
33
- "inputs": [],
34
- "name": "MULTIPLIER_HALF",
35
- "outputs": [
36
- {
37
- "internalType": "uint256",
38
- "name": "",
39
- "type": "uint256"
40
- }
41
- ],
42
- "stateMutability": "view",
43
- "type": "function"
44
- },
45
- {
46
- "inputs": [],
47
- "name": "ROUNDING_DEFAULT",
48
- "outputs": [
49
- {
50
- "internalType": "enum UFixedMathLib.Rounding",
51
- "name": "",
52
- "type": "UFixedMathLib.Rounding"
53
- }
54
- ],
55
- "stateMutability": "view",
56
- "type": "function"
57
- },
58
- {
59
- "inputs": [
60
- {
61
- "internalType": "UFixed",
62
- "name": "a",
63
- "type": "uint256"
64
- },
65
- {
66
- "internalType": "UFixed",
67
- "name": "b",
68
- "type": "uint256"
69
- }
70
- ],
71
- "name": "add",
72
- "outputs": [
73
- {
74
- "internalType": "UFixed",
75
- "name": "",
76
- "type": "uint256"
77
- }
78
- ],
79
- "stateMutability": "pure",
80
- "type": "function"
81
- },
82
- {
83
- "inputs": [],
84
- "name": "decimals",
85
- "outputs": [
86
- {
87
- "internalType": "uint256",
88
- "name": "",
89
- "type": "uint256"
90
- }
91
- ],
92
- "stateMutability": "pure",
93
- "type": "function"
94
- },
95
- {
96
- "inputs": [
97
- {
98
- "internalType": "UFixed",
99
- "name": "a",
100
- "type": "uint256"
101
- },
102
- {
103
- "internalType": "UFixed",
104
- "name": "b",
105
- "type": "uint256"
106
- }
107
- ],
108
- "name": "delta",
109
- "outputs": [
110
- {
111
- "internalType": "UFixed",
112
- "name": "",
113
- "type": "uint256"
114
- }
115
- ],
116
- "stateMutability": "pure",
117
- "type": "function"
118
- },
119
- {
120
- "inputs": [
121
- {
122
- "internalType": "UFixed",
123
- "name": "a",
124
- "type": "uint256"
125
- },
126
- {
127
- "internalType": "UFixed",
128
- "name": "b",
129
- "type": "uint256"
130
- }
131
- ],
132
- "name": "div",
133
- "outputs": [
134
- {
135
- "internalType": "UFixed",
136
- "name": "",
137
- "type": "uint256"
138
- }
139
- ],
140
- "stateMutability": "pure",
141
- "type": "function"
142
- },
143
- {
144
- "inputs": [
145
- {
146
- "internalType": "UFixed",
147
- "name": "a",
148
- "type": "uint256"
149
- },
150
- {
151
- "internalType": "UFixed",
152
- "name": "b",
153
- "type": "uint256"
154
- }
155
- ],
156
- "name": "eq",
157
- "outputs": [
158
- {
159
- "internalType": "bool",
160
- "name": "isEqual",
161
- "type": "bool"
162
- }
163
- ],
164
- "stateMutability": "pure",
165
- "type": "function"
166
- },
167
- {
168
- "inputs": [
169
- {
170
- "internalType": "UFixed",
171
- "name": "a",
172
- "type": "uint256"
173
- }
174
- ],
175
- "name": "eqz",
176
- "outputs": [
177
- {
178
- "internalType": "bool",
179
- "name": "isZero",
180
- "type": "bool"
181
- }
182
- ],
183
- "stateMutability": "pure",
184
- "type": "function"
185
- },
186
- {
187
- "inputs": [
188
- {
189
- "internalType": "UFixed",
190
- "name": "a",
191
- "type": "uint256"
192
- },
193
- {
194
- "internalType": "UFixed",
195
- "name": "b",
196
- "type": "uint256"
197
- }
198
- ],
199
- "name": "gt",
200
- "outputs": [
201
- {
202
- "internalType": "bool",
203
- "name": "isGreaterThan",
204
- "type": "bool"
205
- }
206
- ],
207
- "stateMutability": "pure",
208
- "type": "function"
209
- },
210
- {
211
- "inputs": [
212
- {
213
- "internalType": "UFixed",
214
- "name": "a",
215
- "type": "uint256"
216
- },
217
- {
218
- "internalType": "UFixed",
219
- "name": "b",
220
- "type": "uint256"
221
- }
222
- ],
223
- "name": "gte",
224
- "outputs": [
225
- {
226
- "internalType": "bool",
227
- "name": "isGreaterThan",
228
- "type": "bool"
229
- }
230
- ],
231
- "stateMutability": "pure",
232
- "type": "function"
233
- },
234
- {
235
- "inputs": [
236
- {
237
- "internalType": "UFixed",
238
- "name": "a",
239
- "type": "uint256"
240
- }
241
- ],
242
- "name": "gtz",
243
- "outputs": [
244
- {
245
- "internalType": "bool",
246
- "name": "isZero",
247
- "type": "bool"
248
- }
249
- ],
250
- "stateMutability": "pure",
251
- "type": "function"
252
- },
253
- {
254
- "inputs": [
255
- {
256
- "internalType": "UFixed",
257
- "name": "a",
258
- "type": "uint256"
259
- },
260
- {
261
- "internalType": "UFixed",
262
- "name": "b",
263
- "type": "uint256"
264
- }
265
- ],
266
- "name": "lt",
267
- "outputs": [
268
- {
269
- "internalType": "bool",
270
- "name": "isGreaterThan",
271
- "type": "bool"
272
- }
273
- ],
274
- "stateMutability": "pure",
275
- "type": "function"
276
- },
277
- {
278
- "inputs": [
279
- {
280
- "internalType": "UFixed",
281
- "name": "a",
282
- "type": "uint256"
283
- },
284
- {
285
- "internalType": "UFixed",
286
- "name": "b",
287
- "type": "uint256"
288
- }
289
- ],
290
- "name": "lte",
291
- "outputs": [
292
- {
293
- "internalType": "bool",
294
- "name": "isGreaterThan",
295
- "type": "bool"
296
- }
297
- ],
298
- "stateMutability": "pure",
299
- "type": "function"
300
- },
301
- {
302
- "inputs": [
303
- {
304
- "internalType": "UFixed",
305
- "name": "a",
306
- "type": "uint256"
307
- },
308
- {
309
- "internalType": "UFixed",
310
- "name": "b",
311
- "type": "uint256"
312
- }
313
- ],
314
- "name": "mul",
315
- "outputs": [
316
- {
317
- "internalType": "UFixed",
318
- "name": "",
319
- "type": "uint256"
320
- }
321
- ],
322
- "stateMutability": "pure",
323
- "type": "function"
324
- },
325
- {
326
- "inputs": [
327
- {
328
- "internalType": "UFixed",
329
- "name": "a",
330
- "type": "uint256"
331
- },
332
- {
333
- "internalType": "UFixed",
334
- "name": "b",
335
- "type": "uint256"
336
- }
337
- ],
338
- "name": "sub",
339
- "outputs": [
340
- {
341
- "internalType": "UFixed",
342
- "name": "",
343
- "type": "uint256"
344
- }
345
- ],
346
- "stateMutability": "pure",
347
- "type": "function"
348
- },
349
- {
350
- "inputs": [
351
- {
352
- "internalType": "UFixed",
353
- "name": "a",
354
- "type": "uint256"
355
- }
356
- ],
357
- "name": "toInt",
358
- "outputs": [
359
- {
360
- "internalType": "uint256",
361
- "name": "",
362
- "type": "uint256"
363
- }
364
- ],
365
- "stateMutability": "pure",
366
- "type": "function"
367
- },
368
- {
369
- "inputs": [
370
- {
371
- "internalType": "UFixed",
372
- "name": "a",
373
- "type": "uint256"
374
- },
375
- {
376
- "internalType": "enum UFixedMathLib.Rounding",
377
- "name": "rounding",
378
- "type": "UFixedMathLib.Rounding"
379
- }
380
- ],
381
- "name": "toIntWithRounding",
382
- "outputs": [
383
- {
384
- "internalType": "uint256",
385
- "name": "",
386
- "type": "uint256"
387
- }
388
- ],
389
- "stateMutability": "pure",
390
- "type": "function"
391
- },
392
- {
393
- "inputs": [
394
- {
395
- "internalType": "uint256",
396
- "name": "a",
397
- "type": "uint256"
398
- },
399
- {
400
- "internalType": "int8",
401
- "name": "exp",
402
- "type": "int8"
403
- }
404
- ],
405
- "name": "toUFixed",
406
- "outputs": [
407
- {
408
- "internalType": "UFixed",
409
- "name": "",
410
- "type": "uint256"
411
- }
412
- ],
413
- "stateMutability": "pure",
414
- "type": "function"
415
- },
416
- {
417
- "inputs": [
418
- {
419
- "internalType": "uint256",
420
- "name": "a",
421
- "type": "uint256"
422
- }
423
- ],
424
- "name": "toUFixed",
425
- "outputs": [
426
- {
427
- "internalType": "UFixed",
428
- "name": "",
429
- "type": "uint256"
430
- }
431
- ],
432
- "stateMutability": "pure",
433
- "type": "function"
434
- },
435
- {
436
- "inputs": [],
437
- "name": "zero",
438
- "outputs": [
439
- {
440
- "internalType": "UFixed",
441
- "name": "",
442
- "type": "uint256"
443
- }
444
- ],
445
- "stateMutability": "pure",
446
- "type": "function"
447
- }
448
- ],
449
- "bytecode": "0x610a4d61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061014c5760003560e01c80637a858b97116100c2578063c8a4ac9c11610086578063c8a4ac9c14610289578063cc8b7b731461029c578063df739011146102af578063ea6515c4146102c2578063eb646d71146102d5578063f30ed598146102dd57600080fd5b80637a858b9714610236578063a391c15b14610249578063b47733291461025c578063b67d77c51461026f578063bc1b392d1461028257600080fd5b8063313ce56711610114578063313ce567146101d057806332148d73146101d757806344aa6836146101ea57806345ebb61e146101fd578063753b14a514610210578063771602f71461022357600080fd5b8063059f8b1614610151578063118fc88c1461016c5780631488c8451461018f5780631a12cd47146101a257806321e5749b146101bd575b600080fd5b6101596102f2565b6040519081526020015b60405180910390f35b61017f61017a366004610794565b610301565b6040519015158152602001610163565b61015961019d3660046107b6565b610310565b6101aa601281565b60405160009190910b8152602001610163565b61017f6101cb366004610794565b6103f2565b6012610159565b61017f6101e5366004610794565b6103fc565b6101596101f83660046107ec565b610406565b61015961020b3660046107ec565b610413565b61017f61021e3660046107ec565b61042b565b610159610231366004610794565b610434565b61017f6102443660046107ec565b610440565b610159610257366004610794565b61044a565b61017f61026a366004610794565b610456565b61015961027d366004610794565b610461565b6000610159565b610159610297366004610794565b61046d565b6101596102aa366004610794565b610479565b6101596102bd366004610805565b610485565b61017f6102d0366004610794565b610525565b610159610530565b6102e5600281565b6040516101639190610844565b6102fe6012600a610966565b81565b60008282115b90505b92915050565b60008061031e836012610972565b60000b12156103745760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031303a4558504f4e454e545f544f4f5f534d414c4c0060448201526064015b60405180910390fd5b6040610381836012610972565b60000b13156103d25760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031313a4558504f4e454e545f544f4f5f4c4152474500604482015260640161036b565b6103dd826012610972565b6103e890600a610993565b61030790846109a2565b6000828210610307565b6000818314610307565b600061030a826002610485565b60006104216012600a610966565b61030a90836109a2565b6000811561030a565b60006103078383610548565b600081151561030a565b60006103078383610554565b600082821115610307565b600061030783836105b8565b60006103078383610614565b60006103078383610629565b6000600282600281111561049b5761049b61082e565b036104e1576104da60026104b16012600a610966565b6104bb91906109cf565b6104c590856109f1565b60016104d36012600a610966565b6000610647565b905061030a565b60008260028111156104f5576104f561082e565b0361050c576104da8360016104d36012600a610966565b6104da83600161051e6012600a610966565b6001610647565b600082821015610307565b600261053e6012600a610966565b6102fe91906109cf565b600061030782846109f1565b60008082116105a55760405162461bcd60e51b815260206004820152601a60248201527f4552524f523a55464d2d3032303a44495649534f525f5a45524f000000000000604482015260640161036b565b61030783670de0b6b3a7640000846106a4565b60008282111561060a5760405162461bcd60e51b815260206004820152601d60248201527f4552524f523a55464d2d3031303a4e454741544956455f524553554c54000000604482015260640161036b565b6103078284610a04565b60006103078383670de0b6b3a76400006106a4565b60008282101561063d576104da83836105b8565b61030782846105b8565b6000806106558686866106a4565b9050600183600281111561066b5761066b61082e565b148015610688575060008480610683576106836109b9565b868809115b1561069b576106986001826109f1565b90505b95945050505050565b60008080600019858709858702925082811083820303915050806000036106de578382816106d4576106d46109b9565b049250505061078d565b8084116107255760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b604482015260640161036b565b600084868809851960019081018716968790049682860381900495909211909303600082900391909104909201919091029190911760038402600290811880860282030280860282030280860282030280860282030280860282030280860290910302029150505b9392505050565b600080604083850312156107a757600080fd5b50508035926020909101359150565b600080604083850312156107c957600080fd5b8235915060208301358060000b81146107e157600080fd5b809150509250929050565b6000602082840312156107fe57600080fd5b5035919050565b6000806040838503121561081857600080fd5b823591506020830135600381106107e157600080fd5b634e487b7160e01b600052602160045260246000fd5b602081016003831061086657634e487b7160e01b600052602160045260246000fd5b91905290565b634e487b7160e01b600052601160045260246000fd5b600181815b808511156108bd5781600019048211156108a3576108a361086c565b808516156108b057918102915b93841c9390800290610887565b509250929050565b6000826108d45750600161030a565b816108e15750600061030a565b81600181146108f757600281146109015761091d565b600191505061030a565b60ff8411156109125761091261086c565b50506001821b61030a565b5060208310610133831016604e8410600b8410161715610940575081810a61030a565b61094a8383610882565b806000190482111561095e5761095e61086c565b029392505050565b600061030783836108c5565b600081810b9083900b01607f8113607f198212171561030a5761030a61086c565b600061030760ff8416836108c5565b808202811582820484141761030a5761030a61086c565b634e487b7160e01b600052601260045260246000fd5b6000826109ec57634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561030a5761030a61086c565b8181038181111561030a5761030a61086c56fea26469706673582212203e54f48eab75437862b6140e654746538ce5d107025fea2883a132e04e5d771c64736f6c63430008140033",
450
- "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061014c5760003560e01c80637a858b97116100c2578063c8a4ac9c11610086578063c8a4ac9c14610289578063cc8b7b731461029c578063df739011146102af578063ea6515c4146102c2578063eb646d71146102d5578063f30ed598146102dd57600080fd5b80637a858b9714610236578063a391c15b14610249578063b47733291461025c578063b67d77c51461026f578063bc1b392d1461028257600080fd5b8063313ce56711610114578063313ce567146101d057806332148d73146101d757806344aa6836146101ea57806345ebb61e146101fd578063753b14a514610210578063771602f71461022357600080fd5b8063059f8b1614610151578063118fc88c1461016c5780631488c8451461018f5780631a12cd47146101a257806321e5749b146101bd575b600080fd5b6101596102f2565b6040519081526020015b60405180910390f35b61017f61017a366004610794565b610301565b6040519015158152602001610163565b61015961019d3660046107b6565b610310565b6101aa601281565b60405160009190910b8152602001610163565b61017f6101cb366004610794565b6103f2565b6012610159565b61017f6101e5366004610794565b6103fc565b6101596101f83660046107ec565b610406565b61015961020b3660046107ec565b610413565b61017f61021e3660046107ec565b61042b565b610159610231366004610794565b610434565b61017f6102443660046107ec565b610440565b610159610257366004610794565b61044a565b61017f61026a366004610794565b610456565b61015961027d366004610794565b610461565b6000610159565b610159610297366004610794565b61046d565b6101596102aa366004610794565b610479565b6101596102bd366004610805565b610485565b61017f6102d0366004610794565b610525565b610159610530565b6102e5600281565b6040516101639190610844565b6102fe6012600a610966565b81565b60008282115b90505b92915050565b60008061031e836012610972565b60000b12156103745760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031303a4558504f4e454e545f544f4f5f534d414c4c0060448201526064015b60405180910390fd5b6040610381836012610972565b60000b13156103d25760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031313a4558504f4e454e545f544f4f5f4c4152474500604482015260640161036b565b6103dd826012610972565b6103e890600a610993565b61030790846109a2565b6000828210610307565b6000818314610307565b600061030a826002610485565b60006104216012600a610966565b61030a90836109a2565b6000811561030a565b60006103078383610548565b600081151561030a565b60006103078383610554565b600082821115610307565b600061030783836105b8565b60006103078383610614565b60006103078383610629565b6000600282600281111561049b5761049b61082e565b036104e1576104da60026104b16012600a610966565b6104bb91906109cf565b6104c590856109f1565b60016104d36012600a610966565b6000610647565b905061030a565b60008260028111156104f5576104f561082e565b0361050c576104da8360016104d36012600a610966565b6104da83600161051e6012600a610966565b6001610647565b600082821015610307565b600261053e6012600a610966565b6102fe91906109cf565b600061030782846109f1565b60008082116105a55760405162461bcd60e51b815260206004820152601a60248201527f4552524f523a55464d2d3032303a44495649534f525f5a45524f000000000000604482015260640161036b565b61030783670de0b6b3a7640000846106a4565b60008282111561060a5760405162461bcd60e51b815260206004820152601d60248201527f4552524f523a55464d2d3031303a4e454741544956455f524553554c54000000604482015260640161036b565b6103078284610a04565b60006103078383670de0b6b3a76400006106a4565b60008282101561063d576104da83836105b8565b61030782846105b8565b6000806106558686866106a4565b9050600183600281111561066b5761066b61082e565b148015610688575060008480610683576106836109b9565b868809115b1561069b576106986001826109f1565b90505b95945050505050565b60008080600019858709858702925082811083820303915050806000036106de578382816106d4576106d46109b9565b049250505061078d565b8084116107255760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b604482015260640161036b565b600084868809851960019081018716968790049682860381900495909211909303600082900391909104909201919091029190911760038402600290811880860282030280860282030280860282030280860282030280860282030280860290910302029150505b9392505050565b600080604083850312156107a757600080fd5b50508035926020909101359150565b600080604083850312156107c957600080fd5b8235915060208301358060000b81146107e157600080fd5b809150509250929050565b6000602082840312156107fe57600080fd5b5035919050565b6000806040838503121561081857600080fd5b823591506020830135600381106107e157600080fd5b634e487b7160e01b600052602160045260246000fd5b602081016003831061086657634e487b7160e01b600052602160045260246000fd5b91905290565b634e487b7160e01b600052601160045260246000fd5b600181815b808511156108bd5781600019048211156108a3576108a361086c565b808516156108b057918102915b93841c9390800290610887565b509250929050565b6000826108d45750600161030a565b816108e15750600061030a565b81600181146108f757600281146109015761091d565b600191505061030a565b60ff8411156109125761091261086c565b50506001821b61030a565b5060208310610133831016604e8410600b8410161715610940575081810a61030a565b61094a8383610882565b806000190482111561095e5761095e61086c565b029392505050565b600061030783836108c5565b600081810b9083900b01607f8113607f198212171561030a5761030a61086c565b600061030760ff8416836108c5565b808202811582820484141761030a5761030a61086c565b634e487b7160e01b600052601260045260246000fd5b6000826109ec57634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561030a5761030a61086c565b8181038181111561030a5761030a61086c56fea26469706673582212203e54f48eab75437862b6140e654746538ce5d107025fea2883a132e04e5d771c64736f6c63430008140033",
451
- "linkReferences": {},
452
- "deployedLinkReferences": {}
453
- }
@@ -1,112 +0,0 @@
1
- # State Machines
2
-
3
- Most GIF objects have a life cycle defined by a state machine.
4
-
5
- For each object type the set of possible states is defined together with its initial state and the set of valid state transitions.
6
-
7
- ## Object Types without States
8
-
9
- * Protocol
10
- * Chains
11
- * Registries (both chain and main registry)
12
-
13
- ## Object Types with States
14
-
15
- * Tokens
16
- * Instances
17
- * Products
18
- * Oracles
19
- * Pools
20
- * Bundles
21
- * Policies
22
- * Claim (non-NFT)
23
- * Payout (non-NFT)
24
-
25
- ### Simple State Machine
26
-
27
- Valid states
28
-
29
- * Active (initial state)
30
- * Paused
31
- * Archived (final state)
32
-
33
- Valid state transitions:
34
-
35
- * Active -> Paused
36
- * Paused -> Active
37
- * Paused -> Archived
38
-
39
-
40
- Candidate object types for simple state machine
41
-
42
- * Token
43
- * Instance
44
- * Product
45
- * Oracle
46
- * Pool
47
-
48
- To discuss:
49
-
50
- * Archived is final state
51
- * What mechanism should exist to revert an unintended transition to 'Archived' state. Should there be such a mechanism?
52
- * What mechanism should exist when the NFT of such an object is burned prematurely. Should there be such a mechanism
53
-
54
- ### Bundle State Machine
55
-
56
- Valid states
57
-
58
- * Active (initial state)
59
- * Paused
60
- * Expired (implicit state)
61
- * Closed (final state)
62
-
63
- Expired is not an explicit state.
64
- A bundle is expired for block.timestamp >= expiredAt
65
-
66
- ### Policy State Machine
67
-
68
- Valid states
69
-
70
- * Applied (initial state)
71
- * Revoked (final state)
72
- * Declined (final state)
73
- * Active
74
- * Expired (implicit state)
75
- * Closed (final state)
76
-
77
- Expired is not an explicit state.
78
- A policy is expired for block.timestamp >= expiredAt
79
-
80
- To discuss:
81
-
82
- * Should 'Closed' be less explicit using a closedAt state variable?
83
- * Or even more lighweight? ie. block.timestamp >= expiredAt and no open claims
84
-
85
- Valid state transitions:
86
-
87
- * Applied -> Revoked
88
- * Applied -> Declined
89
- * Applied -> Active
90
- * Active -> Closed (needs to be expired)
91
-
92
- ### Claim State Machine
93
-
94
- Valid states
95
- * Applied (initial state)
96
- * Confirmed
97
- * Declined (final state)
98
- * Closed (final state)
99
-
100
- Valid state transitions:
101
- * Applied -> Confirmed
102
- * Applied -> Declined
103
- * Confirmed -> Closed
104
-
105
- ### Payout State Machine
106
-
107
- Valid states
108
- * Expected
109
- * PaidOut
110
-
111
- Valid state transitions:
112
- * Expected -> PaidOut
@@ -1,8 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.19;
3
-
4
- import {IInstance} from "./IInstance.sol";
5
-
6
- interface IInstanceLinked {
7
- function getInstance() external view returns (IInstance instance);
8
- }
@@ -1,12 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.19;
3
-
4
- import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
5
- import {IProductService} from "./service/IProductService.sol";
6
- import {IPoolService} from "./service/IPoolService.sol";
7
-
8
- interface IServiceLinked {
9
- function getComponentOwnerService() external view returns(IComponentOwnerService service);
10
- function getProductService() external view returns(IProductService service);
11
- function getPoolService() external view returns(IPoolService service);
12
- }
@@ -1,74 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.19;
3
-
4
- import {Versionable} from "../shared/Versionable.sol";
5
- import {Registerable} from "../shared/Registerable.sol";
6
- // import {IRegistry} from "../registry/IRegistry.sol";
7
-
8
- // import {IInstance} from "./IInstance.sol";
9
- import {ObjectType, INSTANCE} from "../types/ObjectType.sol";
10
- import {NftId} from "../types/NftId.sol";
11
- import {Version, VersionPart, toVersion, toVersionPart} from "../types/Version.sol";
12
-
13
- import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
14
- import {IProductService} from "./service/IProductService.sol";
15
- import {IPoolService} from "./service/IPoolService.sol";
16
-
17
- import {IServiceLinked} from "./IServiceLinked.sol";
18
- import {IInstance} from "./IInstance.sol";
19
-
20
- abstract contract InstanceBase is
21
- Versionable,
22
- Registerable,
23
- IServiceLinked
24
- {
25
- IComponentOwnerService internal _componentOwnerService;
26
- IProductService internal _productService;
27
- IPoolService internal _poolService;
28
-
29
- constructor(
30
- address registry,
31
- NftId registryNftId
32
- )
33
- Registerable(registry, registryNftId)
34
- Versionable()
35
- {
36
- _registerInterface(type(IInstance).interfaceId);
37
- _linkToServicesInRegistry();
38
- }
39
-
40
- // from versionable
41
- function getVersion()
42
- public
43
- pure
44
- virtual override
45
- returns(Version)
46
- {
47
- return toVersion(
48
- toVersionPart(3),
49
- toVersionPart(0),
50
- toVersionPart(0));
51
- }
52
-
53
- // from registerable
54
- function getType() external pure override returns (ObjectType objectType) {
55
- return INSTANCE();
56
- }
57
-
58
-
59
- // internal / private functions
60
- function _linkToServicesInRegistry() internal {
61
- VersionPart majorVersion = getVersion().toMajorPart();
62
- _componentOwnerService = IComponentOwnerService(_getAndCheck("ComponentOwnerService", majorVersion));
63
- _productService = IProductService(_getAndCheck("ProductService", majorVersion));
64
- _poolService = IPoolService(_getAndCheck("PoolService", majorVersion));
65
- }
66
-
67
- function _getAndCheck(string memory serviceName, VersionPart majorVersion) internal view returns (address serviceAddress) {
68
- serviceAddress = _registry.getServiceAddress(serviceName, majorVersion);
69
- require(
70
- serviceAddress != address(0),
71
- "ERROR:INS-001:NOT_REGISTERED"
72
- );
73
- }
74
- }