@etherisc/gif-next 0.0.2-b3e9a44-364 → 0.0.2-b43fece-589
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 +138 -94
- 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 +78 -58
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +120 -86
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +64 -60
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +65 -58
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +13 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +119 -135
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +114 -22
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +218 -159
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +81 -25
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +140 -96
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +121 -77
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +197 -145
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +508 -177
- 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 +37 -31
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +13 -84
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +46 -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 +94 -79
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +56 -130
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +32 -40
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +174 -103
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- 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/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 +119 -75
- 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 +60 -53
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +27 -9
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +73 -53
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +70 -47
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +32 -36
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +73 -81
- 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 +125 -119
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +57 -69
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +32 -15
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +60 -92
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +90 -88
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +73 -92
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +149 -158
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +40 -52
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +50 -32
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +29 -33
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +118 -54
- 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 +106 -88
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +56 -60
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +13 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +13 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +13 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +70 -57
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +105 -54
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +13 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +80 -62
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +45 -49
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +133 -115
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +42 -46
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +118 -54
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +44 -26
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +26 -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 +0 -15
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +98 -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 +38 -53
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +193 -165
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +129 -61
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +25 -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 +121 -223
- 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 +52 -28
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +334 -155
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +67 -63
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +26 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +2 -2
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +39 -28
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +305 -19
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +60 -53
- 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/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 +13 -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 +13 -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 +73 -53
- 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/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -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 +50 -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 +26 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +39 -28
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +13 -0
- 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 +122 -78
- 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 +52 -42
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +50 -32
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +29 -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/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +2 -2
- 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 +12 -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 +0 -1
- package/contracts/distribution/Distribution.sol +4 -15
- package/contracts/distribution/DistributionService.sol +14 -7
- package/contracts/distribution/IDistributionComponent.sol +1 -1
- package/contracts/examples/fire/FirePool.sol +19 -8
- package/contracts/examples/fire/FireProduct.sol +32 -12
- package/contracts/examples/fire/FireProductAuthorization.sol +1 -2
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +4 -4
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -4
- package/contracts/examples/unpermissioned/SimplePool.sol +11 -6
- package/contracts/examples/unpermissioned/SimpleProduct.sol +17 -23
- package/contracts/instance/IInstance.sol +4 -1
- package/contracts/instance/IInstanceService.sol +0 -20
- package/contracts/instance/Instance.sol +20 -17
- package/contracts/instance/InstanceAdmin.sol +16 -27
- package/contracts/instance/InstanceAuthorizationV3.sol +9 -19
- package/contracts/instance/InstanceService.sol +14 -68
- package/contracts/instance/module/IComponents.sol +7 -4
- 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 +20 -14
- package/contracts/pool/BasicPool.sol +22 -12
- package/contracts/pool/BasicPoolAuthorization.sol +12 -2
- package/contracts/pool/BundleService.sol +63 -39
- package/contracts/pool/IBundleService.sol +2 -5
- package/contracts/pool/IPoolComponent.sol +1 -7
- package/contracts/pool/IPoolService.sol +23 -22
- package/contracts/pool/Pool.sol +111 -123
- package/contracts/pool/PoolService.sol +186 -128
- 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 +82 -51
- package/contracts/product/IPricingService.sol +9 -9
- package/contracts/product/IProductComponent.sol +6 -0
- package/contracts/product/PolicyService.sol +15 -10
- package/contracts/product/PricingService.sol +7 -7
- package/contracts/product/Product.sol +51 -54
- package/contracts/registry/ChainNft.sol +6 -9
- package/contracts/registry/IRegistry.sol +0 -3
- package/contracts/registry/IRegistryService.sol +6 -4
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +6 -4
- package/contracts/registry/RegistryAdmin.sol +7 -23
- package/contracts/registry/RegistryService.sol +37 -55
- package/contracts/registry/ReleaseLifecycle.sol +6 -3
- package/contracts/registry/ReleaseRegistry.sol +201 -191
- package/contracts/registry/ServiceAuthorizationV3.sol +20 -15
- package/contracts/shared/Component.sol +25 -21
- package/contracts/shared/ComponentService.sol +235 -131
- package/contracts/shared/ComponentVerifyingService.sol +22 -14
- package/contracts/shared/IComponent.sol +6 -2
- package/contracts/shared/IComponentService.sol +25 -13
- package/contracts/shared/IInstanceLinkedComponent.sol +3 -11
- package/contracts/shared/ILifecycle.sol +3 -1
- package/contracts/shared/IRegisterable.sol +11 -0
- package/contracts/shared/InstanceLinkedComponent.sol +67 -25
- package/contracts/shared/KeyValueStore.sol +1 -1
- package/contracts/shared/Lifecycle.sol +15 -4
- package/contracts/shared/NftOwnable.sol +8 -4
- package/contracts/shared/Registerable.sol +15 -7
- package/contracts/shared/Service.sol +4 -7
- package/contracts/staking/Staking.sol +2 -3
- package/contracts/staking/StakingService.sol +14 -0
- package/contracts/type/RiskId.sol +1 -1
- package/contracts/type/RoleId.sol +0 -12
- package/contracts/type/StateId.sol +14 -1
- package/contracts/upgradeability/ProxyManager.sol +2 -1
- package/package.json +1 -1
- 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/contracts/authorization/IModuleAuthorization.sol +0 -21
- package/contracts/authorization/ModuleAuthorization.sol +0 -78
@@ -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)
|
@@ -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,11 +417,20 @@ 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
|
}
|
432
|
+
|
433
|
+
// TODO add logging
|
400
434
|
}
|
401
435
|
|
402
436
|
function processPayout(
|
@@ -410,6 +444,8 @@ contract PoolService is
|
|
410
444
|
virtual
|
411
445
|
restricted()
|
412
446
|
{
|
447
|
+
_checkNftType(policyNftId, POLICY());
|
448
|
+
|
413
449
|
NftId bundleNftId = policyInfo.bundleNftId;
|
414
450
|
NftId poolNftId = getRegistry().getObjectInfo(bundleNftId).parentNftId;
|
415
451
|
InstanceStore instanceStore = instance.getInstanceStore();
|
@@ -452,6 +488,8 @@ contract PoolService is
|
|
452
488
|
virtual
|
453
489
|
restricted()
|
454
490
|
{
|
491
|
+
_checkNftType(policyNftId, POLICY());
|
492
|
+
|
455
493
|
Amount remainingCollateralAmount = policyInfo.sumInsuredAmount - policyInfo.claimAmount;
|
456
494
|
|
457
495
|
_bundleService.releaseCollateral(
|
@@ -480,12 +518,17 @@ contract PoolService is
|
|
480
518
|
public
|
481
519
|
view
|
482
520
|
returns(
|
521
|
+
NftId poolNftId,
|
483
522
|
Amount totalCollateralAmount,
|
484
|
-
Amount localCollateralAmount
|
523
|
+
Amount localCollateralAmount,
|
524
|
+
bool poolIsVerifyingApplications
|
485
525
|
)
|
486
526
|
{
|
487
|
-
|
527
|
+
_checkNftType(productNftId, PRODUCT());
|
528
|
+
|
529
|
+
poolNftId = instanceReader.getProductInfo(productNftId).poolNftId;
|
488
530
|
IComponents.PoolInfo memory poolInfo = instanceReader.getPoolInfo(poolNftId);
|
531
|
+
poolIsVerifyingApplications = poolInfo.isVerifyingApplications;
|
489
532
|
|
490
533
|
(
|
491
534
|
totalCollateralAmount,
|
@@ -524,6 +567,7 @@ contract PoolService is
|
|
524
567
|
Amount stakingAmount
|
525
568
|
)
|
526
569
|
internal
|
570
|
+
pure
|
527
571
|
returns (Amount stakingNetAmount)
|
528
572
|
{
|
529
573
|
stakingNetAmount = stakingAmount;
|
@@ -538,25 +582,39 @@ contract PoolService is
|
|
538
582
|
}
|
539
583
|
|
540
584
|
|
541
|
-
/// @dev transfers the specified amount from the
|
585
|
+
/// @dev transfers the specified amount from the "from account" to the pool's wallet
|
542
586
|
function _collectStakingAmount(
|
543
|
-
InstanceReader
|
587
|
+
InstanceReader reader,
|
544
588
|
NftId poolNftId,
|
545
|
-
address
|
589
|
+
address from,
|
546
590
|
Amount amount
|
547
591
|
)
|
548
592
|
internal
|
549
593
|
{
|
594
|
+
IComponents.ComponentInfo memory info = reader.getComponentInfo(poolNftId);
|
595
|
+
info.tokenHandler.collectTokens(
|
596
|
+
from,
|
597
|
+
info.wallet,
|
598
|
+
amount);
|
599
|
+
}
|
550
600
|
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
601
|
+
/// @dev distributes the specified amount from the pool's wallet to the "to account"
|
602
|
+
function _distributeUnstakingAmount(
|
603
|
+
InstanceReader reader,
|
604
|
+
NftId poolNftId,
|
605
|
+
address to,
|
606
|
+
Amount amount
|
607
|
+
)
|
608
|
+
internal
|
609
|
+
{
|
610
|
+
IComponents.ComponentInfo memory info = reader.getComponentInfo(poolNftId);
|
611
|
+
info.tokenHandler.distributeTokens(
|
612
|
+
info.wallet,
|
613
|
+
to,
|
557
614
|
amount);
|
558
615
|
}
|
559
616
|
|
617
|
+
|
560
618
|
function _getDomain() internal pure override returns(ObjectType) {
|
561
619
|
return POOL();
|
562
620
|
}
|
@@ -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
|
}
|