@etherisc/gif-next 0.0.2-2a0a7d0-893 → 0.0.2-2a59cd5-352

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 (249) hide show
  1. package/README.md +73 -1
  2. package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
  3. package/artifacts/contracts/components/Component.sol/Component.json +405 -6
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  5. package/artifacts/contracts/components/Distribution.sol/Distribution.json +883 -141
  6. package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
  7. package/artifacts/contracts/components/IComponent.sol/IComponent.json +113 -6
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  9. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +798 -0
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  11. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +662 -43
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  13. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +656 -0
  14. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  15. package/artifacts/contracts/components/Pool.sol/Pool.json +583 -75
  16. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  17. package/artifacts/contracts/components/Product.sol/Product.json +504 -5
  18. package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +1 -1
  19. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +1 -1
  20. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +1 -1
  21. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
  22. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
  23. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
  24. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
  25. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
  26. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
  27. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
  28. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
  29. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
  30. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
  31. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
  32. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +2 -2
  33. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
  34. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
  35. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
  36. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
  37. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
  38. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
  39. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
  40. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +2 -2
  41. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
  42. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  43. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +450 -35
  44. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  45. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +111 -7
  46. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  47. package/artifacts/contracts/instance/Instance.sol/Instance.json +589 -223
  48. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  49. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +39 -89
  50. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  51. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +58 -53
  52. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  53. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +400 -96
  54. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  55. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +175 -25
  56. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
  57. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +2 -2
  58. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
  59. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +166 -7
  60. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  61. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  62. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  63. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +2 -2
  64. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  65. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +2 -2
  66. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  67. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +13 -13
  68. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  69. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  70. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  71. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  72. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
  73. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
  74. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +4 -0
  75. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +1117 -0
  76. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
  77. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +290 -66
  78. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  79. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +169 -19
  80. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
  81. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +439 -27
  82. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  83. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +194 -16
  84. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
  85. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +638 -0
  86. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
  87. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +118 -40
  88. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  89. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +217 -7
  90. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  91. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +33 -20
  92. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  93. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +20 -7
  94. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  95. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +20 -7
  96. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
  97. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +223 -64
  98. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  99. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +182 -32
  100. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  101. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +186 -27
  102. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  103. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +166 -16
  104. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  105. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +186 -27
  106. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  107. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +166 -16
  108. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  109. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  110. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +15 -2
  111. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  112. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +100 -26
  113. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  114. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  115. package/artifacts/contracts/registry/Registry.sol/Registry.json +28 -15
  116. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
  117. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +2 -2
  118. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  119. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +260 -40
  120. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  121. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +166 -16
  122. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
  123. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +11 -11
  124. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  125. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +160 -10
  126. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  127. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  128. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +41 -3
  129. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  130. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +37 -0
  131. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
  132. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +129 -0
  133. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  134. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +18 -5
  135. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
  136. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +69 -0
  137. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  138. package/artifacts/contracts/shared/IService.sol/IService.json +20 -7
  139. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  140. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +2 -2
  141. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  142. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +156 -11
  143. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
  144. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +269 -0
  145. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  146. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +156 -6
  147. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  148. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +152 -11
  149. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
  150. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +105 -0
  151. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  152. package/artifacts/contracts/shared/Service.sol/Service.json +166 -7
  153. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  154. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  155. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
  156. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  157. package/artifacts/contracts/shared/Versionable.sol/Versionable.json +2 -2
  158. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  159. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  160. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +152 -11
  161. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  162. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
  163. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  164. package/artifacts/contracts/test/TestService.sol/TestService.json +184 -25
  165. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  166. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  167. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  168. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +8 -8
  169. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  170. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  171. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  172. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  173. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  174. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
  175. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  176. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  177. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
  178. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  179. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +2 -2
  180. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  181. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
  182. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  183. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  184. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
  185. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  186. package/artifacts/contracts/types/Referral.sol/ReferralLib.json +2 -2
  187. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  188. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
  189. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  190. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
  191. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  192. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  193. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  194. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  195. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  196. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  197. package/contracts/components/Component.sol +121 -62
  198. package/contracts/components/Distribution.sol +207 -53
  199. package/contracts/components/IComponent.sol +16 -3
  200. package/contracts/components/IDistributionComponent.sol +59 -3
  201. package/contracts/components/IPoolComponent.sol +50 -29
  202. package/contracts/components/IProductComponent.sol +5 -1
  203. package/contracts/components/Pool.sol +133 -137
  204. package/contracts/components/Product.sol +90 -107
  205. package/contracts/instance/IInstance.sol +26 -6
  206. package/contracts/instance/IInstanceService.sol +19 -0
  207. package/contracts/instance/Instance.sol +58 -30
  208. package/contracts/instance/InstanceAccessManager.sol +12 -13
  209. package/contracts/instance/InstanceService.sol +119 -39
  210. package/contracts/instance/base/ComponentService.sol +3 -2
  211. package/contracts/instance/module/IAccess.sol +3 -4
  212. package/contracts/instance/module/ISetup.sol +5 -4
  213. package/contracts/instance/service/ApplicationService.sol +268 -0
  214. package/contracts/instance/service/BundleService.sol +11 -6
  215. package/contracts/instance/service/DistributionService.sol +197 -30
  216. package/contracts/instance/service/IApplicationService.sol +82 -0
  217. package/contracts/instance/service/IBundleService.sol +11 -1
  218. package/contracts/instance/service/IDistributionService.sol +53 -0
  219. package/contracts/instance/service/IPolicyService.sol +10 -16
  220. package/contracts/instance/service/PolicyService.sol +84 -98
  221. package/contracts/instance/service/PoolService.sol +9 -42
  222. package/contracts/instance/service/ProductService.sol +20 -28
  223. package/contracts/registry/IRegistry.sol +3 -2
  224. package/contracts/registry/IRegistryService.sol +16 -6
  225. package/contracts/registry/Registry.sol +20 -8
  226. package/contracts/registry/RegistryService.sol +50 -85
  227. package/contracts/registry/ReleaseManager.sol +19 -40
  228. package/contracts/registry/TokenRegistry.sol +4 -3
  229. package/contracts/shared/ERC165.sol +12 -11
  230. package/contracts/shared/INftOwnable.sol +12 -6
  231. package/contracts/shared/IPolicyHolder.sol +26 -0
  232. package/contracts/shared/IRegisterable.sol +4 -4
  233. package/contracts/shared/IRegistryLinked.sol +15 -0
  234. package/contracts/shared/IVersionable.sol +2 -2
  235. package/contracts/shared/NftOwnable.sol +113 -59
  236. package/contracts/shared/PolicyHolder.sol +81 -0
  237. package/contracts/shared/ProxyManager.sol +5 -4
  238. package/contracts/shared/Registerable.sol +15 -24
  239. package/contracts/shared/RegistryLinked.sol +64 -0
  240. package/contracts/shared/Service.sol +5 -5
  241. package/contracts/shared/Versionable.sol +3 -2
  242. package/contracts/test/TestRegisterable.sol +1 -1
  243. package/contracts/test/TestService.sol +1 -1
  244. package/contracts/types/DistributorType.sol +2 -2
  245. package/contracts/types/ObjectType.sol +6 -2
  246. package/package.json +3 -3
  247. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
  248. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -100
  249. package/contracts/instance/base/IInstanceBase.sol +0 -21
