@etherisc/gif-next 0.0.2-f7eda15-119 → 0.0.2-f831797-539
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +73 -1
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/components/Component.sol/Component.json +252 -94
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +611 -159
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IComponent.sol/IComponent.json +104 -72
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +311 -108
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +331 -164
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +108 -144
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +553 -185
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +356 -166
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +30 -11
- 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 +722 -422
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +94 -171
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +911 -779
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +39 -89
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +119 -216
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +276 -254
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +319 -99
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +2 -2
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +118 -169
- 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 +13 -13
- 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 +4 -0
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +968 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +665 -0
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +306 -315
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +305 -93
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +754 -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 +1207 -255
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +449 -85
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +556 -0
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +155 -240
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +409 -0
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +711 -139
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +60 -286
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +81 -147
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +22 -169
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +185 -391
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +311 -127
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +214 -204
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +306 -90
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +142 -221
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +302 -90
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +15 -2
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +83 -174
- 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 +28 -15
- 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 +193 -216
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +300 -94
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +11 -11
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +141 -37
- 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 -29
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/{experiment/inheritance/IB.sol/IB.json → shared/IRegistryLinked.sol/IRegistryLinked.json} +18 -20
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +22 -169
- 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 +113 -33
- 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 -74
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +125 -55
- 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 +113 -164
- 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 +2 -152
- 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 +125 -55
- 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 +134 -221
- 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 +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/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 +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/Fee.sol/FeeLib.json +2 -2
- 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 +100 -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 +25 -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 +103 -78
- package/contracts/components/Distribution.sol +187 -57
- package/contracts/components/IComponent.sol +48 -17
- package/contracts/components/IDistributionComponent.sol +39 -15
- package/contracts/components/IPoolComponent.sol +84 -31
- package/contracts/components/IProductComponent.sol +3 -2
- package/contracts/components/Pool.sol +217 -145
- package/contracts/components/Product.sol +97 -69
- package/contracts/instance/BundleManager.sol +7 -5
- package/contracts/instance/IInstance.sol +24 -3
- package/contracts/instance/IInstanceService.sol +20 -1
- package/contracts/instance/Instance.sol +65 -39
- package/contracts/instance/InstanceAccessManager.sol +12 -13
- package/contracts/instance/InstanceReader.sol +4 -3
- package/contracts/instance/InstanceService.sol +111 -57
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/base/ComponentService.sol +1 -1
- package/contracts/instance/base/KeyValueStore.sol +5 -2
- package/contracts/instance/base/Lifecycle.sol +11 -2
- package/contracts/instance/module/IAccess.sol +3 -4
- package/contracts/instance/module/IBundle.sol +2 -1
- package/contracts/instance/module/IComponents.sol +35 -0
- package/contracts/instance/module/IDistribution.sol +2 -0
- package/contracts/instance/module/IPolicy.sol +30 -3
- package/contracts/instance/module/ISetup.sol +7 -20
- package/contracts/instance/service/ApplicationService.sol +350 -0
- package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
- package/contracts/instance/service/BundleService.sol +82 -39
- package/contracts/instance/service/BundleServiceManager.sol +1 -1
- package/contracts/instance/service/ClaimService.sol +151 -0
- package/contracts/instance/service/ClaimServiceManager.sol +35 -0
- package/contracts/instance/service/DistributionService.sol +360 -16
- package/contracts/instance/service/DistributionServiceManager.sol +1 -1
- package/contracts/instance/service/IApplicationService.sol +82 -0
- package/contracts/instance/service/IBundleService.sol +30 -12
- package/contracts/instance/service/IClaimService.sol +61 -0
- package/contracts/instance/service/IDistributionService.sol +86 -0
- package/contracts/instance/service/IPolicyService.sol +27 -49
- package/contracts/instance/service/IPoolService.sol +17 -2
- package/contracts/instance/service/PolicyService.sol +148 -283
- package/contracts/instance/service/PolicyServiceManager.sol +2 -2
- package/contracts/instance/service/PoolService.sol +75 -22
- package/contracts/instance/service/PoolServiceManager.sol +1 -1
- package/contracts/instance/service/ProductService.sol +10 -11
- package/contracts/instance/service/ProductServiceManager.sol +2 -2
- package/contracts/registry/IRegistry.sol +3 -2
- package/contracts/registry/IRegistryService.sol +10 -8
- package/contracts/registry/Registry.sol +20 -8
- package/contracts/registry/RegistryService.sol +69 -48
- package/contracts/registry/RegistryServiceManager.sol +13 -13
- package/contracts/registry/ReleaseManager.sol +18 -28
- package/contracts/registry/TokenRegistry.sol +16 -12
- 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 +3 -3
- package/contracts/shared/IRegistryLinked.sol +12 -0
- package/contracts/shared/IService.sol +2 -0
- package/contracts/shared/IVersionable.sol +4 -47
- package/contracts/shared/NftOwnable.sol +66 -85
- package/contracts/shared/PolicyHolder.sol +81 -0
- package/contracts/shared/ProxyManager.sol +100 -25
- package/contracts/shared/Registerable.sol +7 -19
- package/contracts/shared/RegistryLinked.sol +48 -0
- package/contracts/shared/Service.sol +15 -17
- package/contracts/shared/TokenHandler.sol +11 -5
- package/contracts/shared/Versionable.sol +4 -92
- package/contracts/test/TestRegisterable.sol +1 -1
- package/contracts/test/TestService.sol +1 -1
- package/contracts/types/Blocknumber.sol +1 -0
- package/contracts/types/ClaimId.sol +52 -0
- package/contracts/types/DistributorType.sol +2 -2
- package/contracts/types/Fee.sol +1 -0
- package/contracts/types/NftId.sol +8 -0
- package/contracts/types/ObjectType.sol +10 -5
- package/contracts/types/PayoutId.sol +54 -0
- package/contracts/types/Referral.sol +4 -0
- package/contracts/types/RoleId.sol +10 -5
- package/contracts/types/Seconds.sol +54 -0
- package/contracts/types/StateId.sol +1 -0
- package/contracts/types/Timestamp.sol +13 -13
- package/contracts/types/UFixed.sol +1 -0
- package/contracts/types/Version.sol +1 -0
- package/package.json +3 -3
- 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/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
@@ -0,0 +1,82 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.19;
|
3
|
+
|
4
|
+
import {IPolicy} from "../module/IPolicy.sol";
|
5
|
+
import {IRisk} from "../module/IRisk.sol";
|
6
|
+
import {IService} from "../../shared/IService.sol";
|
7
|
+
|
8
|
+
import {NftId} from "../../types/NftId.sol";
|
9
|
+
import {ReferralId} from "../../types/Referral.sol";
|
10
|
+
import {RiskId} from "../../types/RiskId.sol";
|
11
|
+
import {Seconds} from "../../types/Seconds.sol";
|
12
|
+
import {StateId} from "../../types/StateId.sol";
|
13
|
+
import {Timestamp} from "../../types/Timestamp.sol";
|
14
|
+
import {UFixed} from "../../types/UFixed.sol";
|
15
|
+
import {Fee} from "../../types/Fee.sol";
|
16
|
+
|
17
|
+
/// @dev gif service responsible for creating applications
|
18
|
+
/// only product components may call transaction functions
|
19
|
+
interface IApplicationService is IService {
|
20
|
+
|
21
|
+
error IApplicationServicePolicyNotApplied(NftId applicationNftId);
|
22
|
+
error IApplicationServiceBundlePoolMismatch(NftId bundleNftId, NftId bundlePoolNftId, NftId poolNftId);
|
23
|
+
|
24
|
+
/// @dev creates a new application based on the specified attributes
|
25
|
+
/// may only be called by a product component
|
26
|
+
function create(
|
27
|
+
address applicationOwner,
|
28
|
+
RiskId riskId,
|
29
|
+
uint256 sumInsuredAmount,
|
30
|
+
Seconds lifetime,
|
31
|
+
NftId bundleNftId,
|
32
|
+
ReferralId referralId,
|
33
|
+
bytes memory applicationData
|
34
|
+
) external returns (NftId applicationNftId);
|
35
|
+
|
36
|
+
/// @dev updates application attributes
|
37
|
+
/// may only be called while the application is in applied state
|
38
|
+
/// may only be called by the referenced product related to applicationNftId
|
39
|
+
function adjust(
|
40
|
+
NftId applicationNftId,
|
41
|
+
RiskId riskId,
|
42
|
+
NftId bundleNftId,
|
43
|
+
ReferralId referralId,
|
44
|
+
uint256 sumInsuredAmount,
|
45
|
+
uint256 lifetime,
|
46
|
+
bytes memory applicationData
|
47
|
+
) external;
|
48
|
+
|
49
|
+
/// @dev creates a new application that extends the provided policy
|
50
|
+
/// lifetime will seamlessly extend referenced policy, for closed policies
|
51
|
+
/// lifetime will start at underwriting time
|
52
|
+
/// product will need to limit the time window for renewal as underwriting
|
53
|
+
/// will lock the collateral at underwriting time which might be earlier than activation time
|
54
|
+
/// policyNftId needs to refer to an underwritten (or active or closed) policy
|
55
|
+
/// may only be called by the referenced product related to policyNftId
|
56
|
+
function renew(
|
57
|
+
NftId policyNftId, // policy to be renewd (renewal inherits policy attributes)
|
58
|
+
NftId bundleNftId // will likely need a newer bundle for underwriting
|
59
|
+
) external returns (NftId applicationNftId);
|
60
|
+
|
61
|
+
/// @dev revokes the application represented by {policyNftId}
|
62
|
+
/// an application can only be revoked in applied state
|
63
|
+
/// only the application holder may revoke an application
|
64
|
+
function revoke(NftId policyNftId) external;
|
65
|
+
|
66
|
+
/// @dev calculates the premium amount for the specified attributes
|
67
|
+
/// also returns the various fee components involved with creating a policy
|
68
|
+
function calculatePremium(
|
69
|
+
NftId productNftId,
|
70
|
+
RiskId riskId,
|
71
|
+
uint256 sumInsuredAmount,
|
72
|
+
Seconds lifetime,
|
73
|
+
bytes memory applicationData,
|
74
|
+
NftId bundleNftId,
|
75
|
+
ReferralId referralId
|
76
|
+
)
|
77
|
+
external
|
78
|
+
view
|
79
|
+
returns (
|
80
|
+
IPolicy.Premium memory premium
|
81
|
+
);
|
82
|
+
}
|
@@ -3,42 +3,60 @@ pragma solidity ^0.8.19;
|
|
3
3
|
|
4
4
|
import {NftId} from "../../types/NftId.sol";
|
5
5
|
import {Fee} from "../../types/Fee.sol";
|
6
|
-
import {StateId} from "../../types/StateId.sol";
|
7
6
|
import {IService} from "../../shared/IService.sol";
|
8
7
|
import {IBundle} from "../module/IBundle.sol";
|
9
8
|
import {IInstance} from "../../instance/IInstance.sol";
|
9
|
+
import {Seconds} from "../../types/Seconds.sol";
|
10
|
+
import {StateId} from "../../types/StateId.sol";
|
10
11
|
|
11
12
|
interface IBundleService is IService {
|
12
|
-
error ErrorIBundleServiceInsufficientAllowance(address bundleOwner, address tokenHandlerAddress, uint256 amount);
|
13
13
|
|
14
|
-
|
14
|
+
event LogBundleServiceBundleActivated(NftId bundleNftId);
|
15
|
+
event LogBundleServiceBundleLocked(NftId bundleNftId);
|
16
|
+
event LogBundleServiceBundleClosed(NftId bundleNftId);
|
17
|
+
|
18
|
+
error ErrorBundleServiceInsufficientAllowance(address bundleOwner, address tokenHandlerAddress, uint256 amount);
|
19
|
+
error ErrorBundleServiceBundleNotOpen(NftId bundleNftId, StateId state);
|
20
|
+
error ErrorBundleServiceBundleWithOpenPolicies(NftId bundleNftId, uint256 openPoliciesCount);
|
21
|
+
|
22
|
+
function create(
|
15
23
|
address owner,
|
16
24
|
Fee memory fee,
|
17
25
|
uint256 amount,
|
18
|
-
|
26
|
+
Seconds lifetime,
|
19
27
|
bytes calldata filter
|
20
28
|
) external returns(NftId bundleNftId);
|
21
29
|
|
22
|
-
|
30
|
+
|
31
|
+
function setFee(
|
23
32
|
NftId bundleNftId,
|
24
33
|
Fee memory fee
|
25
34
|
) external;
|
26
35
|
|
27
|
-
function updateBundle(NftId instanceNftId, NftId bundleNftId, IBundle.BundleInfo memory bundleInfo, StateId state) external;
|
28
36
|
|
29
|
-
function
|
37
|
+
function lockCollateral(
|
38
|
+
IInstance instanceNftId,
|
39
|
+
NftId policyNftId,
|
40
|
+
NftId bundleNftId,
|
41
|
+
uint256 collateralAmount,
|
42
|
+
uint256 netPremium
|
43
|
+
)
|
44
|
+
external
|
45
|
+
returns (
|
46
|
+
IBundle.BundleInfo memory bundleInfo
|
47
|
+
);
|
30
48
|
|
31
49
|
function increaseBalance(IInstance instance, NftId bundleNftId, uint256 amount) external;
|
32
50
|
|
33
51
|
function closePolicy(IInstance instance, NftId policyNftId, NftId bundleNftId, uint256 collateralAmount) external;
|
34
52
|
|
35
|
-
// function
|
53
|
+
// function stake(NftId bundleNftId, uint256 amount) external returns(uint256 netAmount);
|
36
54
|
|
37
|
-
// function
|
55
|
+
// function unstake(NftId bundleNftId, uint256 amount) external returns(uint256 netAmount);
|
38
56
|
|
39
|
-
function
|
57
|
+
function lock(NftId bundleNftId) external;
|
40
58
|
|
41
|
-
function
|
59
|
+
function unlock(NftId bundleNftId) external;
|
42
60
|
|
43
|
-
|
61
|
+
function close(NftId bundleNftId) external;
|
44
62
|
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.19;
|
3
|
+
|
4
|
+
import {IRisk} from "../module/IRisk.sol";
|
5
|
+
import {IService} from "../../shared/IService.sol";
|
6
|
+
|
7
|
+
import {ClaimId} from "../../types/ClaimId.sol";
|
8
|
+
import {PayoutId} from "../../types/PayoutId.sol";
|
9
|
+
import {NftId} from "../../types/NftId.sol";
|
10
|
+
import {ReferralId} from "../../types/Referral.sol";
|
11
|
+
import {RiskId} from "../../types/RiskId.sol";
|
12
|
+
import {StateId} from "../../types/StateId.sol";
|
13
|
+
import {Timestamp} from "../../types/Timestamp.sol";
|
14
|
+
import {UFixed} from "../../types/UFixed.sol";
|
15
|
+
import {Fee} from "../../types/Fee.sol";
|
16
|
+
|
17
|
+
/// @dev gif service responsible for creating claims and payouts
|
18
|
+
/// only product components may call transaction functions
|
19
|
+
interface IClaimService is
|
20
|
+
IService
|
21
|
+
{
|
22
|
+
|
23
|
+
/// @dev create a new claim for the specified policy
|
24
|
+
/// function can only be called by product, policy needs to match with calling product
|
25
|
+
function createClaim(
|
26
|
+
NftId policyNftId,
|
27
|
+
uint256 claimAmount,
|
28
|
+
bytes memory claimData
|
29
|
+
) external returns (ClaimId);
|
30
|
+
|
31
|
+
/// @dev confirms the specified claim and fixes the final claim amount
|
32
|
+
/// function can only be called by product, policy needs to match with calling product
|
33
|
+
function confirmClaim(NftId policyNftId, ClaimId claimId, uint256 claimAmount) external;
|
34
|
+
|
35
|
+
/// @dev declares the claim as invalid, no payout(s) will be made
|
36
|
+
/// function can only be called by product, policy needs to match with calling product
|
37
|
+
function declineClaim(NftId policyNftId, ClaimId claimId) external;
|
38
|
+
|
39
|
+
/// @dev closes the claim
|
40
|
+
/// a claim may only be closed once all existing payouts have been executed and the sum of the paid out amounts has reached the claim amount
|
41
|
+
/// function can only be called by product, policy needs to match with calling product
|
42
|
+
function closeClaim(NftId policyNftId, ClaimId claimId) external;
|
43
|
+
|
44
|
+
/// @dev create a new payout for the specified policy and claim
|
45
|
+
/// function can only be called by product, policy needs to match with calling product
|
46
|
+
function createPayout(
|
47
|
+
NftId policyNftId,
|
48
|
+
ClaimId claimId,
|
49
|
+
uint256 payoutAmount,
|
50
|
+
bytes calldata payoutData
|
51
|
+
) external returns (PayoutId payoutId);
|
52
|
+
|
53
|
+
/// @dev callback function to confirm transfer of payout token to beneficiary
|
54
|
+
/// allows claim service to update claims/payout book keeping
|
55
|
+
/// only pool service can confirm executed payout
|
56
|
+
function payoutExecuted(
|
57
|
+
NftId policyNftId,
|
58
|
+
PayoutId payoutId
|
59
|
+
) external;
|
60
|
+
|
61
|
+
}
|
@@ -3,10 +3,96 @@ pragma solidity ^0.8.19;
|
|
3
3
|
|
4
4
|
import {NftId} from "../../types/NftId.sol";
|
5
5
|
import {Fee} from "../../types/Fee.sol";
|
6
|
+
import {IPolicy} from "../module/IPolicy.sol";
|
6
7
|
import {IService} from "../../shared/IService.sol";
|
8
|
+
import {UFixed} from "../../types/UFixed.sol";
|
9
|
+
import {DistributorType} from "../../types/DistributorType.sol";
|
10
|
+
import {ReferralId} from "../../types/Referral.sol";
|
11
|
+
import {Timestamp} from "../../types/Timestamp.sol";
|
12
|
+
|
7
13
|
|
8
14
|
interface IDistributionService is IService {
|
15
|
+
error ErrorIDistributionServiceParentNftIdNotInstance(NftId nftId, NftId parentNftId);
|
16
|
+
error ErrorIDistributionServiceCallerNotDistributor(address caller);
|
17
|
+
error ErrorIDistributionServiceInvalidReferralId(ReferralId referralId);
|
18
|
+
error ErrorIDistributionServiceMaxReferralsExceeded(uint256 maxReferrals);
|
19
|
+
error ErrorIDistributionServiceDiscountTooLow(uint256 minDiscountPercentage, uint256 discountPercentage);
|
20
|
+
error ErrorIDistributionServiceDiscountTooHigh(uint256 maxDiscountPercentage, uint256 discountPercentage);
|
21
|
+
error ErrorIDistributionServiceExpiryTooLong(uint256 maxReferralLifetime, uint256 expiryAt);
|
22
|
+
error ErrorIDistributionServiceInvalidReferral(string code);
|
23
|
+
error ErrorIDistributionServiceExpirationInvalid(Timestamp expiryAt);
|
24
|
+
error ErrorIDistributionServiceCommissionTooHigh(uint256 commissionPercentage, uint256 maxCommissionPercentage);
|
25
|
+
error ErrorIDistributionServiceMinFeeTooHigh(uint256 minFee, uint256 limit);
|
26
|
+
error ErrorIDistributionServiceMaxDiscountTooHigh(uint256 maxDiscountPercentage, uint256 limit);
|
27
|
+
error ErrorIDistributionServiceFeeCalculationMismatch(
|
28
|
+
uint256 distributionFeeFixAmount,
|
29
|
+
uint256 distributionFeeVarAmount,
|
30
|
+
uint256 distributionOwnerFeeFixAmount,
|
31
|
+
uint256 distributionOwnerFeeVarAmount,
|
32
|
+
uint256 commissionAmount,
|
33
|
+
uint256 discountAmount
|
34
|
+
);
|
35
|
+
error ErrorIDistributionServiceReferralInvalid(NftId distributionNftId, ReferralId referralId);
|
36
|
+
error ErrorIDistributionServiceInvalidFeeTransferred(uint256 transferredDistributionFeeAmount, uint256 expectedDistributionFeeAmount);
|
37
|
+
|
9
38
|
function setFees(
|
39
|
+
Fee memory minDistributionOwnerFee,
|
10
40
|
Fee memory distributionFee
|
11
41
|
) external;
|
42
|
+
|
43
|
+
function createDistributorType(
|
44
|
+
string memory name,
|
45
|
+
UFixed minDiscountPercentage,
|
46
|
+
UFixed maxDiscountPercentage,
|
47
|
+
UFixed commissionPercentage,
|
48
|
+
uint32 maxReferralCount,
|
49
|
+
uint32 maxReferralLifetime,
|
50
|
+
bool allowSelfReferrals,
|
51
|
+
bool allowRenewals,
|
52
|
+
bytes memory data
|
53
|
+
)
|
54
|
+
external
|
55
|
+
returns (DistributorType distributorType);
|
56
|
+
|
57
|
+
function createDistributor(
|
58
|
+
address distributor,
|
59
|
+
DistributorType distributorType,
|
60
|
+
bytes memory data
|
61
|
+
) external returns (NftId distributorNftId);
|
62
|
+
|
63
|
+
function updateDistributorType(
|
64
|
+
NftId distributorNftId,
|
65
|
+
DistributorType distributorType,
|
66
|
+
bytes memory data
|
67
|
+
) external;
|
68
|
+
|
69
|
+
function createReferral(
|
70
|
+
NftId distributorNftId,
|
71
|
+
string memory code,
|
72
|
+
UFixed discountPercentage,
|
73
|
+
uint32 maxReferrals,
|
74
|
+
Timestamp expiryAt,
|
75
|
+
bytes memory data
|
76
|
+
)
|
77
|
+
external
|
78
|
+
returns (ReferralId referralId);
|
79
|
+
|
80
|
+
/// @dev callback from product service when selling a policy for a specific referralId
|
81
|
+
function processSale(
|
82
|
+
NftId distributionNftId,
|
83
|
+
ReferralId referralId,
|
84
|
+
IPolicy.Premium memory premium,
|
85
|
+
uint256 transferredDistributionFeeAmount
|
86
|
+
) external;
|
87
|
+
|
88
|
+
function calculateFeeAmount(
|
89
|
+
NftId distributionNftId,
|
90
|
+
ReferralId referralId,
|
91
|
+
IPolicy.Premium memory premium
|
92
|
+
) external view returns (IPolicy.Premium memory finalPremium);
|
93
|
+
|
94
|
+
function referralIsValid(
|
95
|
+
NftId distributorNftId,
|
96
|
+
ReferralId referralId
|
97
|
+
) external view returns (bool isValid);
|
12
98
|
}
|
@@ -7,6 +7,7 @@ import {IService} from "../../shared/IService.sol";
|
|
7
7
|
import {NftId} from "../../types/NftId.sol";
|
8
8
|
import {ReferralId} from "../../types/Referral.sol";
|
9
9
|
import {RiskId} from "../../types/RiskId.sol";
|
10
|
+
import {Seconds} from "../../types/Seconds.sol";
|
10
11
|
import {StateId} from "../../types/StateId.sol";
|
11
12
|
import {Timestamp} from "../../types/Timestamp.sol";
|
12
13
|
import {UFixed} from "../../types/UFixed.sol";
|
@@ -22,70 +23,47 @@ interface IPolicyService is IService {
|
|
22
23
|
error ErrorIPolicyServicePremiumNotFullyPaid(NftId policyNftId, uint256 premiumAmount, uint256 premiumPaidAmount);
|
23
24
|
error ErrorIPolicyServiceOpenClaims(NftId policyNftId, uint16 openClaimsCount);
|
24
25
|
error ErrorIPolicyServicePolicyHasNotExpired(NftId policyNftId, Timestamp expiredAt);
|
25
|
-
|
26
|
-
function calculatePremium(
|
27
|
-
RiskId riskId,
|
28
|
-
uint256 sumInsuredAmount,
|
29
|
-
uint256 lifetime,
|
30
|
-
bytes memory applicationData,
|
31
|
-
NftId bundleNftId,
|
32
|
-
ReferralId referralId
|
33
|
-
)
|
34
|
-
external
|
35
|
-
view
|
36
|
-
returns (
|
37
|
-
uint256 premiumAmount,
|
38
|
-
uint256 productFeeAmount,
|
39
|
-
uint256 poolFeeAmount,
|
40
|
-
uint256 bundleFeeAmount,
|
41
|
-
uint256 distributionFeeAmount
|
42
|
-
);
|
43
|
-
|
44
26
|
|
45
|
-
|
46
|
-
address applicationOwner,
|
47
|
-
RiskId riskId,
|
48
|
-
uint256 sumInsuredAmount,
|
49
|
-
uint256 lifetime,
|
50
|
-
bytes memory applicationData,
|
51
|
-
NftId bundleNftId,
|
52
|
-
ReferralId referralId
|
53
|
-
) external returns (NftId nftId);
|
27
|
+
error ErrorIPolicyServicePremiumMismatch(NftId policyNftId, uint256 premiumAmount, uint256 recalculatedPremiumAmount);
|
54
28
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
*/
|
60
|
-
function revoke(NftId policyNftId) external;
|
29
|
+
/// @dev declines an application represented by {policyNftId}
|
30
|
+
/// an application can only be declined in applied state
|
31
|
+
/// only the related product may decline an application
|
32
|
+
function decline(NftId policyNftId) external;
|
61
33
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
34
|
+
/// @dev underwrites the policy represented by {policyNftId}
|
35
|
+
/// sets the policy state to underwritten
|
36
|
+
/// may set the policy state to activated and set the activation date
|
37
|
+
/// optionally collects premiums and activates the policy.
|
38
|
+
/// - premium payment is only attempted if requirePremiumPayment is set to true
|
39
|
+
/// - activation is only done if activateAt is a non-zero timestamp
|
40
|
+
/// an application can only be underwritten in applied state
|
41
|
+
/// only the related product may underwrite an application
|
68
42
|
function underwrite(
|
69
43
|
NftId policyNftId,
|
70
44
|
bool requirePremiumPayment,
|
71
45
|
Timestamp activateAt
|
72
46
|
) external;
|
73
47
|
|
74
|
-
|
75
|
-
// function expire(uint256 nftId) external;
|
76
|
-
|
48
|
+
/// @dev collects the premium token for the specified policy
|
77
49
|
function collectPremium(NftId policyNftId, Timestamp activateAt) external;
|
78
50
|
|
51
|
+
/// @dev activates the specified policy and sets the activation date in the policy metadata
|
52
|
+
/// to activate a policy it needs to be in underwritten state
|
79
53
|
function activate(NftId policyNftId, Timestamp activateAt) external;
|
80
54
|
|
55
|
+
/// @dev expires the specified policy and sets the expiry date in the policy metadata
|
56
|
+
/// to expire a policy it must be in active state, policies may be expired even when the predefined expiry date is still in the future
|
57
|
+
/// a policy can only be closed when it has been expired. in addition, it must not have any open claims
|
58
|
+
/// this function can only be called by a product. the policy needs to match with the calling product
|
59
|
+
function expire(NftId policyNftId) external;
|
81
60
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
// function declineClaim(uint256 nftId, uint256 claimId) external;
|
87
|
-
// function closeClaim(uint256 nftId, uint256 claimId) external; // TODO payoutClaim() -> implicit close when payed out in full
|
61
|
+
/// @dev closes the specified policy and sets the closed data in the policy metadata
|
62
|
+
/// a policy can only be closed when it has been expired. in addition, it must not have any open claims
|
63
|
+
/// this function can only be called by a product. the policy needs to match with the calling product
|
64
|
+
function close(NftId policyNftId) external;
|
88
65
|
|
66
|
+
// TODO move function to pool service
|
89
67
|
function calculateRequiredCollateral(
|
90
68
|
UFixed collateralizationLevel,
|
91
69
|
uint256 sumInsuredAmount
|
@@ -1,17 +1,32 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.19;
|
3
3
|
|
4
|
-
import {NftId} from "../../types/NftId.sol";
|
5
4
|
import {Fee} from "../../types/Fee.sol";
|
6
|
-
import {
|
5
|
+
import {NftId} from "../../types/NftId.sol";
|
7
6
|
import {IService} from "../../shared/IService.sol";
|
8
7
|
import {IBundle} from "../module/IBundle.sol";
|
9
8
|
import {IInstance} from "../../instance/IInstance.sol";
|
9
|
+
import {RoleId} from "../../types/RoleId.sol";
|
10
|
+
import {StateId} from "../../types/StateId.sol";
|
10
11
|
|
11
12
|
interface IPoolService is IService {
|
12
13
|
|
14
|
+
event LogPoolServiceMaxCapitalAmountUpdated(NftId poolNftId, uint256 previousMaxCapitalAmount, uint256 currentMaxCapitalAmount);
|
15
|
+
event LogPoolServiceBundleOwnerRoleSet(NftId poolNftId, RoleId bundleOwnerRole);
|
16
|
+
|
17
|
+
error ErrorPoolServiceBundleOwnerRoleAlreadySet(NftId poolNftId);
|
18
|
+
|
19
|
+
/// @dev registers a new pool with the registry service
|
13
20
|
function register(address poolAddress) external returns(NftId);
|
14
21
|
|
22
|
+
/// @dev defines the required role for bundle owners for the calling pool
|
23
|
+
/// default implementation returns PUBLIC ROLE
|
24
|
+
function setBundleOwnerRole(RoleId bundleOwnerRole) external;
|
25
|
+
|
26
|
+
/// @dev sets the max capital amount for the calling pool
|
27
|
+
function setMaxCapitalAmount(uint256 maxCapitalAmount) external;
|
28
|
+
|
29
|
+
/// @dev set pool sepecific fees
|
15
30
|
function setFees(
|
16
31
|
Fee memory poolFee,
|
17
32
|
Fee memory stakingFee,
|