@etherisc/gif-next 0.0.2-abde86b-349 → 0.0.2-ac4bee9-682
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +96 -37
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +67 -11
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +60 -13
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +40 -3
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +19 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +4 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +1196 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +68 -5
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +139 -157
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +77 -17
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +102 -96
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +152 -86
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +104 -60
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +92 -81
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +29 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1429 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +502 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +1979 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +470 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +151 -132
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +133 -127
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +249 -188
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +530 -229
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +53 -31
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +31 -86
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +78 -40
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +148 -118
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +57 -97
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +113 -135
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +91 -133
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +72 -40
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +172 -111
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +46 -5
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- 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/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +121 -139
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +77 -17
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +87 -76
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +43 -9
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +97 -91
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +102 -47
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +72 -36
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +97 -119
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +114 -22
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +205 -103
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +108 -60
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +72 -15
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +87 -115
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +213 -195
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +97 -130
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +294 -255
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +83 -47
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +82 -32
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +69 -33
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +142 -92
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +77 -17
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +175 -82
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +102 -58
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +29 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +56 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +65 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +80 -51
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +128 -73
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +29 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +154 -61
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +87 -47
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +165 -107
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +85 -45
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +138 -88
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +76 -26
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +66 -30
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +72 -15
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +114 -35
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +5 -18
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +116 -51
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +206 -165
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +161 -61
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +65 -29
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +47 -6
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +123 -225
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +66 -8
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +76 -66
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +425 -155
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +103 -63
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +42 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +21 -2
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +66 -51
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +388 -19
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +87 -76
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +36 -0
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +36 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +16 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +29 -0
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +29 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +97 -91
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +42 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +18 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +66 -8
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +42 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +388 -35
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +395 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +88 -24
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +84 -87
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +29 -21
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +2 -2
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +154 -166
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +46 -5
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +81 -51
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +7 -12
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +82 -53
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +69 -33
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +144 -103
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +32 -8
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +28 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +2 -2
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +60 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +15 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +44 -12
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +65 -61
- package/contracts/authorization/Authorization.sol +106 -38
- package/contracts/authorization/IAccess.sol +1 -0
- package/contracts/authorization/IAccessAdmin.sol +4 -2
- package/contracts/authorization/IAuthorization.sol +13 -7
- package/contracts/authorization/IServiceAuthorization.sol +3 -1
- package/contracts/authorization/ReleaseAccessManager.sol +38 -0
- package/contracts/authorization/ServiceAuthorization.sol +26 -10
- package/contracts/distribution/BasicDistribution.sol +2 -1
- package/contracts/distribution/Distribution.sol +6 -16
- package/contracts/distribution/DistributionService.sol +55 -36
- package/contracts/distribution/IDistributionComponent.sol +1 -1
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +86 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +34 -0
- package/contracts/examples/fire/FireProduct.sol +431 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +44 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +12 -4
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -4
- package/contracts/examples/unpermissioned/SimplePool.sol +38 -6
- package/contracts/examples/unpermissioned/SimpleProduct.sol +17 -23
- package/contracts/instance/IInstance.sol +4 -1
- package/contracts/instance/IInstanceService.sol +2 -23
- package/contracts/instance/Instance.sol +20 -17
- package/contracts/instance/InstanceAdmin.sol +17 -28
- package/contracts/instance/InstanceAuthorizationV3.sol +9 -19
- package/contracts/instance/InstanceReader.sol +10 -34
- package/contracts/instance/InstanceService.sol +29 -80
- package/contracts/instance/module/IComponents.sol +7 -5
- package/contracts/instance/module/IPolicy.sol +2 -1
- package/contracts/oracle/BasicOracle.sol +0 -1
- package/contracts/oracle/IOracleService.sol +2 -1
- package/contracts/oracle/Oracle.sol +4 -15
- package/contracts/oracle/OracleService.sol +47 -36
- package/contracts/pool/BasicPool.sol +33 -24
- package/contracts/pool/BasicPoolAuthorization.sol +12 -2
- package/contracts/pool/BundleService.sol +88 -41
- package/contracts/pool/IBundleService.sol +11 -5
- package/contracts/pool/IPoolComponent.sol +1 -7
- package/contracts/pool/IPoolService.sol +25 -24
- package/contracts/pool/Pool.sol +118 -126
- package/contracts/pool/PoolService.sol +203 -131
- package/contracts/product/ApplicationService.sol +9 -1
- package/contracts/product/BasicProduct.sol +8 -12
- package/contracts/product/BasicProductAuthorization.sol +0 -1
- package/contracts/product/ClaimService.sol +99 -58
- package/contracts/product/IClaimService.sol +2 -1
- package/contracts/product/IPolicyService.sol +6 -1
- package/contracts/product/IPricingService.sol +9 -9
- package/contracts/product/IProductComponent.sol +6 -0
- package/contracts/product/PolicyService.sol +76 -27
- package/contracts/product/PricingService.sol +8 -8
- package/contracts/product/Product.sol +56 -56
- package/contracts/registry/ChainNft.sol +6 -9
- package/contracts/registry/IRegistry.sol +6 -3
- package/contracts/registry/IRegistryService.sol +6 -4
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +22 -4
- package/contracts/registry/RegistryAdmin.sol +29 -31
- package/contracts/registry/RegistryService.sol +37 -55
- package/contracts/registry/ReleaseLifecycle.sol +6 -3
- package/contracts/registry/ReleaseRegistry.sol +202 -208
- package/contracts/registry/ServiceAuthorizationV3.sol +24 -20
- package/contracts/shared/Component.sol +58 -97
- package/contracts/shared/ComponentService.sol +285 -147
- package/contracts/shared/ComponentVerifyingService.sol +27 -15
- package/contracts/shared/ContractLib.sol +17 -1
- package/contracts/shared/IComponent.sol +10 -13
- package/contracts/shared/IComponentService.sol +38 -16
- package/contracts/shared/IInstanceLinkedComponent.sol +3 -11
- package/contracts/shared/ILifecycle.sol +3 -1
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IRegisterable.sol +11 -0
- package/contracts/shared/InstanceLinkedComponent.sol +66 -32
- package/contracts/shared/KeyValueStore.sol +1 -1
- package/contracts/shared/Lifecycle.sol +15 -4
- package/contracts/shared/NftOwnable.sol +23 -3
- package/contracts/shared/Registerable.sol +15 -7
- package/contracts/shared/RegistryLinked.sol +6 -12
- package/contracts/shared/Service.sol +4 -7
- package/contracts/shared/TokenHandler.sol +324 -66
- package/contracts/shared/TokenHandlerDeployerLib.sol +10 -2
- package/contracts/staking/IStaking.sol +9 -4
- package/contracts/staking/IStakingService.sol +0 -3
- package/contracts/staking/Staking.sol +31 -24
- package/contracts/staking/StakingReader.sol +12 -5
- package/contracts/staking/StakingService.sol +69 -23
- package/contracts/type/Amount.sol +15 -0
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/NftId.sol +1 -0
- package/contracts/type/ObjectType.sol +1 -0
- package/contracts/type/RiskId.sol +16 -2
- package/contracts/type/RoleId.sol +0 -12
- package/contracts/type/StateId.sol +14 -1
- package/contracts/upgradeability/ProxyManager.sol +2 -1
- package/package.json +4 -3
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +0 -290
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +0 -390
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- package/contracts/authorization/IModuleAuthorization.sol +0 -21
- package/contracts/authorization/ModuleAuthorization.sol +0 -78
- package/contracts/shared/InitializableCustom.sol +0 -177
@@ -6,24 +6,22 @@ import {IBundleService} from "./IBundleService.sol";
|
|
6
6
|
import {IComponents} from "../instance/module/IComponents.sol";
|
7
7
|
import {IComponentService} from "../shared/IComponentService.sol";
|
8
8
|
import {IInstance} from "../instance/IInstance.sol";
|
9
|
-
import {IInstanceService} from "../instance/IInstanceService.sol";
|
10
9
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
11
|
-
import {
|
10
|
+
import {IPoolComponent} from "../pool/IPoolComponent.sol";
|
12
11
|
import {IPoolService} from "./IPoolService.sol";
|
12
|
+
import {IProductComponent} from "../product/IProductComponent.sol";
|
13
13
|
import {IRegistry} from "../registry/IRegistry.sol";
|
14
|
-
import {IRegistryService} from "../registry/IRegistryService.sol";
|
15
14
|
import {IStaking} from "../staking/IStaking.sol";
|
16
15
|
|
17
16
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
18
17
|
import {ClaimId} from "../type/ClaimId.sol";
|
19
18
|
import {Fee, FeeLib} from "../type/Fee.sol";
|
20
19
|
import {NftId} from "../type/NftId.sol";
|
21
|
-
import {ObjectType, POOL, BUNDLE,
|
22
|
-
import {RoleId, PUBLIC_ROLE} from "../type/RoleId.sol";
|
20
|
+
import {ObjectType, POOL, BUNDLE, PRODUCT, POLICY, COMPONENT} from "../type/ObjectType.sol";
|
23
21
|
import {Fee, FeeLib} from "../type/Fee.sol";
|
24
22
|
import {KEEP_STATE} from "../type/StateId.sol";
|
25
23
|
import {Seconds} from "../type/Seconds.sol";
|
26
|
-
import {UFixed
|
24
|
+
import {UFixed} from "../type/UFixed.sol";
|
27
25
|
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
28
26
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
29
27
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
@@ -36,9 +34,6 @@ contract PoolService is
|
|
36
34
|
{
|
37
35
|
IBundleService internal _bundleService;
|
38
36
|
IComponentService internal _componentService;
|
39
|
-
IInstanceService private _instanceService;
|
40
|
-
IRegistryService private _registryService;
|
41
|
-
|
42
37
|
IStaking private _staking;
|
43
38
|
|
44
39
|
function _initialize(
|
@@ -56,11 +51,8 @@ contract PoolService is
|
|
56
51
|
|
57
52
|
_initializeService(registryAddress, authority, owner);
|
58
53
|
|
59
|
-
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
60
54
|
_bundleService = IBundleService(_getServiceAddress(BUNDLE()));
|
61
|
-
_instanceService = IInstanceService(_getServiceAddress(INSTANCE()));
|
62
55
|
_componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
63
|
-
|
64
56
|
_staking = IStaking(getRegistry().getStakingAddress());
|
65
57
|
|
66
58
|
_registerInterface(type(IPoolService).interfaceId);
|
@@ -83,71 +75,39 @@ contract PoolService is
|
|
83
75
|
emit LogPoolServiceMaxBalanceAmountUpdated(poolNftId, previousMaxBalanceAmount, maxBalanceAmount);
|
84
76
|
}
|
85
77
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
address bundleOwner, // initial bundle owner
|
112
|
-
Fee memory fee, // fees deducted from premium that go to bundle owner
|
113
|
-
Seconds lifetime, // initial duration for which new policies are covered
|
114
|
-
bytes calldata filter // optional use case specific criteria that define if a policy may be covered by this bundle
|
115
|
-
)
|
116
|
-
external
|
117
|
-
virtual
|
118
|
-
returns(NftId bundleNftId)
|
119
|
-
{
|
120
|
-
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
121
|
-
|
122
|
-
// create the empty bundle
|
123
|
-
bundleNftId = _bundleService.create(
|
124
|
-
instance,
|
125
|
-
poolNftId,
|
126
|
-
bundleOwner,
|
127
|
-
fee,
|
128
|
-
AmountLib.zero(),
|
129
|
-
lifetime,
|
130
|
-
filter);
|
131
|
-
|
132
|
-
emit LogPoolServiceBundleCreated(instance.getNftId(), poolNftId, bundleNftId);
|
133
|
-
}
|
134
|
-
|
135
|
-
|
136
|
-
function _getStakingFee(InstanceReader instanceReader, NftId poolNftId)
|
137
|
-
internal
|
138
|
-
virtual
|
139
|
-
view
|
140
|
-
returns (Fee memory stakingFee)
|
141
|
-
{
|
142
|
-
NftId productNftId = instanceReader.getComponentInfo(poolNftId).productNftId;
|
143
|
-
return instanceReader.getProductInfo(productNftId).stakingFee;
|
144
|
-
}
|
78
|
+
// TODO cleanup
|
79
|
+
// /// @inheritdoc IPoolService
|
80
|
+
// function createBundle(
|
81
|
+
// address bundleOwner, // initial bundle owner
|
82
|
+
// Fee memory fee, // fees deducted from premium that go to bundle owner
|
83
|
+
// Seconds lifetime, // initial duration for which new policies are covered
|
84
|
+
// bytes calldata filter // optional use case specific criteria that define if a policy may be covered by this bundle
|
85
|
+
// )
|
86
|
+
// external
|
87
|
+
// virtual
|
88
|
+
// returns(NftId bundleNftId)
|
89
|
+
// {
|
90
|
+
// (NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
91
|
+
|
92
|
+
// // create the empty bundle
|
93
|
+
// bundleNftId = _bundleService.create(
|
94
|
+
// instance,
|
95
|
+
// poolNftId,
|
96
|
+
// bundleOwner,
|
97
|
+
// fee,
|
98
|
+
// lifetime,
|
99
|
+
// filter);
|
100
|
+
|
101
|
+
// emit LogPoolServiceBundleCreated(instance.getNftId(), poolNftId, bundleNftId);
|
102
|
+
// }
|
145
103
|
|
146
104
|
|
147
105
|
function closeBundle(NftId bundleNftId)
|
148
106
|
external
|
149
107
|
virtual
|
150
108
|
{
|
109
|
+
_checkNftType(bundleNftId, BUNDLE());
|
110
|
+
|
151
111
|
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
152
112
|
|
153
113
|
// TODO get performance fee for pool (#477)
|
@@ -166,7 +126,7 @@ contract PoolService is
|
|
166
126
|
if ((unstakedAmount + feeAmount).gtz()){
|
167
127
|
IComponents.ComponentInfo memory poolComponentInfo = instance.getInstanceReader().getComponentInfo(poolNftId);
|
168
128
|
poolComponentInfo.tokenHandler.distributeTokens(
|
169
|
-
poolComponentInfo.
|
129
|
+
poolComponentInfo.tokenHandler.getWallet(),
|
170
130
|
getRegistry().ownerOf(bundleNftId),
|
171
131
|
unstakedAmount + feeAmount);
|
172
132
|
}
|
@@ -182,9 +142,11 @@ contract PoolService is
|
|
182
142
|
external
|
183
143
|
virtual
|
184
144
|
{
|
145
|
+
_checkNftType(policyNftId, POLICY());
|
146
|
+
|
185
147
|
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
186
148
|
InstanceReader instanceReader = instance.getInstanceReader();
|
187
|
-
NftId productNftId =
|
149
|
+
NftId productNftId = _getProductNftId(poolNftId);
|
188
150
|
|
189
151
|
// check policy matches with calling pool
|
190
152
|
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
@@ -212,6 +174,8 @@ contract PoolService is
|
|
212
174
|
// TODO: restricted() (once #462 is done)
|
213
175
|
returns(Amount netAmount)
|
214
176
|
{
|
177
|
+
_checkNftType(bundleNftId, BUNDLE());
|
178
|
+
|
215
179
|
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
216
180
|
InstanceReader instanceReader = instance.getInstanceReader();
|
217
181
|
IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
|
@@ -228,17 +192,22 @@ contract PoolService is
|
|
228
192
|
}
|
229
193
|
}
|
230
194
|
|
231
|
-
|
232
195
|
// calculate fees
|
196
|
+
IRegistry registry = getRegistry();
|
233
197
|
Amount feeAmount;
|
234
|
-
(
|
235
|
-
feeAmount,
|
236
|
-
netAmount
|
237
|
-
) = FeeLib.calculateFee(
|
238
|
-
_getStakingFee(instanceReader, poolNftId),
|
239
|
-
amount);
|
240
198
|
|
241
|
-
|
199
|
+
{
|
200
|
+
NftId productNftId = registry.getObjectInfo(poolNftId).parentNftId;
|
201
|
+
Fee memory stakingFee = instanceReader.getProductInfo(productNftId).stakingFee;
|
202
|
+
(
|
203
|
+
feeAmount,
|
204
|
+
netAmount
|
205
|
+
) = FeeLib.calculateFee(
|
206
|
+
stakingFee,
|
207
|
+
amount);
|
208
|
+
}
|
209
|
+
|
210
|
+
// do all the book keeping
|
242
211
|
_componentService.increasePoolBalance(
|
243
212
|
instance.getInstanceStore(),
|
244
213
|
poolNftId,
|
@@ -247,18 +216,22 @@ contract PoolService is
|
|
247
216
|
|
248
217
|
_bundleService.stake(instance, bundleNftId, netAmount);
|
249
218
|
|
250
|
-
// collect tokens from bundle owner
|
251
|
-
address bundleOwner = getRegistry().ownerOf(bundleNftId);
|
252
219
|
emit LogPoolServiceBundleStaked(instance.getNftId(), poolNftId, bundleNftId, amount, netAmount);
|
253
220
|
|
254
|
-
//
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
bundleOwner
|
259
|
-
|
221
|
+
// only collect staking amount when pool is not externally managed
|
222
|
+
if (!poolInfo.isExternallyManaged) {
|
223
|
+
|
224
|
+
// collect tokens from bundle owner
|
225
|
+
address bundleOwner = getRegistry().ownerOf(bundleNftId);
|
226
|
+
_collectStakingAmount(
|
227
|
+
instanceReader,
|
228
|
+
poolNftId,
|
229
|
+
bundleOwner,
|
230
|
+
amount);
|
231
|
+
}
|
260
232
|
}
|
261
233
|
|
234
|
+
|
262
235
|
/// @inheritdoc IPoolService
|
263
236
|
function unstake(NftId bundleNftId, Amount amount)
|
264
237
|
external
|
@@ -266,11 +239,13 @@ contract PoolService is
|
|
266
239
|
// TODO: restricted() (once #462 is done)
|
267
240
|
returns(Amount netAmount)
|
268
241
|
{
|
242
|
+
_checkNftType(bundleNftId, BUNDLE());
|
243
|
+
|
269
244
|
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
270
245
|
InstanceReader instanceReader = instance.getInstanceReader();
|
271
246
|
InstanceStore instanceStore = instance.getInstanceStore();
|
272
247
|
IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
|
273
|
-
|
248
|
+
|
274
249
|
if (bundleInfo.poolNftId != poolNftId) {
|
275
250
|
revert ErrorPoolServiceBundlePoolMismatch(bundleNftId, poolNftId);
|
276
251
|
}
|
@@ -282,6 +257,7 @@ contract PoolService is
|
|
282
257
|
// if amount was max, this was set to the available amount
|
283
258
|
|
284
259
|
// TODO: handle performance fees (issue #477)
|
260
|
+
netAmount = unstakedAmount;
|
285
261
|
|
286
262
|
// update pool bookkeeping - performance fees stay in the pool, but as fees
|
287
263
|
_componentService.decreasePoolBalance(
|
@@ -290,38 +266,77 @@ contract PoolService is
|
|
290
266
|
unstakedAmount,
|
291
267
|
AmountLib.zero());
|
292
268
|
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
269
|
+
|
270
|
+
emit LogPoolServiceBundleUnstaked(instance.getNftId(), poolNftId, bundleNftId, unstakedAmount, netAmount);
|
271
|
+
|
272
|
+
// only distribute staking amount when pool is not externally managed
|
273
|
+
if (!instanceReader.getPoolInfo(poolNftId).isExternallyManaged) {
|
274
|
+
|
275
|
+
// transfer amount to bundle owner
|
276
|
+
address bundleOwner = getRegistry().ownerOf(bundleNftId);
|
277
|
+
_distributeUnstakingAmount(
|
278
|
+
instanceReader,
|
279
|
+
poolNftId,
|
280
|
+
bundleOwner,
|
281
|
+
netAmount);
|
282
|
+
}
|
303
283
|
}
|
304
284
|
|
305
285
|
|
306
|
-
function fundPoolWallet(
|
286
|
+
function fundPoolWallet(Amount amount)
|
307
287
|
external
|
308
288
|
virtual
|
309
|
-
restricted()
|
289
|
+
// restricted()
|
310
290
|
{
|
311
|
-
|
312
|
-
|
291
|
+
(
|
292
|
+
NftId poolNftId,,
|
293
|
+
IInstance instance
|
294
|
+
) = _getAndVerifyActiveComponent(POOL());
|
295
|
+
|
296
|
+
// check that pool is externally managed
|
297
|
+
InstanceReader reader = instance.getInstanceReader();
|
298
|
+
if (!reader.getPoolInfo(poolNftId).isExternallyManaged) {
|
299
|
+
revert ErrorPoolServicePoolNotExternallyManaged(poolNftId);
|
300
|
+
}
|
301
|
+
|
302
|
+
address poolOwner = getRegistry().ownerOf(poolNftId);
|
303
|
+
emit LogPoolServiceWalletFunded(poolNftId, poolOwner, amount);
|
304
|
+
|
305
|
+
_collectStakingAmount(
|
306
|
+
reader,
|
307
|
+
poolNftId,
|
308
|
+
poolOwner,
|
309
|
+
amount);
|
313
310
|
}
|
314
311
|
|
315
312
|
|
316
|
-
function defundPoolWallet(
|
313
|
+
function defundPoolWallet(Amount amount)
|
317
314
|
external
|
318
315
|
virtual
|
319
|
-
restricted()
|
316
|
+
// restricted()
|
320
317
|
{
|
321
|
-
|
322
|
-
|
318
|
+
(
|
319
|
+
NftId poolNftId,,
|
320
|
+
IInstance instance
|
321
|
+
) = _getAndVerifyActiveComponent(POOL());
|
322
|
+
|
323
|
+
// check that pool is externally managed
|
324
|
+
InstanceReader reader = instance.getInstanceReader();
|
325
|
+
if (!reader.getPoolInfo(poolNftId).isExternallyManaged) {
|
326
|
+
revert ErrorPoolServicePoolNotExternallyManaged(poolNftId);
|
327
|
+
}
|
328
|
+
|
329
|
+
address poolOwner = getRegistry().ownerOf(poolNftId);
|
330
|
+
emit LogPoolServiceWalletDefunded(poolNftId, poolOwner, amount);
|
331
|
+
|
332
|
+
_distributeUnstakingAmount(
|
333
|
+
reader,
|
334
|
+
poolNftId,
|
335
|
+
poolOwner,
|
336
|
+
amount);
|
323
337
|
}
|
324
338
|
|
339
|
+
|
325
340
|
function processSale(
|
326
341
|
NftId bundleNftId,
|
327
342
|
IPolicy.PremiumInfo memory premium
|
@@ -330,11 +345,13 @@ contract PoolService is
|
|
330
345
|
virtual
|
331
346
|
restricted()
|
332
347
|
{
|
348
|
+
_checkNftType(bundleNftId, BUNDLE());
|
349
|
+
|
333
350
|
IRegistry registry = getRegistry();
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
351
|
+
NftId poolNftId = registry.getObjectInfo(bundleNftId).parentNftId;
|
352
|
+
IInstance instance = _getInstanceForComponent(
|
353
|
+
registry,
|
354
|
+
registry.getObjectInfo(poolNftId).parentNftId);
|
338
355
|
|
339
356
|
Amount poolFeeAmount = premium.poolFeeFixAmount + premium.poolFeeVarAmount;
|
340
357
|
Amount bundleFeeAmount = premium.bundleFeeFixAmount + premium.bundleFeeVarAmount;
|
@@ -343,13 +360,13 @@ contract PoolService is
|
|
343
360
|
InstanceStore instanceStore = instance.getInstanceStore();
|
344
361
|
_componentService.increasePoolBalance(
|
345
362
|
instanceStore,
|
346
|
-
|
363
|
+
poolNftId,
|
347
364
|
bundleNetAmount + bundleFeeAmount,
|
348
365
|
poolFeeAmount);
|
349
366
|
|
350
367
|
_componentService.increaseBundleBalance(
|
351
368
|
instanceStore,
|
352
|
-
|
369
|
+
bundleNftId,
|
353
370
|
bundleNetAmount,
|
354
371
|
bundleFeeAmount);
|
355
372
|
}
|
@@ -371,9 +388,17 @@ contract PoolService is
|
|
371
388
|
Amount localCollateralAmount
|
372
389
|
)
|
373
390
|
{
|
391
|
+
_checkNftType(productNftId, PRODUCT());
|
392
|
+
_checkNftType(applicationNftId, POLICY());
|
393
|
+
_checkNftType(bundleNftId, BUNDLE());
|
394
|
+
|
395
|
+
NftId poolNftId;
|
396
|
+
bool poolIsVerifyingApplications;
|
374
397
|
(
|
398
|
+
poolNftId,
|
375
399
|
totalCollateralAmount,
|
376
|
-
localCollateralAmount
|
400
|
+
localCollateralAmount,
|
401
|
+
poolIsVerifyingApplications
|
377
402
|
) = calculateRequiredCollateral(
|
378
403
|
instance.getInstanceReader(),
|
379
404
|
productNftId,
|
@@ -392,15 +417,23 @@ contract PoolService is
|
|
392
417
|
token,
|
393
418
|
totalCollateralAmount);
|
394
419
|
|
395
|
-
//
|
396
|
-
|
397
|
-
|
420
|
+
// pool callback when required
|
421
|
+
if (poolIsVerifyingApplications) {
|
422
|
+
IPoolComponent pool = IPoolComponent(
|
423
|
+
getRegistry().getObjectAddress(poolNftId));
|
398
424
|
|
425
|
+
pool.verifyApplication(
|
426
|
+
applicationNftId,
|
427
|
+
bundleNftId,
|
428
|
+
totalCollateralAmount);
|
429
|
+
|
430
|
+
// TODO add logging
|
399
431
|
}
|
400
|
-
}
|
401
432
|
|
433
|
+
// TODO add logging
|
434
|
+
}
|
402
435
|
|
403
|
-
function
|
436
|
+
function processPayout(
|
404
437
|
IInstance instance,
|
405
438
|
address token,
|
406
439
|
NftId policyNftId,
|
@@ -411,6 +444,24 @@ contract PoolService is
|
|
411
444
|
virtual
|
412
445
|
restricted()
|
413
446
|
{
|
447
|
+
_checkNftType(policyNftId, POLICY());
|
448
|
+
|
449
|
+
NftId bundleNftId = policyInfo.bundleNftId;
|
450
|
+
NftId poolNftId = getRegistry().getObjectInfo(bundleNftId).parentNftId;
|
451
|
+
InstanceStore instanceStore = instance.getInstanceStore();
|
452
|
+
|
453
|
+
_componentService.decreasePoolBalance(
|
454
|
+
instanceStore,
|
455
|
+
poolNftId,
|
456
|
+
payoutAmount,
|
457
|
+
AmountLib.zero());
|
458
|
+
|
459
|
+
_componentService.decreaseBundleBalance(
|
460
|
+
instanceStore,
|
461
|
+
bundleNftId,
|
462
|
+
payoutAmount,
|
463
|
+
AmountLib.zero());
|
464
|
+
|
414
465
|
_bundleService.releaseCollateral(
|
415
466
|
instance,
|
416
467
|
policyNftId,
|
@@ -437,6 +488,8 @@ contract PoolService is
|
|
437
488
|
virtual
|
438
489
|
restricted()
|
439
490
|
{
|
491
|
+
_checkNftType(policyNftId, POLICY());
|
492
|
+
|
440
493
|
Amount remainingCollateralAmount = policyInfo.sumInsuredAmount - policyInfo.claimAmount;
|
441
494
|
|
442
495
|
_bundleService.releaseCollateral(
|
@@ -465,12 +518,17 @@ contract PoolService is
|
|
465
518
|
public
|
466
519
|
view
|
467
520
|
returns(
|
521
|
+
NftId poolNftId,
|
468
522
|
Amount totalCollateralAmount,
|
469
|
-
Amount localCollateralAmount
|
523
|
+
Amount localCollateralAmount,
|
524
|
+
bool poolIsVerifyingApplications
|
470
525
|
)
|
471
526
|
{
|
472
|
-
|
527
|
+
_checkNftType(productNftId, PRODUCT());
|
528
|
+
|
529
|
+
poolNftId = instanceReader.getProductInfo(productNftId).poolNftId;
|
473
530
|
IComponents.PoolInfo memory poolInfo = instanceReader.getPoolInfo(poolNftId);
|
531
|
+
poolIsVerifyingApplications = poolInfo.isVerifyingApplications;
|
474
532
|
|
475
533
|
(
|
476
534
|
totalCollateralAmount,
|
@@ -509,6 +567,7 @@ contract PoolService is
|
|
509
567
|
Amount stakingAmount
|
510
568
|
)
|
511
569
|
internal
|
570
|
+
pure
|
512
571
|
returns (Amount stakingNetAmount)
|
513
572
|
{
|
514
573
|
stakingNetAmount = stakingAmount;
|
@@ -523,25 +582,38 @@ contract PoolService is
|
|
523
582
|
}
|
524
583
|
|
525
584
|
|
526
|
-
/// @dev transfers the specified amount from the
|
585
|
+
/// @dev transfers the specified amount from the "from account" to the pool's wallet
|
527
586
|
function _collectStakingAmount(
|
528
|
-
InstanceReader
|
587
|
+
InstanceReader reader,
|
529
588
|
NftId poolNftId,
|
530
|
-
address
|
589
|
+
address from,
|
531
590
|
Amount amount
|
532
591
|
)
|
533
592
|
internal
|
534
593
|
{
|
594
|
+
IComponents.ComponentInfo memory info = reader.getComponentInfo(poolNftId);
|
595
|
+
info.tokenHandler.collectTokens(
|
596
|
+
from,
|
597
|
+
amount);
|
598
|
+
}
|
535
599
|
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
600
|
+
/// @dev distributes the specified amount from the pool's wallet to the "to account"
|
601
|
+
function _distributeUnstakingAmount(
|
602
|
+
InstanceReader reader,
|
603
|
+
NftId poolNftId,
|
604
|
+
address to,
|
605
|
+
Amount amount
|
606
|
+
)
|
607
|
+
internal
|
608
|
+
{
|
609
|
+
IComponents.ComponentInfo memory info = reader.getComponentInfo(poolNftId);
|
610
|
+
info.tokenHandler.distributeTokens(
|
611
|
+
info.tokenHandler.getWallet(),
|
612
|
+
to,
|
542
613
|
amount);
|
543
614
|
}
|
544
615
|
|
616
|
+
|
545
617
|
function _getDomain() internal pure override returns(ObjectType) {
|
546
618
|
return POOL();
|
547
619
|
}
|
@@ -13,7 +13,7 @@ import {IRegistryService} from "../registry/IRegistryService.sol";
|
|
13
13
|
import {AmountLib} from "../type/Amount.sol";
|
14
14
|
import {Seconds} from "../type/Seconds.sol";
|
15
15
|
import {zeroTimestamp} from "../type/Timestamp.sol";
|
16
|
-
import {ObjectType, DISTRIBUTION, PRODUCT, REGISTRY, APPLICATION, POLICY, PRICE} from "../type/ObjectType.sol";
|
16
|
+
import {ObjectType, BUNDLE, DISTRIBUTION, PRODUCT, REGISTRY, APPLICATION, POLICY, PRICE} from "../type/ObjectType.sol";
|
17
17
|
import {REVOKED} from "../type/StateId.sol";
|
18
18
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
19
19
|
import {ReferralId} from "../type/Referral.sol";
|
@@ -137,6 +137,8 @@ contract ApplicationService is
|
|
137
137
|
nonReentrant()
|
138
138
|
returns (NftId applicationNftId)
|
139
139
|
{
|
140
|
+
_checkNftType(bundleNftId, BUNDLE());
|
141
|
+
|
140
142
|
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
141
143
|
|
142
144
|
// check if provided references are valid and linked to calling product contract
|
@@ -213,6 +215,8 @@ contract ApplicationService is
|
|
213
215
|
nonReentrant()
|
214
216
|
returns (NftId applicationNftId)
|
215
217
|
{
|
218
|
+
_checkNftType(policyNftId, POLICY());
|
219
|
+
_checkNftType(bundleNftId, BUNDLE());
|
216
220
|
// TODO implement
|
217
221
|
}
|
218
222
|
|
@@ -230,6 +234,8 @@ contract ApplicationService is
|
|
230
234
|
virtual
|
231
235
|
nonReentrant()
|
232
236
|
{
|
237
|
+
_checkNftType(applicationNftId, POLICY());
|
238
|
+
_checkNftType(bundleNftId, BUNDLE());
|
233
239
|
// TODO implement
|
234
240
|
}
|
235
241
|
|
@@ -238,6 +244,8 @@ contract ApplicationService is
|
|
238
244
|
virtual
|
239
245
|
nonReentrant()
|
240
246
|
{
|
247
|
+
_checkNftType(applicationNftId, POLICY());
|
248
|
+
|
241
249
|
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
242
250
|
instance.getInstanceStore().updateApplicationState(applicationNftId, REVOKED());
|
243
251
|
}
|
@@ -3,6 +3,7 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {Fee} from "../type/Fee.sol";
|
5
5
|
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
6
|
+
import {IComponents} from "../instance/module/IComponents.sol";
|
6
7
|
import {NftId} from "../type/NftId.sol";
|
7
8
|
import {Product} from "../product/Product.sol";
|
8
9
|
|
@@ -25,13 +26,11 @@ abstract contract BasicProduct is
|
|
25
26
|
function _initializeBasicProduct(
|
26
27
|
address registry,
|
27
28
|
NftId instanceNftId,
|
28
|
-
IAuthorization authorization,
|
29
|
-
address initialOwner,
|
30
29
|
string memory name,
|
31
30
|
address token,
|
32
|
-
|
33
|
-
|
34
|
-
address
|
31
|
+
IComponents.ProductInfo memory productInfo,
|
32
|
+
IAuthorization authorization,
|
33
|
+
address initialOwner
|
35
34
|
)
|
36
35
|
internal
|
37
36
|
virtual
|
@@ -40,14 +39,11 @@ abstract contract BasicProduct is
|
|
40
39
|
_initializeProduct(
|
41
40
|
registry,
|
42
41
|
instanceNftId,
|
43
|
-
authorization,
|
44
|
-
initialOwner,
|
45
42
|
name,
|
46
43
|
token,
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
""
|
51
|
-
""); // componentData
|
44
|
+
productInfo,
|
45
|
+
authorization,
|
46
|
+
initialOwner,
|
47
|
+
""); // component data
|
52
48
|
}
|
53
49
|
}
|
@@ -36,7 +36,6 @@ contract BasicProductAuthorization
|
|
36
36
|
// authorize public role (open access to any account, only allows to lock target)
|
37
37
|
functions = _authorizeForTarget(getTargetName(), PUBLIC_ROLE());
|
38
38
|
_authorize(functions, BasicProduct.setFees.selector, "setFees");
|
39
|
-
|
40
39
|
_authorize(functions, IInstanceLinkedComponent.withdrawFees.selector, "withdrawFees");
|
41
40
|
}
|
42
41
|
}
|