@etherisc/gif-next 0.0.2-d64ea51-772 → 0.0.2-d8b116d-201

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/README.md +43 -0
  2. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +1 -1
  3. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.json +2 -2
  5. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +1 -1
  6. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  7. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  8. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +2 -2
  9. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  10. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  11. package/artifacts/contracts/components/Pool.sol/Pool.json +16 -11
  12. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  13. package/artifacts/contracts/components/Product.sol/Product.json +13 -8
  14. package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +1 -1
  15. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +1 -1
  16. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +1 -1
  17. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
  18. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
  19. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
  20. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
  21. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
  22. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
  23. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
  24. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
  25. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
  26. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
  27. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
  28. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
  29. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
  30. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
  31. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
  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/AccessManagedSimple.sol/AccessManagedSimple.dbg.json +1 -1
  35. package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.dbg.json +1 -1
  36. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +4 -0
  37. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +750 -0
  38. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +4 -0
  39. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.json +185 -0
  40. package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +1 -1
  41. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  42. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +20 -0
  43. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  44. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  45. package/artifacts/contracts/instance/Instance.sol/Instance.json +52 -32
  46. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  47. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +2 -2
  48. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  49. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +38 -28
  50. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  51. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +2 -2
  52. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  53. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +2 -2
  54. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +4 -0
  55. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +272 -0
  56. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +1 -1
  57. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +1 -1
  58. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  59. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  60. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  61. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  62. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  63. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  64. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  65. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  66. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  67. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
  68. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
  69. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +1 -1
  70. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +2 -2
  71. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
  72. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +2 -2
  73. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  74. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +2 -2
  75. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +1 -1
  76. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  77. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  78. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +21 -0
  79. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  80. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  81. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +59 -14
  82. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  83. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +20 -8
  84. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  85. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +24 -24
  86. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  87. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +13 -13
  88. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  89. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  90. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  91. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  92. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  93. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  94. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +2 -2
  95. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  96. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +2 -2
  97. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  98. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  99. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  100. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  101. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  102. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  103. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  104. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  105. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  106. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  107. package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +1 -1
  108. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  109. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  110. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  111. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  112. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  113. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  114. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  115. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  116. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  117. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  118. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  119. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  120. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  121. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  122. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  123. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  124. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  125. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  126. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  127. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  128. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +26 -3
  129. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  130. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  131. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  132. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  133. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  134. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  135. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  136. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  137. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  138. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  139. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  140. package/contracts/components/IPoolComponent.sol +1 -1
  141. package/contracts/components/Pool.sol +7 -6
  142. package/contracts/components/Product.sol +1 -0
  143. package/contracts/instance/BundleManager.sol +143 -0
  144. package/contracts/instance/Cloneable.sol +47 -0
  145. package/contracts/instance/InstanceService.sol +3 -0
  146. package/contracts/instance/ObjectManager.sol +95 -0
  147. package/contracts/instance/module/ISetup.sol +2 -1
  148. package/contracts/instance/service/IPoolService.sol +2 -0
  149. package/contracts/instance/service/PoolService.sol +15 -12
  150. package/contracts/instance/service/ProductService.sol +2 -4
  151. package/contracts/types/NftIdSet.sol +26 -24
  152. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -2,9 +2,32 @@
2
2
  "_format": "hh-sol-artifact-1",
3
3
  "contractName": "LibNftIdSet",
4
4
  "sourceName": "contracts/types/NftIdSet.sol",
