@etherisc/gif-next 0.0.2-9e6b423-414 → 0.0.2-9f51324-299
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 +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +2 -2
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +2 -2
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +97 -267
- 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/AccessAdminLib.sol/AccessAdminLib.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +36 -652
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +2 -2
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +47 -222
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +27 -175
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +12 -85
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +16 -246
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +27 -420
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +3 -3
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +60 -221
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +114 -167
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +60 -72
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +0 -29
- 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 +2 -2
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +59 -220
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2 -2
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +59 -220
- 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 +3 -3
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +59 -220
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +59 -220
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +59 -220
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +32 -310
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +0 -182
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +72 -322
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +292 -605
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +56 -242
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +290 -478
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +26 -208
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +14 -14
- 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 +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
- 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/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +2 -2
- 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 +2 -2
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +56 -234
- 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/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +2 -2
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +2 -2
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +59 -220
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +108 -92
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +55 -31
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- 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/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +26 -92
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +2 -2
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +2 -2
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +36 -60
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +19 -15
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +59 -220
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +78 -78
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +40 -40
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- 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/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 +2 -2
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +26 -82
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +2 -2
- 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/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +2 -2
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +2 -2
- 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/IRelease.sol/IRelease.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 +249 -378
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +68 -243
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +10 -10
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +186 -384
- 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 +76 -128
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +26 -437
- 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/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +54 -54
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +28 -28
- 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 +45 -16
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/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/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/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/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +8 -8
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +2 -2
- 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 +5 -5
- 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 +3 -3
- 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 +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +6 -6
- 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 +2 -2
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +218 -39
- 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/String.sol/StrLib.json +2 -50
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.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/authorization/AccessAdmin.sol +185 -261
- package/contracts/authorization/AccessAdminLib.sol +7 -220
- package/contracts/authorization/Authorization.sol +229 -38
- package/contracts/authorization/IAccess.sol +4 -14
- package/contracts/authorization/IAccessAdmin.sol +45 -19
- package/contracts/authorization/IAuthorization.sol +56 -3
- package/contracts/authorization/IServiceAuthorization.sol +17 -55
- package/contracts/authorization/ServiceAuthorization.sol +33 -247
- package/contracts/distribution/BasicDistributionAuthorization.sol +4 -11
- package/contracts/distribution/Distribution.sol +1 -2
- package/contracts/distribution/DistributionService.sol +33 -75
- package/contracts/distribution/IDistributionComponent.sol +1 -3
- package/contracts/distribution/IDistributionService.sol +4 -10
- package/contracts/instance/IInstance.sol +4 -43
- package/contracts/instance/IInstanceService.sol +3 -28
- package/contracts/instance/Instance.sol +39 -80
- package/contracts/instance/InstanceAdmin.sol +229 -162
- package/contracts/instance/InstanceAuthorizationV3.sol +28 -58
- package/contracts/instance/InstanceReader.sol +389 -371
- package/contracts/instance/InstanceService.sol +53 -105
- package/contracts/oracle/BasicOracleAuthorization.sol +2 -18
- package/contracts/pool/BasicPoolAuthorization.sol +3 -9
- package/contracts/pool/BundleService.sol +9 -8
- package/contracts/pool/PoolLib.sol +0 -44
- package/contracts/product/ApplicationService.sol +26 -4
- package/contracts/product/BasicProductAuthorization.sol +4 -9
- package/contracts/product/ClaimService.sol +20 -11
- package/contracts/product/PolicyService.sol +2 -2
- package/contracts/product/PolicyServiceLib.sol +0 -20
- package/contracts/registry/RegistryAdmin.sol +97 -27
- package/contracts/registry/RegistryAuthorization.sol +25 -35
- package/contracts/registry/ReleaseAdmin.sol +100 -42
- package/contracts/registry/ReleaseRegistry.sol +9 -12
- package/contracts/registry/ServiceAuthorizationV3.sol +20 -32
- package/contracts/registry/TokenRegistry.sol +4 -2
- package/contracts/shared/ComponentService.sol +5 -22
- package/contracts/shared/ContractLib.sol +45 -9
- package/contracts/shared/IRegisterable.sol +1 -0
- package/contracts/shared/Service.sol +4 -6
- package/contracts/staking/Staking.sol +5 -4
- package/contracts/staking/TargetManagerLib.sol +1 -1
- package/contracts/type/ObjectType.sol +3 -16
- package/contracts/type/RoleId.sol +59 -57
- package/contracts/type/String.sol +0 -12
- package/contracts/upgradeability/ProxyManager.sol +2 -2
- package/contracts/upgradeability/Versionable.sol +1 -4
- package/package.json +1 -1
@@ -3,7 +3,6 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
5
|
|
6
|
-
import {IAccess} from "../authorization/IAccess.sol";
|
7
6
|
import {IBundle} from "../instance/module/IBundle.sol";
|
8
7
|
import {IComponents} from "../instance/module/IComponents.sol";
|
9
8
|
import {IDistribution} from "../instance/module/IDistribution.sol";
|
@@ -14,31 +13,28 @@ import {IOracle} from "../oracle/IOracle.sol";
|
|
14
13
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
15
14
|
import {IRegistry} from "../registry/IRegistry.sol";
|
16
15
|
import {IRisk} from "../instance/module/IRisk.sol";
|
16
|
+
import {TimestampLib} from "../type/Timestamp.sol";
|
17
17
|
|
18
|
-
import {AccessAdminLib} from "../authorization/AccessAdminLib.sol";
|
19
18
|
import {Amount} from "../type/Amount.sol";
|
20
19
|
import {BundleSet} from "./BundleSet.sol";
|
21
20
|
import {BUNDLE, COMPONENT, DISTRIBUTOR, DISTRIBUTION, FEE, PREMIUM, POLICY, POOL, PRODUCT} from "../type/ObjectType.sol";
|
22
21
|
import {ClaimId, ClaimIdLib} from "../type/ClaimId.sol";
|
23
22
|
import {DistributorType} from "../type/DistributorType.sol";
|
24
|
-
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
25
23
|
import {InstanceStore} from "./InstanceStore.sol";
|
26
24
|
import {Key32} from "../type/Key32.sol";
|
27
25
|
import {NftId} from "../type/NftId.sol";
|
28
26
|
import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
|
29
|
-
import {
|
30
|
-
import {ReferralId, ReferralStatus, ReferralLib} from "../type/Referral.sol";
|
27
|
+
import {ReferralId, ReferralStatus, ReferralLib, REFERRAL_OK, REFERRAL_ERROR_UNKNOWN, REFERRAL_ERROR_EXPIRED, REFERRAL_ERROR_EXHAUSTED} from "../type/Referral.sol";
|
31
28
|
import {RequestId} from "../type/RequestId.sol";
|
32
29
|
import {RiskId} from "../type/RiskId.sol";
|
33
30
|
import {RiskSet} from "./RiskSet.sol";
|
34
|
-
import {RoleId
|
31
|
+
import {RoleId} from "../type/RoleId.sol";
|
35
32
|
import {StateId} from "../type/StateId.sol";
|
36
33
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
37
34
|
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
38
35
|
|
39
36
|
|
40
|
-
|
41
|
-
/// Provides reading functions for all instance data and related component data.
|
37
|
+
|
42
38
|
contract InstanceReader {
|
43
39
|
|
44
40
|
error ErrorInstanceReaderAlreadyInitialized();
|
@@ -48,7 +44,6 @@ contract InstanceReader {
|
|
48
44
|
|
49
45
|
IRegistry internal _registry;
|
50
46
|
IInstance internal _instance;
|
51
|
-
InstanceAdmin internal _instanceAdmin;
|
52
47
|
|
53
48
|
InstanceStore internal _store;
|
54
49
|
BundleSet internal _bundleSet;
|
@@ -64,8 +59,6 @@ contract InstanceReader {
|
|
64
59
|
initializeWithInstance(msg.sender);
|
65
60
|
}
|
66
61
|
|
67
|
-
|
68
|
-
/// @dev Initializer to upgrade instance reader via instance service
|
69
62
|
function initializeWithInstance(address instanceAddress)
|
70
63
|
public
|
71
64
|
{
|
@@ -75,7 +68,6 @@ contract InstanceReader {
|
|
75
68
|
|
76
69
|
_initialized = true;
|
77
70
|
_instance = IInstance(instanceAddress);
|
78
|
-
_instanceAdmin = _instance.getInstanceAdmin();
|
79
71
|
_registry = _instance.getRegistry();
|
80
72
|
|
81
73
|
_store = _instance.getInstanceStore();
|
@@ -85,347 +77,466 @@ contract InstanceReader {
|
|
85
77
|
}
|
86
78
|
|
87
79
|
|
88
|
-
|
80
|
+
// instance level functions
|
89
81
|
|
90
|
-
/// @dev Returns the registry this instance is registered in.
|
91
82
|
function getRegistry() public view returns (IRegistry registry) {
|
92
83
|
return _registry;
|
93
84
|
}
|
94
85
|
|
95
|
-
|
96
|
-
/// @dev Returns the instance NFT ID.
|
97
86
|
function getInstanceNftId() public view returns (NftId instanceNftid) {
|
98
87
|
return _registry.getNftIdForAddress(address(_instance));
|
99
88
|
}
|
100
89
|
|
101
|
-
|
102
|
-
/// @dev Returns the instance contract.
|
103
90
|
function getInstance() public view returns (IInstance instance) {
|
104
91
|
return _instance;
|
105
92
|
}
|
106
93
|
|
107
|
-
|
108
|
-
//--- component functions ------------------------------------------------------//
|
109
|
-
|
110
|
-
/// @dev Returns the number of registered components.
|
111
|
-
/// Components may be products, distributions, oracles or pools.
|
112
94
|
function components() public view returns (uint256 componentCount) {
|
113
|
-
return
|
95
|
+
return _instance.getInstanceAdmin().components();
|
114
96
|
}
|
115
97
|
|
116
|
-
|
117
|
-
|
118
|
-
function getComponentInfo(NftId componentNftId) public view returns (IComponents.ComponentInfo memory info) {
|
119
|
-
(bytes memory data, bool success) = _getData(_toComponentKey(componentNftId));
|
120
|
-
if (success) { return abi.decode(data, (IComponents.ComponentInfo)); }
|
98
|
+
function products() public view returns (uint256 productCount) {
|
99
|
+
return _instance.products();
|
121
100
|
}
|
122
101
|
|
123
|
-
|
124
|
-
|
125
|
-
function getToken(NftId componentNftId) public view returns (IERC20Metadata token) {
|
126
|
-
TokenHandler tokenHandler = getTokenHandler(componentNftId);
|
127
|
-
if (address(tokenHandler) != address(0)) { return tokenHandler.TOKEN(); }
|
102
|
+
function getProductNftId(uint256 idx) public view returns (NftId productNftId) {
|
103
|
+
return _instance.getProductNftId(idx);
|
128
104
|
}
|
129
105
|
|
106
|
+
// module specific functions
|
130
107
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
if (
|
108
|
+
function getPolicyInfo(NftId policyNftId)
|
109
|
+
public
|
110
|
+
view
|
111
|
+
returns (IPolicy.PolicyInfo memory info)
|
112
|
+
{
|
113
|
+
bytes memory data = _store.getData(toPolicyKey(policyNftId));
|
114
|
+
if (data.length > 0) {
|
115
|
+
return abi.decode(data, (IPolicy.PolicyInfo));
|
116
|
+
}
|
138
117
|
}
|
139
118
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
(bytes memory data, bool success) = _getData(_toComponentKey(componentNftId));
|
147
|
-
if (success) { return abi.decode(data, (IComponents.ComponentInfo)).tokenHandler; }
|
119
|
+
function getPolicyState(NftId policyNftId)
|
120
|
+
public
|
121
|
+
view
|
122
|
+
returns (StateId state)
|
123
|
+
{
|
124
|
+
return _store.getState(toPolicyKey(policyNftId));
|
148
125
|
}
|
149
126
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
127
|
+
function getPremiumInfo(NftId policyNftId)
|
128
|
+
public
|
129
|
+
view
|
130
|
+
returns (IPolicy.PremiumInfo memory info)
|
131
|
+
{
|
132
|
+
bytes memory data = _store.getData(toPremiumKey(policyNftId));
|
133
|
+
if (data.length > 0) {
|
134
|
+
return abi.decode(data, (IPolicy.PremiumInfo));
|
135
|
+
}
|
155
136
|
}
|
156
137
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
138
|
+
function getPremiumInfoState(NftId policyNftId)
|
139
|
+
public
|
140
|
+
view
|
141
|
+
returns (StateId state)
|
142
|
+
{
|
143
|
+
return _store.getState(toPremiumKey(policyNftId));
|
162
144
|
}
|
163
145
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
146
|
+
function bundles(NftId poolNftId)
|
147
|
+
public
|
148
|
+
view
|
149
|
+
returns (uint256 bundleCount)
|
150
|
+
{
|
151
|
+
return _bundleSet.bundles(poolNftId);
|
169
152
|
}
|
170
153
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
154
|
+
function activeBundles(NftId poolNftId)
|
155
|
+
public
|
156
|
+
view
|
157
|
+
returns (uint256 bundleCount)
|
158
|
+
{
|
159
|
+
return _bundleSet.activeBundles(poolNftId);
|
176
160
|
}
|
177
161
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
162
|
+
function getActiveBundleNftId(NftId poolNftId, uint256 idx)
|
163
|
+
public
|
164
|
+
view
|
165
|
+
returns (NftId bundleNftId)
|
166
|
+
{
|
167
|
+
return _bundleSet.getActiveBundleNftId(poolNftId, idx);
|
182
168
|
}
|
183
169
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
(
|
188
|
-
|
170
|
+
function getBundleNftId(NftId poolNftId, uint256 idx)
|
171
|
+
public
|
172
|
+
view
|
173
|
+
returns (NftId bundleNftId)
|
174
|
+
{
|
175
|
+
return _bundleSet.getBundleNftId(poolNftId, idx);
|
189
176
|
}
|
190
177
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
(
|
195
|
-
|
178
|
+
function getBundleState(NftId bundleNftId)
|
179
|
+
public
|
180
|
+
view
|
181
|
+
returns (StateId state)
|
182
|
+
{
|
183
|
+
return _store.getState(toBundleKey(bundleNftId));
|
196
184
|
}
|
197
185
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
186
|
+
/// @dev Returns true iff policy is active.
|
187
|
+
function policyIsActive(NftId policyNftId)
|
188
|
+
public
|
189
|
+
view
|
190
|
+
returns (bool isCloseable)
|
191
|
+
{
|
192
|
+
IPolicy.PolicyInfo memory info = getPolicyInfo(policyNftId);
|
204
193
|
|
194
|
+
if (info.productNftId.eqz()) { return false; } // not closeable: policy does not exist (or does not belong to this instance)
|
195
|
+
if (info.activatedAt.eqz()) { return false; } // not closeable: not yet activated
|
196
|
+
if (info.activatedAt > TimestampLib.blockTimestamp()) { return false; } // not yet active
|
197
|
+
if (info.expiredAt <= TimestampLib.blockTimestamp()) { return false; } // already expired
|
205
198
|
|
206
|
-
|
207
|
-
function activeRisks(NftId productNftId) public view returns (uint256 activeRiskCount) {
|
208
|
-
return _riskSet.activeRisks(productNftId);
|
199
|
+
return true;
|
209
200
|
}
|
210
201
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
202
|
+
function claims(NftId policyNftId)
|
203
|
+
public
|
204
|
+
view
|
205
|
+
returns (uint16 claimCount)
|
206
|
+
{
|
207
|
+
return getPolicyInfo(policyNftId).claimsCount;
|
215
208
|
}
|
216
209
|
|
217
210
|
|
218
|
-
|
219
|
-
|
220
|
-
|
211
|
+
function getClaimId(uint idx)
|
212
|
+
public
|
213
|
+
view
|
214
|
+
returns (ClaimId claimId)
|
215
|
+
{
|
216
|
+
return ClaimIdLib.toClaimId(idx + 1);
|
221
217
|
}
|
222
218
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
(
|
227
|
-
|
219
|
+
function getClaimInfo(NftId policyNftId, ClaimId claimId)
|
220
|
+
public
|
221
|
+
view
|
222
|
+
returns (IPolicy.ClaimInfo memory info)
|
223
|
+
{
|
224
|
+
bytes memory data = _store.getData(claimId.toKey32(policyNftId));
|
225
|
+
if (data.length > 0) {
|
226
|
+
return abi.decode(data, (IPolicy.ClaimInfo));
|
227
|
+
}
|
228
228
|
}
|
229
229
|
|
230
230
|
|
231
|
-
|
232
|
-
|
233
|
-
|
231
|
+
function getClaimState(NftId policyNftId, ClaimId claimId)
|
232
|
+
public
|
233
|
+
view
|
234
|
+
returns (StateId state)
|
235
|
+
{
|
236
|
+
return _store.getState(claimId.toKey32(policyNftId));
|
234
237
|
}
|
235
238
|
|
236
239
|
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
240
|
+
function payouts(NftId policyNftId, ClaimId claimId)
|
241
|
+
public
|
242
|
+
view
|
243
|
+
returns (uint24 payoutCount)
|
244
|
+
{
|
245
|
+
return getClaimInfo(policyNftId, claimId).payoutsCount;
|
242
246
|
}
|
243
247
|
|
244
248
|
|
245
|
-
|
246
|
-
|
247
|
-
|
249
|
+
function getPayoutId(ClaimId claimId, uint24 idx)
|
250
|
+
public
|
251
|
+
view
|
252
|
+
returns (PayoutId payoutId)
|
253
|
+
{
|
254
|
+
return PayoutIdLib.toPayoutId(claimId, idx + 1);
|
248
255
|
}
|
249
256
|
|
250
257
|
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
258
|
+
function getRemainingClaimableAmount(NftId policyNftId)
|
259
|
+
public
|
260
|
+
view
|
261
|
+
returns (Amount remainingClaimableAmount)
|
262
|
+
{
|
263
|
+
IPolicy.PolicyInfo memory info = getPolicyInfo(policyNftId);
|
264
|
+
return info.sumInsuredAmount - info.claimAmount;
|
255
265
|
}
|
256
266
|
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
267
|
+
function getPayoutInfo(NftId policyNftId, PayoutId payoutId)
|
268
|
+
public
|
269
|
+
view
|
270
|
+
returns (IPolicy.PayoutInfo memory info)
|
271
|
+
{
|
272
|
+
bytes memory data = _store.getData(payoutId.toKey32(policyNftId));
|
273
|
+
if (data.length > 0) {
|
274
|
+
return abi.decode(data, (IPolicy.PayoutInfo));
|
275
|
+
}
|
261
276
|
}
|
262
277
|
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
278
|
+
function getPayoutState(NftId policyNftId, PayoutId payoutId)
|
279
|
+
public
|
280
|
+
view
|
281
|
+
returns (StateId state)
|
282
|
+
{
|
283
|
+
return _store.getState(payoutId.toKey32(policyNftId));
|
267
284
|
}
|
268
285
|
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
286
|
+
function risks(NftId productNftId)
|
287
|
+
public
|
288
|
+
view
|
289
|
+
returns (uint256 riskCount)
|
290
|
+
{
|
291
|
+
return _riskSet.risks(productNftId);
|
274
292
|
}
|
275
293
|
|
294
|
+
function getRiskId(NftId productNftId, uint256 idx)
|
295
|
+
public
|
296
|
+
view
|
297
|
+
returns (RiskId riskId)
|
298
|
+
{
|
299
|
+
return _riskSet.getRiskId(productNftId, idx);
|
300
|
+
}
|
276
301
|
|
277
|
-
|
278
|
-
|
279
|
-
|
302
|
+
function activeRisks(NftId productNftId)
|
303
|
+
public
|
304
|
+
view
|
305
|
+
returns (uint256 activeRiskCount)
|
306
|
+
{
|
307
|
+
return _riskSet.activeRisks(productNftId);
|
280
308
|
}
|
281
309
|
|
310
|
+
function getActiveRiskId(NftId productNftId, uint256 idx)
|
311
|
+
public
|
312
|
+
view
|
313
|
+
returns (RiskId riskId)
|
314
|
+
{
|
315
|
+
return _riskSet.getActiveRiskId(productNftId, idx);
|
316
|
+
}
|
282
317
|
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
318
|
+
function getRiskInfo(RiskId riskId)
|
319
|
+
public
|
320
|
+
view
|
321
|
+
returns (IRisk.RiskInfo memory info)
|
322
|
+
{
|
323
|
+
bytes memory data = _store.getData(riskId.toKey32());
|
324
|
+
if (data.length > 0) {
|
325
|
+
return abi.decode(data, (IRisk.RiskInfo));
|
288
326
|
}
|
289
327
|
}
|
290
328
|
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
329
|
+
function getRiskState(RiskId riskId)
|
330
|
+
public
|
331
|
+
view
|
332
|
+
returns (StateId stateId)
|
333
|
+
{
|
334
|
+
bytes memory data = _store.getData(riskId.toKey32());
|
335
|
+
return _store.getState(riskId.toKey32());
|
295
336
|
}
|
296
337
|
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
return info.sumInsuredAmount - info.claimAmount;
|
338
|
+
function policiesForRisk(RiskId riskId)
|
339
|
+
public
|
340
|
+
view
|
341
|
+
returns (uint256 linkedPolicies)
|
342
|
+
{
|
343
|
+
return _riskSet.linkedPolicies(riskId);
|
304
344
|
}
|
305
345
|
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
346
|
+
function getPolicyNftIdForRisk(RiskId riskId, uint256 idx)
|
347
|
+
public
|
348
|
+
view
|
349
|
+
returns (NftId linkedPolicyNftId)
|
350
|
+
{
|
351
|
+
return _riskSet.getLinkedPolicyNftId(riskId, idx);
|
311
352
|
}
|
312
353
|
|
313
354
|
|
314
|
-
|
315
|
-
|
316
|
-
|
355
|
+
function getToken(NftId componentNftId)
|
356
|
+
public
|
357
|
+
view
|
358
|
+
returns (IERC20Metadata token)
|
359
|
+
{
|
360
|
+
TokenHandler tokenHandler = getTokenHandler(componentNftId);
|
361
|
+
if (address(tokenHandler) != address(0)) {
|
362
|
+
return tokenHandler.TOKEN();
|
363
|
+
}
|
317
364
|
}
|
318
365
|
|
319
366
|
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
367
|
+
function getWallet(NftId componentNftId)
|
368
|
+
public
|
369
|
+
view
|
370
|
+
returns (address wallet)
|
371
|
+
{
|
372
|
+
TokenHandler tokenHandler = getTokenHandler(componentNftId);
|
373
|
+
if (address(tokenHandler) != address(0)) {
|
374
|
+
return tokenHandler.getWallet();
|
375
|
+
}
|
324
376
|
}
|
325
377
|
|
326
378
|
|
327
|
-
|
328
|
-
|
329
|
-
|
379
|
+
function getTokenHandler(NftId componentNftId)
|
380
|
+
public
|
381
|
+
view
|
382
|
+
returns (TokenHandler tokenHandler)
|
383
|
+
{
|
384
|
+
bytes memory data = _store.getData(toComponentKey(componentNftId));
|
385
|
+
if (data.length > 0) {
|
386
|
+
return abi.decode(data, (IComponents.ComponentInfo)).tokenHandler;
|
387
|
+
}
|
330
388
|
}
|
331
389
|
|
332
|
-
//--- premium functions -------------------------------------------------------//
|
333
390
|
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
391
|
+
function getBundleInfo(NftId bundleNftId)
|
392
|
+
public
|
393
|
+
view
|
394
|
+
returns (IBundle.BundleInfo memory info)
|
395
|
+
{
|
396
|
+
bytes memory data = _store.getData(toBundleKey(bundleNftId));
|
397
|
+
if (data.length > 0) {
|
398
|
+
return abi.decode(data, (IBundle.BundleInfo));
|
399
|
+
}
|
338
400
|
}
|
339
401
|
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
402
|
+
function getDistributorTypeInfo(DistributorType distributorType)
|
403
|
+
public
|
404
|
+
view
|
405
|
+
returns (IDistribution.DistributorTypeInfo memory info)
|
406
|
+
{
|
407
|
+
bytes memory data = _store.getData(distributorType.toKey32());
|
408
|
+
if (data.length > 0) {
|
409
|
+
return abi.decode(data, (IDistribution.DistributorTypeInfo));
|
410
|
+
}
|
344
411
|
}
|
345
412
|
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
413
|
+
function getDistributorInfo(NftId distributorNftId)
|
414
|
+
public
|
415
|
+
view
|
416
|
+
returns (IDistribution.DistributorInfo memory info)
|
417
|
+
{
|
418
|
+
bytes memory data = _store.getData(toDistributorKey(distributorNftId));
|
419
|
+
if (data.length > 0) {
|
420
|
+
return abi.decode(data, (IDistribution.DistributorInfo));
|
421
|
+
}
|
352
422
|
}
|
353
423
|
|
354
|
-
|
355
|
-
|
356
|
-
/// @dev Returns the pool info for the given pool NFT ID.
|
357
|
-
function getPoolInfo(NftId poolNftId) public view returns (IComponents.PoolInfo memory info) {
|
358
|
-
(bytes memory data, bool success) = _getData(poolNftId.toKey32(POOL()));
|
359
|
-
if (success) { return abi.decode(data, (IComponents.PoolInfo)); }
|
424
|
+
function getBalanceAmount(NftId targetNftId) external view returns (Amount) {
|
425
|
+
return _store.getBalanceAmount(targetNftId);
|
360
426
|
}
|
361
427
|
|
362
|
-
|
363
|
-
|
364
|
-
/// @dev Returns the total number of registered bundles for the given pool.
|
365
|
-
function bundles(NftId poolNftId) public view returns (uint256 bundleCount) {
|
366
|
-
return _bundleSet.bundles(poolNftId);
|
428
|
+
function getLockedAmount(NftId targetNftId) external view returns (Amount) {
|
429
|
+
return _store.getLockedAmount(targetNftId);
|
367
430
|
}
|
368
431
|
|
369
|
-
|
370
|
-
|
371
|
-
function activeBundles(NftId poolNftId) public view returns (uint256 bundleCount) {
|
372
|
-
return _bundleSet.activeBundles(poolNftId);
|
432
|
+
function getFeeAmount(NftId targetNftId) external view returns (Amount) {
|
433
|
+
return _store.getFeeAmount(targetNftId);
|
373
434
|
}
|
374
435
|
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
436
|
+
function getComponentInfo(NftId componentNftId)
|
437
|
+
public
|
438
|
+
view
|
439
|
+
returns (IComponents.ComponentInfo memory info)
|
440
|
+
{
|
441
|
+
bytes memory data = _store.getData(toComponentKey(componentNftId));
|
442
|
+
if (data.length > 0) {
|
443
|
+
return abi.decode(data, (IComponents.ComponentInfo));
|
444
|
+
}
|
379
445
|
}
|
380
446
|
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
447
|
+
function getProductInfo(NftId productNftId)
|
448
|
+
public
|
449
|
+
view
|
450
|
+
returns (IComponents.ProductInfo memory info)
|
451
|
+
{
|
452
|
+
bytes memory data = _store.getData(toProductKey(productNftId));
|
453
|
+
if (data.length > 0) {
|
454
|
+
return abi.decode(data, (IComponents.ProductInfo));
|
455
|
+
}
|
385
456
|
}
|
386
457
|
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
(
|
391
|
-
|
458
|
+
function getFeeInfo(NftId productNftId)
|
459
|
+
public
|
460
|
+
view
|
461
|
+
returns (IComponents.FeeInfo memory feeInfo)
|
462
|
+
{
|
463
|
+
bytes memory data = _store.getData(toFeeKey(productNftId));
|
464
|
+
if (data.length > 0) {
|
465
|
+
return abi.decode(data, (IComponents.FeeInfo));
|
466
|
+
}
|
392
467
|
}
|
393
468
|
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
469
|
+
function getPoolInfo(NftId poolNftId)
|
470
|
+
public
|
471
|
+
view
|
472
|
+
returns (IComponents.PoolInfo memory info)
|
473
|
+
{
|
474
|
+
bytes memory data = _store.getData(toPoolKey(poolNftId));
|
475
|
+
if (data.length > 0) {
|
476
|
+
return abi.decode(data, (IComponents.PoolInfo));
|
477
|
+
}
|
398
478
|
}
|
399
479
|
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
(
|
404
|
-
|
480
|
+
function getReferralInfo(ReferralId referralId)
|
481
|
+
public
|
482
|
+
view
|
483
|
+
returns (IDistribution.ReferralInfo memory info)
|
484
|
+
{
|
485
|
+
bytes memory data = _store.getData(referralId.toKey32());
|
486
|
+
if (data.length > 0) {
|
487
|
+
return abi.decode(data, (IDistribution.ReferralInfo));
|
488
|
+
}
|
405
489
|
}
|
406
490
|
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
491
|
+
function isReferralValid(NftId distributionNftId, ReferralId referralId)
|
492
|
+
external
|
493
|
+
view
|
494
|
+
returns (bool isValid)
|
495
|
+
{
|
496
|
+
return _distributionService.referralIsValid(
|
497
|
+
distributionNftId,
|
498
|
+
referralId);
|
411
499
|
}
|
412
500
|
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
501
|
+
function getRequestInfo(RequestId requestId)
|
502
|
+
public
|
503
|
+
view
|
504
|
+
returns (IOracle.RequestInfo memory requestInfo)
|
505
|
+
{
|
506
|
+
bytes memory data = _store.getData(requestId.toKey32());
|
507
|
+
if (data.length > 0) {
|
508
|
+
return abi.decode(data, (IOracle.RequestInfo));
|
509
|
+
}
|
418
510
|
}
|
419
511
|
|
512
|
+
function getMetadata(Key32 key)
|
513
|
+
public
|
514
|
+
view
|
515
|
+
returns (IKeyValueStore.Metadata memory metadata)
|
516
|
+
{
|
517
|
+
return _store.getMetadata(key);
|
518
|
+
}
|
420
519
|
|
421
|
-
function
|
422
|
-
|
520
|
+
function getState(Key32 key)
|
521
|
+
public
|
522
|
+
view
|
523
|
+
returns (StateId state)
|
524
|
+
{
|
525
|
+
return _store.getMetadata(key).state;
|
423
526
|
}
|
424
527
|
|
425
528
|
|
426
|
-
function
|
427
|
-
|
428
|
-
|
529
|
+
function toReferralId(
|
530
|
+
NftId distributionNftId,
|
531
|
+
string memory referralCode
|
532
|
+
)
|
533
|
+
public
|
534
|
+
pure
|
535
|
+
returns (ReferralId referralId)
|
536
|
+
{
|
537
|
+
return ReferralLib.toReferralId(
|
538
|
+
distributionNftId,
|
539
|
+
referralCode);
|
429
540
|
}
|
430
541
|
|
431
542
|
|
@@ -437,196 +548,103 @@ contract InstanceReader {
|
|
437
548
|
ReferralStatus status
|
438
549
|
)
|
439
550
|
{
|
440
|
-
|
441
|
-
|
442
|
-
DISTRIBUTION(),
|
443
|
-
_instance.getRelease())).getDiscountPercentage(
|
444
|
-
this, // instance reader
|
445
|
-
referralId);
|
446
|
-
}
|
447
|
-
|
448
|
-
//--- authorization functions -------------------------------------------------------//
|
449
|
-
|
450
|
-
/// @dev Returns the number of defined roles.
|
451
|
-
function roles() public view returns (uint256) {
|
452
|
-
return _instanceAdmin.roles();
|
453
|
-
}
|
454
|
-
|
455
|
-
|
456
|
-
/// @dev Returns the role ID for the given index.
|
457
|
-
function getRoleId(uint256 idx) public view returns (RoleId roleId) {
|
458
|
-
return _instanceAdmin.getRoleId(uint64(idx));
|
459
|
-
}
|
460
|
-
|
461
|
-
|
462
|
-
/// @dev Returns the role ID for the instance owner role.
|
463
|
-
/// This role may be used as a "root" admin role for other custom roles defined for this instance.
|
464
|
-
function getInstanceOwnerRole() public pure returns (RoleId roleId) {
|
465
|
-
return INSTANCE_OWNER_ROLE();
|
466
|
-
}
|
551
|
+
IDistribution.ReferralInfo memory info = getReferralInfo(
|
552
|
+
referralId);
|
467
553
|
|
554
|
+
if (info.expiryAt.eqz()) {
|
555
|
+
return (
|
556
|
+
UFixedLib.zero(),
|
557
|
+
REFERRAL_ERROR_UNKNOWN());
|
558
|
+
}
|
468
559
|
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
560
|
+
if (info.expiryAt < TimestampLib.blockTimestamp()) {
|
561
|
+
return (
|
562
|
+
UFixedLib.zero(),
|
563
|
+
REFERRAL_ERROR_EXPIRED());
|
564
|
+
}
|
473
565
|
|
566
|
+
if (info.usedReferrals >= info.maxReferrals) {
|
567
|
+
return (
|
568
|
+
UFixedLib.zero(),
|
569
|
+
REFERRAL_ERROR_EXHAUSTED());
|
570
|
+
}
|
474
571
|
|
475
|
-
|
476
|
-
|
477
|
-
|
572
|
+
return (
|
573
|
+
info.discountPercentage,
|
574
|
+
REFERRAL_OK()
|
575
|
+
);
|
478
576
|
}
|
479
577
|
|
480
578
|
|
481
|
-
|
482
|
-
|
483
|
-
return _instanceAdmin.isRoleCustom(roleId);
|
579
|
+
function hasRole(address account, RoleId roleId) public view returns (bool isMember) {
|
580
|
+
return _instance.getInstanceAdmin().hasRole(account, roleId);
|
484
581
|
}
|
485
582
|
|
486
583
|
|
487
|
-
|
488
|
-
|
489
|
-
return _instanceAdmin.isRoleActive(roleId);
|
584
|
+
function hasAdminRole(address account, RoleId roleId) public view returns (bool isMember) {
|
585
|
+
return _instance.getInstanceAdmin().hasAdminRole(account, roleId);
|
490
586
|
}
|
491
587
|
|
492
588
|
|
493
|
-
|
494
|
-
|
495
|
-
return _instanceAdmin.roleMembers(roleId);
|
589
|
+
function isLocked(address target) public view returns (bool) {
|
590
|
+
return _instance.getInstanceAdmin().isTargetLocked(target);
|
496
591
|
}
|
497
592
|
|
498
|
-
|
499
|
-
|
500
|
-
function getRoleMember(RoleId roleId, uint256 idx) public view returns (address account) {
|
501
|
-
return _instanceAdmin.getRoleMember(roleId, idx);
|
593
|
+
function toPolicyKey(NftId policyNftId) public pure returns (Key32) {
|
594
|
+
return policyNftId.toKey32(POLICY());
|
502
595
|
}
|
503
596
|
|
504
|
-
|
505
|
-
|
506
|
-
function isRoleMember(RoleId roleId, address account) public view returns (bool isMember) {
|
507
|
-
return _instanceAdmin.isRoleMember(roleId, account);
|
597
|
+
function toPremiumKey(NftId policyNftId) public pure returns (Key32) {
|
598
|
+
return policyNftId.toKey32(PREMIUM());
|
508
599
|
}
|
509
600
|
|
510
|
-
|
511
|
-
|
512
|
-
/// Role admins may grant and revoke the role to other accounts.
|
513
|
-
function isRoleAdmin(RoleId roleId, address account) public view returns (bool isMember) {
|
514
|
-
return _instanceAdmin.isRoleAdmin(roleId, account);
|
601
|
+
function toDistributorKey(NftId distributorNftId) public pure returns (Key32) {
|
602
|
+
return distributorNftId.toKey32(DISTRIBUTOR());
|
515
603
|
}
|
516
604
|
|
517
|
-
|
518
|
-
|
519
|
-
function targets() public view returns (uint256 targetCount) {
|
520
|
-
return _instanceAdmin.targets();
|
605
|
+
function toBundleKey(NftId poolNftId) public pure returns (Key32) {
|
606
|
+
return poolNftId.toKey32(BUNDLE());
|
521
607
|
}
|
522
608
|
|
523
|
-
|
524
|
-
|
525
|
-
function getTargetAddress(uint256 idx) public view returns (address target) {
|
526
|
-
return _instanceAdmin.getTargetAddress(idx);
|
609
|
+
function toComponentKey(NftId componentNftId) public pure returns (Key32) {
|
610
|
+
return componentNftId.toKey32(COMPONENT());
|
527
611
|
}
|
528
612
|
|
529
|
-
|
530
|
-
|
531
|
-
function getTargetInfo(address target) public view returns (IAccess.TargetInfo memory targetInfo) {
|
532
|
-
return _instanceAdmin.getTargetInfo(target);
|
613
|
+
function toDistributionKey(NftId distributionNftId) public pure returns (Key32) {
|
614
|
+
return distributionNftId.toKey32(DISTRIBUTION());
|
533
615
|
}
|
534
616
|
|
535
|
-
|
536
|
-
|
537
|
-
function targetExists(address target) public view returns (bool exists) {
|
538
|
-
return _instanceAdmin.targetExists(target);
|
617
|
+
function toPoolKey(NftId poolNftId) public pure returns (Key32) {
|
618
|
+
return poolNftId.toKey32(POOL());
|
539
619
|
}
|
540
620
|
|
541
|
-
|
542
|
-
|
543
|
-
function isLocked(address target) public view returns (bool) {
|
544
|
-
return _instanceAdmin.isTargetLocked(target);
|
621
|
+
function toProductKey(NftId productNftId) public pure returns (Key32) {
|
622
|
+
return productNftId.toKey32(PRODUCT());
|
545
623
|
}
|
546
624
|
|
547
|
-
|
548
|
-
|
549
|
-
function authorizedFunctions(address target) external view returns (uint256 numberOfFunctions) {
|
550
|
-
return _instanceAdmin.authorizedFunctions(target);
|
625
|
+
function toFeeKey(NftId productNftId) public pure returns (Key32) {
|
626
|
+
return productNftId.toKey32(FEE());
|
551
627
|
}
|
552
628
|
|
553
|
-
|
554
|
-
/// @dev Returns the authorized function info for the given target and index.
|
555
|
-
function getAuthorizedFunction(address target, uint256 idx) external view returns (IAccess.FunctionInfo memory func, RoleId roleId) {
|
556
|
-
return _instanceAdmin.getAuthorizedFunction(target, idx);
|
557
|
-
}
|
558
|
-
|
559
|
-
|
560
|
-
/// @dev Returns a function info for the given function signature and function name.
|
561
|
-
/// The function signature must not be zero and the function name must not be empty.
|
562
|
-
function toFunction(bytes4 signature, string memory name) public view returns (IAccess.FunctionInfo memory) {
|
563
|
-
return AccessAdminLib.toFunction(signature, name);
|
564
|
-
}
|
565
|
-
|
566
|
-
//--- low level function ----------------------------------------------------//
|
567
|
-
|
568
|
-
function getInstanceAdmin() external view returns (InstanceAdmin instanceAdmin) {
|
569
|
-
return _instanceAdmin;
|
570
|
-
}
|
629
|
+
// low level function
|
571
630
|
|
572
631
|
function getInstanceStore() external view returns (IKeyValueStore store) {
|
573
632
|
return _store;
|
574
633
|
}
|
575
634
|
|
576
|
-
|
577
635
|
function getBundleSet() external view returns (BundleSet bundleSet) {
|
578
636
|
return _bundleSet;
|
579
637
|
}
|
580
638
|
|
581
|
-
|
582
639
|
function getRiskSet() external view returns (RiskSet riskSet) {
|
583
640
|
return _riskSet;
|
584
641
|
}
|
585
642
|
|
586
|
-
|
587
|
-
function getMetadata(Key32 key) public view returns (IKeyValueStore.Metadata memory metadata) {
|
588
|
-
return _store.getMetadata(key);
|
589
|
-
}
|
590
|
-
|
591
|
-
|
592
|
-
function getState(Key32 key) public view returns (StateId state) {
|
593
|
-
return _store.getState(key);
|
594
|
-
}
|
595
|
-
|
596
|
-
|
597
643
|
function toUFixed(uint256 value, int8 exp) public pure returns (UFixed) {
|
598
644
|
return UFixedLib.toUFixed(value, exp);
|
599
645
|
}
|
600
646
|
|
601
|
-
|
602
647
|
function toInt(UFixed value) public pure returns (uint256) {
|
603
648
|
return UFixedLib.toInt(value);
|
604
649
|
}
|
605
|
-
|
606
|
-
//--- internal functions ----------------------------------------------------//
|
607
|
-
|
608
|
-
function _getData(Key32 key) internal view returns (bytes memory data, bool success) {
|
609
|
-
data = _store.getData(key);
|
610
|
-
return (data, data.length > 0);
|
611
|
-
}
|
612
|
-
|
613
|
-
|
614
|
-
function _toPolicyKey(NftId policyNftId) internal pure returns (Key32) {
|
615
|
-
return policyNftId.toKey32(POLICY());
|
616
|
-
}
|
617
|
-
|
618
|
-
|
619
|
-
function _toPremiumKey(NftId policyNftId) internal pure returns (Key32) {
|
620
|
-
return policyNftId.toKey32(PREMIUM());
|
621
|
-
}
|
622
|
-
|
623
|
-
|
624
|
-
function _toBundleKey(NftId poolNftId) internal pure returns (Key32) {
|
625
|
-
return poolNftId.toKey32(BUNDLE());
|
626
|
-
}
|
627
|
-
|
628
|
-
|
629
|
-
function _toComponentKey(NftId componentNftId) internal pure returns (Key32) {
|
630
|
-
return componentNftId.toKey32(COMPONENT());
|
631
|
-
}
|
632
650
|
}
|