@etherisc/gif-next 0.0.2-ead1eb0-841 → 0.0.2-eadf4ad-211

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  2. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  3. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +80 -80
  4. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  5. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +97 -58
  6. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  7. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  8. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
  9. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +2 -2
  10. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  11. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  12. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  13. package/artifacts/contracts/instance/Instance.sol/Instance.json +2 -2
  14. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  15. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +2 -2
  16. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +1 -1
  17. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +2 -2
  18. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  19. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +2 -2
  20. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  21. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +24 -24
  22. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  23. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +69 -30
  24. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  25. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2 -2
  26. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  27. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  28. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  29. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  30. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  31. package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +1 -1
  32. package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +2 -2
  33. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  34. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  35. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  36. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  37. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  38. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  39. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
  40. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
  41. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  42. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +44 -44
  43. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  44. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +79 -40
  45. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  46. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  47. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  48. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  49. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  50. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +48 -48
  51. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  52. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +81 -42
  53. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  54. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +4 -4
  55. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  56. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +68 -29
  57. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  58. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +10 -10
  59. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  60. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +90 -51
  61. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  62. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  63. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  64. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  65. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  66. package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
  67. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  68. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +8 -8
  69. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  70. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +90 -51
  71. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  72. package/artifacts/contracts/product/PricingService.sol/PricingService.json +30 -30
  73. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  74. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +77 -38
  75. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  76. package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
  77. package/artifacts/contracts/product/ProductService.sol/ProductService.json +6 -6
  78. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  79. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +66 -27
  80. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  81. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  82. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +73 -13
  83. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  84. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +153 -51
  85. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  86. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  87. package/artifacts/contracts/registry/Registry.sol/Registry.json +93 -25
  88. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
  89. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +48 -95
  90. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  91. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +170 -68
  92. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  93. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +72 -28
  94. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
  95. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +363 -76
  96. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  97. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  98. package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +1 -1
  99. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  100. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  101. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  102. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  103. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  104. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  105. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  106. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  107. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  108. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  109. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  110. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  111. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  112. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
  113. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  114. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +43 -14
  115. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  116. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +2 -2
  117. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  118. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
  119. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  120. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  121. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  122. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  123. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  124. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  125. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +4 -4
  126. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +4 -0
  127. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +667 -0
  128. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  129. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  130. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  131. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  132. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  133. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  134. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  135. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  136. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  137. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  138. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  139. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  140. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  141. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  142. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
  143. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  144. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  145. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  146. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
  147. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  148. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  149. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  150. package/contracts/distribution/DistributionService.sol +8 -6
  151. package/contracts/distribution/DistributionServiceManager.sol +9 -6
  152. package/contracts/instance/InstanceService.sol +9 -16
  153. package/contracts/instance/InstanceServiceManager.sol +10 -20
  154. package/contracts/pool/BundleService.sol +13 -11
  155. package/contracts/pool/BundleServiceManager.sol +9 -18
  156. package/contracts/pool/PoolService.sol +12 -11
  157. package/contracts/pool/PoolServiceManager.sol +9 -18
  158. package/contracts/product/ApplicationService.sol +6 -5
  159. package/contracts/product/ApplicationServiceManager.sol +9 -6
  160. package/contracts/product/ClaimService.sol +6 -5
  161. package/contracts/product/ClaimServiceManager.sol +9 -6
  162. package/contracts/product/PolicyService.sol +6 -4
  163. package/contracts/product/PolicyServiceManager.sol +9 -21
  164. package/contracts/product/PricingService.sol +6 -5
  165. package/contracts/product/PricingServiceManager.sol +9 -18
  166. package/contracts/product/ProductService.sol +6 -4
  167. package/contracts/product/ProductServiceManager.sol +9 -21
  168. package/contracts/registry/IRegistry.sol +19 -12
  169. package/contracts/registry/IRegistryService.sol +22 -30
  170. package/contracts/registry/Registry.sol +40 -36
  171. package/contracts/registry/RegistryAccessManager.sol +39 -123
  172. package/contracts/registry/RegistryService.sol +22 -76
  173. package/contracts/registry/RegistryServiceManager.sol +21 -9
  174. package/contracts/registry/ReleaseManager.sol +243 -189
  175. package/contracts/shared/ComponentService.sol +0 -9
  176. package/contracts/shared/ProxyManager.sol +26 -0
  177. package/contracts/staking/StakingService.sol +7 -4
  178. package/contracts/staking/{StakeingServiceManager.sol → StakingServiceManager.sol} +8 -5
  179. package/contracts/type/RoleId.sol +10 -3
  180. package/package.json +1 -1
  181. package/artifacts/contracts/staking/StakeingServiceManager.sol/StakingServiceManager.dbg.json +0 -4
  182. package/artifacts/contracts/staking/StakeingServiceManager.sol/StakingServiceManager.json +0 -628