5
- "abi": [],
6
- "bytecode": "0x61048d61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c80632bfdd6b91461007157806331a97de214610099578063a3082a18146100ac578063a73d5756146100cc578063d2fa1e36146100ec578063e797d8991461010c575b600080fd5b61008461007f366004610393565b610137565b60405190151581526020015b60405180910390f35b6100846100a73660046103cf565b541590565b8180156100b857600080fd5b506100846100c7366004610393565b61015b565b8180156100d857600080fd5b506100846100e7366004610393565b6101da565b6100fe6100fa3660046103cf565b5490565b604051908152602001610090565b61011f61011a3660046103e8565b61034b565b6040516001600160601b039091168152602001610090565b6001600160601b038116600090815260018301602052604090205415155b92915050565b6001600160601b038116600090815260018301602052604081205481036101d2575081546001818101845560008481526020808220600285040180546001600160601b03808816600c978716979097026101000a878102910219909116179055855493825282860190526040902091909155610155565b506000610155565b6001600160601b0381166000908152600183016020526040812054801561034157600061020860018361040a565b855490915060009061021c9060019061040a565b90508181146102c657600086600001828154811061023c5761023c61042b565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b031690508087600001848154811061027d5761027d61042b565b60009182526020808320600283040180546001600160601b03958616600c6001958616026101000a90810290870219909116179055939092168152908801909152604090208390555b85548690806102d7576102d7610441565b6001900381819060005260206000209060029182820401919006600c026101000a8154906001600160601b0302191690559055856001016000866001600160601b03166001600160601b031681526020019081526020016000206000905560019350505050610155565b6000915050610155565b60008260000182815481106103625761036261042b565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b0316905092915050565b600080604083850312156103a657600080fd5b8235915060208301356001600160601b03811681146103c457600080fd5b809150509250929050565b6000602082840312156103e157600080fd5b5035919050565b600080604083850312156103fb57600080fd5b50508035926020909101359150565b8181038181111561015557634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220391bcca3e0f726ed4a106be56ba7b8ff7e86a89fb2d14b665b751d124abd5b1764736f6c63430008140033",
7
- "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c80632bfdd6b91461007157806331a97de214610099578063a3082a18146100ac578063a73d5756146100cc578063d2fa1e36146100ec578063e797d8991461010c575b600080fd5b61008461007f366004610393565b610137565b60405190151581526020015b60405180910390f35b6100846100a73660046103cf565b541590565b8180156100b857600080fd5b506100846100c7366004610393565b61015b565b8180156100d857600080fd5b506100846100e7366004610393565b6101da565b6100fe6100fa3660046103cf565b5490565b604051908152602001610090565b61011f61011a3660046103e8565b61034b565b6040516001600160601b039091168152602001610090565b6001600160601b038116600090815260018301602052604090205415155b92915050565b6001600160601b038116600090815260018301602052604081205481036101d2575081546001818101845560008481526020808220600285040180546001600160601b03808816600c978716979097026101000a878102910219909116179055855493825282860190526040902091909155610155565b506000610155565b6001600160601b0381166000908152600183016020526040812054801561034157600061020860018361040a565b855490915060009061021c9060019061040a565b90508181146102c657600086600001828154811061023c5761023c61042b565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b031690508087600001848154811061027d5761027d61042b565b60009182526020808320600283040180546001600160601b03958616600c6001958616026101000a90810290870219909116179055939092168152908801909152604090208390555b85548690806102d7576102d7610441565b6001900381819060005260206000209060029182820401919006600c026101000a8154906001600160601b0302191690559055856001016000866001600160601b03166001600160601b031681526020019081526020016000206000905560019350505050610155565b6000915050610155565b60008260000182815481106103625761036261042b565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b0316905092915050565b600080604083850312156103a657600080fd5b8235915060208301356001600160601b03811681146103c457600080fd5b809150509250929050565b6000602082840312156103e157600080fd5b5035919050565b600080604083850312156103fb57600080fd5b50508035926020909101359150565b8181038181111561015557634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220391bcca3e0f726ed4a106be56ba7b8ff7e86a89fb2d14b665b751d124abd5b1764736f6c63430008140033",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "NftId",
10
+ "name": "nftId",
11
+ "type": "uint96"
12
+ }
13
+ ],
14
+ "name": "ErrorNftIdSetAlreadyAdded",
15
+ "type": "error"
16
+ },
17
+ {
18
+ "inputs": [
19
+ {
20
+ "internalType": "NftId",
21
+ "name": "nftId",
22
+ "type": "uint96"
23
+ }
24
+ ],
25
+ "name": "ErrorNftIdSetNotInSet",
26
+ "type": "error"
27
+ }
28
+ ],
29
+ "bytecode": "0x6104c261003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c80632bfdd6b91461007157806331a97de2146100995780638b6233dd146100ac578063a3082a18146100cc578063a73d5756146100ee578063e797d8991461010e575b600080fd5b61008461007f3660046103c8565b610139565b60405190151581526020015b60405180910390f35b6100846100a7366004610404565b541590565b6100be6100ba366004610404565b5490565b604051908152602001610090565b8180156100d857600080fd5b506100ec6100e73660046103c8565b61015d565b005b8180156100fa57600080fd5b506100ec6101093660046103c8565b6101f8565b61012161011c36600461041d565b610380565b6040516001600160601b039091168152602001610090565b6001600160601b038116600090815260018301602052604090205415155b92915050565b6001600160601b0381166000908152600183016020526040902054156101a6576040516301eae2c560e61b81526001600160601b03821660048201526024015b60405180910390fd5b81546001818101845560008481526020808220600285040180546001600160601b03968716600c968616969096026101000a868102970219169590951790945584549281529301909152604090912055565b6001600160601b03811660009081526001830160205260408120549081900361023f5760405163482084f160e01b81526001600160601b038316600482015260240161019d565b600061024c60018361043f565b84549091506000906102609060019061043f565b905081811461030a57600085600001828154811061028057610280610460565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b03169050808660000184815481106102c1576102c1610460565b60009182526020808320600283040180546001600160601b03958616600c6001958616026101000a90810290870219909116179055939092168152908701909152604090208390555b845485908061031b5761031b610476565b6001900381819060005260206000209060029182820401919006600c026101000a8154906001600160601b0302191690559055846001016000856001600160601b03166001600160601b03168152602001908152602001600020600090555050505050565b600082600001828154811061039757610397610460565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b0316905092915050565b600080604083850312156103db57600080fd5b8235915060208301356001600160601b03811681146103f957600080fd5b809150509250929050565b60006020828403121561041657600080fd5b5035919050565b6000806040838503121561043057600080fd5b50508035926020909101359150565b8181038181111561015757634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220a59021e4afbe697b487a178e328b0427efd3acf42ac7b39308d6f8fbbe16b6d664736f6c63430008140033",
30
+ "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c80632bfdd6b91461007157806331a97de2146100995780638b6233dd146100ac578063a3082a18146100cc578063a73d5756146100ee578063e797d8991461010e575b600080fd5b61008461007f3660046103c8565b610139565b60405190151581526020015b60405180910390f35b6100846100a7366004610404565b541590565b6100be6100ba366004610404565b5490565b604051908152602001610090565b8180156100d857600080fd5b506100ec6100e73660046103c8565b61015d565b005b8180156100fa57600080fd5b506100ec6101093660046103c8565b6101f8565b61012161011c36600461041d565b610380565b6040516001600160601b039091168152602001610090565b6001600160601b038116600090815260018301602052604090205415155b92915050565b6001600160601b0381166000908152600183016020526040902054156101a6576040516301eae2c560e61b81526001600160601b03821660048201526024015b60405180910390fd5b81546001818101845560008481526020808220600285040180546001600160601b03968716600c968616969096026101000a868102970219169590951790945584549281529301909152604090912055565b6001600160601b03811660009081526001830160205260408120549081900361023f5760405163482084f160e01b81526001600160601b038316600482015260240161019d565b600061024c60018361043f565b84549091506000906102609060019061043f565b905081811461030a57600085600001828154811061028057610280610460565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b03169050808660000184815481106102c1576102c1610460565b60009182526020808320600283040180546001600160601b03958616600c6001958616026101000a90810290870219909116179055939092168152908701909152604090208390555b845485908061031b5761031b610476565b6001900381819060005260206000209060029182820401919006600c026101000a8154906001600160601b0302191690559055846001016000856001600160601b03166001600160601b03168152602001908152602001600020600090555050505050565b600082600001828154811061039757610397610460565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b0316905092915050565b600080604083850312156103db57600080fd5b8235915060208301356001600160601b03811681146103f957600080fd5b809150509250929050565b60006020828403121561041657600080fd5b5035919050565b6000806040838503121561043057600080fd5b50508035926020909101359150565b8181038181111561015757634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220a59021e4afbe697b487a178e328b0427efd3acf42ac7b39308d6f8fbbe16b6d664736f6c63430008140033",
8
31
  "linkReferences": {},
