@etherisc/gif-next 0.0.2-2a59cd5-352 → 0.0.2-2aa1035-611
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 +6 -83
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/components/Component.sol/Component.json +90 -145
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +145 -233
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IComponent.sol/IComponent.json +158 -73
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +169 -150
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +350 -180
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +162 -145
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +298 -288
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +95 -218
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +4 -0
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +1206 -0
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +64 -50
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.json +5 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +274 -2000
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +183 -203
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +398 -2776
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +491 -127
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +124 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +253 -236
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +216 -451
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +184 -121
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2663 -0
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +8 -13
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +100 -215
- 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 +40 -10
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +36 -11
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +56 -73
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.json +10 -0
- 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 +1 -1
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +164 -379
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +649 -0
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +433 -425
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +244 -105
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +1072 -0
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +685 -0
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +657 -318
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +270 -115
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +99 -236
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +235 -319
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +602 -0
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +373 -158
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +417 -232
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +568 -120
- package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.json +518 -0
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +64 -163
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +563 -366
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +220 -121
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +771 -247
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +237 -102
- package/artifacts/contracts/instance/service/PricingService.sol/PricingService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PricingService.sol/PricingService.json +988 -0
- package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.json +689 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +136 -271
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +186 -107
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +15 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +19 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +4 -193
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +18 -0
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +31 -12
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +2 -2
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +28 -277
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +182 -113
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +23 -11
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +34 -67
- 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 +2 -2
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +4 -30
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +4 -30
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +0 -21
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +64 -163
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +0 -150
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +10 -62
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -23
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +171 -88
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +11 -74
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -23
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +72 -203
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- 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 +0 -150
- package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
- package/artifacts/contracts/test/TestFee.sol/TestFee.json +2 -2
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +11 -74
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +6 -6
- package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
- package/artifacts/contracts/test/TestService.sol/TestService.json +90 -253
- 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/TestVersion.sol/TestVersion.json +2 -2
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +6 -188
- 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/Amount.sol/AmountLib.dbg.json +4 -0
- package/artifacts/contracts/types/Amount.sol/AmountLib.json +209 -0
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +2 -2
- 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 +179 -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/Fee.sol/FeeLib.json +40 -9
- 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 +17 -4
- 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 +209 -0
- package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.json +23 -4
- 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/Seconds.sol/SecondsLib.dbg.json +4 -0
- package/artifacts/contracts/types/Seconds.sol/SecondsLib.json +124 -0
- package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +38 -7
- package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/MathLib.json +2 -2
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.json +2 -2
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionPartLib.json +2 -2
- package/contracts/components/Component.sol +100 -83
- package/contracts/components/Distribution.sol +22 -46
- package/contracts/components/IComponent.sol +43 -17
- package/contracts/components/IDistributionComponent.sol +1 -30
- package/contracts/components/IPoolComponent.sol +73 -47
- package/contracts/components/IProductComponent.sol +3 -2
- package/contracts/components/Pool.sol +178 -130
- package/contracts/components/Product.sol +172 -76
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +13 -0
- package/contracts/instance/BundleManager.sol +10 -9
- package/contracts/instance/Cloneable.sol +7 -2
- package/contracts/instance/IInstance.sol +43 -49
- package/contracts/instance/IInstanceService.sol +32 -12
- package/contracts/instance/Instance.sol +129 -173
- package/contracts/instance/InstanceAccessManager.sol +404 -160
- package/contracts/instance/InstanceAuthorizationsLib.sol +300 -0
- package/contracts/instance/InstanceReader.sol +43 -16
- package/contracts/instance/InstanceService.sol +160 -293
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +208 -0
- package/contracts/instance/ObjectManager.sol +6 -8
- package/contracts/instance/base/ComponentService.sol +53 -39
- package/contracts/instance/base/KeyValueStore.sol +13 -5
- package/contracts/instance/base/Lifecycle.sol +23 -6
- package/contracts/instance/module/IAccess.sol +21 -14
- package/contracts/instance/module/IBundle.sol +8 -5
- package/contracts/instance/module/IComponents.sol +41 -0
- package/contracts/instance/module/IDistribution.sol +2 -0
- package/contracts/instance/module/IPolicy.sol +41 -9
- package/contracts/instance/module/ISetup.sol +7 -21
- package/contracts/instance/service/ApplicationService.sol +75 -158
- package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
- package/contracts/instance/service/BundleService.sol +230 -88
- package/contracts/instance/service/BundleServiceManager.sol +1 -1
- package/contracts/instance/service/ClaimService.sol +239 -0
- package/contracts/instance/service/ClaimServiceManager.sol +35 -0
- package/contracts/instance/service/DistributionService.sol +156 -96
- package/contracts/instance/service/DistributionServiceManager.sol +1 -1
- package/contracts/instance/service/IApplicationService.sol +9 -30
- package/contracts/instance/service/IBundleService.sol +74 -26
- package/contracts/instance/service/IClaimService.sol +92 -0
- package/contracts/instance/service/IDistributionService.sol +26 -6
- package/contracts/instance/service/IPolicyService.sol +89 -38
- package/contracts/instance/service/IPoolService.sol +85 -3
- package/contracts/instance/service/IPricingService.sol +36 -0
- package/contracts/instance/service/PolicyService.sol +358 -305
- package/contracts/instance/service/PolicyServiceManager.sol +2 -2
- package/contracts/instance/service/PoolService.sol +246 -19
- package/contracts/instance/service/PoolServiceManager.sol +1 -1
- package/contracts/instance/service/PricingService.sol +275 -0
- package/contracts/instance/service/PricingServiceManager.sol +51 -0
- package/contracts/instance/service/ProductService.sol +37 -60
- package/contracts/instance/service/ProductServiceManager.sol +2 -2
- package/contracts/registry/ChainNft.sol +8 -0
- package/contracts/registry/IRegistry.sol +2 -0
- package/contracts/registry/IRegistryService.sol +11 -10
- package/contracts/registry/ITransferInterceptor.sol +1 -0
- package/contracts/registry/Registry.sol +23 -20
- package/contracts/registry/RegistryService.sol +56 -47
- package/contracts/registry/RegistryServiceManager.sol +13 -13
- package/contracts/registry/ReleaseManager.sol +26 -33
- package/contracts/registry/TokenRegistry.sol +13 -10
- package/contracts/shared/ERC165.sol +2 -1
- package/contracts/shared/INftOwnable.sol +4 -9
- package/contracts/shared/IRegistryLinked.sol +0 -3
- package/contracts/shared/IService.sol +4 -4
- package/contracts/shared/IVersionable.sol +4 -47
- package/contracts/shared/NftOwnable.sol +10 -80
- package/contracts/shared/ProxyManager.sol +98 -24
- package/contracts/shared/Registerable.sol +3 -10
- package/contracts/shared/RegistryLinked.sol +10 -26
- package/contracts/shared/Service.sol +29 -17
- package/contracts/shared/TokenHandler.sol +11 -5
- package/contracts/shared/Versionable.sol +1 -90
- package/contracts/test/TestService.sol +1 -1
- package/contracts/types/Amount.sol +70 -0
- package/contracts/types/Blocknumber.sol +1 -0
- package/contracts/types/ClaimId.sol +75 -0
- package/contracts/types/Fee.sol +13 -5
- package/contracts/types/NftId.sol +8 -0
- package/contracts/types/ObjectType.sol +12 -7
- package/contracts/types/PayoutId.sol +82 -0
- package/contracts/types/Referral.sol +4 -0
- package/contracts/types/RoleId.sol +16 -9
- package/contracts/types/Seconds.sol +54 -0
- package/contracts/types/StateId.sol +7 -2
- package/contracts/types/Timestamp.sol +18 -13
- package/contracts/types/UFixed.sol +1 -0
- package/contracts/types/Version.sol +1 -0
- package/package.json +1 -1
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +0 -4
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.json +0 -66
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +0 -4
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.json +0 -24
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +0 -4
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.json +0 -42
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +0 -4
- package/artifacts/contracts/experiment/errors/Require.sol/Require.json +0 -105
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +0 -4
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.json +0 -105
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/A.sol/A.json +0 -128
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +0 -42
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/B.sol/B.json +0 -76
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/C.sol/C.json +0 -89
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.json +0 -128
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.json +0 -37
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.json +0 -50
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.json +0 -63
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +0 -59
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.json +0 -124
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.json +0 -74
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +0 -124
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +0 -207
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +0 -4
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +0 -10
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +0 -4
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +0 -10
- package/contracts/experiment/cloning/Cloner.sol +0 -47
- package/contracts/experiment/errors/Require.sol +0 -38
- package/contracts/experiment/errors/Revert.sol +0 -44
- package/contracts/experiment/inheritance/A.sol +0 -53
- package/contracts/experiment/inheritance/B.sol +0 -28
- package/contracts/experiment/inheritance/C.sol +0 -34
- package/contracts/experiment/inheritance/IA.sol +0 -13
- package/contracts/experiment/inheritance/IB.sol +0 -10
- package/contracts/experiment/inheritance/IC.sol +0 -12
- package/contracts/experiment/statemachine/Dummy.sol +0 -27
- package/contracts/experiment/statemachine/ISM.sol +0 -25
- package/contracts/experiment/statemachine/SM.sol +0 -57
- package/contracts/experiment/statemachine/SimpleStateMachine.sol +0 -31
- package/contracts/experiment/types/TypeA.sol +0 -47
- package/contracts/experiment/types/TypeB.sol +0 -29
|
@@ -3,22 +3,32 @@ pragma solidity ^0.8.19;
|
|
|
3
3
|
|
|
4
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
5
5
|
|
|
6
|
+
import {Amount} from "../types/Amount.sol";
|
|
7
|
+
import {ClaimId} from "../types/ClaimId.sol";
|
|
8
|
+
import {Component} from "./Component.sol";
|
|
9
|
+
import {Fee} from "../types/Fee.sol";
|
|
6
10
|
import {IRisk} from "../instance/module/IRisk.sol";
|
|
11
|
+
import {IApplicationService} from "../instance/service/IApplicationService.sol";
|
|
7
12
|
import {IPolicyService} from "../instance/service/IPolicyService.sol";
|
|
13
|
+
import {IProductService} from "../instance/service/IProductService.sol";
|
|
14
|
+
import {IClaimService} from "../instance/service/IClaimService.sol";
|
|
15
|
+
import {IPricingService} from "../instance/service/IPricingService.sol";
|
|
8
16
|
import {IProductComponent} from "./IProductComponent.sol";
|
|
9
17
|
import {NftId, NftIdLib} from "../types/NftId.sol";
|
|
10
|
-
import {
|
|
18
|
+
import {PayoutId} from "../types/PayoutId.sol";
|
|
19
|
+
import {PRODUCT, APPLICATION, POLICY, CLAIM, PRICE } from "../types/ObjectType.sol";
|
|
11
20
|
import {ReferralId} from "../types/Referral.sol";
|
|
12
21
|
import {RiskId, RiskIdLib} from "../types/RiskId.sol";
|
|
22
|
+
import {Seconds} from "../types/Seconds.sol";
|
|
13
23
|
import {StateId} from "../types/StateId.sol";
|
|
14
24
|
import {Timestamp} from "../types/Timestamp.sol";
|
|
15
|
-
import {Fee} from "../types/Fee.sol";
|
|
16
|
-
import {Component} from "./Component.sol";
|
|
17
25
|
|
|
18
26
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
|
19
27
|
|
|
20
28
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
|
29
|
+
import {IPolicy} from "../instance/module/IPolicy.sol";
|
|
21
30
|
import {ISetup} from "../instance/module/ISetup.sol";
|
|
31
|
+
import {IComponents} from "../instance/module/IComponents.sol";
|
|
22
32
|
import {Pool} from "../components/Pool.sol";
|
|
23
33
|
import {Distribution} from "../components/Distribution.sol";
|
|
24
34
|
|
|
@@ -30,7 +40,11 @@ abstract contract Product is
|
|
|
30
40
|
bytes32 public constant PRODUCT_STORAGE_LOCATION_V1 = 0x0bb7aafdb8e380f81267337bc5b5dfdf76e6d3a380ecadb51ec665246d9d6800;
|
|
31
41
|
|
|
32
42
|
struct ProductStorage {
|
|
43
|
+
IProductService _productService;
|
|
44
|
+
IApplicationService _applicationService;
|
|
33
45
|
IPolicyService _policyService;
|
|
46
|
+
IClaimService _claimService;
|
|
47
|
+
IPricingService _pricingService;
|
|
34
48
|
Pool _pool;
|
|
35
49
|
Distribution _distribution;
|
|
36
50
|
Fee _initialProductFee;
|
|
@@ -51,17 +65,22 @@ abstract contract Product is
|
|
|
51
65
|
Fee memory productFee,
|
|
52
66
|
Fee memory processingFee,
|
|
53
67
|
address initialOwner,
|
|
54
|
-
bytes memory data
|
|
68
|
+
bytes memory registryData // writeonly data that will saved in the object info record of the registry
|
|
55
69
|
)
|
|
56
70
|
public
|
|
57
71
|
virtual
|
|
58
72
|
onlyInitializing()
|
|
59
73
|
{
|
|
60
|
-
initializeComponent(registry, instanceNftId, name, token, PRODUCT(), isInterceptor, initialOwner,
|
|
74
|
+
initializeComponent(registry, instanceNftId, name, token, PRODUCT(), isInterceptor, initialOwner, registryData);
|
|
61
75
|
|
|
62
76
|
ProductStorage storage $ = _getProductStorage();
|
|
63
77
|
// TODO add validation
|
|
64
|
-
|
|
78
|
+
// TODO refactor to go via registry ?
|
|
79
|
+
$._productService = IProductService(_getServiceAddress(PRODUCT()));
|
|
80
|
+
$._applicationService = IApplicationService(_getServiceAddress(APPLICATION()));
|
|
81
|
+
$._policyService = IPolicyService(_getServiceAddress(POLICY()));
|
|
82
|
+
$._claimService = IClaimService(_getServiceAddress(CLAIM()));
|
|
83
|
+
$._pricingService = IPricingService(_getServiceAddress(PRICE()));
|
|
65
84
|
$._pool = Pool(pool);
|
|
66
85
|
$._distribution = Distribution(distribution);
|
|
67
86
|
$._initialProductFee = productFee;
|
|
@@ -73,55 +92,24 @@ abstract contract Product is
|
|
|
73
92
|
registerInterface(type(IProductComponent).interfaceId);
|
|
74
93
|
}
|
|
75
94
|
|
|
76
|
-
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
uint256 lifetime,
|
|
81
|
-
bytes memory applicationData,
|
|
82
|
-
NftId bundleNftId,
|
|
83
|
-
ReferralId referralId
|
|
84
|
-
)
|
|
85
|
-
external
|
|
86
|
-
view
|
|
87
|
-
override
|
|
88
|
-
returns (uint256 premiumAmount)
|
|
89
|
-
{
|
|
90
|
-
(premiumAmount,,,,) = _getProductStorage()._policyService.calculatePremium(
|
|
91
|
-
riskId,
|
|
92
|
-
sumInsuredAmount,
|
|
93
|
-
lifetime,
|
|
94
|
-
applicationData,
|
|
95
|
-
bundleNftId,
|
|
96
|
-
referralId
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
function calculateNetPremium(
|
|
102
|
-
uint256 sumInsuredAmount,
|
|
103
|
-
RiskId riskId,
|
|
104
|
-
uint256 lifetime,
|
|
105
|
-
bytes memory applicationData
|
|
95
|
+
// from product component
|
|
96
|
+
function setFees(
|
|
97
|
+
Fee memory productFee,
|
|
98
|
+
Fee memory processingFee
|
|
106
99
|
)
|
|
107
100
|
external
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
101
|
+
onlyOwner
|
|
102
|
+
restricted()
|
|
103
|
+
override
|
|
111
104
|
{
|
|
112
|
-
|
|
113
|
-
return sumInsuredAmount / 10;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function _toRiskId(string memory riskName) internal pure returns (RiskId riskId) {
|
|
117
|
-
return RiskIdLib.toRiskId(riskName);
|
|
105
|
+
_getProductService().setFees(productFee, processingFee);
|
|
118
106
|
}
|
|
119
107
|
|
|
120
108
|
function _createRisk(
|
|
121
109
|
RiskId id,
|
|
122
110
|
bytes memory data
|
|
123
111
|
) internal {
|
|
124
|
-
|
|
112
|
+
_getProductService().createRisk(
|
|
125
113
|
id,
|
|
126
114
|
data
|
|
127
115
|
);
|
|
@@ -131,7 +119,7 @@ abstract contract Product is
|
|
|
131
119
|
RiskId id,
|
|
132
120
|
bytes memory data
|
|
133
121
|
) internal {
|
|
134
|
-
|
|
122
|
+
_getProductService().updateRisk(
|
|
135
123
|
id,
|
|
136
124
|
data
|
|
137
125
|
);
|
|
@@ -141,7 +129,7 @@ abstract contract Product is
|
|
|
141
129
|
RiskId id,
|
|
142
130
|
StateId state
|
|
143
131
|
) internal {
|
|
144
|
-
|
|
132
|
+
_getProductService().updateRiskState(
|
|
145
133
|
id,
|
|
146
134
|
state
|
|
147
135
|
);
|
|
@@ -155,33 +143,33 @@ abstract contract Product is
|
|
|
155
143
|
address applicationOwner,
|
|
156
144
|
RiskId riskId,
|
|
157
145
|
uint256 sumInsuredAmount,
|
|
158
|
-
|
|
159
|
-
bytes memory applicationData,
|
|
146
|
+
Seconds lifetime,
|
|
160
147
|
NftId bundleNftId,
|
|
161
|
-
ReferralId referralId
|
|
148
|
+
ReferralId referralId,
|
|
149
|
+
bytes memory applicationData
|
|
162
150
|
)
|
|
163
151
|
internal
|
|
164
|
-
returns (NftId
|
|
152
|
+
returns (NftId applicationNftId)
|
|
165
153
|
{
|
|
166
|
-
return _getProductStorage().
|
|
154
|
+
return _getProductStorage()._applicationService.create(
|
|
167
155
|
applicationOwner,
|
|
168
156
|
riskId,
|
|
169
157
|
sumInsuredAmount,
|
|
170
158
|
lifetime,
|
|
171
|
-
applicationData,
|
|
172
159
|
bundleNftId,
|
|
173
|
-
referralId
|
|
160
|
+
referralId,
|
|
161
|
+
applicationData
|
|
174
162
|
);
|
|
175
163
|
}
|
|
176
164
|
|
|
177
|
-
function
|
|
165
|
+
function _collateralize(
|
|
178
166
|
NftId policyNftId,
|
|
179
167
|
bool requirePremiumPayment,
|
|
180
168
|
Timestamp activateAt
|
|
181
169
|
)
|
|
182
170
|
internal
|
|
183
171
|
{
|
|
184
|
-
_getProductStorage()._policyService.
|
|
172
|
+
_getProductStorage()._policyService.collateralize(
|
|
185
173
|
policyNftId,
|
|
186
174
|
requirePremiumPayment,
|
|
187
175
|
activateAt);
|
|
@@ -214,28 +202,136 @@ abstract contract Product is
|
|
|
214
202
|
)
|
|
215
203
|
internal
|
|
216
204
|
{
|
|
217
|
-
_getProductStorage()._policyService.close(
|
|
205
|
+
_getProductStorage()._policyService.close(
|
|
206
|
+
policyNftId);
|
|
218
207
|
}
|
|
219
208
|
|
|
220
|
-
function
|
|
221
|
-
|
|
209
|
+
function _submitClaim(
|
|
210
|
+
NftId policyNftId,
|
|
211
|
+
Amount claimAmount,
|
|
212
|
+
bytes memory claimData
|
|
213
|
+
)
|
|
214
|
+
internal
|
|
215
|
+
returns(ClaimId)
|
|
216
|
+
{
|
|
217
|
+
return _getProductStorage()._policyService.submitClaim(
|
|
218
|
+
policyNftId,
|
|
219
|
+
claimAmount,
|
|
220
|
+
claimData);
|
|
222
221
|
}
|
|
223
222
|
|
|
224
|
-
function
|
|
225
|
-
|
|
223
|
+
function _confirmClaim(
|
|
224
|
+
NftId policyNftId,
|
|
225
|
+
ClaimId claimId,
|
|
226
|
+
Amount confirmedAmount
|
|
227
|
+
)
|
|
228
|
+
internal
|
|
229
|
+
{
|
|
230
|
+
_getProductStorage()._policyService.confirmClaim(
|
|
231
|
+
policyNftId,
|
|
232
|
+
claimId,
|
|
233
|
+
confirmedAmount);
|
|
226
234
|
}
|
|
227
235
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
236
|
+
function _declineClaim(
|
|
237
|
+
NftId policyNftId,
|
|
238
|
+
ClaimId claimId
|
|
239
|
+
)
|
|
240
|
+
internal
|
|
241
|
+
{
|
|
242
|
+
_getProductStorage()._policyService.declineClaim(
|
|
243
|
+
policyNftId,
|
|
244
|
+
claimId);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function _closeClaim(
|
|
248
|
+
NftId policyNftId,
|
|
249
|
+
ClaimId claimId
|
|
250
|
+
)
|
|
251
|
+
internal
|
|
252
|
+
{
|
|
253
|
+
_getProductStorage()._policyService.closeClaim(
|
|
254
|
+
policyNftId,
|
|
255
|
+
claimId);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function _createPayout(
|
|
259
|
+
NftId policyNftId,
|
|
260
|
+
ClaimId claimId,
|
|
261
|
+
Amount amount,
|
|
262
|
+
bytes memory data
|
|
263
|
+
)
|
|
264
|
+
internal
|
|
265
|
+
returns (PayoutId)
|
|
266
|
+
{
|
|
267
|
+
return _getProductStorage()._policyService.createPayout(
|
|
268
|
+
policyNftId,
|
|
269
|
+
claimId,
|
|
270
|
+
amount,
|
|
271
|
+
data);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function _processPayout(
|
|
275
|
+
NftId policyNftId,
|
|
276
|
+
PayoutId payoutId
|
|
277
|
+
)
|
|
278
|
+
internal
|
|
279
|
+
{
|
|
280
|
+
_getProductStorage()._policyService.processPayout(
|
|
281
|
+
policyNftId,
|
|
282
|
+
payoutId);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function calculatePremium(
|
|
286
|
+
uint256 sumInsuredAmount,
|
|
287
|
+
RiskId riskId,
|
|
288
|
+
Seconds lifetime,
|
|
289
|
+
bytes memory applicationData,
|
|
290
|
+
NftId bundleNftId,
|
|
291
|
+
ReferralId referralId
|
|
292
|
+
)
|
|
293
|
+
external
|
|
294
|
+
view
|
|
295
|
+
override
|
|
296
|
+
returns (uint256 premiumAmount)
|
|
297
|
+
{
|
|
298
|
+
IPolicy.Premium memory premium = _getProductStorage()._pricingService.calculatePremium(
|
|
299
|
+
getNftId(),
|
|
300
|
+
riskId,
|
|
301
|
+
sumInsuredAmount,
|
|
302
|
+
lifetime,
|
|
303
|
+
applicationData,
|
|
304
|
+
bundleNftId,
|
|
305
|
+
referralId
|
|
306
|
+
);
|
|
307
|
+
premiumAmount = premium.premiumAmount;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function calculateNetPremium(
|
|
311
|
+
uint256 sumInsuredAmount,
|
|
312
|
+
RiskId riskId,
|
|
313
|
+
Seconds lifetime,
|
|
314
|
+
bytes memory applicationData
|
|
232
315
|
)
|
|
233
316
|
external
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
317
|
+
view
|
|
318
|
+
virtual override
|
|
319
|
+
returns (uint256 netPremiumAmount)
|
|
237
320
|
{
|
|
238
|
-
|
|
321
|
+
// default 10% of sum insured
|
|
322
|
+
return sumInsuredAmount / 10;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function _toRiskId(string memory riskName) internal pure returns (RiskId riskId) {
|
|
326
|
+
return RiskIdLib.toRiskId(riskName);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function getPoolNftId() external view override returns (NftId poolNftId) {
|
|
330
|
+
return getRegistry().getNftId(address(_getProductStorage()._pool));
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function getDistributionNftId() external view override returns (NftId distributionNftId) {
|
|
334
|
+
return getRegistry().getNftId(address(_getProductStorage()._distribution));
|
|
239
335
|
}
|
|
240
336
|
|
|
241
337
|
function getSetupInfo() public view returns (ISetup.ProductSetupInfo memory setupInfo) {
|
|
@@ -252,19 +348,15 @@ abstract contract Product is
|
|
|
252
348
|
ProductStorage storage $ = _getProductStorage();
|
|
253
349
|
|
|
254
350
|
ISetup.DistributionSetupInfo memory distributionSetupInfo = $._distribution.getSetupInfo();
|
|
255
|
-
|
|
351
|
+
IComponents.PoolInfo memory poolInfo = $._pool.getPoolInfo();
|
|
256
352
|
|
|
257
353
|
return ISetup.ProductSetupInfo(
|
|
258
354
|
getToken(),
|
|
259
355
|
$._tokenHandler,
|
|
260
356
|
$._distributionNftId,
|
|
261
357
|
$._poolNftId,
|
|
262
|
-
distributionSetupInfo.distributionFee,
|
|
263
358
|
$._initialProductFee,
|
|
264
359
|
$._initialProcessingFee,
|
|
265
|
-
poolSetupInfo.poolFee,
|
|
266
|
-
poolSetupInfo.stakingFee,
|
|
267
|
-
poolSetupInfo.performanceFee,
|
|
268
360
|
false,
|
|
269
361
|
getWallet()
|
|
270
362
|
);
|
|
@@ -275,4 +367,8 @@ abstract contract Product is
|
|
|
275
367
|
$.slot := PRODUCT_STORAGE_LOCATION_V1
|
|
276
368
|
}
|
|
277
369
|
}
|
|
278
|
-
|
|
370
|
+
|
|
371
|
+
function _getProductService() internal view returns (IProductService) {
|
|
372
|
+
return _getProductStorage()._productService;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
pragma solidity ^0.8.20;
|
|
3
|
+
|
|
4
|
+
import {AccessManagerUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagerUpgradeable.sol";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
contract AccessManagerUpgradeableInitializeable is AccessManagerUpgradeable {
|
|
8
|
+
|
|
9
|
+
function initialize(address initialAdmin) initializer public {
|
|
10
|
+
__AccessManager_init(initialAdmin);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
}
|
|
@@ -22,9 +22,10 @@ contract BundleManager is
|
|
|
22
22
|
event LogBundleManagerBundleAdded(NftId poolNftId, NftId bundleNftId);
|
|
23
23
|
event LogBundleManagerBundleUnlocked(NftId poolNftId, NftId bundleNftId);
|
|
24
24
|
event LogBundleManagerBundleLocked(NftId poolNftId, NftId bundleNftId);
|
|
25
|
+
event LogBundleManagerBundleClosed(NftId poolNftId, NftId bundleNftId);
|
|
25
26
|
|
|
26
|
-
error
|
|
27
|
-
error
|
|
27
|
+
error ErrorBundleManagerPolicyAlreadyActivated(NftId policyNftId);
|
|
28
|
+
error ErrorBundleManagerBundleLocked(NftId bundleNftId, NftId policyNftId);
|
|
28
29
|
error ErrorBundleManagerPolicyWithOpenClaims(NftId policyNftId, uint256 openClaimsCount);
|
|
29
30
|
error ErrorBundleManagerPolicyNotCloseable(NftId policyNftId);
|
|
30
31
|
error ErrorBundleManagerBundleUnknown(NftId bundleNftId);
|
|
@@ -32,9 +33,8 @@ contract BundleManager is
|
|
|
32
33
|
|
|
33
34
|
mapping(NftId bundleNftId => LibNftIdSet.Set policies) internal _activePolicies;
|
|
34
35
|
|
|
35
|
-
/// @dev links a policy
|
|
36
|
-
// to link a policy it MUST NOT yet have been
|
|
37
|
-
// the bundle MUST be unlocked (active) for linking (underwriting) and registered with this instance
|
|
36
|
+
/// @dev links a policy to its bundle
|
|
37
|
+
// to link a policy it MUST NOT yet have been linked
|
|
38
38
|
function linkPolicy(NftId policyNftId) external restricted() {
|
|
39
39
|
NftId bundleNftId = _instance.getInstanceReader().getPolicyInfo(policyNftId).bundleNftId;
|
|
40
40
|
// decision will likely depend on the decision what to check here and what in the service
|
|
@@ -42,7 +42,7 @@ contract BundleManager is
|
|
|
42
42
|
|
|
43
43
|
// ensure bundle is unlocked (in active set) and registered with this instance
|
|
44
44
|
if (!_isActive(poolNftId, bundleNftId)) {
|
|
45
|
-
revert
|
|
45
|
+
revert ErrorBundleManagerBundleLocked(bundleNftId, policyNftId);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
LibNftIdSet.add(_activePolicies[bundleNftId], policyNftId);
|
|
@@ -71,7 +71,7 @@ contract BundleManager is
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
/// @dev add a new bundle to a
|
|
74
|
+
/// @dev add a new bundle to a pool registerd with this instance
|
|
75
75
|
// the corresponding pool is fetched via instance reader
|
|
76
76
|
function add(NftId bundleNftId) external restricted() {
|
|
77
77
|
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
|
@@ -85,14 +85,15 @@ contract BundleManager is
|
|
|
85
85
|
emit LogBundleManagerBundleAdded(poolNftId, bundleNftId);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
|
|
89
|
+
/// @dev unlocked (active) bundles are available to collateralize new policies
|
|
89
90
|
function unlock(NftId bundleNftId) external restricted() {
|
|
90
91
|
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
|
91
92
|
_activate(poolNftId, bundleNftId);
|
|
92
93
|
emit LogBundleManagerBundleUnlocked(poolNftId, bundleNftId);
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
/// @dev locked (deactivated) bundles may not
|
|
96
|
+
/// @dev locked (deactivated) bundles may not collateralize any new policies
|
|
96
97
|
function lock(NftId bundleNftId) external restricted() {
|
|
97
98
|
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
|
98
99
|
_deactivate(poolNftId, bundleNftId);
|
|
@@ -10,7 +10,8 @@ abstract contract Cloneable is
|
|
|
10
10
|
AccessManagedUpgradeable
|
|
11
11
|
{
|
|
12
12
|
event CloneableInitialized(address authority, address registry);
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
error CloneableAuthorityZero();
|
|
14
15
|
error CloneableRegistryInvalid(address registry);
|
|
15
16
|
|
|
16
17
|
IRegistry internal _registry;
|
|
@@ -25,9 +26,13 @@ abstract contract Cloneable is
|
|
|
25
26
|
address registry
|
|
26
27
|
)
|
|
27
28
|
public
|
|
28
|
-
|
|
29
|
+
onlyInitializing
|
|
29
30
|
{
|
|
30
31
|
// check/handle access managed
|
|
32
|
+
if(authority == address(0)) {
|
|
33
|
+
revert CloneableAuthorityZero();
|
|
34
|
+
}
|
|
35
|
+
|
|
31
36
|
__AccessManaged_init(authority);
|
|
32
37
|
|
|
33
38
|
// check/handle registry
|
|
@@ -3,40 +3,68 @@ pragma solidity ^0.8.20;
|
|
|
3
3
|
|
|
4
4
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
|
5
5
|
|
|
6
|
+
import {ClaimId} from "../types/ClaimId.sol";
|
|
7
|
+
import {DistributorType} from "../types/DistributorType.sol";
|
|
8
|
+
import {PayoutId} from "../types/PayoutId.sol";
|
|
9
|
+
import {ClaimId} from "../types/ClaimId.sol";
|
|
10
|
+
import {DistributorType} from "../types/DistributorType.sol";
|
|
11
|
+
import {PayoutId} from "../types/PayoutId.sol";
|
|
6
12
|
import {NftId} from "../types/NftId.sol";
|
|
7
13
|
import {StateId} from "../types/StateId.sol";
|
|
14
|
+
import {ReferralId} from "../types/Referral.sol";
|
|
15
|
+
import {ReferralId} from "../types/Referral.sol";
|
|
8
16
|
import {RiskId} from "../types/RiskId.sol";
|
|
17
|
+
import {VersionPart} from "../types/Version.sol";
|
|
18
|
+
import {Key32} from "../types/Key32.sol";
|
|
19
|
+
import {RoleId} from "../types/RoleId.sol";
|
|
9
20
|
|
|
10
21
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
|
11
22
|
|
|
23
|
+
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
|
24
|
+
|
|
12
25
|
import {InstanceAccessManager} from "./InstanceAccessManager.sol";
|
|
13
26
|
import {BundleManager} from "./BundleManager.sol";
|
|
14
27
|
import {InstanceReader} from "./InstanceReader.sol";
|
|
28
|
+
import {InstanceStore} from "./InstanceStore.sol";
|
|
29
|
+
|
|
30
|
+
import {IKeyValueStore} from "./base/IKeyValueStore.sol";
|
|
31
|
+
|
|
32
|
+
import {IAccess} from "./module/IAccess.sol";
|
|
15
33
|
|
|
16
|
-
import {IBundle} from "./module/IBundle.sol";
|
|
17
34
|
import {IBundleService} from "./service/IBundleService.sol";
|
|
18
35
|
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
36
|
import {IPolicyService} from "./service/IPolicyService.sol";
|
|
24
37
|
import {IPoolService} from "./service/IPoolService.sol";
|
|
25
38
|
import {IProductService} from "./service/IProductService.sol";
|
|
26
39
|
import {IPolicyService} from "./service/IPolicyService.sol";
|
|
27
40
|
import {IBundleService} from "./service/IBundleService.sol";
|
|
28
|
-
import {IRisk} from "./module/IRisk.sol";
|
|
29
|
-
import {ISetup} from "./module/ISetup.sol";
|
|
30
|
-
import {NftId} from "../types/NftId.sol";
|
|
31
|
-
import {RiskId} from "../types/RiskId.sol";
|
|
32
|
-
import {StateId} from "../types/StateId.sol";
|
|
33
|
-
import {VersionPart} from "../types/Version.sol";
|
|
34
|
-
import {Key32} from "../types/Key32.sol";
|
|
35
41
|
|
|
36
42
|
|
|
37
43
|
|
|
44
|
+
interface IInstance is
|
|
45
|
+
IRegisterable,
|
|
46
|
+
ITransferInterceptor,
|
|
47
|
+
IAccessManaged
|
|
48
|
+
{
|
|
49
|
+
error ErrorInstanceInstanceAccessManagerAlreadySet(address instanceAccessManager);
|
|
50
|
+
error ErrorInstanceInstanceAccessManagerAuthorityMismatch(address instanceAuthority);
|
|
38
51
|
|
|
39
|
-
|
|
52
|
+
error ErrorInstanceBundleManagerAlreadySet(address instanceBundleManager);
|
|
53
|
+
error ErrorInstanceBundleManagerInstanceMismatch(address instance);
|
|
54
|
+
error ErrorInstanceBundleManagerAuthorityMismatch(address instanceAuthority);
|
|
55
|
+
|
|
56
|
+
error ErrorInstanceInstanceReaderInstanceMismatch(address instanceAuthority);
|
|
57
|
+
|
|
58
|
+
error ErrorInstanceInstanceStoreAlreadySet(address instanceStore);
|
|
59
|
+
error ErrorInstanceInstanceStoreAuthorityMismatch(address instanceAuthority);
|
|
60
|
+
|
|
61
|
+
function createRole(string memory roleName, string memory adminName) external returns (RoleId roleId, RoleId admin);
|
|
62
|
+
function grantRole(RoleId roleId, address account) external;
|
|
63
|
+
function revokeRole(RoleId roleId, address account) external;
|
|
64
|
+
|
|
65
|
+
function createTarget(address target, string memory name) external;
|
|
66
|
+
function setTargetFunctionRole(string memory targetName, bytes4[] calldata selectors, RoleId roleId) external;
|
|
67
|
+
function setTargetLocked(address target, bool locked) external;
|
|
40
68
|
|
|
41
69
|
function getDistributionService() external view returns (IDistributionService);
|
|
42
70
|
function getProductService() external view returns (IProductService);
|
|
@@ -44,43 +72,9 @@ interface IInstance is IRegisterable, IKeyValueStore, IAccessManaged {
|
|
|
44
72
|
function getPolicyService() external view returns (IPolicyService);
|
|
45
73
|
function getBundleService() external view returns (IBundleService);
|
|
46
74
|
|
|
47
|
-
function createDistributionSetup(NftId distributionNftId, ISetup.DistributionSetupInfo memory setup) external;
|
|
48
|
-
function updateDistributionSetup(NftId distributionNftId, ISetup.DistributionSetupInfo memory setup, StateId newState) external;
|
|
49
|
-
function updateDistributionSetupState(NftId distributionNftId, StateId newState) external;
|
|
50
|
-
|
|
51
|
-
function createPoolSetup(NftId poolNftId, ISetup.PoolSetupInfo memory setup) external;
|
|
52
|
-
function updatePoolSetup(NftId poolNftId, ISetup.PoolSetupInfo memory setup, StateId newState) external;
|
|
53
|
-
function updatePoolSetupState(NftId poolNftId, StateId newState) external;
|
|
54
|
-
|
|
55
|
-
function createBundle(NftId bundleNftId, IBundle.BundleInfo memory bundle) external;
|
|
56
|
-
function updateBundle(NftId bundleNftId, IBundle.BundleInfo memory bundle, StateId newState) external;
|
|
57
|
-
function updateBundleState(NftId bundleNftId, StateId newState) external;
|
|
58
|
-
|
|
59
|
-
function createProductSetup(NftId productNftId, ISetup.ProductSetupInfo memory setup) external;
|
|
60
|
-
function updateProductSetup(NftId productNftId, ISetup.ProductSetupInfo memory setup, StateId newState) external;
|
|
61
|
-
function updateProductSetupState(NftId productNftId, StateId newState) external;
|
|
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
|
-
|
|
75
|
-
function createRisk(RiskId riskId, IRisk.RiskInfo memory risk) external;
|
|
76
|
-
function updateRisk(RiskId riskId, IRisk.RiskInfo memory risk, StateId newState) external;
|
|
77
|
-
function updateRiskState(RiskId riskId, StateId newState) external;
|
|
78
|
-
|
|
79
|
-
function createPolicy(NftId policyNftId, IPolicy.PolicyInfo memory policy) external;
|
|
80
|
-
function updatePolicy(NftId policyNftId, IPolicy.PolicyInfo memory policy, StateId newState) external;
|
|
81
|
-
function updatePolicyState(NftId policyNftId, StateId newState) external;
|
|
82
|
-
|
|
83
75
|
function getMajorVersion() external pure returns (VersionPart majorVersion);
|
|
84
76
|
function getInstanceReader() external view returns (InstanceReader);
|
|
85
77
|
function getBundleManager() external view returns (BundleManager);
|
|
78
|
+
function getInstanceAccessManager() external view returns (InstanceAccessManager);
|
|
79
|
+
function getInstanceStore() external view returns (InstanceStore);
|
|
86
80
|
}
|