@@ -11,15 +11,18 @@ contract ClaimServiceManager is ProxyManager {
11
11
 
12
12
  /// @dev initializes proxy manager with service implementation
13
13
  constructor(
14
- address registryAddress
15
- )
14
+ address authority,
15
+ address registryAddress,
16
+ bytes32 salt
17
+ )
16
18
  ProxyManager(registryAddress)
17
19
  {
18
- ClaimService svc = new ClaimService();
19
- bytes memory data = abi.encode(registryAddress, address(this));
20
- IVersionable versionable = deploy(
20
+ ClaimService svc = new ClaimService{salt: salt}();
21
+ bytes memory data = abi.encode(registryAddress, address(this), authority);
22
+ IVersionable versionable = deployDetermenistic(
21
23
  address(svc),
22
- data);
24
+ data,
25
+ salt);
23
26
 
24
27
  _claimService = ClaimService(address(versionable));
25
28
  }
@@ -61,11 +61,13 @@ contract PolicyService is
61
61
  virtual override
62
62
  initializer
63
63
  {
64
- address registryAddress;
65
- address initialOwner;
66
- (registryAddress, initialOwner) = abi.decode(data, (address, address));
64
+ (
65
+ address registryAddress,,
66
+ //address managerAddress
67
+ address authority
68
+ ) = abi.decode(data, (address, address, address));
67
69
 
68
- initializeService(registryAddress, address(0), owner);
70
+ initializeService(registryAddress, authority, owner);
69
71
 
70
72
  VersionPart majorVersion = getVersion().toMajorPart();
71
73
  _poolService = IPoolService(getRegistry().getServiceAddress(POOL(), majorVersion));
@@ -14,32 +14,20 @@ contract PolicyServiceManager is ProxyManager {
14
14
 
15
15
  /// @dev initializes proxy manager with product service implementation
16
16
  constructor(
17
- address registryAddress
18
- )
17
+ address authority,
18
+ address registryAddress,
19
+ bytes32 salt
20
+ )
19
21
  ProxyManager(registryAddress)
20
22
  {
21
- PolicyService svc = new PolicyService();
22
- bytes memory data = abi.encode(registryAddress, address(this));
23
- IVersionable versionable = deploy(
23
+ PolicyService svc = new PolicyService{salt: salt}();
24
+ bytes memory data = abi.encode(registryAddress, address(this), authority);
25
+ IVersionable versionable = deployDetermenistic(
24
26
  address(svc),
25
- data);
27
+ data,
28
+ salt);
26
29
 
27
30
  _policyService = PolicyService(address(versionable));
28
-
29
- // Registry registry = Registry(registryAddress);
30
- // address registryServiceAddress = registry.getServiceAddress("RegistryService", VersionLib.toVersion(3, 0, 0).toMajorPart());
31
- // RegistryService registryService = RegistryService(registryServiceAddress);
32
- // TODO this must have a role or own nft to register service
33
- //registryService.registerService(_productService);
34
-
35
- // TODO no nft to link yet
36
- // link ownership of instance service manager ot nft owner of instance service
37
- //_linkToNftOwnable(
38
- // address(registryAddress),
39
- // address(_productService));
40
-
41
- // implies that after this constructor call only upgrade functionality is available
42
- // _isDeployed = true;
43
31
  }
44
32
 
45
33
  //--- view functions ----------------------------------------------------//
@@ -45,12 +45,13 @@ contract PricingService is
45
45
  virtual override
46
46
  initializer()
47
47
  {
48
- // TODO check this, might no longer be the way, refactor if necessary
49
- address registryAddress;
50
- address initialOwner;
51
- (registryAddress, initialOwner) = abi.decode(data, (address, address));
48
+ (
49
+ address registryAddress,,
50
+ //address managerAddress
51
+ address authority
52
+ ) = abi.decode(data, (address, address, address));
52
53
 
53
- initializeService(registryAddress, address(0), owner);
54
+ initializeService(registryAddress, authority, owner);
54
55
  registerInterface(type(IPricingService).interfaceId);
55
56
 
56
57
  _distributionService = IDistributionService(_getServiceAddress(DISTRIBUTION()));
@@ -12,31 +12,22 @@ contract PricingServiceManager is ProxyManager {
12
12
 
13
13
  PricingService private _pricingService;
14
14
 
15
- /// @dev initializes proxy manager with distribution service implementation and deploys instance
15
+ /// @dev initializes proxy manager with pricing service implementation and deploys instance
16
16
  constructor(
17
- address registryAddress
17
+ address authority,
18
+ address registryAddress,
19
+ bytes32 salt
18
20
  )
19
21
  ProxyManager(registryAddress)
20
22
  {
21
- PricingService pricingSrv = new PricingService();
22
- bytes memory data = abi.encode(registryAddress, address(this));
23
- IVersionable versionable = deploy(
23
+ PricingService pricingSrv = new PricingService{salt: salt}();
24
+ bytes memory data = abi.encode(registryAddress, address(this), authority);
25
+ IVersionable versionable = deployDetermenistic(
24
26
  address(pricingSrv),
25
- data);
27
+ data,
28
+ salt);
26
29
 
27
30
  _pricingService = PricingService(address(versionable));
28
-
29
- // TODO `thi` must have a role or own nft to register service
30
- //Registry registry = Registry(registryAddress);
31
- //address registryServiceAddress = registry.getServiceAddress(REGISTRY(), _distributionService.getMajorVersion());
32
- //RegistryService registryService = RegistryService(registryServiceAddress);
33
- //registryService.registerService(_distributionService);
34
-
35
- // TODO no nft to link yet
36
- // link ownership of instance service manager ot nft owner of instance service
37
- //_linkToNftOwnable(
38
- // address(registryAddress),
39
- // address(_distributionService));
40
31
  }
41
32
 
42
33
  //--- view functions ----------------------------------------------------//
@@ -56,11 +56,13 @@ contract ProductService is ComponentService, IProductService {
56
56
  initializer
57
57
  virtual override
58
58
  {
59
- address registryAddress;
60
- address initialOwner;
61
- (registryAddress, initialOwner) = abi.decode(data, (address, address));
59
+ (
60
+ address registryAddress,,
61
+ //address managerAddress
62
+ address authority
63
+ ) = abi.decode(data, (address, address, address));
62
64
 
63
- initializeService(registryAddress, address(0), owner);
65
+ initializeService(registryAddress, authority, owner);
64
66
 
65
67
  _poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getVersion().toMajorPart()));
66
68
 
@@ -14,32 +14,20 @@ contract ProductServiceManager is ProxyManager {
14
14
 
15
15
  /// @dev initializes proxy manager with product service implementation
16
16
  constructor(
17
- address registryAddress
18
- )
17
+ address authority,
18
+ address registryAddress,
19
+ bytes32 salt
20
+ )
19
21
  ProxyManager(registryAddress)
20
22
  {
21
- ProductService svc = new ProductService();
22
- bytes memory data = abi.encode(registryAddress, address(this));
23
- IVersionable versionable = deploy(
23
+ ProductService svc = new ProductService{salt: salt}();
24
+ bytes memory data = abi.encode(registryAddress, address(this), authority);
25
+ IVersionable versionable = deployDetermenistic(
24
26
  address(svc),
25
- data);
27
+ data,
28
+ salt);
26
29
 
27
30
  _productService = ProductService(address(versionable));
28
-
29
- // Registry registry = Registry(registryAddress);
30
- // address registryServiceAddress = registry.getServiceAddress("RegistryService", VersionLib.toVersion(3, 0, 0).toMajorPart());
31
- // RegistryService registryService = RegistryService(registryServiceAddress);
32
- // TODO this must have a role or own nft to register service
33
- //registryService.registerService(_productService);
34
-
35
- // TODO no nft to link yet
36
- // link ownership of instance service manager ot nft owner of instance service
37
- //_linkToNftOwnable(
38
- // address(registryAddress),
39
- // address(_productService));
40
-
41
- // implies that after this constructor call only upgrade functionality is available
42
- // _isDeployed = true;
43
31
  }
44
32
 
45
33
  //--- view functions ----------------------------------------------------//
@@ -7,6 +7,7 @@ import {NftId} from "../type/NftId.sol";
7
7
  import {ObjectType} from "../type/ObjectType.sol";
8
8
  import {VersionPart} from "../type/Version.sol";
9
9
  import {Timestamp} from "../type/Timestamp.sol";
10
+ import {RoleId} from "../type/RoleId.sol";
10
11
 
11
12
  interface IRegistry is IERC165 {
12
13
 
@@ -14,20 +15,20 @@ interface IRegistry is IERC165 {
14
15
  event LogServiceRegistration(VersionPart majorVersion, ObjectType domain);
15
16
 
16
17
  // registerService()
17
- error CallerNotReleaseManager();
18
- error ServiceAlreadyRegistered(address service);
18
+ error ErrorRegistryCallerNotReleaseManager();
19
+ error ErrorRegistryDomainZero(address service);
20
+ error ErrorRegistryDomainAlreadyRegistered(address service, VersionPart version, ObjectType domain);
19
21
 
20
22
  // register()
21
- error CallerNotRegistryService();
22
- error ServiceRegistration();
23
+ error ErrorRegistryCallerNotRegistryService();
23
24
 
24
25
  // registerWithCustomTypes()
25
- error CoreTypeRegistration();
26
+ error ErrorRegistryCoreTypeRegistration();
26
27
 
27
28
  // _register()
28
- error ZeroParentAddress();
29
- error InvalidTypesCombination(ObjectType objectType, ObjectType parentType);
30
- error ContractAlreadyRegistered(address objectAddress);
29
+ error ErrorRegistryParentAddressZero();
30
+ error ErrorRegistryTypesCombinationInvalid(ObjectType objectType, ObjectType parentType);
31
+ error ErrorRegistryContractAlreadyRegistered(address objectAddress);
31
32
 
32
33
  struct ObjectInfo {
33
34
  NftId nftId;
@@ -37,13 +38,17 @@ interface IRegistry is IERC165 {
37
38
  address objectAddress;
38
39
  address initialOwner;
39
40
  bytes data;
40
- }// TODO delete nftId and initialOwner(if not used) from struct
41
- // TODO strong disagree, keep nftId there (lets keep get object info return object consistent)
41
+ }
42
+
42
43
 
43
44
  struct ReleaseInfo {
45
+ VersionPart version;
46
+ address[] addresses;
47
+ RoleId[][] serviceRoles;
48
+ RoleId[][] functionRoles;
49
+ bytes4[][][] selectors;
44
50
  ObjectType[] domains;
45
- Timestamp createdAt;
46
- //Timestamp updatedAt;
51
+ Timestamp activatedAt;
47
52
  }
48
53
 
49
54
  function registerService(
@@ -95,6 +100,8 @@ interface IRegistry is IERC165 {
95
100
 
96
101
  function getReleaseManagerAddress() external view returns (address);
97
102
 
103
+ function getReleaseAccessManagerAddress(VersionPart version) external view returns (address);
104
+
98
105
  function getChainNftAddress() external view returns (address);
99
106
 
100
107
  function getOwner() external view returns (address);
@@ -15,36 +15,28 @@ import {IComponent} from "../shared/IComponent.sol";
15
15
  interface IRegistryService is
16
16
  IService
17
17
  {
18
- error SelfRegistration();
19
- error NotRegistryOwner();
20
-
21
- error NotService();
22
- error NotInstance();
23
- error NotProduct();
24
- error NotPool();
25
- error NotDistribution();
26
-
27
- error UnexpectedRegisterableType(ObjectType expected, ObjectType found);
28
- error NotRegisterableOwner(address expectedOwner);
29
- error RegisterableOwnerIsZero();
30
- error RegisterableOwnerIsRegistered();
31
- error InvalidInitialOwner(address initialOwner);
32
- error InvalidAddress(address registerableAddress);
33
-
34
- struct FunctionConfig
35
- {
36
- ObjectType serviceDomain;
37
- bytes4[] selectors;
38
- }
39
-
40
- function getFunctionConfigs()
41
- external
42
- pure
43
- returns(
44
- FunctionConfig[] memory config
45
- );
46
-
47
- // TODO used by service -> add owner arg
18
+ error ErrorRegistryServiceNotRegistryOwner();
19
+
20
+ error ErrorRegistryServiceNotService(address notService);
21
+ error ErrorRegistryServiceNotInstance(address notInstance);
22
+ error ErrorRegistryServiceNotProduct(address notProduct);
23
+ error ErrorRegistryServiceNotPool(address notPool);
24
+ error ErrorRegistryServiceNotDistribution(address notDistribution);
25
+
26
+ error ErrorRegistryServiceRegisterableAddressInvalid(IRegisterable registerable, address found);
27
+ error ErrorRegistryServiceRegisterableTypeInvalid(IRegisterable registerable, ObjectType expected, ObjectType found);
28
+ error ErrorRegistryServiceRegisterableOwnerInvalid(IRegisterable registerable, address expected, address found);
29
+ error ErrorRegistryServiceRegisterableOwnerZero(IRegisterable registerable);
30
+ error ErrorRegistryServiceRegisterableOwnerRegistered(IRegisterable registerable, address owner);
31
+ error ErrorRegistryServiceRegisterableSelfRegistration(IRegisterable registerable);
32
+
33
+ error ErrorRegistryServiceObjectTypeInvalid(ObjectType expected, ObjectType found);
34
+ error ErrorRegistryServiceObjectOwnerRegistered(ObjectType objectType, address owner);
35
+ error ErrorRegistryServiceObjectOwnerZero(ObjectType objectType);
36
+
37
+ error ErrorRegistryServiceInvalidInitialOwner(address initialOwner);
38
+ error ErrorRegistryServiceInvalidAddress(address registerableAddress);
39
+
48
40
  function registerInstance(IRegisterable instance, address owner)
49
41
  external returns(IRegistry.ObjectInfo memory info);
50
42
 
@@ -48,14 +48,14 @@ contract Registry is
48
48
 
49
49
  modifier onlyRegistryService() {
50
50
  if(!_releaseManager.isActiveRegistryService(msg.sender)) {
51
- revert CallerNotRegistryService();
51
+ revert ErrorRegistryCallerNotRegistryService();
52
52
  }
53
53
  _;
54
54
  }
55
55
 
56
56
  modifier onlyReleaseManager() {
57
57
  if(msg.sender != address(_releaseManager)) {
58
- revert CallerNotReleaseManager();
58
+ revert ErrorRegistryCallerNotReleaseManager();
59
59
  }
60
60
  _;
61
61
  }
@@ -84,7 +84,16 @@ contract Registry is
84
84
  onlyReleaseManager
85
85
  returns(NftId nftId)
86
86
  {
87
+ address service = info.objectAddress;
87
88
  /* must be guaranteed by release manager
89
+ if(service == address(0)) {
90
+ revert();
91
+ }
92
+
93
+ if(version.eqz()) {
94
+ revert();
95
+ }
96
+
88
97
  if(info.objectType != SERVICE()) {
89
98
  revert();
90
99
  }
@@ -94,11 +103,15 @@ contract Registry is
94
103
  info.initialOwner == NFT_LOCK_ADDRESS <- if services are access managed
95
104
  */
96
105
 
97
- if(_service[version][domain] > address(0)) {
98
- revert ServiceAlreadyRegistered(info.objectAddress);
106
+ if(domain.eqz()) {
107
+ revert ErrorRegistryDomainZero(service);
99
108
  }
100
109
 
101
- _service[version][domain] = info.objectAddress; // nftId;
110
+ if(_service[version][domain] > address(0)) {
111
+ revert ErrorRegistryDomainAlreadyRegistered(service, version, domain);
112
+ }
113
+
114
+ _service[version][domain] = service;
102
115
 
103
116
  nftId = _register(info);
104
117
 
@@ -113,23 +126,17 @@ contract Registry is
113
126
  ObjectType objectType = info.objectType;
114
127
  ObjectType parentType = _info[info.parentNftId].objectType;
115
128
 
116
- // TODO do not need it here -> SERVICE is no longer part of _coreContractCombinations
117
- // no service registrations
118
- if(objectType == SERVICE()) {
119
- revert ServiceRegistration();
120
- }
121
-
122
129
  // only valid core types combinations
123
130
  if(info.objectAddress == address(0))
124
131
  {
125
132
  if(_coreObjectCombinations[objectType][parentType] == false) {
126
- revert InvalidTypesCombination(objectType, parentType);
133
+ revert ErrorRegistryTypesCombinationInvalid(objectType, parentType);
127
134
  }
128
135
  }
129
136
  else
130
137
  {
131
138
  if(_coreContractCombinations[objectType][parentType] == false) {
132
- revert InvalidTypesCombination(objectType, parentType);
139
+ revert ErrorRegistryTypesCombinationInvalid(objectType, parentType);
133
140
  }
134
141
  }
135
142
 
@@ -145,7 +152,7 @@ contract Registry is
145
152
  ObjectType parentType = _info[info.parentNftId].objectType;
146
153
 
147
154
  if(_coreTypes[objectType]) {
148
- revert CoreTypeRegistration();
155
+ revert ErrorRegistryCoreTypeRegistration();
149
156
  }
150
157
 
151
158
  if(
@@ -153,7 +160,7 @@ contract Registry is
153
160
  parentType == REGISTRY() ||
154
161
  parentType == SERVICE()
155
162
  ) {
156
- revert InvalidTypesCombination(objectType, parentType);
163
+ revert ErrorRegistryTypesCombinationInvalid(objectType, parentType);
157
164
  }
158
165
 
159
166
  _register(info);
@@ -189,10 +196,6 @@ contract Registry is
189
196
  return _chainNft.totalSupply();
190
197
  }
191
198
 
192
- function getReleaseManagerAddress() external view returns (address) {
193
- return address(_releaseManager);
194
- }
195
-
196
199
  function getNftId() external view returns (NftId nftId) {
197
200
  return _registryNftId;
198
201
  }
@@ -244,10 +247,15 @@ contract Registry is
244
247
  VersionPart releaseVersion
245
248
  ) external view returns (address service)
246
249
  {
247
- // TODO how can I get service address while release is not validated/activated ?!! -> user will check validity of release on its own
248
- //if(_releaseManager.isValidRelease(releaseVersion)) {
249
250
  service = _service[releaseVersion][serviceDomain];
250
- //}
251
+ }
252
+
253
+ function getReleaseAccessManagerAddress(VersionPart version) external view returns (address) {
254
+ return address(_releaseManager.getReleaseAccessManager(version));
255
+ }
256
+
257
+ function getReleaseManagerAddress() external view returns (address) {
258
+ return address(_releaseManager);
251
259
  }
252
260
 
253
261
  function getChainNftAddress() external view override returns (address) {
@@ -287,7 +295,7 @@ contract Registry is
287
295
  // special case: when parentNftId == _chainNft.mint(), check for zero parent address before mint
288
296
  // special case: when parentNftId == _chainNft.mint() && objectAddress == initialOwner
289
297
  if(parentAddress == address(0)) {
290
- revert ZeroParentAddress();
298
+ revert ErrorRegistryParentAddressZero();
291
299
  }
292
300
 
293
301
  address interceptor = _getInterceptor(info.isInterceptor, info.objectAddress, parentInfo.isInterceptor, parentAddress);
@@ -302,7 +310,7 @@ contract Registry is
302
310
  address contractAddress = info.objectAddress;
303
311
 
304
312
  if(_nftIdByAddress[contractAddress].gtz()) {
305
- revert ContractAlreadyRegistered(contractAddress);
313
+ revert ErrorRegistryContractAlreadyRegistered(contractAddress);
306
314
  }
307
315
 
308
316
  _nftIdByAddress[contractAddress] = nftId;
@@ -437,30 +445,26 @@ contract Registry is
437
445
  _coreTypes[PRODUCT()] = true;
438
446
  _coreTypes[POOL()] = true;
439
447
  _coreTypes[DISTRIBUTION()] = true;
448
+ _coreTypes[DISTRIBUTOR()] = true;
449
+ _coreTypes[ORACLE()] = true;
440
450
  _coreTypes[POLICY()] = true;
441
451
  _coreTypes[BUNDLE()] = true;
442
452
  _coreTypes[STAKE()] = true;
443
-
444
- // registry as parent, ONLY registry owner
445
- //_coreContractCombinations[REGISTRY()][REGISTRY()] = true; // only for global regstry
446
- _coreContractCombinations[TOKEN()][REGISTRY()] = true;
447
- //_coreContractCombinations[SERVICE()][REGISTRY()] = true;// do not need it here -> registerService() registers exactly this combination
448
453
 
449
- // registry as parent, ONLY approved
450
454
  _coreContractCombinations[INSTANCE()][REGISTRY()] = true;
451
-
452
- // instance as parent, ONLY approved
453
455
  _coreContractCombinations[PRODUCT()][INSTANCE()] = true;
454
456
  _coreContractCombinations[DISTRIBUTION()][INSTANCE()] = true;
455
457
  _coreContractCombinations[ORACLE()][INSTANCE()] = true;
456
458
  _coreContractCombinations[POOL()][INSTANCE()] = true;
457
459
 
458
- _coreObjectCombinations[DISTRIBUTOR()][DISTRIBUTION()] = true;
460
+ uint256 registryId = _chainNft.calculateTokenId(REGISTRY_TOKEN_SEQUENCE_ID);
461
+ if(registryId == _chainNft.GLOBAL_REGISTRY_ID())
462
+ {// we are global registry
463
+ _coreObjectCombinations[REGISTRY()][REGISTRY()] = true;
464
+ }
459
465
 
460
- // product as parent, ONLY approved
466
+ _coreObjectCombinations[DISTRIBUTOR()][DISTRIBUTION()] = true;
461
467
  _coreObjectCombinations[POLICY()][PRODUCT()] = true;
462
-
463
- // pool as parent, ONLY approved
464
468
  _coreObjectCombinations[BUNDLE()][POOL()] = true;
465
469
  _coreObjectCombinations[STAKE()][POOL()] = true;
466
470
  }