@etherisc/gif-next 0.0.2-b244df3-779 → 0.0.2-b38343e-249
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.
- package/README.md +73 -1
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/components/Component.sol/Component.json +853 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +887 -242
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/components/{BaseComponent.sol/BaseComponent.json → IComponent.sol/IComponent.json} +160 -100
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +791 -0
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +655 -43
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +654 -5
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +600 -217
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +543 -152
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +1 -1
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +1 -1
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +1 -1
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +2 -2
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +38 -62
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +881 -121
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +168 -166
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +791 -438
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +118 -173
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +61 -97
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +390 -362
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +299 -130
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +8 -32
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +4 -0
- package/artifacts/contracts/instance/base/{ComponentServiceBase.sol/ComponentServiceBase.json → ComponentService.sol/ComponentService.json} +188 -168
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +2 -2
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +2 -2
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +24 -13
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +858 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +657 -0
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +408 -246
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +302 -81
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +743 -0
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +637 -0
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +443 -192
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +322 -73
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/{IComponentOwnerService.sol/IComponentOwnerService.json → IApplicationService.sol/IApplicationService.json} +200 -204
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +170 -217
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/{components/IBaseComponent.sol/IBaseComponent.json → instance/service/IClaimService.sol/IClaimService.json} +154 -124
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +197 -163
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +138 -230
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +23 -186
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +29 -192
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +392 -267
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +339 -86
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +216 -218
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +299 -78
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +217 -219
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +305 -76
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +225 -133
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +149 -217
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +238 -235
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +285 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +195 -322
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +298 -145
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +547 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +141 -53
- package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +41 -3
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +40 -29
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +129 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +21 -34
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +48 -0
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +23 -186
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +2 -152
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +120 -27
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +248 -0
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +294 -61
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +129 -51
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +84 -0
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +119 -173
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/shared/Versionable.sol/Versionable.json +2 -152
- package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +129 -51
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
- package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
- package/artifacts/contracts/test/TestService.sol/TestService.json +140 -230
- package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +8 -190
- package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
- package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +100 -0
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.json +100 -0
- package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
- package/contracts/components/Component.sol +242 -0
- package/contracts/components/Distribution.sol +209 -64
- package/contracts/components/IComponent.sol +55 -0
- package/contracts/components/IDistributionComponent.sol +59 -3
- package/contracts/components/IPoolComponent.sol +50 -29
- package/contracts/components/IProductComponent.sol +7 -3
- package/contracts/components/Pool.sol +135 -152
- package/contracts/components/Product.sol +114 -121
- package/contracts/instance/BundleManager.sol +7 -11
- package/contracts/instance/IInstance.sol +42 -10
- package/contracts/instance/IInstanceService.sol +27 -2
- package/contracts/instance/Instance.sol +84 -69
- package/contracts/instance/InstanceAccessManager.sol +36 -41
- package/contracts/instance/InstanceReader.sol +3 -25
- package/contracts/instance/InstanceService.sol +271 -79
- package/contracts/instance/InstanceServiceManager.sol +6 -9
- package/contracts/instance/ObjectManager.sol +7 -24
- package/contracts/instance/base/ComponentService.sol +134 -0
- package/contracts/instance/module/IAccess.sol +4 -5
- package/contracts/instance/module/IPolicy.sol +4 -2
- package/contracts/instance/module/ISetup.sol +5 -4
- package/contracts/instance/service/ApplicationService.sol +268 -0
- package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
- package/contracts/instance/service/BundleService.sol +52 -14
- package/contracts/instance/service/BundleServiceManager.sol +6 -9
- package/contracts/instance/service/ClaimService.sol +151 -0
- package/contracts/instance/service/ClaimServiceManager.sol +35 -0
- package/contracts/instance/service/DistributionService.sol +208 -49
- package/contracts/instance/service/DistributionServiceManager.sol +7 -10
- package/contracts/instance/service/IApplicationService.sol +82 -0
- package/contracts/instance/service/IBundleService.sol +12 -3
- package/contracts/instance/service/IClaimService.sol +61 -0
- package/contracts/instance/service/IDistributionService.sol +53 -0
- package/contracts/instance/service/IPolicyService.sol +48 -46
- package/contracts/instance/service/PolicyService.sol +156 -190
- package/contracts/instance/service/PolicyServiceManager.sol +2 -2
- package/contracts/instance/service/PoolService.sol +27 -42
- package/contracts/instance/service/PoolServiceManager.sol +6 -9
- package/contracts/instance/service/ProductService.sol +100 -40
- package/contracts/instance/service/ProductServiceManager.sol +2 -2
- package/contracts/registry/ChainNft.sol +1 -1
- package/contracts/registry/IRegistry.sol +37 -19
- package/contracts/registry/IRegistryService.sol +30 -13
- package/contracts/registry/Registry.sol +233 -217
- package/contracts/registry/RegistryAccessManager.sol +216 -0
- package/contracts/registry/RegistryService.sol +96 -171
- package/contracts/registry/RegistryServiceManager.sol +21 -39
- package/contracts/registry/ReleaseManager.sol +322 -0
- package/contracts/registry/TokenRegistry.sol +22 -17
- package/contracts/shared/ERC165.sol +14 -12
- package/contracts/shared/INftOwnable.sol +11 -10
- package/contracts/shared/IPolicyHolder.sol +26 -0
- package/contracts/shared/IRegisterable.sol +4 -6
- package/contracts/shared/IRegistryLinked.sol +12 -0
- package/contracts/shared/IService.sol +2 -1
- package/contracts/shared/IVersionable.sol +4 -47
- package/contracts/shared/NftOwnable.sol +66 -80
- package/contracts/shared/PolicyHolder.sol +81 -0
- package/contracts/shared/ProxyManager.sol +100 -25
- package/contracts/shared/Registerable.sol +14 -30
- package/contracts/shared/RegistryLinked.sol +48 -0
- package/contracts/shared/Service.sol +25 -22
- package/contracts/shared/Versionable.sol +4 -92
- package/contracts/test/TestRegisterable.sol +1 -1
- package/contracts/test/TestService.sol +4 -3
- package/contracts/types/ClaimId.sol +52 -0
- package/contracts/types/DistributorType.sol +2 -2
- package/contracts/types/ObjectType.sol +9 -5
- package/contracts/types/PayoutId.sol +54 -0
- package/contracts/types/RoleId.sol +6 -8
- package/package.json +3 -3
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
- package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +0 -4
- package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.json +0 -1082
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.json +0 -448
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.json +0 -763
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -113
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -827
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +0 -4
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.json +0 -442
- package/contracts/components/BaseComponent.sol +0 -132
- package/contracts/components/IBaseComponent.sol +0 -31
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +0 -23
- package/contracts/instance/IAccessManagerSimple.sol +0 -391
- package/contracts/instance/IInstanceBase.sol +0 -26
- package/contracts/instance/InstanceBase.sol +0 -41
- package/contracts/instance/base/ComponentServiceBase.sol +0 -72
- package/contracts/instance/base/IInstanceBase.sol +0 -23
- package/contracts/instance/service/ComponentOwnerService.sol +0 -317
- package/contracts/instance/service/IComponentOwnerService.sol +0 -20
- package/contracts/shared/RegisterableUpgradable.sol +0 -16
@@ -4,22 +4,19 @@ pragma solidity ^0.8.19;
|
|
4
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
5
|
|
6
6
|
import {IRisk} from "../instance/module/IRisk.sol";
|
7
|
-
import {
|
8
|
-
import {IProductService} from "../instance/service/IProductService.sol";
|
7
|
+
import {IApplicationService} from "../instance/service/IApplicationService.sol";
|
9
8
|
import {IPolicyService} from "../instance/service/IPolicyService.sol";
|
9
|
+
import {IClaimService} from "../instance/service/IClaimService.sol";
|
10
10
|
import {IProductComponent} from "./IProductComponent.sol";
|
11
|
-
import {NftId,
|
12
|
-
import {
|
11
|
+
import {NftId, NftIdLib} from "../types/NftId.sol";
|
12
|
+
import {PRODUCT, APPLICATION, POLICY, CLAIM } from "../types/ObjectType.sol";
|
13
13
|
import {ReferralId} from "../types/Referral.sol";
|
14
14
|
import {RiskId, RiskIdLib} from "../types/RiskId.sol";
|
15
15
|
import {StateId} from "../types/StateId.sol";
|
16
16
|
import {Timestamp} from "../types/Timestamp.sol";
|
17
|
-
import {Fee
|
18
|
-
import {
|
17
|
+
import {Fee} from "../types/Fee.sol";
|
18
|
+
import {Component} from "./Component.sol";
|
19
19
|
|
20
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
21
|
-
import {IRegisterable} from "../shared/IRegisterable.sol";
|
22
|
-
import {Registerable} from "../shared/Registerable.sol";
|
23
20
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
24
21
|
|
25
22
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
@@ -27,47 +24,60 @@ import {ISetup} from "../instance/module/ISetup.sol";
|
|
27
24
|
import {Pool} from "../components/Pool.sol";
|
28
25
|
import {Distribution} from "../components/Distribution.sol";
|
29
26
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
27
|
+
abstract contract Product is
|
28
|
+
Component,
|
29
|
+
IProductComponent
|
30
|
+
{
|
31
|
+
// keccak256(abi.encode(uint256(keccak256("etherisc.storage.Product")) - 1)) & ~bytes32(uint256(0xff));
|
32
|
+
bytes32 public constant PRODUCT_STORAGE_LOCATION_V1 = 0x0bb7aafdb8e380f81267337bc5b5dfdf76e6d3a380ecadb51ec665246d9d6800;
|
33
|
+
|
34
|
+
struct ProductStorage {
|
35
|
+
IApplicationService _applicationService;
|
36
|
+
IPolicyService _policyService;
|
37
|
+
IClaimService _claimService;
|
38
|
+
Pool _pool;
|
39
|
+
Distribution _distribution;
|
40
|
+
Fee _initialProductFee;
|
41
|
+
Fee _initialProcessingFee;
|
42
|
+
TokenHandler _tokenHandler;
|
43
|
+
NftId _poolNftId;
|
44
|
+
NftId _distributionNftId;
|
45
|
+
}
|
45
46
|
|
46
|
-
|
47
|
+
function initializeProduct(
|
47
48
|
address registry,
|
48
|
-
NftId
|
49
|
+
NftId instanceNftId,
|
50
|
+
string memory name,
|
49
51
|
address token,
|
50
52
|
bool isInterceptor,
|
51
53
|
address pool,
|
52
54
|
address distribution,
|
53
55
|
Fee memory productFee,
|
54
56
|
Fee memory processingFee,
|
55
|
-
address initialOwner
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
_initialProcessingFee = processingFee;
|
64
|
-
|
65
|
-
_tokenHandler = new TokenHandler(token);
|
66
|
-
|
67
|
-
_poolNftId = getRegistry().getNftId(address(_pool));
|
68
|
-
_distributionNftId = getRegistry().getNftId(address(_distribution));
|
57
|
+
address initialOwner,
|
58
|
+
bytes memory data
|
59
|
+
)
|
60
|
+
public
|
61
|
+
virtual
|
62
|
+
onlyInitializing()
|
63
|
+
{
|
64
|
+
initializeComponent(registry, instanceNftId, name, token, PRODUCT(), isInterceptor, initialOwner, data);
|
69
65
|
|
70
|
-
|
66
|
+
ProductStorage storage $ = _getProductStorage();
|
67
|
+
// TODO add validation
|
68
|
+
// TODO refactor to go via registry
|
69
|
+
$._applicationService = IApplicationService(getServiceAddress(APPLICATION()));
|
70
|
+
$._policyService = IPolicyService(getServiceAddress(POLICY()));
|
71
|
+
$._claimService = IClaimService(getServiceAddress(CLAIM()));
|
72
|
+
$._pool = Pool(pool);
|
73
|
+
$._distribution = Distribution(distribution);
|
74
|
+
$._initialProductFee = productFee;
|
75
|
+
$._initialProcessingFee = processingFee;
|
76
|
+
$._tokenHandler = new TokenHandler(token);
|
77
|
+
$._poolNftId = getRegistry().getNftId(pool);
|
78
|
+
$._distributionNftId = getRegistry().getNftId(distribution);
|
79
|
+
|
80
|
+
registerInterface(type(IProductComponent).interfaceId);
|
71
81
|
}
|
72
82
|
|
73
83
|
|
@@ -76,15 +86,15 @@ contract Product is BaseComponent, IProductComponent {
|
|
76
86
|
RiskId riskId,
|
77
87
|
uint256 lifetime,
|
78
88
|
bytes memory applicationData,
|
79
|
-
|
80
|
-
|
89
|
+
NftId bundleNftId,
|
90
|
+
ReferralId referralId
|
81
91
|
)
|
82
92
|
external
|
83
93
|
view
|
84
94
|
override
|
85
95
|
returns (uint256 premiumAmount)
|
86
96
|
{
|
87
|
-
(premiumAmount,,,,) = _policyService.calculatePremium(
|
97
|
+
(premiumAmount,,,,) = _getProductStorage()._policyService.calculatePremium(
|
88
98
|
riskId,
|
89
99
|
sumInsuredAmount,
|
90
100
|
lifetime,
|
@@ -118,7 +128,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
118
128
|
RiskId id,
|
119
129
|
bytes memory data
|
120
130
|
) internal {
|
121
|
-
|
131
|
+
getProductService().createRisk(
|
122
132
|
id,
|
123
133
|
data
|
124
134
|
);
|
@@ -128,7 +138,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
128
138
|
RiskId id,
|
129
139
|
bytes memory data
|
130
140
|
) internal {
|
131
|
-
|
141
|
+
getProductService().updateRisk(
|
132
142
|
id,
|
133
143
|
data
|
134
144
|
);
|
@@ -138,14 +148,14 @@ contract Product is BaseComponent, IProductComponent {
|
|
138
148
|
RiskId id,
|
139
149
|
StateId state
|
140
150
|
) internal {
|
141
|
-
|
151
|
+
getProductService().updateRiskState(
|
142
152
|
id,
|
143
153
|
state
|
144
154
|
);
|
145
155
|
}
|
146
156
|
|
147
157
|
function _getRiskInfo(RiskId id) internal view returns (IRisk.RiskInfo memory info) {
|
148
|
-
return
|
158
|
+
return getInstance().getInstanceReader().getRiskInfo(id);
|
149
159
|
}
|
150
160
|
|
151
161
|
function _createApplication(
|
@@ -153,18 +163,21 @@ contract Product is BaseComponent, IProductComponent {
|
|
153
163
|
RiskId riskId,
|
154
164
|
uint256 sumInsuredAmount,
|
155
165
|
uint256 lifetime,
|
156
|
-
bytes memory applicationData,
|
157
166
|
NftId bundleNftId,
|
158
|
-
ReferralId referralId
|
159
|
-
|
160
|
-
|
167
|
+
ReferralId referralId,
|
168
|
+
bytes memory applicationData
|
169
|
+
)
|
170
|
+
internal
|
171
|
+
returns (NftId applicationNftId)
|
172
|
+
{
|
173
|
+
return _getProductStorage()._applicationService.create(
|
161
174
|
applicationOwner,
|
162
175
|
riskId,
|
163
176
|
sumInsuredAmount,
|
164
177
|
lifetime,
|
165
|
-
applicationData,
|
166
178
|
bundleNftId,
|
167
|
-
referralId
|
179
|
+
referralId,
|
180
|
+
applicationData
|
168
181
|
);
|
169
182
|
}
|
170
183
|
|
@@ -175,7 +188,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
175
188
|
)
|
176
189
|
internal
|
177
190
|
{
|
178
|
-
_policyService.underwrite(
|
191
|
+
_getProductStorage()._policyService.underwrite(
|
179
192
|
policyNftId,
|
180
193
|
requirePremiumPayment,
|
181
194
|
activateAt);
|
@@ -187,7 +200,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
187
200
|
)
|
188
201
|
internal
|
189
202
|
{
|
190
|
-
_policyService.collectPremium(
|
203
|
+
_getProductStorage()._policyService.collectPremium(
|
191
204
|
policyNftId,
|
192
205
|
activateAt);
|
193
206
|
}
|
@@ -198,17 +211,25 @@ contract Product is BaseComponent, IProductComponent {
|
|
198
211
|
)
|
199
212
|
internal
|
200
213
|
{
|
201
|
-
_policyService.activate(
|
214
|
+
_getProductStorage()._policyService.activate(
|
202
215
|
policyNftId,
|
203
216
|
activateAt);
|
204
217
|
}
|
205
218
|
|
219
|
+
function _close(
|
220
|
+
NftId policyNftId
|
221
|
+
)
|
222
|
+
internal
|
223
|
+
{
|
224
|
+
_getProductStorage()._policyService.close(policyNftId);
|
225
|
+
}
|
226
|
+
|
206
227
|
function getPoolNftId() external view override returns (NftId poolNftId) {
|
207
|
-
return getRegistry().getNftId(address(_pool));
|
228
|
+
return getRegistry().getNftId(address(_getProductStorage()._pool));
|
208
229
|
}
|
209
230
|
|
210
231
|
function getDistributionNftId() external view override returns (NftId distributionNftId) {
|
211
|
-
return getRegistry().getNftId(address(_distribution));
|
232
|
+
return getRegistry().getNftId(address(_getProductStorage()._distribution));
|
212
233
|
}
|
213
234
|
|
214
235
|
// from product component
|
@@ -218,75 +239,47 @@ contract Product is BaseComponent, IProductComponent {
|
|
218
239
|
)
|
219
240
|
external
|
220
241
|
onlyOwner
|
242
|
+
restricted()
|
221
243
|
override
|
222
244
|
{
|
223
|
-
|
245
|
+
getProductService().setFees(productFee, processingFee);
|
224
246
|
}
|
225
247
|
|
226
248
|
function getSetupInfo() public view returns (ISetup.ProductSetupInfo memory setupInfo) {
|
227
|
-
InstanceReader reader =
|
228
|
-
|
229
|
-
}
|
249
|
+
InstanceReader reader = getInstance().getInstanceReader();
|
250
|
+
setupInfo = reader.getProductSetupInfo(getNftId());
|
230
251
|
|
231
|
-
|
252
|
+
// fallback to initial setup info (wallet is always != address(0))
|
253
|
+
if(setupInfo.wallet == address(0)) {
|
254
|
+
setupInfo = _getInitialSetupInfo();
|
255
|
+
}
|
256
|
+
}
|
232
257
|
|
233
|
-
function
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
// from PoolComponent
|
253
|
-
(
|
254
|
-
,
|
255
|
-
bytes memory poolData
|
256
|
-
) = _pool.getInitialInfo();
|
257
|
-
|
258
|
-
(
|
259
|
-
ISetup.PoolSetupInfo memory poolSetupInfo
|
260
|
-
) = abi.decode(poolData, (ISetup.PoolSetupInfo));
|
261
|
-
|
262
|
-
// from DistributionComponent
|
263
|
-
(
|
264
|
-
,
|
265
|
-
bytes memory distributionData
|
266
|
-
) = _distribution.getInitialInfo();
|
267
|
-
|
268
|
-
(
|
269
|
-
ISetup.DistributionSetupInfo memory distributionSetupInfo
|
270
|
-
) = abi.decode(distributionData, (ISetup.DistributionSetupInfo));
|
271
|
-
|
272
|
-
return (
|
273
|
-
productInfo,
|
274
|
-
abi.encode(
|
275
|
-
ISetup.ProductSetupInfo(
|
276
|
-
_token,
|
277
|
-
_tokenHandler,
|
278
|
-
_distributionNftId,
|
279
|
-
_poolNftId,
|
280
|
-
distributionSetupInfo.distributionFee,
|
281
|
-
_initialProductFee,
|
282
|
-
_initialProcessingFee,
|
283
|
-
poolSetupInfo.poolFee,
|
284
|
-
poolSetupInfo.stakingFee,
|
285
|
-
poolSetupInfo.performanceFee,
|
286
|
-
false,
|
287
|
-
_wallet
|
288
|
-
)
|
289
|
-
)
|
258
|
+
function _getInitialSetupInfo() internal view returns (ISetup.ProductSetupInfo memory setupInfo) {
|
259
|
+
ProductStorage storage $ = _getProductStorage();
|
260
|
+
|
261
|
+
ISetup.DistributionSetupInfo memory distributionSetupInfo = $._distribution.getSetupInfo();
|
262
|
+
ISetup.PoolSetupInfo memory poolSetupInfo = $._pool.getSetupInfo();
|
263
|
+
|
264
|
+
return ISetup.ProductSetupInfo(
|
265
|
+
getToken(),
|
266
|
+
$._tokenHandler,
|
267
|
+
$._distributionNftId,
|
268
|
+
$._poolNftId,
|
269
|
+
distributionSetupInfo.distributionFee,
|
270
|
+
$._initialProductFee,
|
271
|
+
$._initialProcessingFee,
|
272
|
+
poolSetupInfo.poolFee,
|
273
|
+
poolSetupInfo.stakingFee,
|
274
|
+
poolSetupInfo.performanceFee,
|
275
|
+
false,
|
276
|
+
getWallet()
|
290
277
|
);
|
291
278
|
}
|
279
|
+
|
280
|
+
function _getProductStorage() private pure returns (ProductStorage storage $) {
|
281
|
+
assembly {
|
282
|
+
$.slot := PRODUCT_STORAGE_LOCATION_V1
|
283
|
+
}
|
284
|
+
}
|
292
285
|
}
|
@@ -32,17 +32,13 @@ contract BundleManager is
|
|
32
32
|
|
33
33
|
mapping(NftId bundleNftId => LibNftIdSet.Set policies) internal _activePolicies;
|
34
34
|
|
35
|
-
constructor() ObjectManager() {
|
36
|
-
}
|
37
|
-
|
38
|
-
|
39
35
|
/// @dev links a policy with its bundle
|
40
36
|
// to link a policy it MUST NOT yet have been activated
|
41
37
|
// the bundle MUST be unlocked (active) for linking (underwriting) and registered with this instance
|
42
38
|
function linkPolicy(NftId policyNftId) external restricted() {
|
43
|
-
NftId bundleNftId =
|
39
|
+
NftId bundleNftId = _instance.getInstanceReader().getPolicyInfo(policyNftId).bundleNftId;
|
44
40
|
// decision will likely depend on the decision what to check here and what in the service
|
45
|
-
NftId poolNftId =
|
41
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
46
42
|
|
47
43
|
// ensure bundle is unlocked (in active set) and registered with this instance
|
48
44
|
if (!_isActive(poolNftId, bundleNftId)) {
|
@@ -59,11 +55,11 @@ contract BundleManager is
|
|
59
55
|
// - the policy MUST be past its expiry period and it MUST NOT have any open claims
|
60
56
|
// - the policy's payoutAmount MUST be equal to its sumInsuredAmount and MUST NOT have any open claims
|
61
57
|
function unlinkPolicy(NftId policyNftId) external restricted() {
|
62
|
-
IPolicy.PolicyInfo memory policyInfo =
|
58
|
+
IPolicy.PolicyInfo memory policyInfo = _instance.getInstanceReader().getPolicyInfo(policyNftId);
|
63
59
|
|
64
60
|
NftId bundleNftId = policyInfo.bundleNftId;
|
65
61
|
// decision will likely depend on the decision what to check here and what in the service
|
66
|
-
NftId poolNftId =
|
62
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
67
63
|
|
68
64
|
// ensure bundle is registered with this instance
|
69
65
|
if (!_contains(poolNftId, bundleNftId)) {
|
@@ -78,7 +74,7 @@ contract BundleManager is
|
|
78
74
|
/// @dev add a new bundle to a riskpool registerd with this instance
|
79
75
|
// the corresponding pool is fetched via instance reader
|
80
76
|
function add(NftId bundleNftId) external restricted() {
|
81
|
-
NftId poolNftId =
|
77
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
82
78
|
|
83
79
|
// ensure pool is registered with instance
|
84
80
|
if(poolNftId.eqz()) {
|
@@ -91,14 +87,14 @@ contract BundleManager is
|
|
91
87
|
|
92
88
|
/// @dev unlocked (active) bundles are available to underwrite new policies
|
93
89
|
function unlock(NftId bundleNftId) external restricted() {
|
94
|
-
NftId poolNftId =
|
90
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
95
91
|
_activate(poolNftId, bundleNftId);
|
96
92
|
emit LogBundleManagerBundleUnlocked(poolNftId, bundleNftId);
|
97
93
|
}
|
98
94
|
|
99
95
|
/// @dev locked (deactivated) bundles may not underwrite any new policies
|
100
96
|
function lock(NftId bundleNftId) external restricted() {
|
101
|
-
NftId poolNftId =
|
97
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
102
98
|
_deactivate(poolNftId, bundleNftId);
|
103
99
|
emit LogBundleManagerBundleLocked(poolNftId, bundleNftId);
|
104
100
|
}
|
@@ -1,30 +1,43 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
4
|
+
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
5
|
|
6
|
+
import {NftId} from "../types/NftId.sol";
|
7
|
+
import {StateId} from "../types/StateId.sol";
|
8
|
+
import {RiskId} from "../types/RiskId.sol";
|
9
|
+
|
10
|
+
import {IRegisterable} from "../shared/IRegisterable.sol";
|
11
|
+
|
12
|
+
import {InstanceAccessManager} from "./InstanceAccessManager.sol";
|
6
13
|
import {BundleManager} from "./BundleManager.sol";
|
7
14
|
import {InstanceReader} from "./InstanceReader.sol";
|
8
15
|
|
9
|
-
import {
|
16
|
+
import {IBundle} from "./module/IBundle.sol";
|
17
|
+
import {IBundleService} from "./service/IBundleService.sol";
|
10
18
|
import {IDistributionService} from "./service/IDistributionService.sol";
|
19
|
+
import {InstanceAccessManager} from "./InstanceAccessManager.sol";
|
20
|
+
import {IKeyValueStore} from "./base/IKeyValueStore.sol";
|
21
|
+
import {IPolicy} from "./module/IPolicy.sol";
|
22
|
+
import {IDistribution} from "./module/IDistribution.sol";
|
23
|
+
import {IPolicyService} from "./service/IPolicyService.sol";
|
11
24
|
import {IPoolService} from "./service/IPoolService.sol";
|
12
25
|
import {IProductService} from "./service/IProductService.sol";
|
13
26
|
import {IPolicyService} from "./service/IPolicyService.sol";
|
14
27
|
import {IBundleService} from "./service/IBundleService.sol";
|
15
|
-
import {
|
28
|
+
import {IRisk} from "./module/IRisk.sol";
|
16
29
|
import {ISetup} from "./module/ISetup.sol";
|
17
30
|
import {NftId} from "../types/NftId.sol";
|
18
|
-
import {StateId} from "../types/StateId.sol";
|
19
31
|
import {RiskId} from "../types/RiskId.sol";
|
20
|
-
import {
|
21
|
-
import {
|
22
|
-
import {
|
32
|
+
import {StateId} from "../types/StateId.sol";
|
33
|
+
import {VersionPart} from "../types/Version.sol";
|
34
|
+
import {Key32} from "../types/Key32.sol";
|
35
|
+
|
23
36
|
|
24
37
|
|
25
|
-
interface IInstance is IERC165, IKeyValueStore {
|
26
38
|
|
27
|
-
|
39
|
+
interface IInstance is IRegisterable, IKeyValueStore, IAccessManaged {
|
40
|
+
|
28
41
|
function getDistributionService() external view returns (IDistributionService);
|
29
42
|
function getProductService() external view returns (IProductService);
|
30
43
|
function getPoolService() external view returns (IPoolService);
|
@@ -47,14 +60,33 @@ interface IInstance is IERC165, IKeyValueStore {
|
|
47
60
|
function updateProductSetup(NftId productNftId, ISetup.ProductSetupInfo memory setup, StateId newState) external;
|
48
61
|
function updateProductSetupState(NftId productNftId, StateId newState) external;
|
49
62
|
|
63
|
+
function createDistributorType(Key32 distributorKey, IDistribution.DistributorTypeInfo memory info) external;
|
64
|
+
function updateDistributorType(Key32 distributorKey, IDistribution.DistributorTypeInfo memory info, StateId newState) external;
|
65
|
+
function updateDistributorTypeState(Key32 distributorKey, StateId newState) external;
|
66
|
+
|
67
|
+
function createDistributor(NftId nftId, IDistribution.DistributorInfo memory info) external;
|
68
|
+
function updateDistributor(NftId nftId, IDistribution.DistributorInfo memory info, StateId newState) external;
|
69
|
+
function updateDistributorState(NftId nftId, StateId newState) external;
|
70
|
+
|
71
|
+
function createReferral(Key32 referralKey, IDistribution.ReferralInfo memory referralInfo) external;
|
72
|
+
function updateReferral(Key32 referralKey, IDistribution.ReferralInfo memory referralInfo, StateId newState) external;
|
73
|
+
function updateReferralState(Key32 referralKey, StateId newState) external;
|
74
|
+
|
50
75
|
function createRisk(RiskId riskId, IRisk.RiskInfo memory risk) external;
|
51
76
|
function updateRisk(RiskId riskId, IRisk.RiskInfo memory risk, StateId newState) external;
|
52
77
|
function updateRiskState(RiskId riskId, StateId newState) external;
|
53
78
|
|
54
|
-
function
|
79
|
+
function createApplication(NftId applicationNftId, IPolicy.PolicyInfo memory policy) external;
|
80
|
+
function updateApplication(NftId applicationNftId, IPolicy.PolicyInfo memory policy, StateId newState) external;
|
81
|
+
function updateApplicationState(NftId applicationNftId, StateId newState) external;
|
82
|
+
|
55
83
|
function updatePolicy(NftId policyNftId, IPolicy.PolicyInfo memory policy, StateId newState) external;
|
56
84
|
function updatePolicyState(NftId policyNftId, StateId newState) external;
|
57
85
|
|
86
|
+
// TODO add claims/payouts function to instance
|
87
|
+
// function updateClaims(NftId policyNftId, IPolicy.PolicyInfo memory policy, StateId newState) external;
|
88
|
+
|
89
|
+
function getMajorVersion() external pure returns (VersionPart majorVersion);
|
58
90
|
function getInstanceReader() external view returns (InstanceReader);
|
59
91
|
function getBundleManager() external view returns (BundleManager);
|
60
92
|
}
|
@@ -8,7 +8,7 @@ import {IService} from "../shared/IService.sol";
|
|
8
8
|
import {IRegistry} from "../registry/IRegistry.sol";
|
9
9
|
|
10
10
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
11
|
-
import {
|
11
|
+
import {IComponent} from "../components/IComponent.sol";
|
12
12
|
|
13
13
|
import {InstanceAccessManager} from "./InstanceAccessManager.sol";
|
14
14
|
import {Instance} from "./Instance.sol";
|
@@ -17,8 +17,29 @@ import {BundleManager} from "./BundleManager.sol";
|
|
17
17
|
|
18
18
|
interface IInstanceService is IService {
|
19
19
|
|
20
|
-
error
|
20
|
+
error ErrorInstanceServiceMasterInstanceAlreadySet();
|
21
|
+
error ErrorInstanceServiceMasterInstanceAccessManagerAlreadySet();
|
22
|
+
error ErrorInstanceServiceMasterBundleManagerAlreadySet();
|
23
|
+
error ErrorInstanceServiceInstanceAddressZero();
|
24
|
+
|
25
|
+
error ErrorInstanceServiceMasterInstanceReaderNotSet();
|
26
|
+
error ErrorInstanceServiceInstanceReaderAddressZero();
|
27
|
+
error ErrorInstanceServiceInstanceReaderSameAsMasterInstanceReader();
|
28
|
+
error ErrorInstanceServiceInstanceReaderInstanceMismatch();
|
29
|
+
|
30
|
+
error ErrorInstanceServiceAccessManagerZero();
|
31
|
+
error ErrorInstanceServiceInstanceReaderZero();
|
32
|
+
error ErrorInstanceServiceBundleManagerZero();
|
33
|
+
|
34
|
+
error ErrorInstanceServiceInstanceAuthorityMismatch();
|
35
|
+
error ErrorInstanceServiceInstanceReaderInstanceMismatch2();
|
36
|
+
error ErrorInstanceServiceBundleMangerInstanceMismatch();
|
21
37
|
|
38
|
+
error ErrorInstanceServiceRequestUnauhorized(address caller);
|
39
|
+
error ErrorInstanceServiceNotInstanceOwner(address caller, NftId instanceNftId);
|
40
|
+
error ErrorInstanceServiceComponentNotRegistered(address componentAddress);
|
41
|
+
error ErrorInstanceServiceInvalidComponentType(address componentAddress, ObjectType expectedType, ObjectType componentType);
|
42
|
+
|
22
43
|
event LogInstanceCloned(address clonedAccessManagerAddress, address clonedInstanceAddress, address clonedInstanceReaderAddress, NftId clonedInstanceNftId);
|
23
44
|
|
24
45
|
function createInstanceClone()
|
@@ -30,5 +51,9 @@ interface IInstanceService is IService {
|
|
30
51
|
InstanceReader clonedInstanceReader,
|
31
52
|
BundleManager clonedBundleManager
|
32
53
|
);
|
54
|
+
|
55
|
+
function hasRole(address account, RoleId role, address instanceAddress) external returns (bool);
|
56
|
+
function setTargetLocked(string memory targetName, bool locked) external;
|
57
|
+
|
33
58
|
}
|
34
59
|
|