@etherisc/gif-next 0.0.2-b2910e7-757 → 0.0.2-b312c9a-831
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1000 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +746 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +767 -0
- 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 +24 -42
- 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 +0 -18
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +58 -58
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +30 -30
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +0 -18
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- 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 +40 -14
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +24 -24
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +86 -60
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +17 -17
- 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 +39 -26
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +470 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +16 -34
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +33 -20
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +502 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +50 -24
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +470 -0
- 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 +22 -2
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +64 -13
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +83 -70
- 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 +298 -65
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +44 -24
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +12 -12
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2 -2
- 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 +14 -32
- 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 +0 -18
- 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 +0 -18
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +70 -62
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +36 -16
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +0 -18
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +2 -2
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +68 -177
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +35 -63
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +0 -42
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +0 -18
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +0 -18
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +62 -78
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +32 -24
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +44 -25
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +6 -10
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +0 -18
- 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 +2 -2
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +2 -2
- 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 +31 -18
- 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 +0 -18
- 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 +119 -122
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +45 -37
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +2 -2
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +2 -2
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +0 -18
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +20 -20
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +11 -11
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/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 +2 -2
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +58 -58
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +2 -2
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +2 -2
- 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 +2 -2
- 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 +0 -18
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +70 -428
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +36 -64
- 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 +383 -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 +0 -18
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +0 -270
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +0 -18
- 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 +0 -18
- 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 +2 -2
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.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 +0 -18
- 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 +26 -26
- 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 +14 -14
- 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 +2 -2
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +2 -2
- 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 +2 -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/accounting/AccountingService.sol +264 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +45 -0
- package/contracts/authorization/AccessAdmin.sol +21 -1
- package/contracts/distribution/BasicDistribution.sol +4 -4
- package/contracts/distribution/Distribution.sol +27 -24
- package/contracts/distribution/DistributionService.sol +10 -7
- package/contracts/examples/fire/FirePool.sol +6 -2
- package/contracts/examples/fire/FirePoolAuthorization.sol +1 -0
- package/contracts/examples/fire/FireProduct.sol +5 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +1 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +6 -7
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +7 -8
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +7 -0
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +38 -34
- package/contracts/instance/IInstance.sol +6 -0
- package/contracts/instance/IInstanceService.sol +5 -1
- package/contracts/instance/Instance.sol +14 -5
- package/contracts/instance/InstanceAdmin.sol +3 -1
- package/contracts/instance/InstanceAuthorizationV3.sol +42 -14
- package/contracts/instance/InstanceReader.sol +85 -1
- package/contracts/instance/InstanceService.sol +18 -7
- package/contracts/instance/RiskSet.sol +119 -0
- package/contracts/instance/base/ObjectSet.sol +24 -25
- package/contracts/instance/module/IRisk.sol +1 -0
- package/contracts/oracle/OracleService.sol +87 -70
- package/contracts/pool/BundleService.sol +9 -69
- package/contracts/pool/IBundleService.sol +0 -19
- package/contracts/pool/IPoolService.sol +0 -19
- package/contracts/pool/PoolService.sol +49 -54
- package/contracts/product/ApplicationService.sol +12 -12
- package/contracts/product/BasicProductAuthorization.sol +1 -2
- package/contracts/product/IApplicationService.sol +5 -2
- package/contracts/product/IPolicyService.sol +14 -6
- package/contracts/product/PolicyService.sol +233 -192
- package/contracts/product/Product.sol +2 -7
- package/contracts/product/RiskService.sol +14 -3
- package/contracts/registry/RegistryAdmin.sol +7 -12
- package/contracts/registry/ServiceAuthorizationV3.sol +43 -39
- package/contracts/shared/Component.sol +5 -20
- package/contracts/shared/ComponentService.sol +79 -205
- package/contracts/shared/ContractLib.sol +181 -11
- package/contracts/shared/IComponent.sol +0 -5
- package/contracts/shared/IComponentService.sol +1 -19
- package/contracts/shared/InstanceLinkedComponent.sol +1 -1
- package/contracts/shared/TokenHandler.sol +1 -9
- package/contracts/staking/Staking.sol +10 -0
- package/contracts/staking/StakingService.sol +0 -13
- 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 +10 -0
- package/contracts/type/RiskId.sol +18 -6
- package/package.json +1 -1
@@ -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,18 +303,6 @@ contract OracleService is
|
|
274
303
|
}
|
275
304
|
|
276
305
|
|
277
|
-
// TODO cleanup
|
278
|
-
// function _getInstanceForComponent(NftId componentNftId)
|
279
|
-
// internal
|
280
|
-
// view
|
281
|
-
// returns(IInstance instance)
|
282
|
-
// {
|
283
|
-
// NftId instanceNftId = getRegistry().getObjectInfo(componentNftId).parentNftId;
|
284
|
-
// address instanceAddress = getRegistry().getObjectAddress(instanceNftId);
|
285
|
-
// return IInstance(instanceAddress);
|
286
|
-
// }
|
287
|
-
|
288
|
-
|
289
306
|
function _getDomain() internal pure override returns(ObjectType) {
|
290
307
|
return ORACLE();
|
291
308
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {IAccountingService} from "../accounting/IAccountingService.sol";
|
4
5
|
import {IBundle} from "../instance/module/IBundle.sol";
|
5
6
|
import {IBundleService} from "./IBundleService.sol";
|
6
7
|
import {IComponents} from "../instance/module/IComponents.sol";
|
@@ -9,7 +10,6 @@ import {IRegistry} from "../registry/IRegistry.sol";
|
|
9
10
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
10
11
|
import {IInstance} from "../instance/IInstance.sol";
|
11
12
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
12
|
-
import {IPolicy} from "../instance/module/IPolicy.sol";
|
13
13
|
|
14
14
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
15
15
|
import {BundleSet} from "../instance/BundleSet.sol";
|
@@ -17,7 +17,7 @@ import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol
|
|
17
17
|
import {Fee} from "../type/Fee.sol";
|
18
18
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
19
19
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
20
|
-
import {ObjectType, COMPONENT, POOL, BUNDLE, POLICY, REGISTRY} from "../type/ObjectType.sol";
|
20
|
+
import {ObjectType, ACCOUNTING, COMPONENT, POOL, BUNDLE, POLICY, REGISTRY} from "../type/ObjectType.sol";
|
21
21
|
import {StateId, ACTIVE, PAUSED, CLOSED, KEEP_STATE} from "../type/StateId.sol";
|
22
22
|
import {Seconds} from "../type/Seconds.sol";
|
23
23
|
import {Timestamp, TimestampLib, zeroTimestamp} from "../type/Timestamp.sol";
|
@@ -33,6 +33,7 @@ contract BundleService is
|
|
33
33
|
|
34
34
|
address private _registryAddress;
|
35
35
|
IRegistryService private _registryService;
|
36
|
+
IAccountingService private _accountingService;
|
36
37
|
IComponentService private _componentService;
|
37
38
|
|
38
39
|
function _initialize(
|
@@ -51,6 +52,7 @@ contract BundleService is
|
|
51
52
|
_initializeService(registryAddress, authority, owner);
|
52
53
|
|
53
54
|
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
55
|
+
_accountingService = IAccountingService(_getServiceAddress(ACCOUNTING()));
|
54
56
|
_componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
55
57
|
|
56
58
|
_registerInterface(type(IBundleService).interfaceId);
|
@@ -175,9 +177,6 @@ contract BundleService is
|
|
175
177
|
|
176
178
|
// updated locked amount
|
177
179
|
instanceStore.increaseLocked(bundleNftId, collateralAmount);
|
178
|
-
|
179
|
-
// link policy to bundle in bundle manger
|
180
|
-
_linkPolicy(instance, policyNftId);
|
181
180
|
}
|
182
181
|
|
183
182
|
|
@@ -251,7 +250,7 @@ contract BundleService is
|
|
251
250
|
Amount balanceAmountWithFees = instanceReader.getBalanceAmount(bundleNftId);
|
252
251
|
feeAmount = instanceReader.getFeeAmount(bundleNftId);
|
253
252
|
unstakedAmount = balanceAmountWithFees - feeAmount;
|
254
|
-
|
253
|
+
_accountingService.decreaseBundleBalance(instanceStore, bundleNftId, unstakedAmount, feeAmount);
|
255
254
|
}
|
256
255
|
}
|
257
256
|
|
@@ -276,7 +275,7 @@ contract BundleService is
|
|
276
275
|
revert ErrorBundleServiceBundleNotOpen(bundleNftId, bundleState, bundleInfo.expiredAt);
|
277
276
|
}
|
278
277
|
|
279
|
-
|
278
|
+
_accountingService.increaseBundleBalance(
|
280
279
|
instance.getInstanceStore(),
|
281
280
|
bundleNftId,
|
282
281
|
amount,
|
@@ -316,7 +315,7 @@ contract BundleService is
|
|
316
315
|
revert ErrorBundleServiceUnstakeAmountExceedsLimit(amount, availableAmount);
|
317
316
|
}
|
318
317
|
|
319
|
-
|
318
|
+
_accountingService.decreaseBundleBalance(
|
320
319
|
instanceStore,
|
321
320
|
bundleNftId,
|
322
321
|
unstakedAmount,
|
@@ -375,24 +374,6 @@ contract BundleService is
|
|
375
374
|
instance.getInstanceStore().decreaseLocked(bundleNftId, collateralAmount);
|
376
375
|
}
|
377
376
|
|
378
|
-
/// @dev unlinks policy from bundle
|
379
|
-
function unlinkPolicy(
|
380
|
-
IInstance instance,
|
381
|
-
NftId policyNftId
|
382
|
-
)
|
383
|
-
external
|
384
|
-
virtual
|
385
|
-
restricted
|
386
|
-
{
|
387
|
-
_checkNftType(policyNftId, POLICY());
|
388
|
-
|
389
|
-
// ensure policy is closeable
|
390
|
-
if (!policyIsCloseable(instance, policyNftId)) {
|
391
|
-
revert ErrorBundleServicePolicyNotCloseable(policyNftId);
|
392
|
-
}
|
393
|
-
|
394
|
-
instance.getBundleSet().unlinkPolicy(policyNftId);
|
395
|
-
}
|
396
377
|
|
397
378
|
/// @inheritdoc IBundleService
|
398
379
|
function withdrawBundleFees(NftId bundleNftId, Amount amount)
|
@@ -425,9 +406,9 @@ contract BundleService is
|
|
425
406
|
{
|
426
407
|
InstanceStore store = instance.getInstanceStore();
|
427
408
|
// decrease fee amount of the bundle
|
428
|
-
|
409
|
+
_accountingService.decreaseBundleBalance(store, bundleNftId, AmountLib.zero(), withdrawnAmount);
|
429
410
|
// decrease pool balance
|
430
|
-
|
411
|
+
_accountingService.decreasePoolBalance(store, poolNftId, withdrawnAmount, AmountLib.zero());
|
431
412
|
}
|
432
413
|
|
433
414
|
// transfer amount to bundle owner
|
@@ -438,47 +419,6 @@ contract BundleService is
|
|
438
419
|
}
|
439
420
|
}
|
440
421
|
|
441
|
-
/// @inheritdoc IBundleService
|
442
|
-
function policyIsCloseable(IInstance instance, NftId policyNftId)
|
443
|
-
public
|
444
|
-
view
|
445
|
-
returns (bool isCloseable)
|
446
|
-
{
|
447
|
-
_checkNftType(policyNftId, POLICY());
|
448
|
-
|
449
|
-
IPolicy.PolicyInfo memory info = instance.getInstanceReader().getPolicyInfo(policyNftId);
|
450
|
-
|
451
|
-
if (info.productNftId.eqz()) { return false; } // not closeable: policy does not exist (or does not belong to this instance)
|
452
|
-
if (info.activatedAt.eqz()) { return false; } // not closeable: not yet activated
|
453
|
-
if (info.closedAt.gtz()) { return false; } // not closeable: already closed
|
454
|
-
if (info.openClaimsCount > 0) { return false; } // not closeable: has open claims
|
455
|
-
|
456
|
-
// closeable: if sum of claims matches sum insured a policy may be closed prior to the expiry date
|
457
|
-
if (info.claimAmount == info.sumInsuredAmount) { return true; }
|
458
|
-
|
459
|
-
// not closeable: not yet expired
|
460
|
-
if (TimestampLib.blockTimestamp() < info.expiredAt) { return false; }
|
461
|
-
|
462
|
-
// all conditionsl to close the policy are met
|
463
|
-
return true;
|
464
|
-
}
|
465
|
-
|
466
|
-
/// @dev links policy to bundle
|
467
|
-
function _linkPolicy(IInstance instance, NftId policyNftId)
|
468
|
-
internal
|
469
|
-
{
|
470
|
-
InstanceReader instanceReader = instance.getInstanceReader();
|
471
|
-
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
472
|
-
|
473
|
-
// ensure policy has not yet been activated in a previous tx already
|
474
|
-
if (policyInfo.activatedAt.gtz() && policyInfo.activatedAt < TimestampLib.blockTimestamp()) {
|
475
|
-
revert BundleSet.ErrorBundleSetPolicyAlreadyActivated(policyNftId);
|
476
|
-
}
|
477
|
-
|
478
|
-
BundleSet bundleManager = instance.getBundleSet();
|
479
|
-
bundleManager.linkPolicy(policyNftId);
|
480
|
-
}
|
481
|
-
|
482
422
|
function _getDomain() internal pure override returns(ObjectType) {
|
483
423
|
return BUNDLE();
|
484
424
|
}
|
@@ -5,7 +5,6 @@ import {Amount} from "../type/Amount.sol";
|
|
5
5
|
import {NftId} from "../type/NftId.sol";
|
6
6
|
import {Fee} from "../type/Fee.sol";
|
7
7
|
import {IService} from "../shared/IService.sol";
|
8
|
-
import {IBundle} from "../instance/module/IBundle.sol";
|
9
8
|
import {IInstance} from "../instance/IInstance.sol";
|
10
9
|
import {Seconds} from "../type/Seconds.sol";
|
11
10
|
import {StateId} from "../type/StateId.sol";
|
@@ -113,28 +112,10 @@ interface IBundleService is IService {
|
|
113
112
|
Amount collateralAmount
|
114
113
|
) external;
|
115
114
|
|
116
|
-
/// @dev unlink policy from bundle
|
117
|
-
/// policy may only be unlinked if policy is closeable
|
118
|
-
/// may only be called by pool service
|
119
|
-
function unlinkPolicy(
|
120
|
-
IInstance instance,
|
121
|
-
NftId policyNftId
|
122
|
-
) external;
|
123
|
-
|
124
115
|
// FIXME: move to pool service
|
125
116
|
/// @dev Withdraw bundle feeds for the given bundle
|
126
117
|
/// @param bundleNftId the bundle Nft Id
|
127
118
|
/// @param amount the amount to withdraw. If set to AMOUNT_MAX, the full commission available is withdrawn
|
128
119
|
/// @return withdrawnAmount the effective withdrawn amount
|
129
120
|
function withdrawBundleFees(NftId bundleNftId, Amount amount) external returns (Amount withdrawnAmount);
|
130
|
-
|
131
|
-
/// @dev returns true iff policy may be closed
|
132
|
-
/// a policy can be closed all conditions below are met
|
133
|
-
/// - policy exists
|
134
|
-
/// - has been activated
|
135
|
-
/// - is not yet closed
|
136
|
-
/// - has no open claims
|
137
|
-
/// - claim amount matches sum insured amount or is expired
|
138
|
-
function policyIsCloseable(IInstance instance, NftId policyNftId) external view returns (bool isCloseable);
|
139
|
-
|
140
121
|
}
|
@@ -3,17 +3,11 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {Amount} from "../type/Amount.sol";
|
5
5
|
import {ClaimId} from "../type/ClaimId.sol";
|
6
|
-
import {Fee} from "../type/Fee.sol";
|
7
|
-
import {IBundle} from "../instance/module/IBundle.sol";
|
8
6
|
import {IInstance} from "../instance/IInstance.sol";
|
9
7
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
10
8
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
11
9
|
import {IService} from "../shared/IService.sol";
|
12
10
|
import {NftId} from "../type/NftId.sol";
|
13
|
-
import {PayoutId} from "../type/PayoutId.sol";
|
14
|
-
import {RoleId} from "../type/RoleId.sol";
|
15
|
-
import {Seconds} from "../type/Seconds.sol";
|
16
|
-
import {StateId} from "../type/StateId.sol";
|
17
11
|
import {UFixed} from "../type/UFixed.sol";
|
18
12
|
|
19
13
|
interface IPoolService is IService {
|
@@ -82,19 +76,6 @@ interface IPoolService is IService {
|
|
82
76
|
) external;
|
83
77
|
|
84
78
|
|
85
|
-
// TODO cleanup
|
86
|
-
// /// @dev create a new empty bundle with the provided parameters
|
87
|
-
// /// may only be called by registered and unlocked pool components.
|
88
|
-
// function createBundle(
|
89
|
-
// address owner, // initial bundle owner
|
90
|
-
// Fee memory fee, // fees deducted from premium that go to bundle owner
|
91
|
-
// Seconds lifetime, // initial duration for which new policies are covered
|
92
|
-
// bytes calldata filter // optional use case specific criteria that define if a policy may be covered by this bundle
|
93
|
-
// )
|
94
|
-
// external
|
95
|
-
// returns(NftId bundleNftId); // the nft id of the newly created bundle
|
96
|
-
|
97
|
-
|
98
79
|
/// @dev increase stakes for bundle
|
99
80
|
/// staking fees will be deducted by the pool service from the staking amount
|
100
81
|
/// may only be called by registered and unlocked pool components
|