@etherisc/gif-next 0.0.2-e5a6af8-639 → 0.0.2-e5bdc7a-937
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +27 -6
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +2 -2
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
- 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/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +1 -1
- 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 +55 -133
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +2 -2
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +8 -38
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +133 -78
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +78 -46
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +11 -23
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +23 -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 +38 -147
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +49 -17
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +92 -190
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +2 -2
- 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 +66 -107
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +33 -87
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +155 -141
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +391 -205
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +147 -42
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +46 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +24 -4
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +78 -11
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +85 -72
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +40 -27
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +302 -74
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +61 -25
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +46 -22
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +36 -46
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +810 -0
- 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 +22 -100
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +2 -2
- 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 +11 -23
- 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 +8 -38
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +84 -60
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +66 -22
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +8 -53
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +49 -17
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +101 -206
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +58 -70
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +19 -57
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +11 -62
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +77 -75
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +8 -77
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +153 -159
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +61 -33
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +66 -31
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +42 -22
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +13 -38
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +2 -2
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +84 -76
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +67 -47
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +34 -7
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +38 -19
- 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 +16 -23
- 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 +132 -121
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +70 -42
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +54 -38
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +56 -32
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +13 -38
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +34 -18
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +40 -16
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +24 -0
- 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 +62 -38
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +107 -94
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +32 -16
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +39 -15
- 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 +12 -12
- 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 +8 -38
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +169 -102
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +74 -42
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +402 -6
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +11 -23
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +67 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +11 -23
- 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/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/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +8 -38
- 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 +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 +2 -2
- 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/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +388 -35
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +395 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +88 -24
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +29 -59
- 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 +80 -152
- 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 +50 -46
- 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 +36 -20
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +43 -19
- 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/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 +2 -2
- 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/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +4 -0
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +23 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +43 -5
- 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/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 +18 -2
- 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 +21 -1
- package/contracts/distribution/BasicDistribution.sol +2 -2
- package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
- package/contracts/distribution/Distribution.sol +5 -6
- package/contracts/distribution/DistributionService.sol +19 -20
- package/contracts/distribution/IDistributionService.sol +5 -6
- package/contracts/examples/fire/FirePool.sol +19 -8
- package/contracts/examples/fire/FireProduct.sol +24 -11
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +8 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +34 -2
- package/contracts/examples/unpermissioned/SimpleProduct.sol +15 -21
- package/contracts/instance/BundleSet.sol +38 -34
- package/contracts/instance/IInstance.sol +6 -0
- package/contracts/instance/IInstanceService.sol +7 -5
- package/contracts/instance/Instance.sol +14 -5
- package/contracts/instance/InstanceAdmin.sol +6 -5
- package/contracts/instance/InstanceAuthorizationV3.sol +30 -7
- package/contracts/instance/InstanceReader.sol +85 -1
- package/contracts/instance/InstanceService.sol +32 -19
- package/contracts/instance/RiskSet.sol +119 -0
- package/contracts/instance/base/ObjectSet.sol +24 -25
- package/contracts/instance/module/IComponents.sol +1 -2
- package/contracts/instance/module/IPolicy.sol +2 -1
- package/contracts/instance/module/IRisk.sol +1 -0
- package/contracts/oracle/OracleService.sol +87 -69
- package/contracts/pool/BasicPool.sol +24 -3
- package/contracts/pool/BasicPoolAuthorization.sol +12 -1
- package/contracts/pool/BundleService.sol +37 -94
- package/contracts/pool/IBundleService.sol +2 -23
- package/contracts/pool/IPoolComponent.sol +1 -7
- package/contracts/pool/IPoolService.sol +12 -26
- package/contracts/pool/Pool.sol +112 -102
- package/contracts/pool/PoolService.sol +177 -99
- package/contracts/product/ApplicationService.sol +20 -18
- package/contracts/product/BasicProduct.sol +7 -11
- package/contracts/product/ClaimService.sol +19 -9
- package/contracts/product/IApplicationService.sol +5 -2
- package/contracts/product/IPolicyService.sol +17 -7
- package/contracts/product/PolicyService.sol +241 -191
- package/contracts/product/PricingService.sol +4 -1
- package/contracts/product/Product.sol +12 -40
- package/contracts/product/RiskService.sol +14 -3
- package/contracts/registry/IRegistry.sol +2 -0
- package/contracts/registry/Registry.sol +9 -1
- package/contracts/registry/RegistryAdmin.sol +14 -11
- package/contracts/registry/ReleaseRegistry.sol +2 -18
- package/contracts/registry/ServiceAuthorizationV3.sol +12 -31
- package/contracts/shared/Component.sol +35 -83
- package/contracts/shared/ComponentService.sol +105 -34
- package/contracts/shared/ComponentVerifyingService.sol +15 -13
- package/contracts/shared/ContractLib.sol +196 -10
- package/contracts/shared/IComponent.sol +5 -12
- package/contracts/shared/IComponentService.sol +13 -3
- package/contracts/shared/InstanceLinkedComponent.sol +1 -9
- package/contracts/shared/NftOwnable.sol +5 -1
- package/contracts/shared/Registerable.sol +0 -2
- package/contracts/shared/RegistryLinked.sol +6 -12
- package/contracts/shared/TokenHandler.sol +316 -66
- package/contracts/shared/TokenHandlerDeployerLib.sol +10 -2
- package/contracts/staking/IStaking.sol +9 -4
- package/contracts/staking/Staking.sol +29 -21
- package/contracts/staking/StakingService.sol +55 -8
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +6 -0
- package/contracts/type/ObjectType.sol +2 -0
- package/contracts/type/RiskId.sol +18 -6
- package/package.json +3 -3
@@ -1,7 +1,7 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
4
|
+
import {ContractLib} from "../shared/ContractLib.sol";
|
5
5
|
import {IComponent} from "../shared/IComponent.sol";
|
6
6
|
import {IInstance} from "../instance/IInstance.sol";
|
7
7
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
@@ -13,12 +13,13 @@ import {IRegistry} from "../registry/IRegistry.sol";
|
|
13
13
|
import {NftId} from "../type/NftId.sol";
|
14
14
|
import {ObjectType, COMPONENT, ORACLE, PRODUCT} from "../type/ObjectType.sol";
|
15
15
|
import {RequestId} from "../type/RequestId.sol";
|
16
|
+
import {Service} from "../shared/Service.sol";
|
16
17
|
import {StateId, ACTIVE, KEEP_STATE, FULFILLED, FAILED, CANCELLED} from "../type/StateId.sol";
|
17
18
|
import {Timestamp, TimestampLib} from "../type/Timestamp.sol";
|
18
19
|
|
19
20
|
|
20
21
|
contract OracleService is
|
21
|
-
|
22
|
+
Service,
|
22
23
|
IOracleService
|
23
24
|
{
|
24
25
|
|
@@ -49,51 +50,27 @@ contract OracleService is
|
|
49
50
|
virtual
|
50
51
|
// restricted() // add authz
|
51
52
|
onlyNftOfType(oracleNftId, ORACLE())
|
52
|
-
returns (
|
53
|
-
RequestId requestId
|
54
|
-
)
|
53
|
+
returns (RequestId requestId)
|
55
54
|
{
|
56
|
-
(
|
57
|
-
NftId componentNftId,
|
58
|
-
IRegistry.ObjectInfo memory componentInfo,
|
59
|
-
IInstance instance
|
60
|
-
) = _getAndVerifyActiveComponent(COMPONENT());
|
55
|
+
// IRegistry registry = getRegistry();
|
61
56
|
|
62
|
-
//
|
57
|
+
// get and check active caller
|
63
58
|
(
|
64
|
-
IRegistry.ObjectInfo memory
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
true); // only active
|
69
|
-
|
70
|
-
{
|
71
|
-
// check that requester and oracle share same product cluster
|
72
|
-
if (componentInfo.objectType == PRODUCT()) {
|
73
|
-
if (oracleInfo.parentNftId != componentInfo.nftId) {
|
74
|
-
revert ErrorOracleServiceProductMismatch(componentInfo.objectType, componentInfo.nftId, oracleInfo.parentNftId);
|
75
|
-
}
|
76
|
-
} else {
|
77
|
-
if (oracleInfo.parentNftId != componentInfo.parentNftId) {
|
78
|
-
revert ErrorOracleServiceProductMismatch(componentInfo.objectType, componentInfo.parentNftId, oracleInfo.parentNftId);
|
79
|
-
}
|
80
|
-
}
|
59
|
+
IRegistry.ObjectInfo memory info,
|
60
|
+
address instance
|
61
|
+
) = ContractLib.getAndVerifyAnyComponent(
|
62
|
+
getRegistry(), msg.sender, true);
|
81
63
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
// check callbackMethodName.length > 0
|
88
|
-
if (bytes(callbackMethodName).length == 0) {
|
89
|
-
revert ErrorOracleServiceCallbackMethodNameEmpty();
|
90
|
-
}
|
91
|
-
}
|
64
|
+
(
|
65
|
+
NftId requesterNftId,
|
66
|
+
IOracleComponent oracle
|
67
|
+
) = _checkRequestParams(
|
68
|
+
getRegistry(), oracleNftId, info, expiryAt, callbackMethodName);
|
92
69
|
|
93
70
|
{
|
94
71
|
// create request info
|
95
72
|
IOracle.RequestInfo memory request = IOracle.RequestInfo({
|
96
|
-
requesterNftId:
|
73
|
+
requesterNftId: requesterNftId,
|
97
74
|
callbackMethodName: callbackMethodName,
|
98
75
|
oracleNftId: oracleNftId,
|
99
76
|
requestData: requestData,
|
@@ -104,17 +81,17 @@ contract OracleService is
|
|
104
81
|
});
|
105
82
|
|
106
83
|
// store request with instance
|
107
|
-
requestId = instance.getInstanceStore().createRequest(request);
|
84
|
+
requestId = IInstance(instance).getInstanceStore().createRequest(request);
|
108
85
|
}
|
109
86
|
|
110
|
-
//
|
111
|
-
|
87
|
+
// callback to oracle component
|
88
|
+
oracle.request(
|
112
89
|
requestId,
|
113
|
-
|
90
|
+
requesterNftId,
|
114
91
|
requestData,
|
115
92
|
expiryAt);
|
116
93
|
|
117
|
-
emit LogOracleServiceRequestCreated(requestId,
|
94
|
+
emit LogOracleServiceRequestCreated(requestId, requesterNftId, oracleNftId, expiryAt);
|
118
95
|
}
|
119
96
|
|
120
97
|
|
@@ -130,11 +107,13 @@ contract OracleService is
|
|
130
107
|
returns (bool success)
|
131
108
|
{
|
132
109
|
(
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
110
|
+
IRegistry.ObjectInfo memory info,
|
111
|
+
address instanceAddress
|
112
|
+
) = ContractLib.getAndVerifyComponent(
|
113
|
+
getRegistry(), msg.sender, ORACLE(), true);
|
137
114
|
|
115
|
+
NftId oracleNftId = info.nftId;
|
116
|
+
IInstance instance = IInstance(instanceAddress);
|
138
117
|
bool callerIsOracle = true;
|
139
118
|
IOracle.RequestInfo memory request = _checkAndGetRequestInfo(instance, requestId, oracleNftId, callerIsOracle);
|
140
119
|
request.responseData = responseData;
|
@@ -176,11 +155,13 @@ contract OracleService is
|
|
176
155
|
// restricted() // add authz
|
177
156
|
{
|
178
157
|
(
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
158
|
+
IRegistry.ObjectInfo memory info,
|
159
|
+
address instanceAddress
|
160
|
+
) = ContractLib.getAndVerifyAnyComponent(
|
161
|
+
getRegistry(), msg.sender, true);
|
183
162
|
|
163
|
+
NftId requesterNftId = info.nftId;
|
164
|
+
IInstance instance = IInstance(instanceAddress);
|
184
165
|
bool callerIsOracle = false;
|
185
166
|
IOracle.RequestInfo memory request = _checkAndGetRequestInfo(instance, requestId, requesterNftId, callerIsOracle);
|
186
167
|
|
@@ -191,7 +172,7 @@ contract OracleService is
|
|
191
172
|
"(uint64,bytes)"
|
192
173
|
));
|
193
174
|
|
194
|
-
(bool success, bytes memory returnData) =
|
175
|
+
(bool success, bytes memory returnData) = info.objectAddress.call(
|
195
176
|
abi.encodeWithSignature(
|
196
177
|
functionSignature,
|
197
178
|
requestId,
|
@@ -202,7 +183,7 @@ contract OracleService is
|
|
202
183
|
instance.getInstanceStore().updateRequestState(requestId, FULFILLED());
|
203
184
|
emit LogOracleServiceResponseResent(requestId, requesterNftId);
|
204
185
|
} else {
|
205
|
-
emit LogOracleServiceDeliveryFailed(requestId,
|
186
|
+
emit LogOracleServiceDeliveryFailed(requestId, info.objectAddress, functionSignature);
|
206
187
|
}
|
207
188
|
}
|
208
189
|
|
@@ -213,11 +194,13 @@ contract OracleService is
|
|
213
194
|
// restricted() // add authz
|
214
195
|
{
|
215
196
|
(
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
197
|
+
IRegistry.ObjectInfo memory info,
|
198
|
+
address instanceAddress
|
199
|
+
) = ContractLib.getAndVerifyAnyComponent(
|
200
|
+
getRegistry(), msg.sender, true);
|
220
201
|
|
202
|
+
NftId requesterNftId = info.nftId;
|
203
|
+
IInstance instance = IInstance(instanceAddress);
|
221
204
|
bool callerIsOracle = false;
|
222
205
|
// TODO property isCancelled and state update to CANCELLED are redundant, get rid of isCancelled
|
223
206
|
IOracle.RequestInfo memory request = _checkAndGetRequestInfo(instance, requestId, requesterNftId, callerIsOracle);
|
@@ -234,6 +217,52 @@ contract OracleService is
|
|
234
217
|
}
|
235
218
|
|
236
219
|
|
220
|
+
function _checkRequestParams(
|
221
|
+
IRegistry registry,
|
222
|
+
NftId oracleNftId,
|
223
|
+
IRegistry.ObjectInfo memory info,
|
224
|
+
Timestamp expiryAt,
|
225
|
+
string memory callbackMethodName
|
226
|
+
)
|
227
|
+
internal
|
228
|
+
virtual
|
229
|
+
view
|
230
|
+
returns (
|
231
|
+
NftId requesterNftId,
|
232
|
+
IOracleComponent oracle
|
233
|
+
)
|
234
|
+
{
|
235
|
+
// get oracle info
|
236
|
+
(IRegistry.ObjectInfo memory oracleInfo,) = ContractLib.getInfoAndInstance(
|
237
|
+
registry, oracleNftId, true);
|
238
|
+
|
239
|
+
// obtain return values
|
240
|
+
requesterNftId = info.nftId;
|
241
|
+
oracle = IOracleComponent(oracleInfo.objectAddress);
|
242
|
+
|
243
|
+
// check that requester and oracle share same product cluster
|
244
|
+
if (info.objectType == PRODUCT()) {
|
245
|
+
if (oracleInfo.parentNftId != requesterNftId) {
|
246
|
+
revert ErrorOracleServiceProductMismatch(info.objectType, requesterNftId, oracleInfo.parentNftId);
|
247
|
+
}
|
248
|
+
} else {
|
249
|
+
if (oracleInfo.parentNftId != info.parentNftId) {
|
250
|
+
revert ErrorOracleServiceProductMismatch(info.objectType, info.parentNftId, oracleInfo.parentNftId);
|
251
|
+
}
|
252
|
+
}
|
253
|
+
|
254
|
+
// check expiriyAt >= now
|
255
|
+
if (expiryAt < TimestampLib.blockTimestamp()) {
|
256
|
+
revert ErrorOracleServiceExpiryInThePast(TimestampLib.blockTimestamp(), expiryAt);
|
257
|
+
}
|
258
|
+
|
259
|
+
// check callbackMethodName.length > 0
|
260
|
+
if (bytes(callbackMethodName).length == 0) {
|
261
|
+
revert ErrorOracleServiceCallbackMethodNameEmpty();
|
262
|
+
}
|
263
|
+
}
|
264
|
+
|
265
|
+
|
237
266
|
function _checkAndGetRequestInfo(
|
238
267
|
IInstance instance,
|
239
268
|
RequestId requestId,
|
@@ -274,17 +303,6 @@ contract OracleService is
|
|
274
303
|
}
|
275
304
|
|
276
305
|
|
277
|
-
function _getInstanceForComponent(NftId componentNftId)
|
278
|
-
internal
|
279
|
-
view
|
280
|
-
returns(IInstance instance)
|
281
|
-
{
|
282
|
-
NftId instanceNftId = getRegistry().getObjectInfo(componentNftId).parentNftId;
|
283
|
-
address instanceAddress = getRegistry().getObjectAddress(instanceNftId);
|
284
|
-
return IInstance(instanceAddress);
|
285
|
-
}
|
286
|
-
|
287
|
-
|
288
306
|
function _getDomain() internal pure override returns(ObjectType) {
|
289
307
|
return ORACLE();
|
290
308
|
}
|
@@ -4,6 +4,7 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {Amount} from "../type/Amount.sol";
|
5
5
|
import {Fee} from "../type/Fee.sol";
|
6
6
|
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
7
|
+
import {IComponents} from "../instance/module/IComponents.sol";
|
7
8
|
import {NftId} from "../type/NftId.sol";
|
8
9
|
import {BUNDLE} from "../type/ObjectType.sol";
|
9
10
|
import {RoleId} from "../type/RoleId.sol";
|
@@ -19,9 +20,10 @@ abstract contract BasicPool is
|
|
19
20
|
function _initializeBasicPool(
|
20
21
|
address registry,
|
21
22
|
NftId productNftId,
|
22
|
-
IAuthorization authorization,
|
23
|
-
address token,
|
24
23
|
string memory name,
|
24
|
+
address token,
|
25
|
+
IComponents.PoolInfo memory poolInfo,
|
26
|
+
IAuthorization authorization,
|
25
27
|
address initialOwner
|
26
28
|
)
|
27
29
|
internal
|
@@ -33,8 +35,8 @@ abstract contract BasicPool is
|
|
33
35
|
productNftId,
|
34
36
|
name,
|
35
37
|
token,
|
38
|
+
poolInfo,
|
36
39
|
authorization,
|
37
|
-
false, // isInterceptingNftTransfers,
|
38
40
|
initialOwner,
|
39
41
|
""); // componentData
|
40
42
|
}
|
@@ -115,6 +117,9 @@ abstract contract BasicPool is
|
|
115
117
|
}
|
116
118
|
|
117
119
|
|
120
|
+
/// @dev Updates the bundle feeds to the specified values.
|
121
|
+
/// @param bundleNftId the bundle Nft Id
|
122
|
+
/// @param fee the new fee values
|
118
123
|
function setBundleFee(
|
119
124
|
NftId bundleNftId,
|
120
125
|
Fee memory fee
|
@@ -129,6 +134,22 @@ abstract contract BasicPool is
|
|
129
134
|
}
|
130
135
|
|
131
136
|
|
137
|
+
/// @dev Withdraw bundle feeds for the given bundle.
|
138
|
+
/// @param bundleNftId the bundle Nft Id
|
139
|
+
/// @param amount the amount to withdraw. If set to AMOUNT_MAX, the full commission available is withdrawn
|
140
|
+
/// @return withdrawnAmount the effective withdrawn amount
|
141
|
+
function withdrawBundleFees(NftId bundleNftId, Amount amount)
|
142
|
+
external
|
143
|
+
virtual
|
144
|
+
restricted()
|
145
|
+
onlyBundleOwner(bundleNftId)
|
146
|
+
onlyNftOfType(bundleNftId, BUNDLE())
|
147
|
+
returns (Amount withdrawnAmount)
|
148
|
+
{
|
149
|
+
return _withdrawBundleFees(bundleNftId, amount);
|
150
|
+
}
|
151
|
+
|
152
|
+
|
132
153
|
function setMaxBalanceAmount(Amount maxBalanceAmount)
|
133
154
|
public
|
134
155
|
virtual
|
@@ -19,6 +19,13 @@ contract BasicPoolAuthorization
|
|
19
19
|
Authorization(poolName)
|
20
20
|
{}
|
21
21
|
|
22
|
+
function _setupServiceTargets()
|
23
|
+
internal
|
24
|
+
virtual override
|
25
|
+
{
|
26
|
+
_addServiceTargetWithRole(POOL());
|
27
|
+
}
|
28
|
+
|
22
29
|
function _setupTargets()
|
23
30
|
internal
|
24
31
|
virtual override
|
@@ -51,7 +58,11 @@ contract BasicPoolAuthorization
|
|
51
58
|
|
52
59
|
_authorize(functions, IInstanceLinkedComponent.withdrawFees.selector, "withdrawFees");
|
53
60
|
|
54
|
-
_authorize(functions,
|
61
|
+
_authorize(functions, BasicPool.withdrawBundleFees.selector, "withdrawBundleFees");
|
62
|
+
|
63
|
+
// authorize pool service
|
64
|
+
functions = _authorizeForTarget(getTargetName(), getServiceRole(POOL()));
|
65
|
+
_authorize(functions, IPoolComponent.verifyApplication.selector, "verifyApplication");
|
55
66
|
}
|
56
67
|
}
|
57
68
|
|
@@ -63,8 +63,10 @@ contract BundleService is
|
|
63
63
|
)
|
64
64
|
external
|
65
65
|
virtual
|
66
|
-
|
66
|
+
restricted()
|
67
67
|
{
|
68
|
+
_checkNftType(bundleNftId, BUNDLE());
|
69
|
+
|
68
70
|
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
69
71
|
InstanceReader instanceReader = instance.getInstanceReader();
|
70
72
|
IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
|
@@ -82,20 +84,18 @@ contract BundleService is
|
|
82
84
|
|
83
85
|
|
84
86
|
function create(
|
85
|
-
IInstance instance,
|
86
|
-
NftId poolNftId,
|
87
87
|
address owner,
|
88
88
|
Fee memory bundleFee,
|
89
|
-
Amount stakingAmount,
|
90
89
|
Seconds lifetime,
|
91
90
|
bytes calldata filter
|
92
91
|
)
|
93
92
|
external
|
94
|
-
|
95
|
-
restricted
|
96
|
-
onlyNftOfType(poolNftId, POOL())
|
93
|
+
virtual
|
94
|
+
restricted()
|
97
95
|
returns(NftId bundleNftId)
|
98
96
|
{
|
97
|
+
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
98
|
+
|
99
99
|
// register bundle with registry
|
100
100
|
bundleNftId = _registryService.registerBundle(
|
101
101
|
IRegistry.ObjectInfo(
|
@@ -123,19 +123,11 @@ contract BundleService is
|
|
123
123
|
})
|
124
124
|
);
|
125
125
|
|
126
|
-
if (stakingAmount.gtz()) {
|
127
|
-
// bundle book keeping
|
128
|
-
_componentService.increaseBundleBalance(
|
129
|
-
instanceStore,
|
130
|
-
bundleNftId,
|
131
|
-
stakingAmount,
|
132
|
-
AmountLib.zero()); // fee amount
|
133
|
-
}
|
134
|
-
|
135
126
|
// put bundle under bundle managemet
|
136
127
|
BundleSet bundleManager = instance.getBundleSet();
|
137
128
|
bundleManager.add(bundleNftId);
|
138
|
-
|
129
|
+
|
130
|
+
emit LogBundleServiceBundleCreated(bundleNftId, poolNftId);
|
139
131
|
}
|
140
132
|
|
141
133
|
|
@@ -149,9 +141,10 @@ contract BundleService is
|
|
149
141
|
external
|
150
142
|
virtual
|
151
143
|
restricted()
|
152
|
-
onlyNftOfType(policyNftId, POLICY())
|
153
|
-
onlyNftOfType(bundleNftId, BUNDLE())
|
154
144
|
{
|
145
|
+
_checkNftType(policyNftId, POLICY());
|
146
|
+
_checkNftType(bundleNftId, BUNDLE());
|
147
|
+
|
155
148
|
InstanceReader instanceReader = instance.getInstanceReader();
|
156
149
|
|
157
150
|
{
|
@@ -182,17 +175,16 @@ contract BundleService is
|
|
182
175
|
|
183
176
|
// updated locked amount
|
184
177
|
instanceStore.increaseLocked(bundleNftId, collateralAmount);
|
185
|
-
|
186
|
-
// link policy to bundle in bundle manger
|
187
|
-
_linkPolicy(instance, policyNftId);
|
188
178
|
}
|
189
179
|
|
190
180
|
|
191
181
|
function lock(NftId bundleNftId)
|
192
182
|
external
|
193
183
|
virtual
|
194
|
-
|
184
|
+
restricted()
|
195
185
|
{
|
186
|
+
_checkNftType(bundleNftId, BUNDLE());
|
187
|
+
|
196
188
|
(,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
197
189
|
|
198
190
|
// udpate bundle state
|
@@ -209,8 +201,10 @@ contract BundleService is
|
|
209
201
|
function unlock(NftId bundleNftId)
|
210
202
|
external
|
211
203
|
virtual
|
212
|
-
|
204
|
+
restricted()
|
213
205
|
{
|
206
|
+
_checkNftType(bundleNftId, BUNDLE());
|
207
|
+
|
214
208
|
(,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
215
209
|
|
216
210
|
// udpate bundle state
|
@@ -230,10 +224,11 @@ contract BundleService is
|
|
230
224
|
)
|
231
225
|
external
|
232
226
|
virtual
|
233
|
-
restricted
|
234
|
-
onlyNftOfType(bundleNftId, BUNDLE())
|
227
|
+
restricted()
|
235
228
|
returns (Amount unstakedAmount, Amount feeAmount)
|
236
229
|
{
|
230
|
+
_checkNftType(bundleNftId, BUNDLE());
|
231
|
+
|
237
232
|
InstanceReader instanceReader = instance.getInstanceReader();
|
238
233
|
|
239
234
|
// ensure no open policies attached to bundle
|
@@ -265,9 +260,10 @@ contract BundleService is
|
|
265
260
|
)
|
266
261
|
external
|
267
262
|
virtual
|
268
|
-
|
269
|
-
// TODO: restricted() (once #462 is done)
|
263
|
+
restricted()
|
270
264
|
{
|
265
|
+
_checkNftType(bundleNftId, BUNDLE());
|
266
|
+
|
271
267
|
IBundle.BundleInfo memory bundleInfo = instance.getInstanceReader().getBundleInfo(bundleNftId);
|
272
268
|
StateId bundleState = instance.getInstanceReader().getBundleState(bundleNftId);
|
273
269
|
|
@@ -292,10 +288,11 @@ contract BundleService is
|
|
292
288
|
)
|
293
289
|
external
|
294
290
|
virtual
|
295
|
-
|
296
|
-
// TODO: restricted() (once #462 is done)
|
291
|
+
restricted()
|
297
292
|
returns (Amount unstakedAmount)
|
298
293
|
{
|
294
|
+
_checkNftType(bundleNftId, BUNDLE());
|
295
|
+
|
299
296
|
InstanceStore instanceStore = instance.getInstanceStore();
|
300
297
|
(
|
301
298
|
Amount balanceAmount,
|
@@ -327,10 +324,11 @@ contract BundleService is
|
|
327
324
|
function extend(NftId bundleNftId, Seconds lifetimeExtension)
|
328
325
|
external
|
329
326
|
virtual
|
330
|
-
|
331
|
-
// TODO: restricted() (once #462 is done)
|
327
|
+
restricted()
|
332
328
|
returns (Timestamp extendedExpiredAt)
|
333
329
|
{
|
330
|
+
_checkNftType(bundleNftId, BUNDLE());
|
331
|
+
|
334
332
|
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
335
333
|
IBundle.BundleInfo memory bundleInfo = instance.getInstanceReader().getBundleInfo(bundleNftId);
|
336
334
|
StateId bundleState = instance.getInstanceReader().getBundleState(bundleNftId);
|
@@ -367,43 +365,28 @@ contract BundleService is
|
|
367
365
|
external
|
368
366
|
virtual
|
369
367
|
restricted()
|
370
|
-
onlyNftOfType(policyNftId, POLICY())
|
371
|
-
onlyNftOfType(bundleNftId, BUNDLE())
|
372
368
|
{
|
369
|
+
_checkNftType(policyNftId, POLICY());
|
370
|
+
_checkNftType(bundleNftId, BUNDLE());
|
371
|
+
|
373
372
|
instance.getInstanceStore().decreaseLocked(bundleNftId, collateralAmount);
|
374
373
|
}
|
375
374
|
|
376
|
-
/// @dev unlinks policy from bundle
|
377
|
-
function unlinkPolicy(
|
378
|
-
IInstance instance,
|
379
|
-
NftId policyNftId
|
380
|
-
)
|
381
|
-
external
|
382
|
-
virtual
|
383
|
-
restricted
|
384
|
-
onlyNftOfType(policyNftId, POLICY())
|
385
|
-
{
|
386
|
-
// ensure policy is closeable
|
387
|
-
if (!policyIsCloseable(instance, policyNftId)) {
|
388
|
-
revert ErrorBundleServicePolicyNotCloseable(policyNftId);
|
389
|
-
}
|
390
|
-
|
391
|
-
instance.getBundleSet().unlinkPolicy(policyNftId);
|
392
|
-
}
|
393
375
|
|
394
376
|
/// @inheritdoc IBundleService
|
395
377
|
function withdrawBundleFees(NftId bundleNftId, Amount amount)
|
396
378
|
public
|
397
379
|
virtual
|
398
|
-
|
399
|
-
// TODO: restricted() (once #462 is done)
|
380
|
+
restricted()
|
400
381
|
returns (Amount withdrawnAmount)
|
401
382
|
{
|
383
|
+
_checkNftType(bundleNftId, BUNDLE());
|
384
|
+
|
402
385
|
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
403
386
|
InstanceReader reader = instance.getInstanceReader();
|
404
387
|
|
405
388
|
IComponents.ComponentInfo memory poolInfo = reader.getComponentInfo(poolNftId);
|
406
|
-
address poolWallet = poolInfo.
|
389
|
+
address poolWallet = poolInfo.tokenHandler.getWallet();
|
407
390
|
|
408
391
|
// IBundle.BundleInfo memory bundleInfo = reader.getBundleInfo(bundleNftId);
|
409
392
|
|
@@ -434,46 +417,6 @@ contract BundleService is
|
|
434
417
|
}
|
435
418
|
}
|
436
419
|
|
437
|
-
/// @inheritdoc IBundleService
|
438
|
-
function policyIsCloseable(IInstance instance, NftId policyNftId)
|
439
|
-
public
|
440
|
-
view
|
441
|
-
onlyNftOfType(policyNftId, POLICY())
|
442
|
-
returns (bool isCloseable)
|
443
|
-
{
|
444
|
-
IPolicy.PolicyInfo memory info = instance.getInstanceReader().getPolicyInfo(policyNftId);
|
445
|
-
|
446
|
-
if (info.productNftId.eqz()) { return false; } // not closeable: policy does not exist (or does not belong to this instance)
|
447
|
-
if (info.activatedAt.eqz()) { return false; } // not closeable: not yet activated
|
448
|
-
if (info.closedAt.gtz()) { return false; } // not closeable: already closed
|
449
|
-
if (info.openClaimsCount > 0) { return false; } // not closeable: has open claims
|
450
|
-
|
451
|
-
// closeable: if sum of claims matches sum insured a policy may be closed prior to the expiry date
|
452
|
-
if (info.claimAmount == info.sumInsuredAmount) { return true; }
|
453
|
-
|
454
|
-
// not closeable: not yet expired
|
455
|
-
if (TimestampLib.blockTimestamp() < info.expiredAt) { return false; }
|
456
|
-
|
457
|
-
// all conditionsl to close the policy are met
|
458
|
-
return true;
|
459
|
-
}
|
460
|
-
|
461
|
-
/// @dev links policy to bundle
|
462
|
-
function _linkPolicy(IInstance instance, NftId policyNftId)
|
463
|
-
internal
|
464
|
-
{
|
465
|
-
InstanceReader instanceReader = instance.getInstanceReader();
|
466
|
-
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
467
|
-
|
468
|
-
// ensure policy has not yet been activated in a previous tx already
|
469
|
-
if (policyInfo.activatedAt.gtz() && policyInfo.activatedAt < TimestampLib.blockTimestamp()) {
|
470
|
-
revert BundleSet.ErrorBundleSetPolicyAlreadyActivated(policyNftId);
|
471
|
-
}
|
472
|
-
|
473
|
-
BundleSet bundleManager = instance.getBundleSet();
|
474
|
-
bundleManager.linkPolicy(policyNftId);
|
475
|
-
}
|
476
|
-
|
477
420
|
function _getDomain() internal pure override returns(ObjectType) {
|
478
421
|
return BUNDLE();
|
479
422
|
}
|
@@ -13,6 +13,7 @@ import {Timestamp} from "../type/Timestamp.sol";
|
|
13
13
|
|
14
14
|
interface IBundleService is IService {
|
15
15
|
|
16
|
+
event LogBundleServiceBundleCreated(NftId bundleNftId, NftId poolNftId);
|
16
17
|
event LogBundleServiceBundleActivated(NftId bundleNftId);
|
17
18
|
event LogBundleServiceBundleLocked(NftId bundleNftId);
|
18
19
|
|
@@ -35,14 +36,10 @@ interface IBundleService is IService {
|
|
35
36
|
event LogBundleServiceFeesWithdrawn(NftId bundleNftId, address recipient, address tokenAddress, Amount amount);
|
36
37
|
event LogBundleServiceBundleExtended(NftId bundleNftId, Seconds lifetimeExtension, Timestamp extendedExpiredAt);
|
37
38
|
|
38
|
-
/// @dev
|
39
|
-
/// may only be called by pool service
|
39
|
+
/// @dev Create a new bundle for the specified attributes.
|
40
40
|
function create(
|
41
|
-
IInstance instance, // instance relevant for bundle
|
42
|
-
NftId poolNftId, // the pool the bundle will be linked to
|
43
41
|
address owner, // initial bundle owner
|
44
42
|
Fee memory fee, // fees deducted from premium that go to bundle owner
|
45
|
-
Amount stakingAmount, // staking amount - staking fees result in initial bundle capital
|
46
43
|
Seconds lifetime, // initial duration for which new policies are covered
|
47
44
|
bytes calldata filter // optional use case specific criteria that define if a policy may be covered by this bundle
|
48
45
|
)
|
@@ -116,28 +113,10 @@ interface IBundleService is IService {
|
|
116
113
|
Amount collateralAmount
|
117
114
|
) external;
|
118
115
|
|
119
|
-
/// @dev unlink policy from bundle
|
120
|
-
/// policy may only be unlinked if policy is closeable
|
121
|
-
/// may only be called by pool service
|
122
|
-
function unlinkPolicy(
|
123
|
-
IInstance instance,
|
124
|
-
NftId policyNftId
|
125
|
-
) external;
|
126
|
-
|
127
116
|
// FIXME: move to pool service
|
128
117
|
/// @dev Withdraw bundle feeds for the given bundle
|
129
118
|
/// @param bundleNftId the bundle Nft Id
|
130
119
|
/// @param amount the amount to withdraw. If set to AMOUNT_MAX, the full commission available is withdrawn
|
131
120
|
/// @return withdrawnAmount the effective withdrawn amount
|
132
121
|
function withdrawBundleFees(NftId bundleNftId, Amount amount) external returns (Amount withdrawnAmount);
|
133
|
-
|
134
|
-
/// @dev returns true iff policy may be closed
|
135
|
-
/// a policy can be closed all conditions below are met
|
136
|
-
/// - policy exists
|
137
|
-
/// - has been activated
|
138
|
-
/// - is not yet closed
|
139
|
-
/// - has no open claims
|
140
|
-
/// - claim amount matches sum insured amount or is expired
|
141
|
-
function policyIsCloseable(IInstance instance, NftId policyNftId) external view returns (bool isCloseable);
|
142
|
-
|
143
122
|
}
|
@@ -27,9 +27,7 @@ interface IPoolComponent is IInstanceLinkedComponent {
|
|
27
27
|
/// The default implementation is empty.
|
28
28
|
function verifyApplication(
|
29
29
|
NftId applicationNftId,
|
30
|
-
bytes memory applicationData,
|
31
30
|
NftId bundleNftId,
|
32
|
-
bytes memory bundleFilter,
|
33
31
|
Amount collateralizationAmount
|
34
32
|
) external;
|
35
33
|
|
@@ -47,6 +45,7 @@ interface IPoolComponent is IInstanceLinkedComponent {
|
|
47
45
|
view
|
48
46
|
returns (bool isMatching);
|
49
47
|
|
48
|
+
|
50
49
|
/// @dev This is a callback function that is called by the claim service when a claim is confirmed.
|
51
50
|
/// The pool has the option to implement custom behavirous such as triggering a reinsurance claim or blocking the claim confirmaation.
|
52
51
|
/// The default implementation is empty.
|
@@ -56,11 +55,6 @@ interface IPoolComponent is IInstanceLinkedComponent {
|
|
56
55
|
Amount amount
|
57
56
|
) external;
|
58
57
|
|
59
|
-
/// @dev Withdraw bundle feeds for the given bundle
|
60
|
-
/// @param bundleNftId the bundle Nft Id
|
61
|
-
/// @param amount the amount to withdraw. If set to AMOUNT_MAX, the full commission available is withdrawn
|
62
|
-
/// @return withdrawnAmount the effective withdrawn amount
|
63
|
-
function withdrawBundleFees(NftId bundleNftId, Amount amount) external returns (Amount withdrawnAmount);
|
64
58
|
|
65
59
|
/// @dev Returns initial pool specific infos for this pool
|
66
60
|
function getInitialPoolInfo() external view returns (IComponents.PoolInfo memory info);
|