@etherisc/gif-next 0.0.2-b9366f5-670 → 0.0.2-b98b2b0-875
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +33 -52
- 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 +2 -2
- 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 +0 -19
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +2 -2
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +51 -177
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +16 -16
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +21 -147
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +85 -192
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +84 -104
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +21 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- 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 +1512 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +410 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +1999 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +414 -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 +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +1432 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1192 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1566 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2001 -0
- 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/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +10 -99
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +95 -98
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +2 -2
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +260 -67
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +39 -146
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +61 -81
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +71 -51
- 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 +2 -2
- 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 +41 -167
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +18 -18
- 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 +21 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +21 -147
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +37 -144
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +60 -80
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +46 -144
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +16 -16
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +138 -181
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +102 -102
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +24 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +49 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +171 -102
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +46 -144
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +276 -245
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +95 -83
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +31 -138
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +57 -77
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +46 -170
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +16 -16
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +154 -194
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +101 -101
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +35 -8
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +111 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +49 -26
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +212 -160
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +92 -88
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +55 -162
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +68 -88
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +46 -170
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +25 -132
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +54 -74
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +59 -16
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +239 -20
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +437 -81
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +244 -132
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +23 -313
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +52 -72
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +24 -14
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- 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 +21 -147
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +75 -182
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +89 -99
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +5 -112
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +92 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +21 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +21 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- 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/IPolicyHolder.sol/IPolicyHolder.json +15 -47
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- 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/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -22
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +21 -147
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -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 +6 -57
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +19 -141
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +8 -97
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +5 -112
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +21 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- 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 +65 -191
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +70 -85
- 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 +31 -138
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +56 -76
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
- 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 +19 -19
- 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/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/MathLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +15 -2
- 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 +39 -70
- 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 +25 -24
- package/contracts/authorization/Authorization.sol +5 -1
- package/contracts/authorization/IAccessAdmin.sol +0 -1
- package/contracts/distribution/Distribution.sol +1 -1
- package/contracts/distribution/DistributionService.sol +9 -9
- package/contracts/distribution/DistributionServiceManager.sol +6 -6
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +75 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +34 -0
- package/contracts/examples/fire/FireProduct.sol +413 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +45 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/instance/Instance.sol +2 -2
- package/contracts/instance/InstanceAdmin.sol +6 -3
- package/contracts/instance/InstanceReader.sol +83 -18
- package/contracts/instance/InstanceService.sol +6 -8
- package/contracts/instance/InstanceServiceManager.sol +6 -7
- package/contracts/instance/module/IComponents.sol +3 -1
- package/contracts/instance/module/IPolicy.sol +2 -2
- package/contracts/oracle/Oracle.sol +1 -1
- package/contracts/oracle/OracleService.sol +10 -8
- package/contracts/oracle/OracleServiceManager.sol +6 -6
- package/contracts/pool/BundleService.sol +32 -9
- package/contracts/pool/BundleServiceManager.sol +6 -6
- package/contracts/pool/IBundleService.sol +9 -0
- package/contracts/pool/IPoolComponent.sol +18 -8
- package/contracts/pool/IPoolService.sol +21 -10
- package/contracts/pool/Pool.sol +38 -11
- package/contracts/pool/PoolService.sol +81 -27
- package/contracts/pool/PoolServiceManager.sol +4 -4
- package/contracts/product/ApplicationService.sol +11 -8
- package/contracts/product/ApplicationServiceManager.sol +4 -4
- package/contracts/product/ClaimService.sol +164 -70
- package/contracts/product/ClaimServiceManager.sol +4 -4
- package/contracts/product/IClaimService.sol +3 -2
- package/contracts/product/IPolicyService.sol +10 -3
- package/contracts/product/IProductComponent.sol +17 -3
- package/contracts/product/PolicyService.sol +145 -32
- package/contracts/product/PolicyServiceManager.sol +4 -4
- package/contracts/product/PricingService.sol +4 -5
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +26 -19
- package/contracts/product/RiskService.sol +4 -5
- package/contracts/product/RiskServiceManager.sol +4 -4
- package/contracts/registry/ChainNft.sol +65 -32
- package/contracts/registry/IRegistry.sol +50 -14
- package/contracts/registry/IRegistryService.sol +0 -9
- package/contracts/registry/Registry.sol +327 -196
- package/contracts/registry/RegistryAdmin.sol +140 -50
- package/contracts/registry/RegistryService.sol +55 -48
- package/contracts/registry/RegistryServiceManager.sol +2 -2
- package/contracts/registry/ReleaseRegistry.sol +11 -5
- package/contracts/registry/ServiceAuthorizationV3.sol +4 -5
- package/contracts/shared/Component.sol +13 -5
- package/contracts/shared/ComponentService.sol +6 -6
- package/contracts/shared/ComponentServiceManager.sol +8 -5
- package/contracts/shared/ComponentVerifyingService.sol +1 -2
- package/contracts/shared/ContractLib.sol +38 -0
- package/contracts/shared/IComponent.sol +3 -0
- package/contracts/shared/IPolicyHolder.sol +12 -22
- package/contracts/shared/InitializableERC165.sol +2 -2
- package/contracts/shared/InstanceLinkedComponent.sol +4 -5
- package/contracts/shared/NftOwnable.sol +4 -4
- package/contracts/shared/PolicyHolder.sol +15 -52
- package/contracts/shared/Registerable.sol +4 -4
- package/contracts/shared/RegistryLinked.sol +3 -2
- package/contracts/shared/Service.sol +16 -11
- package/contracts/staking/Staking.sol +3 -3
- package/contracts/staking/StakingManager.sol +8 -6
- package/contracts/staking/StakingReader.sol +12 -5
- package/contracts/staking/StakingService.sol +2 -2
- package/contracts/staking/StakingServiceManager.sol +2 -2
- 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/PayoutId.sol +10 -10
- package/contracts/type/RiskId.sol +15 -1
- package/contracts/type/UFixed.sol +4 -0
- package/contracts/upgradeability/ProxyManager.sol +67 -34
- package/contracts/upgradeability/Versionable.sol +2 -2
- package/package.json +1 -1
- package/artifacts/contracts/example_components/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +0 -4
- package/artifacts/contracts/example_components/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +0 -1558
- package/artifacts/contracts/example_components/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +0 -4
- package/artifacts/contracts/example_components/unpermissioned/SimpleOracle.sol/SimpleOracle.json +0 -1318
- package/artifacts/contracts/example_components/unpermissioned/SimplePool.sol/SimplePool.dbg.json +0 -4
- package/artifacts/contracts/example_components/unpermissioned/SimplePool.sol/SimplePool.json +0 -1664
- package/artifacts/contracts/example_components/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +0 -4
- package/artifacts/contracts/example_components/unpermissioned/SimpleProduct.sol/SimpleProduct.json +0 -2125
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- package/contracts/shared/InitializableCustom.sol +0 -177
- /package/contracts/{example_components → examples}/unpermissioned/SimpleDistribution.sol +0 -0
- /package/contracts/{example_components → examples}/unpermissioned/SimpleOracle.sol +0 -0
- /package/contracts/{example_components → examples}/unpermissioned/SimplePool.sol +0 -0
- /package/contracts/{example_components → examples}/unpermissioned/SimpleProduct.sol +0 -0
package/contracts/pool/Pool.sol
CHANGED
@@ -3,6 +3,7 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
5
5
|
import {BUNDLE, COMPONENT, POOL} from "../type/ObjectType.sol";
|
6
|
+
import {ClaimId} from "../type/ClaimId.sol";
|
6
7
|
import {IBundleService} from "./IBundleService.sol";
|
7
8
|
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
8
9
|
import {IPoolComponent} from "./IPoolComponent.sol";
|
@@ -40,6 +41,16 @@ abstract contract Pool is
|
|
40
41
|
}
|
41
42
|
|
42
43
|
|
44
|
+
function register()
|
45
|
+
external
|
46
|
+
virtual
|
47
|
+
onlyOwner()
|
48
|
+
{
|
49
|
+
_getPoolStorage()._componentService.registerPool();
|
50
|
+
_approveTokenHandler(type(uint256).max);
|
51
|
+
}
|
52
|
+
|
53
|
+
|
43
54
|
/// @dev see {IPoolComponent.verifyApplication}
|
44
55
|
function verifyApplication(
|
45
56
|
NftId applicationNftId,
|
@@ -67,6 +78,20 @@ abstract contract Pool is
|
|
67
78
|
}
|
68
79
|
|
69
80
|
|
81
|
+
/// @dev see {IPoolComponent.processConfirmedClaim}
|
82
|
+
function processConfirmedClaim(
|
83
|
+
NftId policyNftId,
|
84
|
+
ClaimId claimId,
|
85
|
+
Amount amount
|
86
|
+
)
|
87
|
+
public
|
88
|
+
virtual
|
89
|
+
restricted()
|
90
|
+
{
|
91
|
+
// default implementation is empty
|
92
|
+
}
|
93
|
+
|
94
|
+
|
70
95
|
/// @dev see {IPoolComponent.applicationMatchesBundle}
|
71
96
|
/// Override this function to implement any custom application verification
|
72
97
|
/// Default implementation always returns true
|
@@ -85,16 +110,6 @@ abstract contract Pool is
|
|
85
110
|
return true;
|
86
111
|
}
|
87
112
|
|
88
|
-
|
89
|
-
function register()
|
90
|
-
external
|
91
|
-
virtual
|
92
|
-
onlyOwner()
|
93
|
-
{
|
94
|
-
_getPoolStorage()._componentService.registerPool();
|
95
|
-
_approveTokenHandler(type(uint256).max);
|
96
|
-
}
|
97
|
-
|
98
113
|
/// @inheritdoc IPoolComponent
|
99
114
|
function withdrawBundleFees(NftId bundleNftId, Amount amount)
|
100
115
|
external
|
@@ -117,6 +132,7 @@ abstract contract Pool is
|
|
117
132
|
maxBalanceAmount: AmountLib.max(),
|
118
133
|
bundleOwnerRole: PUBLIC_ROLE(),
|
119
134
|
isInterceptingBundleTransfers: isNftInterceptor(),
|
135
|
+
isProcessingConfirmedClaims: false,
|
120
136
|
isExternallyManaged: false,
|
121
137
|
isVerifyingApplications: false,
|
122
138
|
collateralizationLevel: UFixedLib.toUFixed(1),
|
@@ -158,7 +174,7 @@ abstract contract Pool is
|
|
158
174
|
$._bundleService = IBundleService(_getServiceAddress(BUNDLE()));
|
159
175
|
$._componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
160
176
|
|
161
|
-
|
177
|
+
_registerInterface(type(IPoolComponent).interfaceId);
|
162
178
|
}
|
163
179
|
|
164
180
|
/// @dev increases the staked tokens by the specified amount
|
@@ -318,6 +334,17 @@ abstract contract Pool is
|
|
318
334
|
return _getPoolStorage()._bundleService.withdrawBundleFees(bundleNftId, amount);
|
319
335
|
}
|
320
336
|
|
337
|
+
function _processFundedClaim(
|
338
|
+
NftId policyNftId,
|
339
|
+
ClaimId claimId,
|
340
|
+
Amount availableAmount
|
341
|
+
)
|
342
|
+
internal
|
343
|
+
{
|
344
|
+
_getPoolStorage()._poolService.processFundedClaim(
|
345
|
+
policyNftId, claimId, availableAmount);
|
346
|
+
}
|
347
|
+
|
321
348
|
function _getPoolStorage() private pure returns (PoolStorage storage $) {
|
322
349
|
assembly {
|
323
350
|
$.slot := POOL_STORAGE_LOCATION_V1
|
@@ -8,12 +8,14 @@ import {IComponentService} from "../shared/IComponentService.sol";
|
|
8
8
|
import {IInstance} from "../instance/IInstance.sol";
|
9
9
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
10
10
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
11
|
+
import {IProductComponent} from "../product/IProductComponent.sol";
|
11
12
|
import {IPoolService} from "./IPoolService.sol";
|
12
13
|
import {IRegistry} from "../registry/IRegistry.sol";
|
13
14
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
14
15
|
import {IStaking} from "../staking/IStaking.sol";
|
15
16
|
|
16
17
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
18
|
+
import {ClaimId} from "../type/ClaimId.sol";
|
17
19
|
import {Fee, FeeLib} from "../type/Fee.sol";
|
18
20
|
import {NftId} from "../type/NftId.sol";
|
19
21
|
import {ObjectType, POOL, BUNDLE, COMPONENT, INSTANCE, REGISTRY} from "../type/ObjectType.sol";
|
@@ -21,7 +23,7 @@ import {RoleId, PUBLIC_ROLE} from "../type/RoleId.sol";
|
|
21
23
|
import {Fee, FeeLib} from "../type/Fee.sol";
|
22
24
|
import {KEEP_STATE} from "../type/StateId.sol";
|
23
25
|
import {Seconds} from "../type/Seconds.sol";
|
24
|
-
import {UFixed} from "../type/UFixed.sol";
|
26
|
+
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
25
27
|
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
26
28
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
27
29
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
@@ -44,16 +46,15 @@ contract PoolService is
|
|
44
46
|
bytes memory data
|
45
47
|
)
|
46
48
|
internal
|
47
|
-
initializer
|
48
49
|
virtual override
|
50
|
+
initializer()
|
49
51
|
{
|
50
52
|
(
|
51
|
-
address registryAddress
|
52
|
-
//address managerAddress
|
53
|
+
address registryAddress,
|
53
54
|
address authority
|
54
|
-
) = abi.decode(data, (address, address
|
55
|
+
) = abi.decode(data, (address, address));
|
55
56
|
|
56
|
-
|
57
|
+
_initializeService(registryAddress, authority, owner);
|
57
58
|
|
58
59
|
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
59
60
|
_bundleService = IBundleService(_getServiceAddress(BUNDLE()));
|
@@ -62,9 +63,10 @@ contract PoolService is
|
|
62
63
|
|
63
64
|
_staking = IStaking(getRegistry().getStakingAddress());
|
64
65
|
|
65
|
-
|
66
|
+
_registerInterface(type(IPoolService).interfaceId);
|
66
67
|
}
|
67
68
|
|
69
|
+
|
68
70
|
/// @inheritdoc IPoolService
|
69
71
|
function setMaxBalanceAmount(Amount maxBalanceAmount)
|
70
72
|
external
|
@@ -81,6 +83,7 @@ contract PoolService is
|
|
81
83
|
emit LogPoolServiceMaxBalanceAmountUpdated(poolNftId, previousMaxBalanceAmount, maxBalanceAmount);
|
82
84
|
}
|
83
85
|
|
86
|
+
|
84
87
|
function setBundleOwnerRole(RoleId bundleOwnerRole)
|
85
88
|
external
|
86
89
|
virtual
|
@@ -102,6 +105,7 @@ contract PoolService is
|
|
102
105
|
emit LogPoolServiceBundleOwnerRoleSet(poolNftId, bundleOwnerRole);
|
103
106
|
}
|
104
107
|
|
108
|
+
|
105
109
|
/// @inheritdoc IPoolService
|
106
110
|
function createBundle(
|
107
111
|
address bundleOwner, // initial bundle owner
|
@@ -128,6 +132,7 @@ contract PoolService is
|
|
128
132
|
emit LogPoolServiceBundleCreated(instance.getNftId(), poolNftId, bundleNftId);
|
129
133
|
}
|
130
134
|
|
135
|
+
|
131
136
|
function _getStakingFee(InstanceReader instanceReader, NftId poolNftId)
|
132
137
|
internal
|
133
138
|
virtual
|
@@ -138,6 +143,7 @@ contract PoolService is
|
|
138
143
|
return instanceReader.getProductInfo(productNftId).stakingFee;
|
139
144
|
}
|
140
145
|
|
146
|
+
|
141
147
|
function closeBundle(NftId bundleNftId)
|
142
148
|
external
|
143
149
|
virtual
|
@@ -166,6 +172,39 @@ contract PoolService is
|
|
166
172
|
}
|
167
173
|
}
|
168
174
|
|
175
|
+
|
176
|
+
/// @inheritdoc IPoolService
|
177
|
+
function processFundedClaim(
|
178
|
+
NftId policyNftId,
|
179
|
+
ClaimId claimId,
|
180
|
+
Amount availableAmount
|
181
|
+
)
|
182
|
+
external
|
183
|
+
virtual
|
184
|
+
{
|
185
|
+
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
186
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
187
|
+
NftId productNftId = instanceReader.getComponentInfo(poolNftId).productNftId;
|
188
|
+
|
189
|
+
// check policy matches with calling pool
|
190
|
+
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
191
|
+
if(policyInfo.productNftId != productNftId) {
|
192
|
+
revert ErrorPoolServicePolicyPoolMismatch(
|
193
|
+
policyNftId,
|
194
|
+
policyInfo.productNftId,
|
195
|
+
productNftId);
|
196
|
+
}
|
197
|
+
|
198
|
+
emit LogPoolServiceProcessFundedClaim(policyNftId, claimId, availableAmount);
|
199
|
+
|
200
|
+
// callback to product component if applicable
|
201
|
+
if (instanceReader.getProductInfo(productNftId).isProcessingFundedClaims) {
|
202
|
+
address productAddress = getRegistry().getObjectAddress(productNftId);
|
203
|
+
IProductComponent(productAddress).processFundedClaim(policyNftId, claimId, availableAmount);
|
204
|
+
}
|
205
|
+
}
|
206
|
+
|
207
|
+
|
169
208
|
/// @inheritdoc IPoolService
|
170
209
|
function stake(NftId bundleNftId, Amount amount)
|
171
210
|
external
|
@@ -189,6 +228,7 @@ contract PoolService is
|
|
189
228
|
}
|
190
229
|
}
|
191
230
|
|
231
|
+
|
192
232
|
// calculate fees
|
193
233
|
Amount feeAmount;
|
194
234
|
(
|
@@ -327,13 +367,13 @@ contract PoolService is
|
|
327
367
|
virtual
|
328
368
|
restricted()
|
329
369
|
returns (
|
330
|
-
Amount
|
331
|
-
Amount
|
370
|
+
Amount totalCollateralAmount,
|
371
|
+
Amount localCollateralAmount
|
332
372
|
)
|
333
373
|
{
|
334
374
|
(
|
335
|
-
|
336
|
-
|
375
|
+
totalCollateralAmount,
|
376
|
+
localCollateralAmount
|
337
377
|
) = calculateRequiredCollateral(
|
338
378
|
instance.getInstanceReader(),
|
339
379
|
productNftId,
|
@@ -359,8 +399,7 @@ contract PoolService is
|
|
359
399
|
}
|
360
400
|
}
|
361
401
|
|
362
|
-
|
363
|
-
function reduceCollateral(
|
402
|
+
function processPayout(
|
364
403
|
IInstance instance,
|
365
404
|
address token,
|
366
405
|
NftId policyNftId,
|
@@ -371,6 +410,22 @@ contract PoolService is
|
|
371
410
|
virtual
|
372
411
|
restricted()
|
373
412
|
{
|
413
|
+
NftId bundleNftId = policyInfo.bundleNftId;
|
414
|
+
NftId poolNftId = getRegistry().getObjectInfo(bundleNftId).parentNftId;
|
415
|
+
InstanceStore instanceStore = instance.getInstanceStore();
|
416
|
+
|
417
|
+
_componentService.decreasePoolBalance(
|
418
|
+
instanceStore,
|
419
|
+
poolNftId,
|
420
|
+
payoutAmount,
|
421
|
+
AmountLib.zero());
|
422
|
+
|
423
|
+
_componentService.decreaseBundleBalance(
|
424
|
+
instanceStore,
|
425
|
+
bundleNftId,
|
426
|
+
payoutAmount,
|
427
|
+
AmountLib.zero());
|
428
|
+
|
374
429
|
_bundleService.releaseCollateral(
|
375
430
|
instance,
|
376
431
|
policyNftId,
|
@@ -425,16 +480,16 @@ contract PoolService is
|
|
425
480
|
public
|
426
481
|
view
|
427
482
|
returns(
|
428
|
-
Amount
|
429
|
-
Amount
|
483
|
+
Amount totalCollateralAmount,
|
484
|
+
Amount localCollateralAmount
|
430
485
|
)
|
431
486
|
{
|
432
487
|
NftId poolNftId = instanceReader.getProductInfo(productNftId).poolNftId;
|
433
488
|
IComponents.PoolInfo memory poolInfo = instanceReader.getPoolInfo(poolNftId);
|
434
489
|
|
435
490
|
(
|
436
|
-
|
437
|
-
|
491
|
+
totalCollateralAmount,
|
492
|
+
localCollateralAmount
|
438
493
|
) = calculateRequiredCollateral(
|
439
494
|
poolInfo.collateralizationLevel,
|
440
495
|
poolInfo.retentionLevel,
|
@@ -450,18 +505,17 @@ contract PoolService is
|
|
450
505
|
public
|
451
506
|
pure
|
452
507
|
returns(
|
453
|
-
Amount
|
454
|
-
Amount
|
508
|
+
Amount totalCollateralAmount,
|
509
|
+
Amount localCollateralAmount
|
455
510
|
)
|
456
511
|
{
|
457
|
-
//
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
//
|
462
|
-
|
463
|
-
|
464
|
-
totalCollateralAmount = localCollateralAmount;
|
512
|
+
// collateralization is applied to sum insured
|
513
|
+
UFixed totalUFixed = collateralizationLevel * sumInsuredAmount.toUFixed();
|
514
|
+
totalCollateralAmount = AmountLib.toAmount(totalUFixed.toInt());
|
515
|
+
|
516
|
+
// retention level defines how much capital is required locally
|
517
|
+
localCollateralAmount = AmountLib.toAmount(
|
518
|
+
(retentionLevel * totalUFixed).toInt());
|
465
519
|
}
|
466
520
|
|
467
521
|
|
@@ -12,14 +12,14 @@ contract PoolServiceManager is ProxyManager {
|
|
12
12
|
/// @dev initializes proxy manager with pool service implementation
|
13
13
|
constructor(
|
14
14
|
address authority,
|
15
|
-
address
|
15
|
+
address registry,
|
16
16
|
bytes32 salt
|
17
17
|
)
|
18
|
-
ProxyManager(registryAddress)
|
19
18
|
{
|
20
19
|
PoolService poolSrv = new PoolService{salt: salt}();
|
21
|
-
bytes memory data = abi.encode(
|
22
|
-
IVersionable versionable =
|
20
|
+
bytes memory data = abi.encode(registry, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registry,
|
23
23
|
address(poolSrv),
|
24
24
|
data,
|
25
25
|
salt);
|
@@ -41,18 +41,17 @@ contract ApplicationService is
|
|
41
41
|
initializer()
|
42
42
|
{
|
43
43
|
(
|
44
|
-
address registryAddress
|
45
|
-
//address managerAddress
|
44
|
+
address registryAddress,
|
46
45
|
address authority
|
47
|
-
) = abi.decode(data, (address, address
|
46
|
+
) = abi.decode(data, (address, address));
|
48
47
|
|
49
|
-
|
48
|
+
_initializeService(registryAddress, authority, owner);
|
50
49
|
|
51
50
|
_distributionService = IDistributionService(_getServiceAddress(DISTRIBUTION()));
|
52
51
|
_pricingService = IPricingService(_getServiceAddress(PRICE()));
|
53
52
|
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
54
53
|
|
55
|
-
|
54
|
+
_registerInterface(type(IApplicationService).interfaceId);
|
56
55
|
}
|
57
56
|
|
58
57
|
|
@@ -135,6 +134,7 @@ contract ApplicationService is
|
|
135
134
|
)
|
136
135
|
external
|
137
136
|
virtual
|
137
|
+
nonReentrant()
|
138
138
|
returns (NftId applicationNftId)
|
139
139
|
{
|
140
140
|
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
@@ -209,7 +209,8 @@ contract ApplicationService is
|
|
209
209
|
NftId bundleNftId // will likely need a newer bundle for underwriting
|
210
210
|
)
|
211
211
|
external
|
212
|
-
virtual
|
212
|
+
virtual
|
213
|
+
nonReentrant()
|
213
214
|
returns (NftId applicationNftId)
|
214
215
|
{
|
215
216
|
// TODO implement
|
@@ -226,14 +227,16 @@ contract ApplicationService is
|
|
226
227
|
bytes memory applicationData
|
227
228
|
)
|
228
229
|
external
|
229
|
-
virtual
|
230
|
+
virtual
|
231
|
+
nonReentrant()
|
230
232
|
{
|
231
233
|
// TODO implement
|
232
234
|
}
|
233
235
|
|
234
236
|
function revoke(NftId applicationNftId)
|
235
237
|
external
|
236
|
-
virtual
|
238
|
+
virtual
|
239
|
+
nonReentrant()
|
237
240
|
{
|
238
241
|
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
239
242
|
instance.getInstanceStore().updateApplicationState(applicationNftId, REVOKED());
|
@@ -12,14 +12,14 @@ contract ApplicationServiceManager is ProxyManager {
|
|
12
12
|
/// @dev initializes proxy manager with service implementation
|
13
13
|
constructor(
|
14
14
|
address authority,
|
15
|
-
address
|
15
|
+
address registry,
|
16
16
|
bytes32 salt
|
17
17
|
)
|
18
|
-
ProxyManager(registryAddress)
|
19
18
|
{
|
20
19
|
ApplicationService svc = new ApplicationService{salt: salt}();
|
21
|
-
bytes memory data = abi.encode(
|
22
|
-
IVersionable versionable =
|
20
|
+
bytes memory data = abi.encode(registry, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registry,
|
23
23
|
address(svc),
|
24
24
|
data,
|
25
25
|
salt);
|