9
32
  "deployedLinkReferences": {}
10
33
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/6e730571a8919f24f85e81e92f606870.json"
3
+ "buildInfo": "../../../build-info/730853b2df4f1285f2f568ad8b5527d6.json"
4
4
  }
@@ -55,7 +55,7 @@ interface IPoolComponent {
55
55
  view
56
56
  returns (bool isMatching);
57
57
 
58
- function isVerifying() external view returns (bool verifying);
58
+ function isConfirmingApplication() external view returns (bool isConfirmingApplication);
59
59
 
60
60
  function getCollateralizationLevel() external view returns (UFixed collateralizationLevel);
61
61
 
@@ -25,7 +25,7 @@ import {Registerable} from "../shared/Registerable.sol";
25
25
  contract Pool is BaseComponent, IPoolComponent {
26
26
  using NftIdLib for NftId;
27
27
 
28
- bool internal _isVerifying;
28
+ bool internal _isConfirmingApplication;
29
29
  UFixed internal _collateralizationLevel;
30
30
 
31
31
  Fee internal _initialPoolFee;
@@ -60,7 +60,7 @@ contract Pool is BaseComponent, IPoolComponent {
60
60
  // TODO refactor into tokenNftId
61
61
  address token,
62
62
  bool isInterceptor,
63
- bool verifying,
63
+ bool isConfirmingApplication,
64
64
  UFixed collateralizationLevel,
65
65
  Fee memory poolFee,
66
66
  Fee memory stakingFee,
@@ -69,7 +69,7 @@ contract Pool is BaseComponent, IPoolComponent {
69
69
  )
70
70
  BaseComponent(registry, instanceNftId, token, POOL(), isInterceptor, initialOwner)
71
71
  {
72
- _isVerifying = verifying;
72
+ _isConfirmingApplication = isConfirmingApplication;
73
73
  // TODO add validation
74
74
  _collateralizationLevel = collateralizationLevel;
75
75
  _initialPoolFee = poolFee;
@@ -140,8 +140,8 @@ contract Pool is BaseComponent, IPoolComponent {
140
140
  }
141
141
 
142
142
 
143
- function isVerifying() external view override returns (bool verifying) {
144
- return _isVerifying;
143
+ function isConfirmingApplication() external view override returns (bool isConfirmingApplication) {
144
+ return _isConfirmingApplication;
145
145
  }
146
146
 
147
147
  function getCollateralizationLevel() external view override returns (UFixed collateralizationLevel) {
@@ -200,7 +200,8 @@ contract Pool is BaseComponent, IPoolComponent {
200
200
  _initialPoolFee,
201
201
  _initialStakingFee,
202
202
  _initialPerformanceFee,
203
- _isVerifying,
203
+ false,
204
+ _isConfirmingApplication,
204
205
  _wallet
205
206
  )
206
207
  )
@@ -280,6 +280,7 @@ contract Product is BaseComponent, IProductComponent {
280
280
  poolSetupInfo.poolFee,
281
281
  poolSetupInfo.stakingFee,
282
282
  poolSetupInfo.performanceFee,
283
+ false,
283
284
  _wallet
284
285
  )
285
286
  )
@@ -0,0 +1,143 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {IInstance} from "./IInstance.sol";
5
+ import {INSTANCE} from "../types/ObjectType.sol";
6
+ import {InstanceReader} from "./InstanceReader.sol";
7
+ import {IPolicy} from "../instance/module/IPolicy.sol";
8
+ import {IRegistry} from "../registry/IRegistry.sol";
9
+ import {LibNftIdSet} from "../types/NftIdSet.sol";
10
+ import {NftId} from "../types/NftId.sol";
11
+ import {TimestampLib} from "../types/Timestamp.sol";
12
+
13
+ import {ObjectManager} from "./ObjectManager.sol";
14
+
15
+ contract BundleManager is
16
+ ObjectManager
17
+ {
18
+
19
+ event LogBundleManagerPolicyLinked(NftId bundleNftId, NftId policyNftId);
20
+ event LogBundleManagerPolicyUnlinked(NftId bundleNftId, NftId policyNftId);
21
+
22
+ event LogBundleManagerBundleAdded(NftId poolNftId, NftId bundleNftId);
23
+ event LogBundleManagerBundleUnlocked(NftId poolNftId, NftId bundleNftId);
24
+ event LogBundleManagerBundleLocked(NftId poolNftId, NftId bundleNftId);
25
+
26
+ error ErrorBundleManagerErrorPolicyAlreadyActivated(NftId policyNftId);
27
+ error ErrorBundleManagerErrorBundleLocked(NftId bundleNftId, NftId policyNftId);
28
+ error ErrorBundleManagerPolicyWithOpenClaims(NftId policyNftId, uint256 openClaimsCount);
29
+ error ErrorBundleManagerPolicyNotCloseable(NftId policyNftId);
30
+ error ErrorBundleManagerBundleUnknown(NftId bundleNftId);
31
+ error ErrorBundleManagerBundleNotRegistered(NftId bundleNftId);
32
+
33
+ mapping(NftId bundleNftId => LibNftIdSet.Set policies) internal _activePolicies;
34
+
35
+ constructor() ObjectManager() { }
36
+
37
+
38
+ /// @dev links a policy with its bundle
39
+ // to link a policy it MUST NOT yet have been activated
40
+ // the bundle MUST be unlocked (active) for linking (underwriting) and registered with this instance
41
+ // TODO decide what is checked here (non upgradeable) and what is checked in the service (upgradeable)
42
+ function linkPolicy(NftId policyNftId) external {
43
+ IPolicy.PolicyInfo memory policyInfo = _instanceReader.getPolicyInfo(policyNftId);
44
+
45
+ // ensure policy has not yet been activated
46
+ if (policyInfo.activatedAt.gtz()) {
47
+ revert ErrorBundleManagerErrorPolicyAlreadyActivated(policyNftId);
48
+ }
49
+
50
+ NftId bundleNftId = policyInfo.bundleNftId;
51
+ // TODO decide to use instance reader or registry
52
+ // decision will likely depend on the decision what to check here and what in the service
53
+ NftId poolNftId = _instanceReader.getBundleInfo(bundleNftId).poolNftId;
54
+
55
+ // ensure bundle is unlocked (in active set) and registered with this instance
56
+ if (!_isActive(poolNftId, bundleNftId)) {
57
+ revert ErrorBundleManagerErrorBundleLocked(bundleNftId, policyNftId);
58
+ }
59
+
60
+ LibNftIdSet.add(_activePolicies[bundleNftId], policyNftId);
61
+ emit LogBundleManagerPolicyLinked(bundleNftId, policyNftId);
62
+ }
63
+
64
+
65
+ /// @dev unlinks a policy from its bundle
66
+ // to unlink a policy it must closable, ie. meet one of the following criterias
67
+ // - the policy MUST be past its expiry period and it MUST NOT have any open claims
68
+ // - the policy's payoutAmount MUST be equal to its sumInsuredAmount and MUST NOT have any open claims
69
+ // TODO decide what is checked here (non upgradeable) and what is checked in the service (upgradeable)
70
+ function unlinkPolicy(NftId policyNftId) external {
71
+ IPolicy.PolicyInfo memory policyInfo = _instanceReader.getPolicyInfo(policyNftId);
72
+
73
+ // ensure policy has no open claims
74
+ if (policyInfo.openClaimsCount > 0) {
75
+ revert ErrorBundleManagerPolicyWithOpenClaims(
76
+ policyNftId,
77
+ policyInfo.openClaimsCount);
78
+ }
79
+
80
+ // ensure policy is closeable
81
+ if (policyInfo.expiredAt < TimestampLib.blockTimestamp()
82
+ || policyInfo.payoutAmount < policyInfo.sumInsuredAmount)
83
+ {
84
+ revert ErrorBundleManagerPolicyNotCloseable(policyNftId);
85
+ }
86
+
87
+ NftId bundleNftId = policyInfo.bundleNftId;
88
+ // TODO decide to use instance reader or registry
89
+ // decision will likely depend on the decision what to check here and what in the service
90
+ NftId poolNftId = _instanceReader.getBundleInfo(bundleNftId).poolNftId;
91
+
92
+ // ensure bundle is registered with this instance
93
+ if (!_contains(poolNftId, bundleNftId)) {
94
+ revert ErrorBundleManagerBundleUnknown(bundleNftId);
95
+ }
96
+
97
+ LibNftIdSet.remove(_activePolicies[bundleNftId], policyNftId);
98
+ emit LogBundleManagerPolicyUnlinked(policyInfo.bundleNftId, policyNftId);
99
+ }
100
+
101
+
102
+ /// @dev add a new bundle to a riskpool registerd with this instance
103
+ // the corresponding pool is fetched via instance reader
104
+ function add(NftId bundleNftId) external {
105
+ NftId poolNftId = _instanceReader.getBundleInfo(bundleNftId).poolNftId;
106
+
107
+ // ensure pool is registered with instance
108
+ if(poolNftId.eqz()) {
109
+ revert ErrorBundleManagerBundleNotRegistered(bundleNftId);
110
+ }
111
+
112
+ _add(poolNftId, bundleNftId);
113
+ emit LogBundleManagerBundleAdded(poolNftId, bundleNftId);
114
+ }
115
+
116
+ /// @dev unlocked (active) bundles are available to underwrite new policies
117
+ function unlock(NftId poolNftId , NftId bundleNftId) external {
118
+ _activate(poolNftId, bundleNftId);
119
+ emit LogBundleManagerBundleUnlocked(poolNftId, bundleNftId);
120
+ }
121
+
122
+ /// @dev locked (deactivated) bundles may not underwrite any new policies
123
+ function lock(NftId poolNftId , NftId bundleNftId) external {
124
+ _deactivate(poolNftId, bundleNftId);
125
+ emit LogBundleManagerBundleLocked(poolNftId, bundleNftId);
126
+ }
127
+
128
+ function bundles(NftId poolNftId) external view returns(uint256) {
129
+ return _objects(poolNftId);
130
+ }
131
+
132
+ function getBundleNftId(NftId poolNftId, uint256 idx) external view returns(NftId bundleNftId) {
133
+ return _getObject(poolNftId, idx);
134
+ }
135
+
136
+ function activeBundles(NftId poolNftId) external view returns(uint256) {
137
+ return _activeObjs(poolNftId);
138
+ }
139
+
140
+ function getActiveBundleNftId(NftId poolNftId, uint256 idx) external view returns(NftId bundleNftId) {
141
+ return _getActiveObject(poolNftId, idx);
142
+ }
143
+ }
@@ -0,0 +1,47 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
5
+ import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
6
+
7
+ import {IRegistry} from "../registry/IRegistry.sol";
8
+
9
+ abstract contract Cloneable is
10
+ AccessManagedUpgradeable
11
+ {
12
+ event CloneableInitialized(address authority, address registry);
13
+
14
+ error CloneableRegistryInvalid(address registry);
15
+
16
+ IRegistry internal _registry;
17
+
18
+ constructor() {
19
+ _disableInitializers();
20
+ _registry = IRegistry(address(0));
21
+ }
22
+
23
+ /// @dev call to initialize MUST be made in the same transaction as cloning of the contract
24
+ function initialize(
25
+ address authority,
26
+ address registry
27
+ )
28
+ public
29
+ initializer
30
+ {
31
+ // check/handle access managed
32
+ __AccessManaged_init(authority);
33
+
34
+ // check/handle registry
35
+ if (registry.code.length == 0) {
36
+ revert CloneableRegistryInvalid(registry);
37
+ }
38
+
39
+ _registry = IRegistry(registry);
40
+
41
+ emit CloneableInitialized(authority, registry);
42
+ }
43
+
44
+ function getRegistry() external view returns (IRegistry) {
45
+ return _registry;
46
+ }
47
+ }
@@ -61,6 +61,9 @@ contract InstanceService is Service, IInstanceService {
61
61
 
62
62
  _grantInitialAuthorizations(clonedAccessManager, clonedInstance);
63
63
 
64
+ // TODO add cloning of bundle manager, policy manager, ...
65
+
66
+ // TODO amend setters with instance specific bundle manager, policy manager ...
64
67
  clonedInstance.setInstanceReader(clonedInstanceReader);
65
68
 
66
69
  // to complete setup switch instance ownership to the instance owner
@@ -0,0 +1,95 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {Cloneable} from "./Cloneable.sol";
5
+
6
+ import {IInstance} from "./IInstance.sol";
7
+ import {INSTANCE} from "../types/ObjectType.sol";
8
+ import {InstanceReader} from "./InstanceReader.sol";
9
+ import {IRegistry} from "../registry/IRegistry.sol";
10
+ import {LibNftIdSet} from "../types/NftIdSet.sol";
11
+ import {NftId} from "../types/NftId.sol";
12
+
13
+ contract ObjectManager is
14
+ Cloneable
15
+ {
16
+
17
+ event LogObjectManagerInitialized(NftId instanceNftId, address instanceReader);
18
+
19
+ error ErrorObjectManagerNftIdInvalid(NftId instanceNftId);
20
+ error ErrorObjectManagerAlreadyAdded(NftId componentNftId, NftId objectNftId);
21
+
22
+ mapping(NftId compnentNftId => LibNftIdSet.Set objects) internal _activeObjects;
23
+ mapping(NftId compnentNftId => LibNftIdSet.Set objects) internal _allObjects;
24
+ InstanceReader internal _instanceReader;
25
+
26
+ constructor() Cloneable() {
27
+ _instanceReader = InstanceReader(address(0));
28
+ }
29
+
30
+ /// @dev call to initialize MUST be made in the same transaction as cloning of the contract
31
+ function initialize(
32
+ address authority,
33
+ address registry,
34
+ NftId instanceNftId
35
+ )
36
+ external
37
+ {
38
+ initialize(authority, registry);
39
+
40
+ // check/handle instance nft id/instance reader
41
+ IRegistry.ObjectInfo memory instanceInfo = _registry.getObjectInfo(instanceNftId);
42
+ if (instanceInfo.objectType != INSTANCE()) {
43
+ revert ErrorObjectManagerNftIdInvalid(instanceNftId);
44
+ }
45
+
46
+ IInstance instance = IInstance(instanceInfo.objectAddress);
47
+ _instanceReader = instance.getInstanceReader();
48
+
49
+ emit LogObjectManagerInitialized(instanceNftId, address(_instanceReader));
50
+ }
51
+
52
+ function getInstanceReader() external view returns (InstanceReader) {
53
+ return _instanceReader;
54
+ }
55
+
56
+ function _add(NftId componentNftId, NftId objectNftId) internal {
57
+ LibNftIdSet.Set storage allSet = _allObjects[componentNftId];
58
+ LibNftIdSet.Set storage activeSet = _activeObjects[componentNftId];
59
+
60
+ LibNftIdSet.add(allSet, objectNftId);
61
+ LibNftIdSet.add(activeSet, objectNftId);
62
+ }
63
+
64
+ function _activate(NftId componentNftId, NftId objectNftId) internal {
65
+ LibNftIdSet.add(_activeObjects[componentNftId], objectNftId);
66
+ }
67
+
68
+ function _deactivate(NftId componentNftId, NftId objectNftId) internal {
69
+ LibNftIdSet.remove(_activeObjects[componentNftId], objectNftId);
70
+ }
71
+
72
+ function _objects(NftId componentNftId) internal view returns (uint256) {
73
+ return LibNftIdSet.size(_allObjects[componentNftId]);
74
+ }
75
+
76
+ function _contains(NftId componentNftId, NftId objectNftId) internal view returns (bool) {
77
+ return LibNftIdSet.contains(_allObjects[componentNftId], objectNftId);
78
+ }
79
+
80
+ function _getObject(NftId componentNftId, uint256 idx) internal view returns (NftId) {
81
+ return LibNftIdSet.getElementAt(_allObjects[componentNftId], idx);
82
+ }
83
+
84
+ function _activeObjs(NftId componentNftId) internal view returns (uint256) {
85
+ return LibNftIdSet.size(_activeObjects[componentNftId]);
86
+ }
87
+
88
+ function _isActive(NftId componentNftId, NftId objectNftId) internal view returns (bool) {
89
+ return LibNftIdSet.contains(_activeObjects[componentNftId], objectNftId);
90
+ }
91
+
92
+ function _getActiveObject(NftId componentNftId, uint256 idx) internal view returns (NftId) {
93
+ return LibNftIdSet.getElementAt(_activeObjects[componentNftId], idx);
94
+ }
95
+ }