@etherisc/gif-next 0.0.2-c5049d4-401 → 0.0.2-c52b5b7-438
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +27 -6
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1007 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +744 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +791 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +505 -245
- 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 +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +673 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +202 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +273 -16
- 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 +396 -185
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +139 -15
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +19 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +68 -5
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +172 -305
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +261 -27
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +103 -185
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +338 -163
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +115 -65
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +90 -167
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +209 -70
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +2 -2
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +204 -222
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +261 -27
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +455 -389
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +258 -28
- 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 +247 -270
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +644 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +156 -175
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +318 -223
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +644 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +751 -340
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +644 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +193 -45
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +236 -39
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +144 -93
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +284 -62
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +734 -321
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +205 -90
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +869 -261
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +170 -169
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +69 -49
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +556 -415
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +853 -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 +46 -5
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +16 -5
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +168 -0
- 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 +142 -183
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +243 -29
- 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 +104 -116
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +69 -11
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +118 -135
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +151 -81
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +95 -41
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +151 -168
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +261 -27
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +162 -268
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +79 -81
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +90 -117
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +126 -149
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +279 -247
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +139 -167
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +456 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +490 -390
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +133 -51
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +190 -48
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +80 -38
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +278 -234
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +261 -27
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +308 -158
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +106 -72
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +131 -9
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +199 -21
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +168 -54
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +117 -43
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +258 -209
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +86 -6
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +264 -170
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +293 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +102 -64
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +179 -133
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +75 -57
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +268 -224
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +167 -67
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +92 -38
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +117 -17
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +144 -41
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.json +24 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +5 -18
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +161 -53
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +600 -440
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +878 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +109 -185
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +68 -34
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +1954 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +47 -6
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +417 -249
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +66 -8
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +4 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +94 -93
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +507 -524
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +96 -74
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +55 -2
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +509 -4
- 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/ContractLib.sol/ITokenRegistryHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +40 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +81 -75
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +463 -300
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +104 -116
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +36 -0
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +36 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +16 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +148 -0
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +55 -2
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +117 -134
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +42 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/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 +18 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +3 -3
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +152 -38
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +55 -2
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +327 -73
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +484 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +88 -24
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +170 -117
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +152 -20
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +258 -198
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +469 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +46 -5
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +92 -50
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +35 -67
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +203 -59
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +77 -39
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +191 -136
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +48 -38
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +35 -11
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +28 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +94 -38
- 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 +33 -31
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +69 -7
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +79 -15
- 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/SelectorLib.json +21 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +15 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +73 -36
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +101 -2
- 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 +44 -12
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +262 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +45 -0
- package/contracts/authorization/AccessAdmin.sol +342 -230
- package/contracts/authorization/AccessAdminLib.sol +183 -0
- package/contracts/authorization/AccessManagerCloneable.sol +146 -4
- package/contracts/authorization/Authorization.sol +350 -202
- package/contracts/authorization/IAccess.sol +1 -0
- package/contracts/authorization/IAccessAdmin.sol +69 -34
- package/contracts/authorization/IAuthorization.sol +33 -7
- package/contracts/authorization/IServiceAuthorization.sol +3 -1
- package/contracts/authorization/ServiceAuthorization.sol +26 -10
- package/contracts/distribution/BasicDistribution.sol +20 -17
- package/contracts/distribution/BasicDistributionAuthorization.sol +22 -9
- package/contracts/distribution/Distribution.sol +36 -87
- package/contracts/distribution/DistributionService.sol +129 -80
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/distribution/IDistributionComponent.sol +1 -10
- package/contracts/distribution/IDistributionService.sol +22 -20
- package/contracts/examples/fire/DamageLevel.sol +5 -2
- package/contracts/examples/fire/FirePool.sol +24 -13
- package/contracts/examples/fire/FirePoolAuthorization.sol +2 -1
- package/contracts/examples/fire/FireProduct.sol +106 -63
- package/contracts/examples/fire/FireProductAuthorization.sol +14 -8
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +43 -12
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +8 -12
- package/contracts/examples/unpermissioned/SimplePool.sol +36 -10
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +51 -29
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +42 -38
- package/contracts/instance/IInstance.sol +60 -17
- package/contracts/instance/IInstanceService.sol +27 -31
- package/contracts/instance/Instance.sol +115 -40
- package/contracts/instance/InstanceAdmin.sol +287 -122
- package/contracts/instance/InstanceAuthorizationV3.sol +90 -59
- package/contracts/instance/InstanceReader.sol +259 -39
- package/contracts/instance/InstanceService.sol +185 -192
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +13 -2
- package/contracts/instance/RiskSet.sol +118 -0
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +4 -2
- package/contracts/instance/base/ObjectSet.sol +31 -33
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +3 -3
- package/contracts/instance/module/IComponents.sol +13 -9
- package/contracts/instance/module/IDistribution.sol +5 -2
- package/contracts/instance/module/IPolicy.sol +5 -4
- package/contracts/instance/module/IRisk.sol +3 -0
- package/contracts/oracle/BasicOracle.sol +1 -4
- package/contracts/oracle/BasicOracleAuthorization.sol +3 -12
- package/contracts/oracle/IOracleService.sol +2 -1
- package/contracts/oracle/Oracle.sol +5 -18
- package/contracts/oracle/OracleService.sol +108 -79
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPool.sol +32 -25
- package/contracts/pool/BasicPoolAuthorization.sol +27 -9
- package/contracts/pool/BundleService.sol +88 -131
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/IBundleService.sol +15 -34
- package/contracts/pool/IPoolComponent.sol +19 -15
- package/contracts/pool/IPoolService.sol +70 -65
- package/contracts/pool/Pool.sol +136 -119
- package/contracts/pool/PoolLib.sol +216 -0
- package/contracts/pool/PoolService.sol +481 -234
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +46 -19
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +9 -13
- package/contracts/product/BasicProductAuthorization.sol +24 -11
- package/contracts/product/ClaimService.sol +246 -160
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IApplicationService.sol +8 -2
- package/contracts/product/IClaimService.sol +17 -4
- package/contracts/product/IPolicyService.sol +27 -9
- package/contracts/product/IPricingService.sol +10 -9
- package/contracts/product/IProductComponent.sol +27 -4
- package/contracts/product/IRiskService.sol +7 -7
- package/contracts/product/PolicyService.sol +262 -249
- package/contracts/product/PolicyServiceLib.sol +65 -0
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +37 -28
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +118 -76
- package/contracts/product/RiskService.sol +89 -31
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/ChainNft.sol +10 -11
- package/contracts/registry/IRegistry.sol +16 -18
- package/contracts/registry/IRegistryService.sol +5 -12
- package/contracts/registry/IRelease.sol +26 -0
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +36 -8
- package/contracts/registry/RegistryAdmin.sol +145 -351
- package/contracts/registry/RegistryAuthorization.sol +267 -0
- package/contracts/registry/RegistryService.sol +36 -47
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +253 -0
- package/contracts/registry/ReleaseLifecycle.sol +8 -3
- package/contracts/registry/ReleaseRegistry.sol +271 -245
- package/contracts/registry/ServiceAuthorizationV3.sol +182 -50
- package/contracts/registry/TokenRegistry.sol +6 -8
- package/contracts/shared/Component.sol +61 -119
- package/contracts/shared/ComponentService.sol +434 -367
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ComponentVerifyingService.sol +27 -16
- package/contracts/shared/ContractLib.sol +246 -3
- package/contracts/shared/IComponent.sol +5 -17
- package/contracts/shared/IComponentService.sol +44 -40
- package/contracts/shared/IInstanceLinkedComponent.sol +3 -22
- package/contracts/shared/ILifecycle.sol +3 -1
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IRegisterable.sol +23 -1
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +69 -46
- package/contracts/shared/KeyValueStore.sol +1 -1
- package/contracts/shared/Lifecycle.sol +15 -4
- package/contracts/shared/NftOwnable.sol +27 -7
- package/contracts/shared/PolicyHolder.sol +5 -1
- package/contracts/shared/Registerable.sol +50 -19
- package/contracts/shared/RegistryLinked.sol +7 -13
- package/contracts/shared/Service.sol +9 -31
- package/contracts/shared/TokenHandler.sol +275 -72
- package/contracts/shared/TokenHandlerDeployerLib.sol +10 -2
- package/contracts/staking/IStaking.sol +17 -10
- package/contracts/staking/IStakingService.sol +16 -4
- package/contracts/staking/Staking.sol +96 -48
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +80 -23
- package/contracts/staking/StakingReader.sol +18 -21
- package/contracts/staking/StakingService.sol +81 -24
- package/contracts/staking/StakingServiceManager.sol +5 -4
- package/contracts/staking/StakingStore.sol +2 -1
- package/contracts/type/Amount.sol +15 -0
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/Fee.sol +7 -8
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +6 -0
- package/contracts/type/ObjectType.sol +54 -35
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/RiskId.sol +26 -8
- package/contracts/type/RoleId.sol +23 -15
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/StateId.sol +14 -1
- package/contracts/type/Timestamp.sol +0 -5
- package/contracts/type/UFixed.sol +37 -126
- package/contracts/type/Version.sol +54 -5
- package/contracts/upgradeability/ProxyManager.sol +2 -1
- package/package.json +5 -4
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +0 -290
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +0 -390
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -129
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -16
- package/contracts/authorization/IModuleAuthorization.sol +0 -21
- package/contracts/authorization/ModuleAuthorization.sol +0 -78
- package/contracts/instance/module/IAccess.sol +0 -46
- package/contracts/shared/InitializableCustom.sol +0 -177
@@ -8,31 +8,34 @@ import {IService} from "../shared/IService.sol";
|
|
8
8
|
import {UFixed} from "../type/UFixed.sol";
|
9
9
|
import {DistributorType} from "../type/DistributorType.sol";
|
10
10
|
import {ReferralId} from "../type/Referral.sol";
|
11
|
+
import {Seconds} from "../type/Seconds.sol";
|
11
12
|
import {Timestamp} from "../type/Timestamp.sol";
|
12
13
|
|
13
14
|
|
14
15
|
interface IDistributionService is IService {
|
15
|
-
|
16
16
|
error ErrorDistributionServiceCallerNotRegistered(address caller);
|
17
|
-
error
|
18
|
-
error
|
19
|
-
error
|
20
|
-
error
|
21
|
-
error
|
22
|
-
error
|
23
|
-
error
|
24
|
-
error
|
25
|
-
error
|
26
|
-
error
|
27
|
-
error
|
17
|
+
error ErrorDistributionServiceParentNftIdNotInstance(NftId nftId, NftId parentNftId);
|
18
|
+
error ErrorDistributionServiceCallerNotDistributor(address caller);
|
19
|
+
error ErrorDistributionServiceInvalidReferralId(ReferralId referralId);
|
20
|
+
error ErrorDistributionServiceMaxReferralsExceeded(uint256 maxReferrals);
|
21
|
+
error ErrorDistributionServiceDiscountTooLow(uint256 minDiscountPercentage, uint256 discountPercentage);
|
22
|
+
error ErrorDistributionServiceDiscountTooHigh(uint256 maxDiscountPercentage, uint256 discountPercentage);
|
23
|
+
error ErrorDistributionServiceExpiryTooLong(Seconds maxReferralLifetime, Timestamp expiryAt);
|
24
|
+
error ErrorDistributionServiceInvalidReferral(string code);
|
25
|
+
error ErrorDistributionServiceExpirationInvalid(Timestamp expiryAt);
|
26
|
+
error ErrorDistributionServiceCommissionTooHigh(uint256 commissionPercentage, uint256 maxCommissionPercentage);
|
27
|
+
error ErrorDistributionServiceMinFeeTooHigh(uint256 minFee, uint256 limit);
|
28
|
+
error ErrorDistributionServiceDistributorTypeDistributionMismatch(DistributorType distributorType, NftId distributorTypeDistributionNftId, NftId distributionNftId);
|
29
|
+
error ErrorDistributionServiceDistributorDistributionMismatch(NftId distributorNftId, NftId distributorDistributionNftId, NftId distributionNftId);
|
28
30
|
|
29
31
|
error ErrorDistributionServiceCommissionWithdrawAmountExceedsLimit(Amount amount, Amount limit);
|
30
32
|
|
31
33
|
error ErrorDistributionServiceVariableFeesTooHight(uint256 maxDiscountPercentage, uint256 limit);
|
32
34
|
error ErrorDistributionServiceMaxDiscountTooHigh(uint256 maxDiscountPercentage, uint256 limit);
|
33
35
|
|
34
|
-
error
|
36
|
+
error ErrorDistributionServiceReferralInvalid(NftId distributionNftId, ReferralId referralId);
|
35
37
|
error ErrorDistributionServiceInvalidFeeTransferred(Amount transferredDistributionFeeAmount, Amount expectedDistributionFeeAmount);
|
38
|
+
error ErrorDistributionServiceReferralDistributionMismatch(ReferralId referralId, NftId referralDistributionNft, NftId distributionNftId);
|
36
39
|
|
37
40
|
event LogDistributionServiceCommissionWithdrawn(NftId distributorNftId, address recipient, address tokenAddress, Amount amount);
|
38
41
|
|
@@ -42,7 +45,7 @@ interface IDistributionService is IService {
|
|
42
45
|
UFixed maxDiscountPercentage,
|
43
46
|
UFixed commissionPercentage,
|
44
47
|
uint32 maxReferralCount,
|
45
|
-
|
48
|
+
Seconds maxReferralLifetime,
|
46
49
|
bool allowSelfReferrals,
|
47
50
|
bool allowRenewals,
|
48
51
|
bytes memory data
|
@@ -56,12 +59,11 @@ interface IDistributionService is IService {
|
|
56
59
|
bytes memory data
|
57
60
|
) external returns (NftId distributorNftId);
|
58
61
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
// ) external;
|
62
|
+
function changeDistributorType(
|
63
|
+
NftId distributorNftId,
|
64
|
+
DistributorType newDistributorType,
|
65
|
+
bytes memory data
|
66
|
+
) external;
|
65
67
|
|
66
68
|
function createReferral(
|
67
69
|
NftId distributorNftId,
|
@@ -10,15 +10,18 @@ using {
|
|
10
10
|
DamageLevelLib.toInt
|
11
11
|
} for DamageLevel global;
|
12
12
|
|
13
|
+
// solhint-disable-next-line func-name-mixedcase
|
13
14
|
function DAMAGE_SMALL() pure returns (DamageLevel) {
|
14
15
|
return DamageLevel.wrap(1);
|
15
16
|
}
|
16
17
|
|
18
|
+
// solhint-disable-next-line func-name-mixedcase
|
17
19
|
function DAMAGE_MEDIUM() pure returns (DamageLevel) {
|
18
20
|
return DamageLevel.wrap(2);
|
19
21
|
}
|
20
22
|
|
21
|
-
|
23
|
+
// solhint-disable-next-line func-name-mixedcase
|
24
|
+
function DAMAGE_LARGE() pure returns (DamageLevel) {
|
22
25
|
return DamageLevel.wrap(3);
|
23
26
|
}
|
24
27
|
|
@@ -36,7 +39,7 @@ library DamageLevelLib {
|
|
36
39
|
} else if (damage == 2) {
|
37
40
|
return DAMAGE_MEDIUM();
|
38
41
|
} else if (damage == 3) {
|
39
|
-
return
|
42
|
+
return DAMAGE_LARGE();
|
40
43
|
} else {
|
41
44
|
revert ErrorDamageLeveLibInvalidDamageLevel(damage);
|
42
45
|
}
|
@@ -1,42 +1,50 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
|
+
|
4
6
|
import {Amount, AmountLib} from "../../type/Amount.sol";
|
5
7
|
import {BasicPool} from "../../pool/BasicPool.sol";
|
6
|
-
import {BasicPoolAuthorization} from "../../pool/BasicPoolAuthorization.sol";
|
7
8
|
import {Fee} from "../../type/Fee.sol";
|
8
9
|
import {IAuthorization} from "../../authorization/IAuthorization.sol";
|
10
|
+
import {IComponents} from "../../instance/module/IComponents.sol";
|
9
11
|
import {NftId} from "../../type/NftId.sol";
|
10
12
|
import {Seconds} from "../../type/Timestamp.sol";
|
11
|
-
import {UFixed} from "../../type/UFixed.sol";
|
13
|
+
import {UFixed, UFixedLib} from "../../type/UFixed.sol";
|
12
14
|
|
13
15
|
contract FirePool is
|
14
16
|
BasicPool
|
15
|
-
{
|
16
|
-
|
17
|
+
{
|
17
18
|
constructor(
|
18
19
|
address registry,
|
19
|
-
NftId
|
20
|
+
NftId fireProductNftId,
|
20
21
|
string memory componentName,
|
21
|
-
address token,
|
22
22
|
IAuthorization authorization
|
23
23
|
)
|
24
24
|
{
|
25
25
|
address initialOwner = msg.sender;
|
26
26
|
_intialize(
|
27
27
|
registry,
|
28
|
-
|
28
|
+
fireProductNftId,
|
29
29
|
componentName,
|
30
|
-
|
30
|
+
IComponents.PoolInfo({
|
31
|
+
maxBalanceAmount: AmountLib.max(),
|
32
|
+
isInterceptingBundleTransfers: false,
|
33
|
+
isProcessingConfirmedClaims: false,
|
34
|
+
isExternallyManaged: false,
|
35
|
+
isVerifyingApplications: false,
|
36
|
+
collateralizationLevel: UFixedLib.one(),
|
37
|
+
retentionLevel: UFixedLib.one()
|
38
|
+
}),
|
31
39
|
authorization,
|
32
40
|
initialOwner);
|
33
41
|
}
|
34
42
|
|
35
43
|
function _intialize(
|
36
44
|
address registry,
|
37
|
-
NftId
|
45
|
+
NftId fireProductNftId,
|
38
46
|
string memory componentName,
|
39
|
-
|
47
|
+
IComponents.PoolInfo memory poolInfo,
|
40
48
|
IAuthorization authorization,
|
41
49
|
address initialOwner
|
42
50
|
)
|
@@ -45,10 +53,10 @@ contract FirePool is
|
|
45
53
|
{
|
46
54
|
_initializeBasicPool(
|
47
55
|
registry,
|
48
|
-
|
49
|
-
authorization,
|
50
|
-
token,
|
56
|
+
fireProductNftId,
|
51
57
|
componentName,
|
58
|
+
poolInfo,
|
59
|
+
authorization,
|
52
60
|
initialOwner);
|
53
61
|
}
|
54
62
|
|
@@ -72,4 +80,7 @@ contract FirePool is
|
|
72
80
|
netStakedAmount = _stake(bundleNftId, initialAmount);
|
73
81
|
}
|
74
82
|
|
83
|
+
function approveTokenHandler(IERC20Metadata token, Amount amount) external restricted() onlyOwner() { _approveTokenHandler(token, amount); }
|
84
|
+
function setLocked(bool locked) external onlyOwner() { _setLocked(locked); }
|
85
|
+
function setWallet(address newWallet) external restricted() onlyOwner() { _setWallet(newWallet); }
|
75
86
|
}
|
@@ -25,8 +25,9 @@ contract FirePoolAuthorization
|
|
25
25
|
IAccess.FunctionInfo[] storage functions;
|
26
26
|
|
27
27
|
// authorize public role (open access to any account, only allows to lock target)
|
28
|
-
functions = _authorizeForTarget(
|
28
|
+
functions = _authorizeForTarget(getMainTargetName(), PUBLIC_ROLE());
|
29
29
|
// TODO: FirePool.createBundle must require a custom role (e.g. INVESTOR) instead of PUBLIC_ROLE
|
30
|
+
_authorize(functions, FirePool.approveTokenHandler.selector, "approveTokenHandler");
|
30
31
|
_authorize(functions, FirePool.createBundle.selector, "createBundle");
|
31
32
|
}
|
32
33
|
|
@@ -1,28 +1,32 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
4
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
|
+
|
6
|
+
import {ACTIVE, PAUSED} from "../../type/StateId.sol";
|
5
7
|
import {Amount, AmountLib} from "../../type/Amount.sol";
|
6
8
|
import {BasicProduct} from "../../product/BasicProduct.sol";
|
7
9
|
import {ClaimId} from "../../type/ClaimId.sol";
|
8
|
-
import {DamageLevel,
|
10
|
+
import {DamageLevel, DAMAGE_SMALL, DAMAGE_MEDIUM, DAMAGE_LARGE} from "./DamageLevel.sol";
|
11
|
+
import {FeeLib} from "../../type/Fee.sol";
|
9
12
|
import {IAuthorization} from "../../authorization/IAuthorization.sol";
|
13
|
+
import {IComponents} from "../../instance/module/IComponents.sol";
|
10
14
|
import {IPolicy} from "../../instance/module/IPolicy.sol";
|
11
|
-
import {NftId} from "../../type/NftId.sol";
|
15
|
+
import {NftId, NftIdLib} from "../../type/NftId.sol";
|
12
16
|
import {PayoutId} from "../../type/PayoutId.sol";
|
17
|
+
import {POLICY, BUNDLE} from "../../type/ObjectType.sol";
|
13
18
|
import {ReferralLib} from "../../type/Referral.sol";
|
14
19
|
import {RiskId, RiskIdLib} from "../../type/RiskId.sol";
|
15
20
|
import {Seconds} from "../../type/Seconds.sol";
|
16
|
-
import {StateId} from "../../type/StateId.sol";
|
17
21
|
import {Timestamp, TimestampLib} from "../../type/Timestamp.sol";
|
18
22
|
import {UFixed, UFixedLib} from "../../type/UFixed.sol";
|
19
23
|
|
20
|
-
|
21
|
-
|
24
|
+
// solhint-disable-next-line func-name-mixedcase
|
22
25
|
function HALF_YEAR() pure returns (Seconds) {
|
23
26
|
return Seconds.wrap(180 * 86400);
|
24
27
|
}
|
25
28
|
|
29
|
+
// solhint-disable-next-line func-name-mixedcase
|
26
30
|
function ONE_YEAR() pure returns (Seconds) {
|
27
31
|
return Seconds.wrap(360 * 86400);
|
28
32
|
}
|
@@ -41,21 +45,22 @@ contract FireProduct is
|
|
41
45
|
}
|
42
46
|
|
43
47
|
error ErrorFireProductCityUnknown(string cityName);
|
44
|
-
error
|
48
|
+
error ErrorFireProductTimestampInFuture();
|
45
49
|
error ErrorFireProductFireAlreadyReported();
|
46
50
|
error ErrorFireProductAlreadyClaimed();
|
47
|
-
error ErrorFireProductPolicyNotActive();
|
48
|
-
error ErrorFireProductPolicyNotYetActive(Timestamp activateAt);
|
49
|
-
error ErrorFireProductPolicyExpired(Timestamp expiredAt);
|
51
|
+
error ErrorFireProductPolicyNotActive(NftId policyNftId);
|
52
|
+
error ErrorFireProductPolicyNotYetActive(NftId policyNftId, Timestamp activateAt);
|
53
|
+
error ErrorFireProductPolicyExpired(NftId policyNftId, Timestamp expiredAt);
|
50
54
|
error ErrorFireProductUnknownDamageLevel(DamageLevel damageLevel);
|
51
55
|
error ErrorFireProductFireUnknown(uint256 fireId);
|
52
56
|
error ErrorFireProductNotPolicyOwner(NftId nftId, address owner);
|
57
|
+
error ErrorFireProductFireNotInCoveredCity(uint256 fireId, string cityName);
|
53
58
|
|
54
59
|
string[] private _cities;
|
55
60
|
// map from city name to the RiskId
|
56
61
|
mapping(string cityName => RiskId risk) private _riskMapping;
|
57
62
|
|
58
|
-
//
|
63
|
+
// map from city name to the damage level and the time of the report
|
59
64
|
mapping(uint256 fireId => Fire) private _fires;
|
60
65
|
mapping(uint256 fireId => mapping (NftId policyId => bool claimed)) private _claimed;
|
61
66
|
|
@@ -63,28 +68,23 @@ contract FireProduct is
|
|
63
68
|
address registry,
|
64
69
|
NftId instanceNftid,
|
65
70
|
string memory componentName,
|
66
|
-
address token,
|
67
|
-
address pool,
|
68
71
|
IAuthorization authorization
|
69
72
|
)
|
70
73
|
{
|
71
74
|
address initialOwner = msg.sender;
|
75
|
+
|
72
76
|
_initialize(
|
73
77
|
registry,
|
74
78
|
instanceNftid,
|
75
79
|
componentName,
|
76
|
-
token,
|
77
|
-
pool,
|
78
80
|
authorization,
|
79
81
|
initialOwner);
|
80
82
|
}
|
81
83
|
|
82
84
|
function _initialize(
|
83
85
|
address registry,
|
84
|
-
NftId
|
86
|
+
NftId instanceNftId,
|
85
87
|
string memory componentName,
|
86
|
-
address token,
|
87
|
-
address pool,
|
88
88
|
IAuthorization authorization,
|
89
89
|
address initialOwner
|
90
90
|
)
|
@@ -93,14 +93,29 @@ contract FireProduct is
|
|
93
93
|
{
|
94
94
|
_initializeBasicProduct(
|
95
95
|
registry,
|
96
|
-
|
97
|
-
authorization,
|
98
|
-
initialOwner,
|
96
|
+
instanceNftId,
|
99
97
|
componentName,
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
98
|
+
IComponents.ProductInfo({
|
99
|
+
isProcessingFundedClaims: false,
|
100
|
+
isInterceptingPolicyTransfers: false,
|
101
|
+
hasDistribution: false,
|
102
|
+
expectedNumberOfOracles: 0,
|
103
|
+
numberOfOracles: 0,
|
104
|
+
poolNftId: NftIdLib.zero(),
|
105
|
+
distributionNftId: NftIdLib.zero(),
|
106
|
+
oracleNftId: new NftId[](0)
|
107
|
+
}),
|
108
|
+
IComponents.FeeInfo({
|
109
|
+
productFee: FeeLib.zero(),
|
110
|
+
processingFee: FeeLib.zero(),
|
111
|
+
distributionFee: FeeLib.zero(),
|
112
|
+
minDistributionOwnerFee: FeeLib.zero(),
|
113
|
+
poolFee: FeeLib.zero(),
|
114
|
+
stakingFee: FeeLib.zero(),
|
115
|
+
performanceFee: FeeLib.zero()
|
116
|
+
}),
|
117
|
+
authorization,
|
118
|
+
initialOwner); // number of oracles
|
104
119
|
}
|
105
120
|
|
106
121
|
function cities() public view returns (uint256) {
|
@@ -155,15 +170,16 @@ contract FireProduct is
|
|
155
170
|
)
|
156
171
|
public
|
157
172
|
view
|
173
|
+
onlyNftOfType(bundleNftId, BUNDLE())
|
158
174
|
returns (Amount premiumAmount)
|
159
175
|
{
|
160
|
-
RiskId
|
161
|
-
if (
|
176
|
+
RiskId risk = _riskMapping[cityName];
|
177
|
+
if (risk.eqz()) {
|
162
178
|
revert ErrorFireProductCityUnknown(cityName);
|
163
179
|
}
|
164
180
|
premiumAmount = calculatePremium(
|
165
181
|
sumInsured,
|
166
|
-
|
182
|
+
risk,
|
167
183
|
lifetime,
|
168
184
|
"",
|
169
185
|
bundleNftId,
|
@@ -196,14 +212,15 @@ contract FireProduct is
|
|
196
212
|
)
|
197
213
|
public
|
198
214
|
restricted()
|
215
|
+
onlyNftOfType(bundleNftId, BUNDLE())
|
199
216
|
returns (NftId policyNftId)
|
200
217
|
{
|
201
218
|
address applicationOwner = msg.sender;
|
202
|
-
RiskId
|
219
|
+
RiskId risk = initializeCity(cityName);
|
203
220
|
|
204
221
|
Amount premiumAmount = calculatePremium(
|
205
222
|
sumInsured,
|
206
|
-
|
223
|
+
risk,
|
207
224
|
lifetime,
|
208
225
|
"",
|
209
226
|
bundleNftId,
|
@@ -211,7 +228,7 @@ contract FireProduct is
|
|
211
228
|
|
212
229
|
return _createApplication(
|
213
230
|
applicationOwner,
|
214
|
-
|
231
|
+
risk,
|
215
232
|
sumInsured,
|
216
233
|
premiumAmount,
|
217
234
|
lifetime,
|
@@ -225,15 +242,14 @@ contract FireProduct is
|
|
225
242
|
string memory cityName
|
226
243
|
)
|
227
244
|
public
|
228
|
-
returns (RiskId
|
245
|
+
returns (RiskId risk)
|
229
246
|
{
|
230
247
|
if (! _riskMapping[cityName].eqz()) {
|
231
248
|
return _riskMapping[cityName];
|
232
249
|
}
|
233
250
|
_cities.push(cityName);
|
234
|
-
|
235
|
-
|
236
|
-
_riskMapping[cityName] = riskId;
|
251
|
+
risk = _createRisk(bytes32(abi.encodePacked(cityName)), "");
|
252
|
+
_riskMapping[cityName] = risk;
|
237
253
|
}
|
238
254
|
|
239
255
|
/// @dev Calling this method will lock the sum insured amount in the pool and activate the policy at the given time.
|
@@ -244,6 +260,8 @@ contract FireProduct is
|
|
244
260
|
)
|
245
261
|
public
|
246
262
|
restricted()
|
263
|
+
onlyOwner()
|
264
|
+
onlyNftOfType(policyNftId, POLICY())
|
247
265
|
{
|
248
266
|
_createPolicy(policyNftId, activateAt);
|
249
267
|
_collectPremium(policyNftId, activateAt);
|
@@ -255,6 +273,8 @@ contract FireProduct is
|
|
255
273
|
)
|
256
274
|
public
|
257
275
|
restricted()
|
276
|
+
onlyOwner()
|
277
|
+
onlyNftOfType(policyNftId, POLICY())
|
258
278
|
{
|
259
279
|
_decline(policyNftId);
|
260
280
|
}
|
@@ -265,6 +285,8 @@ contract FireProduct is
|
|
265
285
|
)
|
266
286
|
public
|
267
287
|
restricted()
|
288
|
+
onlyOwner()
|
289
|
+
onlyNftOfType(policyNftId, POLICY())
|
268
290
|
returns (Timestamp)
|
269
291
|
{
|
270
292
|
return _expire(policyNftId, expireAt);
|
@@ -275,6 +297,8 @@ contract FireProduct is
|
|
275
297
|
)
|
276
298
|
public
|
277
299
|
restricted()
|
300
|
+
onlyOwner()
|
301
|
+
onlyNftOfType(policyNftId, POLICY())
|
278
302
|
{
|
279
303
|
_close(policyNftId);
|
280
304
|
}
|
@@ -292,8 +316,8 @@ contract FireProduct is
|
|
292
316
|
revert ErrorFireProductCityUnknown(cityName);
|
293
317
|
}
|
294
318
|
|
295
|
-
if (reportedAt
|
296
|
-
revert
|
319
|
+
if (reportedAt > TimestampLib.blockTimestamp()) {
|
320
|
+
revert ErrorFireProductTimestampInFuture();
|
297
321
|
}
|
298
322
|
|
299
323
|
if (! _fires[fireId].reportedAt.eqz()) {
|
@@ -318,16 +342,18 @@ contract FireProduct is
|
|
318
342
|
public
|
319
343
|
restricted()
|
320
344
|
onlyNftOwner(policyNftId)
|
345
|
+
onlyNftOfType(policyNftId, POLICY())
|
321
346
|
returns (ClaimId claimId, PayoutId payoutId)
|
322
347
|
{
|
323
348
|
IPolicy.PolicyInfo memory policyInfo = _getInstanceReader().getPolicyInfo(policyNftId);
|
324
|
-
_checkClaimConditions(policyNftId,
|
349
|
+
_checkClaimConditions(policyNftId, policyInfo, fireId);
|
325
350
|
|
326
|
-
Fire memory
|
351
|
+
Fire memory theFire = _fires[fireId];
|
327
352
|
_claimed[fireId][policyNftId] = true;
|
328
|
-
|
353
|
+
|
354
|
+
Amount claimAmount = _getClaimAmount(policyNftId, policyInfo.sumInsuredAmount, theFire.damageLevel);
|
329
355
|
|
330
|
-
claimId = _submitClaim(policyNftId, claimAmount,
|
356
|
+
claimId = _submitClaim(policyNftId, claimAmount, abi.encodePacked(fireId));
|
331
357
|
_confirmClaim(policyNftId, claimId, claimAmount, "");
|
332
358
|
|
333
359
|
payoutId = _createPayout(policyNftId, claimId, claimAmount, "");
|
@@ -336,55 +362,72 @@ contract FireProduct is
|
|
336
362
|
|
337
363
|
function _checkClaimConditions(
|
338
364
|
NftId policyNftId,
|
339
|
-
|
340
|
-
|
365
|
+
IPolicy.PolicyInfo memory policyInfo,
|
366
|
+
uint256 fireId
|
341
367
|
)
|
342
368
|
internal
|
369
|
+
view
|
343
370
|
{
|
344
371
|
// check fire exists
|
345
372
|
if (_fires[fireId].reportedAt.eqz()) {
|
346
373
|
revert ErrorFireProductFireUnknown(fireId);
|
347
374
|
}
|
348
375
|
|
376
|
+
// check fire is in same city as policy coverage
|
377
|
+
if (_riskMapping[_fires[fireId].cityName] != policyInfo.riskId) {
|
378
|
+
revert ErrorFireProductFireNotInCoveredCity(fireId, _fires[fireId].cityName);
|
379
|
+
}
|
380
|
+
|
349
381
|
// check policy has not been claimed yet for this fire
|
350
382
|
if (_claimed[fireId][policyNftId]) {
|
351
383
|
revert ErrorFireProductAlreadyClaimed();
|
352
384
|
}
|
353
385
|
|
354
|
-
|
355
|
-
|
356
|
-
if (! policyState.eq(COLLATERALIZED())) {
|
357
|
-
revert ErrorFireProductPolicyNotActive();
|
358
|
-
}
|
359
|
-
|
360
|
-
Fire memory fire = _fires[fireId];
|
386
|
+
Fire memory theFire = _fires[fireId];
|
361
387
|
|
362
|
-
|
363
|
-
|
388
|
+
// check fire is during policy lifetime
|
389
|
+
if (theFire.reportedAt < policyInfo.activatedAt) {
|
390
|
+
revert ErrorFireProductPolicyNotYetActive(policyNftId, policyInfo.activatedAt);
|
364
391
|
}
|
365
392
|
|
366
|
-
if (
|
367
|
-
revert ErrorFireProductPolicyExpired(policyInfo.expiredAt);
|
393
|
+
if (theFire.reportedAt >= policyInfo.expiredAt) {
|
394
|
+
revert ErrorFireProductPolicyExpired(policyNftId, policyInfo.expiredAt);
|
368
395
|
}
|
369
396
|
}
|
370
397
|
|
371
398
|
function _getClaimAmount(
|
372
|
-
|
373
|
-
|
399
|
+
NftId policyNftId,
|
400
|
+
Amount sumInsured,
|
401
|
+
DamageLevel damageLevel
|
374
402
|
)
|
375
403
|
internal
|
376
404
|
view
|
377
405
|
returns (Amount)
|
378
406
|
{
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
return
|
407
|
+
Amount claimAmount = sumInsured.multiplyWith(_damageLevelToPayoutPercentage(damageLevel));
|
408
|
+
Amount maxPayoutRemaining = _getInstanceReader().getRemainingClaimableAmount(policyNftId);
|
409
|
+
|
410
|
+
// if payout is higher than the remaining maximum payout, then claim what is remaining
|
411
|
+
if (maxPayoutRemaining < claimAmount) {
|
412
|
+
return maxPayoutRemaining;
|
413
|
+
}
|
414
|
+
|
415
|
+
return claimAmount;
|
416
|
+
}
|
417
|
+
|
418
|
+
function _damageLevelToPayoutPercentage(DamageLevel damageLevel) internal pure returns (UFixed) {
|
419
|
+
if (damageLevel.eq(DAMAGE_SMALL())) {
|
420
|
+
return UFixedLib.toUFixed(25, -2);
|
421
|
+
} else if (damageLevel.eq(DAMAGE_MEDIUM())) {
|
422
|
+
return UFixedLib.toUFixed(5, -1);
|
423
|
+
} else if (damageLevel.eq(DAMAGE_LARGE())) {
|
424
|
+
return UFixedLib.toUFixed(1);
|
385
425
|
} else {
|
386
|
-
revert ErrorFireProductUnknownDamageLevel(
|
426
|
+
revert ErrorFireProductUnknownDamageLevel(damageLevel);
|
387
427
|
}
|
388
428
|
}
|
389
429
|
|
430
|
+
function approveTokenHandler(IERC20Metadata token, Amount amount) external restricted() onlyOwner() { _approveTokenHandler(token, amount); }
|
431
|
+
function setLocked(bool locked) external onlyOwner() { _setLocked(locked); }
|
432
|
+
function setWallet(address newWallet) external restricted() onlyOwner() { _setWallet(newWallet); }
|
390
433
|
}
|
@@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {BasicProductAuthorization} from "../../product/BasicProductAuthorization.sol";
|
5
5
|
import {FireProduct} from "./FireProduct.sol";
|
6
6
|
import {IAccess} from "../../../contracts/authorization/IAccess.sol";
|
7
|
-
import {
|
7
|
+
import {PUBLIC_ROLE} from "../../../contracts/type/RoleId.sol";
|
8
8
|
|
9
9
|
|
10
10
|
contract FireProductAuthorization
|
@@ -23,15 +23,21 @@ contract FireProductAuthorization
|
|
23
23
|
IAccess.FunctionInfo[] storage functions;
|
24
24
|
|
25
25
|
// authorize public role (open access to any account, only allows to lock target)
|
26
|
-
functions = _authorizeForTarget(
|
26
|
+
functions = _authorizeForTarget(getMainTargetName(), PUBLIC_ROLE());
|
27
|
+
// fully public functions
|
28
|
+
_authorize(functions, FireProduct.approveTokenHandler.selector, "approveTokenHandler");
|
27
29
|
_authorize(functions, FireProduct.createApplication.selector, "createApplication");
|
28
|
-
|
30
|
+
|
31
|
+
// only owner
|
32
|
+
_authorize(functions, FireProduct.createPolicy.selector, "createPolicy");
|
33
|
+
_authorize(functions, FireProduct.decline.selector, "decline");
|
34
|
+
_authorize(functions, FireProduct.expire.selector, "expire");
|
35
|
+
_authorize(functions, FireProduct.close.selector, "close");
|
29
36
|
|
30
|
-
|
31
|
-
_authorize(functions, FireProduct.
|
32
|
-
|
33
|
-
|
34
|
-
_authorize(functions, FireProduct.close.selector, "close");
|
37
|
+
// only policy nft owner
|
38
|
+
_authorize(functions, FireProduct.submitClaim.selector, "submitClaim");
|
39
|
+
|
40
|
+
// TODO: add custom role for fire reporter
|
35
41
|
_authorize(functions, FireProduct.reportFire.selector, "reportFire");
|
36
42
|
}
|
37
43
|
|