@etherisc/gif-next 0.0.2-e94f4c7-084 → 0.0.2-e964d24-516
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +4 -0
- package/artifacts/contracts/{components → distribution}/Distribution.sol/Distribution.json +45 -14
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +4 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +1556 -0
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +780 -0
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +4 -0
- package/artifacts/contracts/{components → distribution}/IDistributionComponent.sol/IDistributionComponent.json +45 -14
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +4 -0
- package/artifacts/contracts/{instance/service → distribution}/IDistributionService.sol/IDistributionService.json +24 -274
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +6 -6
- 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 +252 -2210
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +21 -38
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +352 -2691
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +71 -53
- 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 +233 -67
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +65 -226
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +39 -124
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2788 -0
- 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/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 +6 -6
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +4 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +4 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +1288 -0
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +696 -0
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +4 -0
- package/artifacts/contracts/{instance/service → pool}/IBundleService.sol/IBundleService.json +57 -31
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +4 -0
- package/artifacts/contracts/{components → pool}/IPoolComponent.sol/IPoolComponent.json +56 -25
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +4 -0
- package/artifacts/contracts/{instance/service → pool}/IPoolService.sol/IPoolService.json +153 -36
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +4 -0
- package/artifacts/contracts/{components → pool}/Pool.sol/Pool.json +56 -25
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +1622 -0
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +708 -0
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +4 -0
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +918 -0
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +648 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +4 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +1376 -0
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +748 -0
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +4 -0
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +493 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/{instance/service → product}/IClaimService.sol/IClaimService.json +230 -89
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +4 -0
- package/artifacts/contracts/{instance/service → product}/IPolicyService.sol/IPolicyService.json +36 -354
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +4 -0
- package/artifacts/contracts/{instance/service/IApplicationService.sol/IApplicationService.json → product/IPricingService.sol/IPricingService.json} +37 -154
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +4 -0
- package/artifacts/contracts/{components → product}/IProductComponent.sol/IProductComponent.json +53 -22
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +4 -0
- package/artifacts/contracts/{instance/service → product}/IProductService.sol/IProductService.json +6 -14
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +1281 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +740 -0
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +4 -0
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +1004 -0
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +688 -0
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +4 -0
- package/artifacts/contracts/{components → product}/Product.sol/Product.json +53 -22
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +4 -0
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +864 -0
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +640 -0
- 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/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +5 -13
- 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 +6 -6
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +4 -4
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +21 -29
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +27 -40
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +9 -9
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +14 -27
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +4 -0
- package/artifacts/contracts/{instance → shared}/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +3 -3
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/{components → shared}/Component.sol/Component.json +38 -7
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +4 -0
- package/artifacts/contracts/{instance/base → shared}/ComponentService.sol/ComponentService.json +38 -14
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/{components → shared}/IComponent.sol/IComponent.json +38 -7
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +0 -13
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +69 -9
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +0 -13
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +0 -13
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +5 -13
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +8 -21
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +80 -26
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +20 -33
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +8 -21
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +5 -13
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +24 -6
- 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/staking/IStakingService.sol/IStakingService.dbg.json +4 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +523 -0
- package/artifacts/contracts/staking/StakeingServiceManager.sol/StakingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakeingServiceManager.sol/StakingServiceManager.json +628 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +767 -0
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/AddressSet.sol/LibAddressSet.json +3 -3
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +4 -0
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +281 -0
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/Blocknumber.sol/BlocknumberLib.json +3 -3
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/ClaimId.sol/ClaimIdLib.json +5 -5
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/DistributorType.sol/DistributorTypeLib.json +5 -5
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +4 -0
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +312 -0
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/Key32.sol/Key32Lib.json +3 -3
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/NftId.sol/NftIdLib.json +5 -5
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/NftIdSet.sol/LibNftIdSet.json +3 -3
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/ObjectType.sol/ObjectTypeLib.json +3 -3
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/PayoutId.sol/PayoutIdLib.json +5 -5
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/Referral.sol/ReferralLib.json +5 -5
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/RiskId.sol/RiskIdLib.json +5 -5
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/RoleId.sol/RoleIdLib.json +5 -5
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/Seconds.sol/SecondsLib.json +3 -3
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/StateId.sol/StateIdLib.json +3 -3
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/Timestamp.sol/TimestampLib.json +5 -5
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/UFixed.sol/MathLib.json +3 -3
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/UFixed.sol/UFixedLib.json +3 -3
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/Version.sol/VersionLib.json +3 -3
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/Version.sol/VersionPartLib.json +3 -3
- package/contracts/{components → distribution}/Distribution.sol +15 -14
- package/contracts/{instance/service → distribution}/DistributionService.sol +80 -163
- package/contracts/{instance/service → distribution}/DistributionServiceManager.sol +5 -5
- package/contracts/{components → distribution}/IDistributionComponent.sol +7 -7
- package/contracts/{instance/service → distribution}/IDistributionService.sol +18 -30
- package/contracts/instance/BundleManager.sol +4 -4
- package/contracts/instance/IInstance.sol +37 -62
- package/contracts/instance/IInstanceService.sol +18 -13
- package/contracts/instance/Instance.sol +94 -175
- package/contracts/instance/InstanceAccessManager.sol +38 -24
- package/contracts/instance/InstanceAuthorizationsLib.sol +308 -0
- package/contracts/instance/InstanceReader.sol +68 -17
- package/contracts/instance/InstanceService.sol +96 -266
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +211 -0
- package/contracts/instance/ObjectManager.sol +4 -4
- package/contracts/instance/base/IKeyValueStore.sol +5 -5
- package/contracts/instance/base/ILifecycle.sol +3 -3
- package/contracts/instance/base/KeyValueStore.sol +6 -37
- package/contracts/instance/base/Lifecycle.sol +8 -5
- package/contracts/instance/module/IAccess.sol +2 -2
- package/contracts/instance/module/IBundle.sol +5 -5
- package/contracts/instance/module/IComponents.sol +8 -8
- package/contracts/instance/module/IDistribution.sol +7 -6
- package/contracts/instance/module/IPolicy.sol +12 -12
- package/contracts/instance/module/IRisk.sol +1 -1
- package/contracts/instance/module/ISetup.sol +4 -4
- package/contracts/instance/module/ITreasury.sol +2 -2
- package/contracts/{instance/service → pool}/BundleService.sol +84 -145
- package/contracts/{instance/service → pool}/BundleServiceManager.sol +5 -5
- package/contracts/{instance/service → pool}/IBundleService.sol +41 -25
- package/contracts/{components → pool}/IPoolComponent.sol +13 -12
- package/contracts/{instance/service → pool}/IPoolService.sol +26 -14
- package/contracts/{components → pool}/Pool.sol +18 -18
- package/contracts/{instance/service → pool}/PoolService.sol +125 -58
- package/contracts/{instance/service → pool}/PoolServiceManager.sol +5 -5
- package/contracts/product/ApplicationService.sol +186 -0
- package/contracts/{instance/service → product}/ApplicationServiceManager.sol +2 -2
- package/contracts/product/ClaimService.sol +437 -0
- package/contracts/{instance/service → product}/ClaimServiceManager.sol +2 -2
- package/contracts/{instance/service → product}/IApplicationService.sol +12 -28
- package/contracts/product/IClaimService.sol +90 -0
- package/contracts/product/IPolicyService.sol +80 -0
- package/contracts/product/IPricingService.sol +37 -0
- package/contracts/{components → product}/IProductComponent.sol +11 -10
- package/contracts/{instance/service → product}/IProductService.sol +10 -10
- package/contracts/product/PolicyService.sol +376 -0
- package/contracts/{instance/service → product}/PolicyServiceManager.sol +5 -5
- package/contracts/product/PricingService.sol +275 -0
- package/contracts/product/PricingServiceManager.sol +51 -0
- package/contracts/{components → product}/Product.sol +37 -33
- package/contracts/{instance/service → product}/ProductService.sol +46 -46
- package/contracts/{instance/service → product}/ProductServiceManager.sol +5 -5
- package/contracts/registry/IRegistry.sol +4 -4
- package/contracts/registry/IRegistryService.sol +4 -6
- package/contracts/registry/Registry.sol +3 -3
- package/contracts/registry/RegistryAccessManager.sol +1 -1
- package/contracts/registry/RegistryService.sol +23 -20
- package/contracts/registry/RegistryServiceManager.sol +0 -2
- package/contracts/registry/ReleaseManager.sol +5 -5
- package/contracts/registry/TokenRegistry.sol +2 -2
- package/contracts/{components → shared}/Component.sol +26 -8
- package/contracts/{instance/base → shared}/ComponentService.sol +63 -34
- package/contracts/{components → shared}/IComponent.sol +19 -5
- package/contracts/shared/INftOwnable.sol +1 -1
- package/contracts/shared/IPolicyHolder.sol +24 -10
- package/contracts/shared/IRegistryLinked.sol +0 -1
- package/contracts/shared/IService.sol +3 -1
- package/contracts/shared/IVersionable.sol +1 -1
- package/contracts/shared/NftOwnable.sol +1 -3
- package/contracts/shared/PolicyHolder.sol +31 -18
- package/contracts/shared/ProxyManager.sol +3 -3
- package/contracts/shared/Registerable.sol +12 -11
- package/contracts/shared/RegistryLinked.sol +0 -5
- package/contracts/shared/Service.sol +3 -3
- package/contracts/shared/TokenHandler.sol +4 -2
- package/contracts/shared/Versionable.sol +1 -1
- package/contracts/staking/IStakingService.sol +102 -0
- package/contracts/staking/StakeingServiceManager.sol +37 -0
- package/contracts/staking/StakingService.sol +166 -0
- package/contracts/{types → type}/Amount.sol +39 -0
- package/contracts/{types → type}/Fee.sol +7 -6
- package/contracts/{types → type}/NftIdSet.sol +1 -1
- package/contracts/{types → type}/ObjectType.sol +5 -1
- package/package.json +1 -1
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +0 -4
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +0 -4
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +0 -4
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +0 -4
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +0 -4
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +0 -1060
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +0 -681
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +0 -1289
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +0 -4
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +0 -725
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +0 -1040
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +0 -685
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +0 -1774
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +0 -4
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +0 -793
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +0 -1543
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +0 -4
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +0 -741
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +0 -1449
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +0 -4
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +0 -709
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +0 -840
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +0 -653
- package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +0 -4
- package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.json +0 -107
- package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +0 -4
- package/artifacts/contracts/test/TestFee.sol/TestFee.json +0 -119
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +0 -4
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +0 -383
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +0 -4
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +0 -116
- package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +0 -4
- package/artifacts/contracts/test/TestService.sol/TestService.json +0 -596
- package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +0 -4
- package/artifacts/contracts/test/TestToken.sol/TestUsdc.json +0 -376
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +0 -4
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +0 -218
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +0 -4
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +0 -104
- package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +0 -4
- package/artifacts/contracts/test/Usdc.sol/USDC.json +0 -376
- package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +0 -4
- package/artifacts/contracts/types/Amount.sol/AmountLib.dbg.json +0 -4
- package/artifacts/contracts/types/Amount.sol/AmountLib.json +0 -209
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +0 -4
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.json +0 -10
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +0 -4
- package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +0 -4
- package/artifacts/contracts/types/Fee.sol/FeeLib.json +0 -288
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +0 -4
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +0 -4
- package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/NumberId.sol/NumberIdLib.json +0 -100
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +0 -4
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +0 -4
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/Seconds.sol/SecondsLib.dbg.json +0 -4
- package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +0 -4
- package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +0 -4
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +0 -4
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +0 -4
- package/contracts/instance/service/ApplicationService.sol +0 -355
- package/contracts/instance/service/ClaimService.sol +0 -239
- package/contracts/instance/service/IClaimService.sol +0 -92
- package/contracts/instance/service/IPolicyService.sol +0 -139
- package/contracts/instance/service/PolicyService.sol +0 -571
- package/contracts/shared/ContractDeployerLib.sol +0 -72
- package/contracts/test/TestFee.sol +0 -25
- package/contracts/test/TestRegisterable.sol +0 -18
- package/contracts/test/TestRoleId.sol +0 -14
- package/contracts/test/TestService.sol +0 -25
- package/contracts/test/TestToken.sol +0 -26
- package/contracts/test/TestVersion.sol +0 -44
- package/contracts/test/TestVersionable.sol +0 -17
- package/contracts/test/Usdc.sol +0 -26
- package/contracts/types/ChainId.sol +0 -38
- package/contracts/types/NumberId.sol +0 -52
- /package/contracts/{instance → shared}/AccessManagerUpgradeableInitializeable.sol +0 -0
- /package/contracts/{types → type}/AddressSet.sol +0 -0
- /package/contracts/{types → type}/Blocknumber.sol +0 -0
- /package/contracts/{types → type}/ClaimId.sol +0 -0
- /package/contracts/{types → type}/DistributorType.sol +0 -0
- /package/contracts/{types → type}/Key32.sol +0 -0
- /package/contracts/{types → type}/NftId.sol +0 -0
- /package/contracts/{types → type}/PayoutId.sol +0 -0
- /package/contracts/{types → type}/Referral.sol +0 -0
- /package/contracts/{types → type}/RiskId.sol +0 -0
- /package/contracts/{types → type}/RoleId.sol +0 -0
- /package/contracts/{types → type}/Seconds.sol +0 -0
- /package/contracts/{types → type}/StateId.sol +0 -0
- /package/contracts/{types → type}/Timestamp.sol +0 -0
- /package/contracts/{types → type}/UFixed.sol +0 -0
- /package/contracts/{types → type}/Version.sol +0 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IVersionable} from "../shared/IVersionable.sol";
|
5
|
+
import {ProxyManager} from "../shared/ProxyManager.sol";
|
6
|
+
import {PricingService} from "./PricingService.sol";
|
7
|
+
import {Registry} from "../registry/Registry.sol";
|
8
|
+
import {RegistryService} from "../registry/RegistryService.sol";
|
9
|
+
import {REGISTRY} from "../type/ObjectType.sol";
|
10
|
+
|
11
|
+
contract PricingServiceManager is ProxyManager {
|
12
|
+
|
13
|
+
PricingService private _pricingService;
|
14
|
+
|
15
|
+
/// @dev initializes proxy manager with distribution service implementation and deploys instance
|
16
|
+
constructor(
|
17
|
+
address registryAddress
|
18
|
+
)
|
19
|
+
ProxyManager(registryAddress)
|
20
|
+
{
|
21
|
+
PricingService pricingSrv = new PricingService();
|
22
|
+
bytes memory data = abi.encode(registryAddress, address(this));
|
23
|
+
IVersionable versionable = deploy(
|
24
|
+
address(pricingSrv),
|
25
|
+
data);
|
26
|
+
|
27
|
+
_pricingService = PricingService(address(versionable));
|
28
|
+
|
29
|
+
// TODO `thi` must have a role or own nft to register service
|
30
|
+
//Registry registry = Registry(registryAddress);
|
31
|
+
//address registryServiceAddress = registry.getServiceAddress(REGISTRY(), _distributionService.getMajorVersion());
|
32
|
+
//RegistryService registryService = RegistryService(registryServiceAddress);
|
33
|
+
//registryService.registerService(_distributionService);
|
34
|
+
|
35
|
+
// TODO no nft to link yet
|
36
|
+
// link ownership of instance service manager ot nft owner of instance service
|
37
|
+
//_linkToNftOwnable(
|
38
|
+
// address(registryAddress),
|
39
|
+
// address(_distributionService));
|
40
|
+
}
|
41
|
+
|
42
|
+
//--- view functions ----------------------------------------------------//
|
43
|
+
function getPricingService()
|
44
|
+
external
|
45
|
+
view
|
46
|
+
returns (PricingService)
|
47
|
+
{
|
48
|
+
return _pricingService;
|
49
|
+
}
|
50
|
+
|
51
|
+
}
|
@@ -3,24 +3,25 @@ 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 "../
|
7
|
-
import {ClaimId} from "../
|
8
|
-
import {Component} from "
|
9
|
-
import {Fee} from "../
|
6
|
+
import {Amount, AmountLib} from "../type/Amount.sol";
|
7
|
+
import {ClaimId} from "../type/ClaimId.sol";
|
8
|
+
import {Component} from "../shared/Component.sol";
|
9
|
+
import {Fee} from "../type/Fee.sol";
|
10
10
|
import {IRisk} from "../instance/module/IRisk.sol";
|
11
|
-
import {IApplicationService} from "
|
12
|
-
import {IPolicyService} from "
|
13
|
-
import {IProductService} from "
|
14
|
-
import {IClaimService} from "
|
11
|
+
import {IApplicationService} from "./IApplicationService.sol";
|
12
|
+
import {IPolicyService} from "./IPolicyService.sol";
|
13
|
+
import {IProductService} from "./IProductService.sol";
|
14
|
+
import {IClaimService} from "./IClaimService.sol";
|
15
|
+
import {IPricingService} from "./IPricingService.sol";
|
15
16
|
import {IProductComponent} from "./IProductComponent.sol";
|
16
|
-
import {NftId, NftIdLib} from "../
|
17
|
-
import {PayoutId} from "../
|
18
|
-
import {PRODUCT, APPLICATION, POLICY, CLAIM } from "../
|
19
|
-
import {ReferralId} from "../
|
20
|
-
import {RiskId, RiskIdLib} from "../
|
21
|
-
import {Seconds} from "../
|
22
|
-
import {StateId} from "../
|
23
|
-
import {Timestamp} from "../
|
17
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
18
|
+
import {PayoutId} from "../type/PayoutId.sol";
|
19
|
+
import {PRODUCT, APPLICATION, POLICY, CLAIM, PRICE } from "../type/ObjectType.sol";
|
20
|
+
import {ReferralId} from "../type/Referral.sol";
|
21
|
+
import {RiskId, RiskIdLib} from "../type/RiskId.sol";
|
22
|
+
import {Seconds} from "../type/Seconds.sol";
|
23
|
+
import {StateId} from "../type/StateId.sol";
|
24
|
+
import {Timestamp} from "../type/Timestamp.sol";
|
24
25
|
|
25
26
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
26
27
|
|
@@ -28,8 +29,8 @@ import {InstanceReader} from "../instance/InstanceReader.sol";
|
|
28
29
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
29
30
|
import {ISetup} from "../instance/module/ISetup.sol";
|
30
31
|
import {IComponents} from "../instance/module/IComponents.sol";
|
31
|
-
import {Pool} from "../
|
32
|
-
import {Distribution} from "../
|
32
|
+
import {Pool} from "../pool/Pool.sol";
|
33
|
+
import {Distribution} from "../distribution/Distribution.sol";
|
33
34
|
|
34
35
|
abstract contract Product is
|
35
36
|
Component,
|
@@ -43,6 +44,7 @@ abstract contract Product is
|
|
43
44
|
IApplicationService _applicationService;
|
44
45
|
IPolicyService _policyService;
|
45
46
|
IClaimService _claimService;
|
47
|
+
IPricingService _pricingService;
|
46
48
|
Pool _pool;
|
47
49
|
Distribution _distribution;
|
48
50
|
Fee _initialProductFee;
|
@@ -78,6 +80,7 @@ abstract contract Product is
|
|
78
80
|
$._applicationService = IApplicationService(_getServiceAddress(APPLICATION()));
|
79
81
|
$._policyService = IPolicyService(_getServiceAddress(POLICY()));
|
80
82
|
$._claimService = IClaimService(_getServiceAddress(CLAIM()));
|
83
|
+
$._pricingService = IPricingService(_getServiceAddress(PRICE()));
|
81
84
|
$._pool = Pool(pool);
|
82
85
|
$._distribution = Distribution(distribution);
|
83
86
|
$._initialProductFee = productFee;
|
@@ -139,7 +142,7 @@ abstract contract Product is
|
|
139
142
|
function _createApplication(
|
140
143
|
address applicationOwner,
|
141
144
|
RiskId riskId,
|
142
|
-
|
145
|
+
Amount sumInsuredAmount,
|
143
146
|
Seconds lifetime,
|
144
147
|
NftId bundleNftId,
|
145
148
|
ReferralId referralId,
|
@@ -211,7 +214,7 @@ abstract contract Product is
|
|
211
214
|
internal
|
212
215
|
returns(ClaimId)
|
213
216
|
{
|
214
|
-
return _getProductStorage().
|
217
|
+
return _getProductStorage()._claimService.submit(
|
215
218
|
policyNftId,
|
216
219
|
claimAmount,
|
217
220
|
claimData);
|
@@ -224,7 +227,7 @@ abstract contract Product is
|
|
224
227
|
)
|
225
228
|
internal
|
226
229
|
{
|
227
|
-
_getProductStorage().
|
230
|
+
_getProductStorage()._claimService.confirm(
|
228
231
|
policyNftId,
|
229
232
|
claimId,
|
230
233
|
confirmedAmount);
|
@@ -236,7 +239,7 @@ abstract contract Product is
|
|
236
239
|
)
|
237
240
|
internal
|
238
241
|
{
|
239
|
-
_getProductStorage().
|
242
|
+
_getProductStorage()._claimService.decline(
|
240
243
|
policyNftId,
|
241
244
|
claimId);
|
242
245
|
}
|
@@ -247,7 +250,7 @@ abstract contract Product is
|
|
247
250
|
)
|
248
251
|
internal
|
249
252
|
{
|
250
|
-
_getProductStorage().
|
253
|
+
_getProductStorage()._claimService.close(
|
251
254
|
policyNftId,
|
252
255
|
claimId);
|
253
256
|
}
|
@@ -261,7 +264,7 @@ abstract contract Product is
|
|
261
264
|
internal
|
262
265
|
returns (PayoutId)
|
263
266
|
{
|
264
|
-
return _getProductStorage().
|
267
|
+
return _getProductStorage()._claimService.createPayout(
|
265
268
|
policyNftId,
|
266
269
|
claimId,
|
267
270
|
amount,
|
@@ -274,13 +277,13 @@ abstract contract Product is
|
|
274
277
|
)
|
275
278
|
internal
|
276
279
|
{
|
277
|
-
_getProductStorage().
|
280
|
+
_getProductStorage()._claimService.processPayout(
|
278
281
|
policyNftId,
|
279
282
|
payoutId);
|
280
283
|
}
|
281
284
|
|
282
285
|
function calculatePremium(
|
283
|
-
|
286
|
+
Amount sumInsuredAmount,
|
284
287
|
RiskId riskId,
|
285
288
|
Seconds lifetime,
|
286
289
|
bytes memory applicationData,
|
@@ -290,9 +293,9 @@ abstract contract Product is
|
|
290
293
|
external
|
291
294
|
view
|
292
295
|
override
|
293
|
-
returns (
|
296
|
+
returns (Amount premiumAmount)
|
294
297
|
{
|
295
|
-
IPolicy.Premium memory premium = _getProductStorage().
|
298
|
+
IPolicy.Premium memory premium = _getProductStorage()._pricingService.calculatePremium(
|
296
299
|
getNftId(),
|
297
300
|
riskId,
|
298
301
|
sumInsuredAmount,
|
@@ -301,11 +304,12 @@ abstract contract Product is
|
|
301
304
|
bundleNftId,
|
302
305
|
referralId
|
303
306
|
);
|
304
|
-
|
307
|
+
|
308
|
+
return AmountLib.toAmount(premium.premiumAmount);
|
305
309
|
}
|
306
310
|
|
307
311
|
function calculateNetPremium(
|
308
|
-
|
312
|
+
Amount sumInsuredAmount,
|
309
313
|
RiskId riskId,
|
310
314
|
Seconds lifetime,
|
311
315
|
bytes memory applicationData
|
@@ -313,10 +317,10 @@ abstract contract Product is
|
|
313
317
|
external
|
314
318
|
view
|
315
319
|
virtual override
|
316
|
-
returns (
|
320
|
+
returns (Amount netPremiumAmount)
|
317
321
|
{
|
318
322
|
// default 10% of sum insured
|
319
|
-
return sumInsuredAmount / 10;
|
323
|
+
return AmountLib.toAmount(sumInsuredAmount.toInt() / 10);
|
320
324
|
}
|
321
325
|
|
322
326
|
function _toRiskId(string memory riskName) internal pure returns (RiskId riskId) {
|
@@ -368,4 +372,4 @@ abstract contract Product is
|
|
368
372
|
function _getProductService() internal view returns (IProductService) {
|
369
373
|
return _getProductStorage()._productService;
|
370
374
|
}
|
371
|
-
}
|
375
|
+
}
|
@@ -1,44 +1,44 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.19;
|
3
3
|
|
4
|
-
import {IRegistry} from "
|
5
|
-
import {IProductComponent} from "
|
6
|
-
import {Product} from "
|
7
|
-
import {IComponent} from "
|
8
|
-
import {IPoolComponent} from "
|
9
|
-
import {IDistributionComponent} from "
|
10
|
-
import {IInstance} from "../IInstance.sol";
|
11
|
-
import {IPolicy} from "../module/IPolicy.sol";
|
12
|
-
import {IRisk} from "../module/IRisk.sol";
|
13
|
-
import {IBundle} from "../module/IBundle.sol";
|
4
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
5
|
+
import {IProductComponent} from "./IProductComponent.sol";
|
6
|
+
import {Product} from "./Product.sol";
|
7
|
+
import {IComponent} from "../shared/IComponent.sol";
|
8
|
+
import {IPoolComponent} from "../pool/IPoolComponent.sol";
|
9
|
+
import {IDistributionComponent} from "../distribution/IDistributionComponent.sol";
|
10
|
+
import {IInstance} from "../instance/IInstance.sol";
|
11
|
+
import {IPolicy} from "../instance/module/IPolicy.sol";
|
12
|
+
import {IRisk} from "../instance/module/IRisk.sol";
|
13
|
+
import {IBundle} from "../instance/module/IBundle.sol";
|
14
14
|
import {IProductService} from "./IProductService.sol";
|
15
|
-
import {ITreasury} from "../module/ITreasury.sol";
|
16
|
-
import {ISetup} from "../module/ISetup.sol";
|
17
|
-
|
18
|
-
import {TokenHandler} from "
|
19
|
-
|
20
|
-
import {IVersionable} from "
|
21
|
-
import {Versionable} from "
|
22
|
-
|
23
|
-
import {Timestamp, zeroTimestamp} from "
|
24
|
-
import {UFixed, UFixedLib} from "
|
25
|
-
import {Blocknumber, blockNumber} from "
|
26
|
-
import {ObjectType, PRODUCT, POOL, POLICY} from "
|
27
|
-
import {APPLIED, ACTIVE, KEEP_STATE} from "
|
28
|
-
import {NftId, NftIdLib, zeroNftId} from "
|
29
|
-
import {Fee, FeeLib} from "
|
30
|
-
import {ReferralId} from "
|
31
|
-
import {RiskId} from "
|
32
|
-
import {StateId} from "
|
33
|
-
import {Version, VersionLib} from "
|
34
|
-
import {RoleId, PRODUCT_OWNER_ROLE} from "
|
35
|
-
|
36
|
-
import {IService} from "
|
37
|
-
import {Service} from "
|
38
|
-
import {ComponentService} from "../
|
15
|
+
import {ITreasury} from "../instance/module/ITreasury.sol";
|
16
|
+
import {ISetup} from "../instance/module/ISetup.sol";
|
17
|
+
|
18
|
+
import {TokenHandler} from "../shared/TokenHandler.sol";
|
19
|
+
|
20
|
+
import {IVersionable} from "../shared/IVersionable.sol";
|
21
|
+
import {Versionable} from "../shared/Versionable.sol";
|
22
|
+
|
23
|
+
import {Timestamp, zeroTimestamp} from "../type/Timestamp.sol";
|
24
|
+
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
25
|
+
import {Blocknumber, blockNumber} from "../type/Blocknumber.sol";
|
26
|
+
import {ObjectType, PRODUCT, POOL, POLICY} from "../type/ObjectType.sol";
|
27
|
+
import {APPLIED, ACTIVE, KEEP_STATE} from "../type/StateId.sol";
|
28
|
+
import {NftId, NftIdLib, zeroNftId} from "../type/NftId.sol";
|
29
|
+
import {Fee, FeeLib} from "../type/Fee.sol";
|
30
|
+
import {ReferralId} from "../type/Referral.sol";
|
31
|
+
import {RiskId} from "../type/RiskId.sol";
|
32
|
+
import {StateId} from "../type/StateId.sol";
|
33
|
+
import {Version, VersionLib} from "../type/Version.sol";
|
34
|
+
import {RoleId, PRODUCT_OWNER_ROLE} from "../type/RoleId.sol";
|
35
|
+
|
36
|
+
import {IService} from "../shared/IService.sol";
|
37
|
+
import {Service} from "../shared/Service.sol";
|
38
|
+
import {ComponentService} from "../shared/ComponentService.sol";
|
39
39
|
import {IProductService} from "./IProductService.sol";
|
40
|
-
import {InstanceReader} from "../InstanceReader.sol";
|
41
|
-
import {IPoolService} from "
|
40
|
+
import {InstanceReader} from "../instance/InstanceReader.sol";
|
41
|
+
import {IPoolService} from "../pool/PoolService.sol";
|
42
42
|
|
43
43
|
// TODO or name this ProtectionService to have Product be something more generic (loan, savings account, ...)
|
44
44
|
contract ProductService is ComponentService, IProductService {
|
@@ -111,7 +111,7 @@ contract ProductService is ComponentService, IProductService {
|
|
111
111
|
product.linkToRegisteredNftId();
|
112
112
|
|
113
113
|
// create product setup in instance
|
114
|
-
instance.createProductSetup(productNftId, product.getSetupInfo());
|
114
|
+
instance.getInstanceStore().createProductSetup(productNftId, product.getSetupInfo());
|
115
115
|
|
116
116
|
bytes4[][] memory selectors = new bytes4[][](1);
|
117
117
|
selectors[0] = new bytes4[](1);
|
@@ -157,7 +157,7 @@ contract ProductService is ComponentService, IProductService {
|
|
157
157
|
{
|
158
158
|
// TODO check args
|
159
159
|
|
160
|
-
(NftId productNftId
|
160
|
+
(NftId productNftId,, IInstance instance) = _getAndVerifyCallingComponentAndInstance(PRODUCT());
|
161
161
|
InstanceReader instanceReader = instance.getInstanceReader();
|
162
162
|
|
163
163
|
ISetup.ProductSetupInfo memory productSetupInfo = instanceReader.getProductSetupInfo(productNftId);
|
@@ -165,7 +165,7 @@ contract ProductService is ComponentService, IProductService {
|
|
165
165
|
productSetupInfo.productFee = productFee;
|
166
166
|
productSetupInfo.processingFee = processingFee;
|
167
167
|
|
168
|
-
instance.updateProductSetup(productNftId, productSetupInfo, KEEP_STATE());
|
168
|
+
instance.getInstanceStore().updateProductSetup(productNftId, productSetupInfo, KEEP_STATE());
|
169
169
|
}
|
170
170
|
|
171
171
|
function createRisk(
|
@@ -175,10 +175,10 @@ contract ProductService is ComponentService, IProductService {
|
|
175
175
|
external
|
176
176
|
override
|
177
177
|
{
|
178
|
-
(NftId productNftId
|
178
|
+
(NftId productNftId,, IInstance instance) = _getAndVerifyCallingComponentAndInstance(PRODUCT());
|
179
179
|
IRisk.RiskInfo memory riskInfo = IRisk.RiskInfo(productNftId, data);
|
180
180
|
|
181
|
-
instance.createRisk(
|
181
|
+
instance.getInstanceStore().createRisk(
|
182
182
|
riskId,
|
183
183
|
riskInfo
|
184
184
|
);
|
@@ -190,12 +190,12 @@ contract ProductService is ComponentService, IProductService {
|
|
190
190
|
)
|
191
191
|
external
|
192
192
|
{
|
193
|
-
(,, IInstance instance) =
|
193
|
+
(,, IInstance instance) = _getAndVerifyCallingComponentAndInstance(PRODUCT());
|
194
194
|
InstanceReader instanceReader = instance.getInstanceReader();
|
195
195
|
|
196
196
|
IRisk.RiskInfo memory riskInfo = instanceReader.getRiskInfo(riskId);
|
197
197
|
riskInfo.data = data;
|
198
|
-
instance.updateRisk(riskId, riskInfo, KEEP_STATE());
|
198
|
+
instance.getInstanceStore().updateRisk(riskId, riskInfo, KEEP_STATE());
|
199
199
|
}
|
200
200
|
|
201
201
|
function updateRiskState(
|
@@ -204,7 +204,7 @@ contract ProductService is ComponentService, IProductService {
|
|
204
204
|
)
|
205
205
|
external
|
206
206
|
{
|
207
|
-
(,, IInstance instance) =
|
208
|
-
instance.updateRiskState(riskId, state);
|
207
|
+
(,, IInstance instance) = _getAndVerifyCallingComponentAndInstance(PRODUCT());
|
208
|
+
instance.getInstanceStore().updateRiskState(riskId, state);
|
209
209
|
}
|
210
|
-
}
|
210
|
+
}
|
@@ -1,12 +1,12 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IVersionable} from "
|
5
|
-
import {ProxyManager} from "
|
4
|
+
import {IVersionable} from "../shared/IVersionable.sol";
|
5
|
+
import {ProxyManager} from "../shared/ProxyManager.sol";
|
6
6
|
import {ProductService} from "./ProductService.sol";
|
7
|
-
import {Registry} from "
|
8
|
-
import {RegistryService} from "
|
9
|
-
import {VersionLib} from "
|
7
|
+
import {Registry} from "../registry/Registry.sol";
|
8
|
+
import {RegistryService} from "../registry/RegistryService.sol";
|
9
|
+
import {VersionLib} from "../type/Version.sol";
|
10
10
|
|
11
11
|
contract ProductServiceManager is ProxyManager {
|
12
12
|
|
@@ -3,10 +3,10 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
5
|
|
6
|
-
import {NftId} from "../
|
7
|
-
import {ObjectType} from "../
|
8
|
-
import {VersionPart} from "../
|
9
|
-
import {Timestamp} from "../
|
6
|
+
import {NftId} from "../type/NftId.sol";
|
7
|
+
import {ObjectType} from "../type/ObjectType.sol";
|
8
|
+
import {VersionPart} from "../type/Version.sol";
|
9
|
+
import {Timestamp} from "../type/Timestamp.sol";
|
10
10
|
|
11
11
|
interface IRegistry is IERC165 {
|
12
12
|
|
@@ -3,19 +3,17 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
// import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
5
|
|
6
|
-
import {NftId} from "../
|
7
|
-
import {ObjectType} from "../
|
8
|
-
import {RoleId} from "../
|
6
|
+
import {NftId} from "../type/NftId.sol";
|
7
|
+
import {ObjectType} from "../type/ObjectType.sol";
|
8
|
+
import {RoleId} from "../type/RoleId.sol";
|
9
9
|
import {IService} from "../shared/IService.sol";
|
10
10
|
import {IRegistry} from "./IRegistry.sol";
|
11
11
|
|
12
12
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
13
|
-
import {IComponent} from "../
|
13
|
+
import {IComponent} from "../shared/IComponent.sol";
|
14
14
|
|
15
15
|
interface IRegistryService is
|
16
16
|
IService
|
17
|
-
// TODO cleanup
|
18
|
-
// IAccessManaged
|
19
17
|
{
|
20
18
|
error SelfRegistration();
|
21
19
|
error NotRegistryOwner();
|
@@ -3,9 +3,9 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
5
|
|
6
|
-
import {NftId, toNftId, zeroNftId} from "../
|
7
|
-
import {VersionPart} from "../
|
8
|
-
import {ObjectType, PROTOCOL, REGISTRY, TOKEN, SERVICE, INSTANCE, STAKE, PRODUCT, DISTRIBUTION, DISTRIBUTOR, ORACLE, POOL, POLICY, BUNDLE} from "../
|
6
|
+
import {NftId, toNftId, zeroNftId} from "../type/NftId.sol";
|
7
|
+
import {VersionPart} from "../type/Version.sol";
|
8
|
+
import {ObjectType, PROTOCOL, REGISTRY, TOKEN, SERVICE, INSTANCE, STAKE, PRODUCT, DISTRIBUTION, DISTRIBUTOR, ORACLE, POOL, POLICY, BUNDLE} from "../type/ObjectType.sol";
|
9
9
|
|
10
10
|
import {ChainNft} from "./ChainNft.sol";
|
11
11
|
import {IRegistry} from "./IRegistry.sol";
|
@@ -7,7 +7,7 @@ import {AccessManaged} from "@openzeppelin/contracts/access/manager/AccessManage
|
|
7
7
|
import {RoleId, RoleIdLib,
|
8
8
|
GIF_MANAGER_ROLE,
|
9
9
|
GIF_ADMIN_ROLE,
|
10
|
-
RELEASE_MANAGER_ROLE} from "../
|
10
|
+
RELEASE_MANAGER_ROLE} from "../type/RoleId.sol";
|
11
11
|
|
12
12
|
import {TokenRegistry} from "./TokenRegistry.sol";
|
13
13
|
import {ReleaseManager} from "./ReleaseManager.sol";
|
@@ -7,23 +7,22 @@ import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165C
|
|
7
7
|
import {IRegistry} from "./IRegistry.sol";
|
8
8
|
import {IInstance} from "../instance/IInstance.sol";
|
9
9
|
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {IDistributionComponent} from "../../contracts/components/IDistributionComponent.sol";
|
10
|
+
import {IComponent} from "../../contracts/shared/IComponent.sol";
|
11
|
+
import {IPoolComponent} from "../../contracts/pool/IPoolComponent.sol";
|
12
|
+
import {IProductComponent} from "../../contracts/product/IProductComponent.sol";
|
13
|
+
import {IDistributionComponent} from "../../contracts/distribution/IDistributionComponent.sol";
|
15
14
|
|
16
15
|
import {IVersionable} from "../../contracts/shared/IVersionable.sol";
|
17
16
|
import {Versionable} from "../../contracts/shared/Versionable.sol";
|
18
17
|
import {IRegisterable} from "../../contracts/shared/IRegisterable.sol";
|
19
18
|
import {Registerable} from "../../contracts/shared/Registerable.sol";
|
20
19
|
|
21
|
-
import {RoleId, PRODUCT_OWNER_ROLE, POOL_OWNER_ROLE, ORACLE_OWNER_ROLE} from "../../contracts/
|
22
|
-
import {ObjectType, REGISTRY, SERVICE, PRODUCT, ORACLE, POOL, INSTANCE, DISTRIBUTION, DISTRIBUTOR, APPLICATION, POLICY, CLAIM, BUNDLE, STAKE} from "../../contracts/
|
23
|
-
import {StateId, ACTIVE, PAUSED} from "../../contracts/
|
24
|
-
import {NftId, NftIdLib, zeroNftId} from "../../contracts/
|
25
|
-
import {Fee, FeeLib} from "../../contracts/
|
26
|
-
import {Version, VersionPart, VersionLib} from "../../contracts/
|
20
|
+
import {RoleId, PRODUCT_OWNER_ROLE, POOL_OWNER_ROLE, ORACLE_OWNER_ROLE} from "../../contracts/type/RoleId.sol";
|
21
|
+
import {ObjectType, REGISTRY, SERVICE, PRODUCT, ORACLE, POOL, INSTANCE, DISTRIBUTION, DISTRIBUTOR, APPLICATION, POLICY, CLAIM, BUNDLE, STAKE, PRICE} from "../../contracts/type/ObjectType.sol";
|
22
|
+
import {StateId, ACTIVE, PAUSED} from "../../contracts/type/StateId.sol";
|
23
|
+
import {NftId, NftIdLib, zeroNftId} from "../../contracts/type/NftId.sol";
|
24
|
+
import {Fee, FeeLib} from "../../contracts/type/Fee.sol";
|
25
|
+
import {Version, VersionPart, VersionLib} from "../../contracts/type/Version.sol";
|
27
26
|
|
28
27
|
import {Service} from "../shared/Service.sol";
|
29
28
|
import {IService} from "../shared/IService.sol";
|
@@ -176,7 +175,7 @@ contract RegistryService is
|
|
176
175
|
FunctionConfig[] memory config
|
177
176
|
)
|
178
177
|
{
|
179
|
-
config = new FunctionConfig[](
|
178
|
+
config = new FunctionConfig[](9);
|
180
179
|
|
181
180
|
// order of service registrations MUST be reverse to this array
|
182
181
|
/*config[-1].serviceDomain = STAKE();
|
@@ -205,15 +204,19 @@ contract RegistryService is
|
|
205
204
|
config[5].selectors = new bytes4[](1);
|
206
205
|
config[5].selectors[0] = RegistryService.registerBundle.selector;
|
207
206
|
|
208
|
-
|
209
|
-
config[6].
|
210
|
-
config[6].selectors
|
211
|
-
config[6].selectors[1] = RegistryService.registerDistributor.selector;
|
207
|
+
// registration of pricing service must preceed registration of application service
|
208
|
+
config[6].serviceDomain = PRICE();
|
209
|
+
config[6].selectors = new bytes4[](0);
|
212
210
|
|
213
|
-
//
|
214
|
-
config[7].serviceDomain =
|
215
|
-
config[7].selectors = new bytes4[](
|
216
|
-
config[7].selectors[0] = RegistryService.
|
211
|
+
// registration of distribution service must preceed registration of pricing service
|
212
|
+
config[7].serviceDomain = DISTRIBUTION();
|
213
|
+
config[7].selectors = new bytes4[](2);
|
214
|
+
config[7].selectors[0] = RegistryService.registerDistribution.selector;
|
215
|
+
config[7].selectors[1] = RegistryService.registerDistributor.selector;
|
216
|
+
|
217
|
+
config[8].serviceDomain = INSTANCE();
|
218
|
+
config[8].selectors = new bytes4[](1);
|
219
|
+
config[8].selectors[0] = RegistryService.registerInstance.selector;
|
217
220
|
}
|
218
221
|
|
219
222
|
// Internal
|
@@ -3,8 +3,6 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {AccessManager} from "@openzeppelin/contracts/access/manager/AccessManager.sol";
|
5
5
|
|
6
|
-
import {ContractDeployerLib} from "../shared/ContractDeployerLib.sol";
|
7
|
-
|
8
6
|
import {Registry} from "./Registry.sol";
|
9
7
|
import {IVersionable} from "../shared/IVersionable.sol";
|
10
8
|
import {ProxyManager} from "../shared/ProxyManager.sol";
|
@@ -3,11 +3,11 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {AccessManaged} from "@openzeppelin/contracts/access/manager/AccessManaged.sol";
|
5
5
|
|
6
|
-
import {NftId} from "../
|
7
|
-
import {RoleId} from "../
|
8
|
-
import {ObjectType, ObjectTypeLib, zeroObjectType, REGISTRY, SERVICE} from "../
|
9
|
-
import {Version, VersionLib, VersionPart, VersionPartLib} from "../
|
10
|
-
import {Timestamp, TimestampLib} from "../
|
6
|
+
import {NftId} from "../type/NftId.sol";
|
7
|
+
import {RoleId} from "../type/RoleId.sol";
|
8
|
+
import {ObjectType, ObjectTypeLib, zeroObjectType, REGISTRY, SERVICE} from "../type/ObjectType.sol";
|
9
|
+
import {Version, VersionLib, VersionPart, VersionPartLib} from "../type/Version.sol";
|
10
|
+
import {Timestamp, TimestampLib} from "../type/Timestamp.sol";
|
11
11
|
|
12
12
|
import {IService} from "../shared/IService.sol";
|
13
13
|
|
@@ -6,8 +6,8 @@ import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165C
|
|
6
6
|
|
7
7
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
8
8
|
import {IRegistry} from "./IRegistry.sol";
|
9
|
-
import {VersionPart} from "../
|
10
|
-
import {REGISTRY} from "../
|
9
|
+
import {VersionPart} from "../type/Version.sol";
|
10
|
+
import {REGISTRY} from "../type/ObjectType.sol";
|
11
11
|
import {NftOwnable} from "../shared/NftOwnable.sol";
|
12
12
|
|
13
13
|
/// @title contract to register token per GIF major release.
|
@@ -8,19 +8,19 @@ import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
|
|
8
8
|
|
9
9
|
import {IComponent} from "./IComponent.sol";
|
10
10
|
import {IComponents} from "../instance/module/IComponents.sol";
|
11
|
-
import {IProductService} from "../instance/service/IProductService.sol";
|
12
11
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
13
12
|
import {IInstance} from "../instance/IInstance.sol";
|
14
13
|
import {InstanceAccessManager} from "../instance/InstanceAccessManager.sol";
|
15
14
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
16
15
|
import {IRegistry} from "../registry/IRegistry.sol";
|
17
|
-
import {NftId} from "../
|
18
|
-
import {ObjectType, INSTANCE, PRODUCT} from "../
|
19
|
-
import {VersionPart} from "../
|
16
|
+
import {NftId} from "../type/NftId.sol";
|
17
|
+
import {ObjectType, INSTANCE, PRODUCT} from "../type/ObjectType.sol";
|
18
|
+
import {VersionPart} from "../type/Version.sol";
|
20
19
|
import {Registerable} from "../shared/Registerable.sol";
|
21
|
-
import {RoleId, RoleIdLib} from "../
|
20
|
+
import {RoleId, RoleIdLib} from "../type/RoleId.sol";
|
22
21
|
import {IAccess} from "../instance/module/IAccess.sol";
|
23
|
-
import {
|
22
|
+
import {TokenHandler} from "../shared/TokenHandler.sol";
|
23
|
+
import {VersionPart} from "../type/Version.sol";
|
24
24
|
|
25
25
|
// TODO discuss to inherit from oz accessmanaged
|
26
26
|
// then add (Distribution|Pool|Product)Upradeable that also intherit from Versionable
|
@@ -95,14 +95,28 @@ abstract contract Component is
|
|
95
95
|
registerInterface(type(IComponent).interfaceId);
|
96
96
|
}
|
97
97
|
|
98
|
-
function lock() external onlyOwner
|
98
|
+
function lock() external onlyOwner {
|
99
99
|
IInstanceService(_getServiceAddress(INSTANCE())).setComponentLocked(true);
|
100
100
|
}
|
101
101
|
|
102
|
-
function unlock() external onlyOwner
|
102
|
+
function unlock() external onlyOwner {
|
103
103
|
IInstanceService(_getServiceAddress(INSTANCE())).setComponentLocked(false);
|
104
104
|
}
|
105
105
|
|
106
|
+
function approveTokenHandler(uint256 spendingLimitAmount) external onlyOwner {
|
107
|
+
IComponents.ComponentInfo memory info = getComponentInfo();
|
108
|
+
|
109
|
+
if(info.wallet != address(this)) {
|
110
|
+
revert ErrorComponentWalletNotComponent();
|
111
|
+
}
|
112
|
+
|
113
|
+
info.token.approve(
|
114
|
+
address(info.tokenHandler),
|
115
|
+
spendingLimitAmount);
|
116
|
+
|
117
|
+
emit LogComponentTokenHandlerApproved(spendingLimitAmount);
|
118
|
+
}
|
119
|
+
|
106
120
|
function setWallet(address newWallet)
|
107
121
|
external
|
108
122
|
override
|
@@ -197,6 +211,10 @@ abstract contract Component is
|
|
197
211
|
return _getComponentStorage()._token;
|
198
212
|
}
|
199
213
|
|
214
|
+
function getTokenHandler() public view returns (TokenHandler tokenHandler) {
|
215
|
+
return getComponentInfo().tokenHandler;
|
216
|
+
}
|
217
|
+
|
200
218
|
function isNftInterceptor() public view override returns(bool isInterceptor) {
|
201
219
|
return _getComponentStorage()._isNftInterceptor;
|
202
220
|
}
|