@@ -5,124 +5,143 @@ import {POOL} from "../types/ObjectType.sol";
5
5
  import {IPoolService} from "../instance/service/IPoolService.sol";
6
6
  import {IBundleService} from "../instance/service/IBundleService.sol";
7
7
  import {NftId, NftIdLib} from "../types/NftId.sol";
8
- import {Fee} from "../types/Fee.sol";
8
+ import {Fee, FeeLib} from "../types/Fee.sol";
9
9
  import {UFixed} from "../types/UFixed.sol";
10
10
  import {IPoolComponent} from "./IPoolComponent.sol";
11
11
  import {Component} from "./Component.sol";
12
12
  import {TokenHandler} from "../shared/TokenHandler.sol";
13
13
  import {ISetup} from "../instance/module/ISetup.sol";
14
14
 
15
- import {IRegistry} from "../registry/IRegistry.sol";
16
-
17
15
  import {ISetup} from "../instance/module/ISetup.sol";
18
16
  import {InstanceReader} from "../instance/InstanceReader.sol";
19
17
 
20
- import {IRegisterable} from "../shared/IRegisterable.sol";
21
- import {Registerable} from "../shared/Registerable.sol";
22
18
 
23
- abstract contract Pool is Component, IPoolComponent {
24
- using NftIdLib for NftId;
19
+ abstract contract Pool is
20
+ Component,
21
+ IPoolComponent
22
+ {
23
+ // keccak256(abi.encode(uint256(keccak256("etherisc.storage.Pool")) - 1)) & ~bytes32(uint256(0xff));
24
+ bytes32 public constant POOL_STORAGE_LOCATION_V1 = 0x25e3e51823fbfffb988e0a2744bb93722d9f3e906c07cc0a9e77884c46c58300;
25
+
26
+ struct PoolStorage {
27
+ UFixed _collateralizationLevel;
28
+ UFixed _retentionLevel;
25
29
 
26
- bool internal _isConfirmingApplication;
27
- UFixed internal _collateralizationLevel;
30
+ bool _isExternallyManaged;
31
+ bool _isInterceptingBundleTransfers;
32
+ bool _isVerifyingApplications;
28
33
 
29
- Fee internal _initialPoolFee;
30
- Fee internal _initialStakingFee;
31
- Fee internal _initialPerformanceFee;
34
+ Fee _initialPoolFee;
35
+ Fee _initialStakingFee;
36
+ Fee _initialPerformanceFee;
32
37
 
33
- TokenHandler internal _tokenHandler;
38
+ TokenHandler _tokenHandler;
34
39
 
35
- // may be used to interact with instance by derived contracts
36
- IPoolService internal _poolService;
37
- IBundleService private _bundleService;
40
+ // may be used to interact with instance by derived contracts
41
+ IPoolService _poolService;
42
+ IBundleService _bundleService;
43
+ }
38
44
 
39
45
  modifier onlyPoolService() {
40
- require(
41
- msg.sender == address(_poolService),
42
- "ERROR:POL-001:NOT_POOL_SERVICE");
46
+ if(msg.sender != address(_getPoolStorage()._poolService)) {
47
+ revert ErrorPoolNotPoolService(msg.sender);
48
+ }
43
49
  _;
44
50
  }
45
51
 
46
- constructor(
52
+
53
+ function initializePool(
47
54
  address registry,
48
55
  NftId instanceNftId,
56
+ string memory name,
49
57
  // TODO refactor into tokenNftId
50
58
  address token,
51
- bool isInterceptor,
52
- bool isConfirmingApplication,
59
+ bool isInterceptingNftTransfers,
60
+ bool isExternallyManaging,
61
+ bool isVerifying,
53
62
  UFixed collateralizationLevel,
54
- Fee memory poolFee,
55
- Fee memory stakingFee,
56
- Fee memory performanceFee,
57
- address initialOwner
63
+ UFixed retentionLevel,
64
+ address initialOwner,
65
+ bytes memory data
58
66
  )
59
- Component(registry, instanceNftId, token, POOL(), isInterceptor, initialOwner)
60
- {
61
- _isConfirmingApplication = isConfirmingApplication;
62
- // TODO add validation
63
- _collateralizationLevel = collateralizationLevel;
64
- _initialPoolFee = poolFee;
65
- _initialStakingFee = stakingFee;
66
- _initialPerformanceFee = performanceFee;
67
-
68
- _tokenHandler = new TokenHandler(token);
69
-
70
- _poolService = _instance.getPoolService();
71
- // _productService = _instance.getProductService();
72
- _bundleService = _instance.getBundleService();
73
-
74
- _registerInterface(type(IPoolComponent).interfaceId);
75
- }
76
-
77
- function createBundle(
78
- Fee memory fee,
79
- uint256 initialAmount,
80
- uint256 lifetime,
81
- bytes memory filter
82
- )
83
- external
84
- virtual override
85
- returns(NftId bundleNftId)
67
+ public
68
+ virtual
69
+ onlyInitializing()
86
70
  {
87
- address owner = msg.sender;
88
- bundleNftId = _bundleService.createBundle(
89
- owner,
90
- fee,
91
- initialAmount,
92
- lifetime,
93
- filter
94
- );
71
+ initializeComponent(registry, instanceNftId, name, token, POOL(), isInterceptingNftTransfers, initialOwner, data);
95
72
 
96
- // TODO add logging
73
+ PoolStorage storage $ = _getPoolStorage();
74
+ // TODO add validation
75
+ $._tokenHandler = new TokenHandler(token);
76
+ $._isExternallyManaged = isExternallyManaging;
77
+ $._isVerifyingApplications = isVerifying;
78
+ $._collateralizationLevel = collateralizationLevel;
79
+ $._retentionLevel = retentionLevel;
80
+ $._initialPoolFee = FeeLib.zeroFee();
81
+ $._initialStakingFee = FeeLib.zeroFee();
82
+ $._initialPerformanceFee = FeeLib.zeroFee();
83
+ $._poolService = getInstance().getPoolService();
84
+ $._bundleService = getInstance().getBundleService();
85
+
86
+ registerInterface(type(IPoolComponent).interfaceId);
97
87
  }
98
88
 
99
89
  /**
100
- * @dev see {IPool.underwrite}.
90
+ * @dev see {IPool.verifyApplication}.
101
91
  * Default implementation that only writes a {LogUnderwrittenByPool} entry.
102
92
  */
103
- function underwrite(
104
- NftId policyNftId,
105
- bytes memory policyData,
93
+ function verifyApplication(
94
+ NftId applicationNftId,
95
+ bytes memory applicationData,
106
96
  bytes memory bundleFilter,
107
97
  uint256 collateralizationAmount
108
98
  )
109
99
  external
110
- onlyProductService
100
+ restricted()
111
101
  virtual override
112
102
  {
113
- _underwrite(policyNftId, policyData, bundleFilter, collateralizationAmount);
103
+ require(
104
+ policyMatchesBundle(applicationData, bundleFilter),
105
+ "ERROR:POL-020:POLICY_BUNDLE_MISMATCH"
106
+ );
107
+
108
+ emit LogUnderwrittenByPool(applicationNftId, collateralizationAmount, address(this));
114
109
  }
115
110
 
116
- /**
117
- * @dev see {IPoolComponent.policyMatchesBundle}.
118
- * Default implementation always returns true
119
- */
111
+
112
+ function isInterceptingBundleTransfers() external view override returns (bool) {
113
+ return isNftInterceptor();
114
+ }
115
+
116
+
117
+ function isExternallyManaged() external view override returns (bool) {
118
+ return _getPoolStorage()._isExternallyManaged;
119
+ }
120
+
121
+
122
+ function getRetentionLevel() external view override returns (UFixed retentionLevel) {
123
+ return _getPoolStorage()._retentionLevel;
124
+ }
125
+
126
+
127
+ function getCollateralizationLevel() external view override returns (UFixed collateralizationLevel) {
128
+ return _getPoolStorage()._collateralizationLevel;
129
+ }
130
+
131
+
132
+ function isVerifyingApplications() external view override returns (bool isConfirmingApplication) {
133
+ return _getPoolStorage()._isVerifyingApplications;
134
+ }
135
+
136
+
137
+ /// @dev see {IPoolComponent.policyMatchesBundle}.
138
+ /// Default implementation always returns true
120
139
  function policyMatchesBundle(
121
140
  bytes memory, // policyData
122
141
  bytes memory // bundleFilter
123
142
  )
124
143
  public
125
- view
144
+ pure
126
145
  virtual override
127
146
  returns (bool isMatching)
128
147
  {
@@ -130,14 +149,6 @@ abstract contract Pool is Component, IPoolComponent {
130
149
  }
131
150
 
132
151
 
133
- function isConfirmingApplication() external view override returns (bool isConfirmingApplication) {
134
- return _isConfirmingApplication;
135
- }
136
-
137
- function getCollateralizationLevel() external view override returns (UFixed collateralizationLevel) {
138
- return _collateralizationLevel;
139
- }
140
-
141
152
  function setFees(
142
153
  Fee memory poolFee,
143
154
  Fee memory stakingFee,
@@ -145,9 +156,10 @@ abstract contract Pool is Component, IPoolComponent {
145
156
  )
146
157
  external
147
158
  onlyOwner
159
+ restricted()
148
160
  override
149
161
  {
150
- _poolService.setFees(poolFee, stakingFee, performanceFee);
162
+ _getPoolStorage()._poolService.setFees(poolFee, stakingFee, performanceFee);
151
163
  }
152
164
 
153
165
  function setBundleFee(
@@ -158,7 +170,7 @@ abstract contract Pool is Component, IPoolComponent {
158
170
  override
159
171
  // TODO add onlyBundleOwner
160
172
  {
161
- _bundleService.setBundleFee(bundleNftId, fee);
173
+ _getPoolStorage()._bundleService.setBundleFee(bundleNftId, fee);
162
174
  }
163
175
 
164
176
  function lockBundle(
@@ -168,7 +180,7 @@ abstract contract Pool is Component, IPoolComponent {
168
180
  override
169
181
  // TODO add onlyBundleOwner
170
182
  {
171
- _bundleService.lockBundle(bundleNftId);
183
+ _getPoolStorage()._bundleService.lockBundle(bundleNftId);
172
184
  }
173
185
 
174
186
  function unlockBundle(
@@ -178,81 +190,65 @@ abstract contract Pool is Component, IPoolComponent {
178
190
  override
179
191
  // TODO add onlyBundleOwner
180
192
  {
181
- _bundleService.unlockBundle(bundleNftId);
193
+ _getPoolStorage()._bundleService.unlockBundle(bundleNftId);
182
194
  }
183
195
 
184
196
  function getSetupInfo() public view returns (ISetup.PoolSetupInfo memory setupInfo) {
185
- InstanceReader reader = _instance.getInstanceReader();
186
- return reader.getPoolSetupInfo(getNftId());
187
- }
197
+ InstanceReader reader = getInstance().getInstanceReader();
198
+ setupInfo = reader.getPoolSetupInfo(getNftId());
188
199
 
189
- // from IRegisterable
200
+ // fallback to initial setup info (wallet is always != address(0))
201
+ if(setupInfo.wallet == address(0)) {
202
+ setupInfo = _getInitialSetupInfo();
203
+ }
204
+ }
190
205
 
191
- // TODO used only once, occupies space
192
- // TODO do not use super
193
- function getInitialInfo()
194
- public
195
- view
196
- override (IRegisterable, Registerable)
197
- returns (IRegistry.ObjectInfo memory, bytes memory)
198
- {
199
- (
200
- IRegistry.ObjectInfo memory info,
201
- ) = super.getInitialInfo();
202
-
203
- return (
204
- info,
205
- abi.encode(
206
- getName(),
207
- ISetup.PoolSetupInfo(
208
- _productNftId,
209
- _tokenHandler,
210
- _collateralizationLevel,
211
- _initialPoolFee,
212
- _initialStakingFee,
213
- _initialPerformanceFee,
214
- false,
215
- _isConfirmingApplication,
216
- _wallet
217
- )
218
- )
206
+ function _getInitialSetupInfo() internal view returns (ISetup.PoolSetupInfo memory) {
207
+ PoolStorage storage $ = _getPoolStorage();
208
+ return ISetup.PoolSetupInfo(
209
+ getProductNftId(),
210
+ $._tokenHandler,
211
+ isNftInterceptor(),
212
+ $._isExternallyManaged,
213
+ $._isVerifyingApplications,
214
+ $._collateralizationLevel,
215
+ $._retentionLevel,
216
+ $._initialPoolFee,
217
+ $._initialStakingFee,
218
+ $._initialPerformanceFee,
219
+ getWallet()
219
220
  );
220
221
  }
221
222
 
222
223
  // Internals
223
224
 
224
- function _underwrite(
225
- NftId policyNftId,
226
- bytes memory policyData,
227
- bytes memory bundleFilter,
228
- uint256 collateralizationAmount
229
- )
230
- internal
231
- {
232
- require(
233
- policyMatchesBundle(policyData, bundleFilter),
234
- "ERROR:POL-020:POLICY_BUNDLE_MISMATCH"
235
- );
236
-
237
- emit LogUnderwrittenByPool(policyNftId, collateralizationAmount, address(this));
238
- }
239
-
240
225
  function _createBundle(
241
226
  address bundleOwner,
242
227
  Fee memory fee,
243
228
  uint256 amount,
244
229
  uint256 lifetime,
245
- bytes calldata filter
230
+ bytes memory filter
246
231
  )
247
232
  internal
248
233
  returns(NftId bundleNftId)
249
234
  {
250
- bundleNftId = _bundleService.createBundle(
235
+ bundleNftId = _getPoolStorage()._bundleService.createBundle(
251
236
  bundleOwner,
252
237
  fee,
253
238
  amount,
254
239
  lifetime,
255
- filter
256
- );
240
+ filter);
241
+
242
+ // TODO add logging
243
+ }
244
+
245
+ function getContractLocation(bytes memory name) external pure returns (bytes32 hash) {
246
+ return keccak256(abi.encode(uint256(keccak256(name)) - 1)) & ~bytes32(uint256(0xff));
247
+ }
248
+
249
+ function _getPoolStorage() private pure returns (PoolStorage storage $) {
250
+ assembly {
251
+ $.slot := POOL_STORAGE_LOCATION_V1
252
+ }
257
253
  }
258
254
  }
@@ -15,9 +15,6 @@ import {Timestamp} from "../types/Timestamp.sol";
15
15
  import {Fee} from "../types/Fee.sol";
16
16
  import {Component} from "./Component.sol";
17
17
 
18
- import {IRegistry} from "../registry/IRegistry.sol";
19
- import {IRegisterable} from "../shared/IRegisterable.sol";
20
- import {Registerable} from "../shared/Registerable.sol";
21
18
  import {TokenHandler} from "../shared/TokenHandler.sol";
22
19
 
23
20
  import {InstanceReader} from "../instance/InstanceReader.sol";
@@ -25,43 +22,55 @@ import {ISetup} from "../instance/module/ISetup.sol";
25
22
  import {Pool} from "../components/Pool.sol";
26
23
  import {Distribution} from "../components/Distribution.sol";
27
24
 
28
- abstract contract Product is Component, IProductComponent {
29
- using NftIdLib for NftId;
30
-
31
- IPolicyService internal _policyService;
32
- Pool internal _pool;
33
- Distribution internal _distribution;
34
- Fee internal _initialProductFee;
35
- Fee internal _initialProcessingFee;
36
- TokenHandler internal _tokenHandler;
37
-
38
- NftId internal _poolNftId;
39
- NftId internal _distributionNftId;
25
+ abstract contract Product is
26
+ Component,
27
+ IProductComponent
28
+ {
29
+ // keccak256(abi.encode(uint256(keccak256("etherisc.storage.Product")) - 1)) & ~bytes32(uint256(0xff));
30
+ bytes32 public constant PRODUCT_STORAGE_LOCATION_V1 = 0x0bb7aafdb8e380f81267337bc5b5dfdf76e6d3a380ecadb51ec665246d9d6800;
31
+
32
+ struct ProductStorage {
33
+ IPolicyService _policyService;
34
+ Pool _pool;
35
+ Distribution _distribution;
36
+ Fee _initialProductFee;
37
+ Fee _initialProcessingFee;
38
+ TokenHandler _tokenHandler;
39
+ NftId _poolNftId;
40
+ NftId _distributionNftId;
41
+ }
40
42
 
41
- constructor(
43
+ function initializeProduct(
42
44
  address registry,
43
- NftId instanceNftid,
45
+ NftId instanceNftId,
46
+ string memory name,
44
47
  address token,
45
48
  bool isInterceptor,
46
49
  address pool,
47
50
  address distribution,
48
51
  Fee memory productFee,
49
52
  Fee memory processingFee,
50
- address initialOwner
51
- ) Component(registry, instanceNftid, token, PRODUCT(), isInterceptor, initialOwner) {
52
- // TODO add validation
53
- _policyService = _instance.getPolicyService();
54
- _pool = Pool(pool);
55
- _distribution = Distribution(distribution);
56
- _initialProductFee = productFee;
57
- _initialProcessingFee = processingFee;
58
-
59
- _tokenHandler = new TokenHandler(token);
60
-
61
- _poolNftId = getRegistry().getNftId(address(_pool));
62
- _distributionNftId = getRegistry().getNftId(address(_distribution));
53
+ address initialOwner,
54
+ bytes memory data
55
+ )
56
+ public
57
+ virtual
58
+ onlyInitializing()
59
+ {
60
+ initializeComponent(registry, instanceNftId, name, token, PRODUCT(), isInterceptor, initialOwner, data);
63
61
 
64
- _registerInterface(type(IProductComponent).interfaceId);
62
+ ProductStorage storage $ = _getProductStorage();
63
+ // TODO add validation
64
+ $._policyService = getInstance().getPolicyService();
65
+ $._pool = Pool(pool);
66
+ $._distribution = Distribution(distribution);
67
+ $._initialProductFee = productFee;
68
+ $._initialProcessingFee = processingFee;
69
+ $._tokenHandler = new TokenHandler(token);
70
+ $._poolNftId = getRegistry().getNftId(pool);
71
+ $._distributionNftId = getRegistry().getNftId(distribution);
72
+
73
+ registerInterface(type(IProductComponent).interfaceId);
65
74
  }
66
75
 
67
76
 
@@ -78,7 +87,7 @@ abstract contract Product is Component, IProductComponent {
78
87
  override
79
88
  returns (uint256 premiumAmount)
80
89
  {
81
- (premiumAmount,,,,) = _policyService.calculatePremium(
90
+ (premiumAmount,,,,) = _getProductStorage()._policyService.calculatePremium(
82
91
  riskId,
83
92
  sumInsuredAmount,
84
93
  lifetime,
@@ -112,7 +121,7 @@ abstract contract Product is Component, IProductComponent {
112
121
  RiskId id,
113
122
  bytes memory data
114
123
  ) internal {
115
- _productService.createRisk(
124
+ getProductService().createRisk(
116
125
  id,
117
126
  data
118
127
  );
@@ -122,7 +131,7 @@ abstract contract Product is Component, IProductComponent {
122
131
  RiskId id,
123
132
  bytes memory data
124
133
  ) internal {
125
- _productService.updateRisk(
134
+ getProductService().updateRisk(
126
135
  id,
127
136
  data
128
137
  );
@@ -132,14 +141,14 @@ abstract contract Product is Component, IProductComponent {
132
141
  RiskId id,
133
142
  StateId state
134
143
  ) internal {
135
- _productService.updateRiskState(
144
+ getProductService().updateRiskState(
136
145
  id,
137
146
  state
138
147
  );
139
148
  }
140
149
 
141
150
  function _getRiskInfo(RiskId id) internal view returns (IRisk.RiskInfo memory info) {
142
- return _instance.getInstanceReader().getRiskInfo(id);
151
+ return getInstance().getInstanceReader().getRiskInfo(id);
143
152
  }
144
153
 
145
154
  function _createApplication(
@@ -150,8 +159,11 @@ abstract contract Product is Component, IProductComponent {
150
159
  bytes memory applicationData,
151
160
  NftId bundleNftId,
152
161
  ReferralId referralId
153
- ) internal returns (NftId nftId) {
154
- nftId = _policyService.createApplication(
162
+ )
163
+ internal
164
+ returns (NftId nftId)
165
+ {
166
+ return _getProductStorage()._policyService.createApplication(
155
167
  applicationOwner,
156
168
  riskId,
157
169
  sumInsuredAmount,
@@ -169,7 +181,7 @@ abstract contract Product is Component, IProductComponent {
169
181
  )
170
182
  internal
171
183
  {
172
- _policyService.underwrite(
184
+ _getProductStorage()._policyService.underwrite(
173
185
  policyNftId,
174
186
  requirePremiumPayment,
175
187
  activateAt);
@@ -181,7 +193,7 @@ abstract contract Product is Component, IProductComponent {
181
193
  )
182
194
  internal
183
195
  {
184
- _policyService.collectPremium(
196
+ _getProductStorage()._policyService.collectPremium(
185
197
  policyNftId,
186
198
  activateAt);
187
199
  }
@@ -192,7 +204,7 @@ abstract contract Product is Component, IProductComponent {
192
204
  )
193
205
  internal
194
206
  {
195
- _policyService.activate(
207
+ _getProductStorage()._policyService.activate(
196
208
  policyNftId,
197
209
  activateAt);
198
210
  }
@@ -202,15 +214,15 @@ abstract contract Product is Component, IProductComponent {
202
214
  )
203
215
  internal
204
216
  {
205
- _policyService.close(policyNftId);
217
+ _getProductStorage()._policyService.close(policyNftId);
206
218
  }
207
219
 
208
220
  function getPoolNftId() external view override returns (NftId poolNftId) {
209
- return getRegistry().getNftId(address(_pool));
221
+ return getRegistry().getNftId(address(_getProductStorage()._pool));
210
222
  }
211
223
 
212
224
  function getDistributionNftId() external view override returns (NftId distributionNftId) {
213
- return getRegistry().getNftId(address(_distribution));
225
+ return getRegistry().getNftId(address(_getProductStorage()._distribution));
214
226
  }
215
227
 
216
228
  // from product component
@@ -220,76 +232,47 @@ abstract contract Product is Component, IProductComponent {
220
232
  )
221
233
  external
222
234
  onlyOwner
235
+ restricted()
223
236
  override
224
237
  {
225
- _productService.setFees(productFee, processingFee);
238
+ getProductService().setFees(productFee, processingFee);
226
239
  }
227
240
 
228
241
  function getSetupInfo() public view returns (ISetup.ProductSetupInfo memory setupInfo) {
229
- InstanceReader reader = _instance.getInstanceReader();
230
- return reader.getProductSetupInfo(getNftId());
231
- }
242
+ InstanceReader reader = getInstance().getInstanceReader();
243
+ setupInfo = reader.getProductSetupInfo(getNftId());
232
244
 
233
- // from IRegisterable
245
+ // fallback to initial setup info (wallet is always != address(0))
246
+ if(setupInfo.wallet == address(0)) {
247
+ setupInfo = _getInitialSetupInfo();
248
+ }
249
+ }
234
250
 
235
- function getInitialInfo()
236
- public
237
- view
238
- override (IRegisterable, Registerable)
239
- returns (IRegistry.ObjectInfo memory, bytes memory)
240
- {
241
- // from Registerable
242
- (
243
- IRegistry.ObjectInfo memory productInfo,
244
- bytes memory data
245
- ) = super.getInitialInfo();
246
-
247
- // TODO read pool & distribution fees
248
- // 1) from pool -> the only option -> pool must be registered first?
249
- // 2) from instance -> all fees are set into instance at product registration which is ongoing here
250
- // checks are done in registryProduct() where THIS function is called
251
- //require(getRegistry().getObjectInfo(_poolNftId).objectType == POOL(), "POOL_NOT_REGISTERED");
252
- //require(getRegistry().getObjectInfo(_distributionNftId).objectType == DISTRIBUTION(), "DISTRIBUTION_NOT_REGISTERED");
253
-
254
- // from PoolComponent
255
- (
256
- ,
257
- bytes memory poolData
258
- ) = _pool.getInitialInfo();
259
-
260
- (
261
- , ISetup.PoolSetupInfo memory poolSetupInfo
262
- ) = abi.decode(poolData, (string, ISetup.PoolSetupInfo));
263
-
264
- // from DistributionComponent
265
- (
266
- ,
267
- bytes memory distributionData
268
- ) = _distribution.getInitialInfo();
269
-
270
- (
271
- , ISetup.DistributionSetupInfo memory distributionSetupInfo
272
- ) = abi.decode(distributionData, (string, ISetup.DistributionSetupInfo));
273
-
274
- return (
275
- productInfo,
276
- abi.encode(
277
- getName(),
278
- ISetup.ProductSetupInfo(
279
- _token,
280
- _tokenHandler,
281
- _distributionNftId,
282
- _poolNftId,
283
- distributionSetupInfo.distributionFee,
284
- _initialProductFee,
285
- _initialProcessingFee,
286
- poolSetupInfo.poolFee,
287
- poolSetupInfo.stakingFee,
288
- poolSetupInfo.performanceFee,
289
- false,
290
- _wallet
291
- )
292
- )
251
+ function _getInitialSetupInfo() internal view returns (ISetup.ProductSetupInfo memory setupInfo) {
252
+ ProductStorage storage $ = _getProductStorage();
253
+
254
+ ISetup.DistributionSetupInfo memory distributionSetupInfo = $._distribution.getSetupInfo();
255
+ ISetup.PoolSetupInfo memory poolSetupInfo = $._pool.getSetupInfo();
256
+
257
+ return ISetup.ProductSetupInfo(
258
+ getToken(),
259
+ $._tokenHandler,
260
+ $._distributionNftId,
261
+ $._poolNftId,
262
+ distributionSetupInfo.distributionFee,
263
+ $._initialProductFee,
264
+ $._initialProcessingFee,
265
+ poolSetupInfo.poolFee,
266
+ poolSetupInfo.stakingFee,
267
+ poolSetupInfo.performanceFee,
268
+ false,
269
+ getWallet()
293
270
  );
294
271
  }
272
+
273
+ function _getProductStorage() private pure returns (ProductStorage storage $) {
274
+ assembly {
275
+ $.slot := PRODUCT_STORAGE_LOCATION_V1
276
+ }
277
+ }
295
278
  }