@etherisc/gif-next 0.0.2-f13fd28-503 → 0.0.2-f15b559-661
Sign up to get free protection for your applications and to get access to all the features.
- 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/IAccessManagedChecker.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +4 -4
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +2 -2
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +126 -118
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +26 -22
- 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 +76 -76
- 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 +2 -2
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +42 -50
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +2 -2
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +4 -4
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +2 -2
- 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 +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +35 -29
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +589 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +3 -3
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +99 -86
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +2 -2
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +117 -72
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +2 -2
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +2 -2
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +18 -18
- 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/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- 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 +2 -2
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/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 +2 -2
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +2 -2
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +2 -2
- 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 +2 -2
- 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 +2 -2
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +2 -2
- 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 +2 -2
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +2 -2
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +2 -2
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/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/IRiskService.sol/IRiskService.json +10 -4
- 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 +2 -2
- 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 +50 -28
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +21 -13
- 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 +2 -2
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +2 -2
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +2 -2
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +2 -2
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +2 -2
- 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 +2 -2
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +2 -2
- 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/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/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- 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/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +3 -3
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +0 -42
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +32 -48
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +31 -39
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +15 -19
- 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 +26 -76
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +14 -18
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- 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/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +9 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/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/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/distribution/BasicDistribution.sol +7 -5
- package/contracts/distribution/Distribution.sol +10 -8
- package/contracts/distribution/DistributionService.sol +18 -17
- package/contracts/distribution/IDistributionService.sol +14 -13
- package/contracts/examples/fire/FireProduct.sol +1 -2
- package/contracts/examples/unpermissioned/SimpleProduct.sol +4 -4
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/IInstance.sol +1 -1
- package/contracts/instance/Instance.sol +1 -1
- package/contracts/instance/InstanceAdmin.sol +9 -14
- package/contracts/instance/InstanceReader.sol +12 -0
- package/contracts/instance/module/IDistribution.sol +2 -1
- package/contracts/product/IRiskService.sol +5 -8
- package/contracts/product/PolicyService.sol +16 -41
- package/contracts/product/Product.sol +6 -15
- package/contracts/product/RiskService.sol +6 -7
- package/contracts/staking/IStaking.sol +1 -1
- package/contracts/staking/IStakingService.sol +1 -3
- package/contracts/staking/StakeManagerLib.sol +6 -62
- package/contracts/staking/Staking.sol +7 -11
- package/contracts/staking/StakingService.sol +2 -21
- package/contracts/type/RiskId.sol +4 -3
- package/package.json +1 -1
@@ -144,9 +144,14 @@
|
|
144
144
|
{
|
145
145
|
"inputs": [
|
146
146
|
{
|
147
|
-
"internalType": "
|
147
|
+
"internalType": "NftId",
|
148
|
+
"name": "productNftId",
|
149
|
+
"type": "uint96"
|
150
|
+
},
|
151
|
+
{
|
152
|
+
"internalType": "bytes32",
|
148
153
|
"name": "risk",
|
149
|
-
"type": "
|
154
|
+
"type": "bytes32"
|
150
155
|
}
|
151
156
|
],
|
152
157
|
"name": "toRiskId",
|
@@ -174,8 +179,8 @@
|
|
174
179
|
"type": "function"
|
175
180
|
}
|
176
181
|
],
|
177
|
-
"bytecode": "
|
178
|
-
"deployedBytecode": "
|
182
|
+
"bytecode": "0x6103da610034600b8282823980515f1a607314602857634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061009b575f3560e01c80637bc32ecf1161006e5780637bc32ecf146101425780638a3065c1146101555780638b0d9ff0146101a4578063b2e508a6146101b8578063bc1b392d146101ce575f80fd5b806301809eea1461009f5780632cf96bf9146100d057806355ee6275146100fe57806370a021ec1461011f575b5f80fd5b6100b26100ad3660046102bd565b6101d4565b6040516001600160c01b031990911681526020015b60405180910390f35b6100eb6100de3660046102f5565b6001600160c01b03191690565b60405160ff1990911681526020016100c7565b61011161010c3660046102f5565b6101fb565b6040519081526020016100c7565b61013261012d36600461030e565b610292565b60405190151581526020016100c7565b6101326101503660046102f5565b6102ab565b6100b261016336600461033f565b604080516bffffffffffffffffffffffff841660208201529081018290525f9060600160405160208183030381529060405280519060200120905092915050565b6101116101b23660046102f5565b60c01c90565b6101326101c63660046102f5565b60c01c151590565b5f6100b2565b80680100000000000000006101e98260c01c90565b106101f6576101f6610379565b919050565b5f73__$4b9aaffa8d044614668dad578b824b8eee$__63f48016ce602c6001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af4158015610268573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061028c919061038d565b92915050565b5f6001600160c01b0319808416908316145b9392505050565b5f6001600160c01b031982161561028c565b5f602082840312156102cd575f80fd5b813560ff19811681146102a4575f80fd5b80356001600160c01b0319811681146101f6575f80fd5b5f60208284031215610305575f80fd5b6102a4826102de565b5f806040838503121561031f575f80fd5b610328836102de565b9150610336602084016102de565b90509250929050565b5f8060408385031215610350575f80fd5b82356bffffffffffffffffffffffff8116811461036b575f80fd5b946020939093013593505050565b634e487b7160e01b5f52600160045260245ffd5b5f6020828403121561039d575f80fd5b505191905056fea2646970667358221220675dcb6c26090d8eed37201a05cb7130d14f0592ea21ac450da0c215cc4dba6364736f6c634300081a0033",
|
183
|
+
"deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061009b575f3560e01c80637bc32ecf1161006e5780637bc32ecf146101425780638a3065c1146101555780638b0d9ff0146101a4578063b2e508a6146101b8578063bc1b392d146101ce575f80fd5b806301809eea1461009f5780632cf96bf9146100d057806355ee6275146100fe57806370a021ec1461011f575b5f80fd5b6100b26100ad3660046102bd565b6101d4565b6040516001600160c01b031990911681526020015b60405180910390f35b6100eb6100de3660046102f5565b6001600160c01b03191690565b60405160ff1990911681526020016100c7565b61011161010c3660046102f5565b6101fb565b6040519081526020016100c7565b61013261012d36600461030e565b610292565b60405190151581526020016100c7565b6101326101503660046102f5565b6102ab565b6100b261016336600461033f565b604080516bffffffffffffffffffffffff841660208201529081018290525f9060600160405160208183030381529060405280519060200120905092915050565b6101116101b23660046102f5565b60c01c90565b6101326101c63660046102f5565b60c01c151590565b5f6100b2565b80680100000000000000006101e98260c01c90565b106101f6576101f6610379565b919050565b5f73__$4b9aaffa8d044614668dad578b824b8eee$__63f48016ce602c6001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af4158015610268573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061028c919061038d565b92915050565b5f6001600160c01b0319808416908316145b9392505050565b5f6001600160c01b031982161561028c565b5f602082840312156102cd575f80fd5b813560ff19811681146102a4575f80fd5b80356001600160c01b0319811681146101f6575f80fd5b5f60208284031215610305575f80fd5b6102a4826102de565b5f806040838503121561031f575f80fd5b610328836102de565b9150610336602084016102de565b90509250929050565b5f8060408385031215610350575f80fd5b82356bffffffffffffffffffffffff8116811461036b575f80fd5b946020939093013593505050565b634e487b7160e01b5f52600160045260245ffd5b5f6020828403121561039d575f80fd5b505191905056fea2646970667358221220675dcb6c26090d8eed37201a05cb7130d14f0592ea21ac450da0c215cc4dba6364736f6c634300081a0033",
|
179
184
|
"linkReferences": {
|
180
185
|
"contracts/type/Key32.sol": {
|
181
186
|
"Key32Lib": [
|
@@ -1,15 +1,17 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
5
|
+
|
4
6
|
import {Distribution} from "./Distribution.sol";
|
7
|
+
import {DistributorType} from "../type/DistributorType.sol";
|
5
8
|
import {DISTRIBUTOR} from "../type/ObjectType.sol";
|
6
|
-
import {
|
9
|
+
import {Fee} from "../type/Fee.sol";
|
7
10
|
import {NftId} from "../type/NftId.sol";
|
8
11
|
import {ReferralId} from "../type/Referral.sol";
|
9
|
-
import {
|
10
|
-
import {UFixed} from "../type/UFixed.sol";
|
11
|
-
import {DistributorType} from "../type/DistributorType.sol";
|
12
|
+
import {Seconds} from "../type/Seconds.sol";
|
12
13
|
import {Timestamp} from "../type/Timestamp.sol";
|
14
|
+
import {UFixed} from "../type/UFixed.sol";
|
13
15
|
|
14
16
|
|
15
17
|
contract BasicDistribution is
|
@@ -37,7 +39,7 @@ contract BasicDistribution is
|
|
37
39
|
UFixed maxDiscountPercentage,
|
38
40
|
UFixed commissionPercentage,
|
39
41
|
uint32 maxReferralCount,
|
40
|
-
|
42
|
+
Seconds maxReferralLifetime,
|
41
43
|
bool allowSelfReferrals,
|
42
44
|
bool allowRenewals,
|
43
45
|
bytes memory data
|
@@ -1,19 +1,21 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {Amount} from "../type/Amount.sol";
|
5
|
-
import {COMPONENT, DISTRIBUTION, DISTRIBUTOR} from "../type/ObjectType.sol";
|
6
4
|
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
5
|
+
import {IComponentService} from "../shared/IComponentService.sol";
|
6
|
+
import {IDistributionComponent} from "./IDistributionComponent.sol";
|
7
7
|
import {IDistributionService} from "./IDistributionService.sol";
|
8
|
+
|
9
|
+
import {Amount} from "../type/Amount.sol";
|
10
|
+
import {COMPONENT, DISTRIBUTION, DISTRIBUTOR} from "../type/ObjectType.sol";
|
11
|
+
import {DistributorType} from "../type/DistributorType.sol";
|
12
|
+
import {Fee} from "../type/Fee.sol";
|
8
13
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
9
14
|
import {ReferralId, ReferralStatus, ReferralLib} from "../type/Referral.sol";
|
10
|
-
import {Fee} from "../type/Fee.sol";
|
11
15
|
import {InstanceLinkedComponent} from "../shared/InstanceLinkedComponent.sol";
|
12
|
-
import {
|
13
|
-
import {IDistributionComponent} from "./IDistributionComponent.sol";
|
14
|
-
import {UFixed} from "../type/UFixed.sol";
|
15
|
-
import {DistributorType} from "../type/DistributorType.sol";
|
16
|
+
import {Seconds} from "../type/Seconds.sol";
|
16
17
|
import {Timestamp} from "../type/Timestamp.sol";
|
18
|
+
import {UFixed} from "../type/UFixed.sol";
|
17
19
|
|
18
20
|
|
19
21
|
abstract contract Distribution is
|
@@ -180,7 +182,7 @@ abstract contract Distribution is
|
|
180
182
|
UFixed maxDiscountPercentage,
|
181
183
|
UFixed commissionPercentage,
|
182
184
|
uint32 maxReferralCount,
|
183
|
-
|
185
|
+
Seconds maxReferralLifetime,
|
184
186
|
bool allowSelfReferrals,
|
185
187
|
bool allowRenewals,
|
186
188
|
bytes memory data
|
@@ -2,27 +2,28 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {IAccountingService} from "../accounting/IAccountingService.sol";
|
5
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
6
|
-
import {IInstance} from "../instance/IInstance.sol";
|
7
5
|
import {IComponentService} from "../shared/IComponentService.sol";
|
6
|
+
import {IDistribution} from "../instance/module/IDistribution.sol";
|
7
|
+
import {IDistributionService} from "./IDistributionService.sol";
|
8
|
+
import {IInstance} from "../instance/IInstance.sol";
|
8
9
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
10
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
9
11
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
10
|
-
import {InstanceReader} from "../instance/InstanceReader.sol";
|
11
12
|
import {IComponents} from "../instance/module/IComponents.sol";
|
12
13
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
13
14
|
|
14
15
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
16
|
+
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
17
|
+
import {DistributorType, DistributorTypeLib} from "../type/DistributorType.sol";
|
15
18
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
16
19
|
import {KEEP_STATE} from "../type/StateId.sol";
|
17
20
|
import {ObjectType, ACCOUNTING, COMPONENT, DISTRIBUTION, INSTANCE, DISTRIBUTION, DISTRIBUTOR, REGISTRY} from "../type/ObjectType.sol";
|
18
|
-
import {
|
19
|
-
import {
|
20
|
-
import {UFixed} from "../type/UFixed.sol";
|
21
|
-
import {DistributorType, DistributorTypeLib} from "../type/DistributorType.sol";
|
21
|
+
import {InstanceReader} from "../instance/InstanceReader.sol";
|
22
|
+
import {InstanceStore} from "../instance/InstanceStore.sol";
|
22
23
|
import {ReferralId, ReferralLib} from "../type/Referral.sol";
|
24
|
+
import {Seconds} from "../type/Seconds.sol";
|
23
25
|
import {Timestamp, TimestampLib} from "../type/Timestamp.sol";
|
24
|
-
import {
|
25
|
-
import {InstanceStore} from "../instance/InstanceStore.sol";
|
26
|
+
import {UFixed} from "../type/UFixed.sol";
|
26
27
|
|
27
28
|
|
28
29
|
contract DistributionService is
|
@@ -64,7 +65,7 @@ contract DistributionService is
|
|
64
65
|
UFixed maxDiscountPercentage,
|
65
66
|
UFixed commissionPercentage,
|
66
67
|
uint32 maxReferralCount,
|
67
|
-
|
68
|
+
Seconds maxReferralLifetime,
|
68
69
|
bool allowSelfReferrals,
|
69
70
|
bool allowRenewals,
|
70
71
|
bytes memory data
|
@@ -171,10 +172,10 @@ contract DistributionService is
|
|
171
172
|
(NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
|
172
173
|
|
173
174
|
if (bytes(code).length == 0) {
|
174
|
-
revert
|
175
|
+
revert ErrorDistributionServiceInvalidReferral(code);
|
175
176
|
}
|
176
177
|
if (expiryAt.eqz() || expiryAt.lte(TimestampLib.blockTimestamp())) {
|
177
|
-
revert
|
178
|
+
revert ErrorDistributionServiceExpirationInvalid(expiryAt);
|
178
179
|
}
|
179
180
|
|
180
181
|
{
|
@@ -183,16 +184,16 @@ contract DistributionService is
|
|
183
184
|
IDistribution.DistributorTypeInfo memory distributorTypeData = instanceReader.getDistributorTypeInfo(distributorType);
|
184
185
|
|
185
186
|
if (distributorTypeData.maxReferralCount < maxReferrals) {
|
186
|
-
revert
|
187
|
+
revert ErrorDistributionServiceMaxReferralsExceeded(distributorTypeData.maxReferralCount);
|
187
188
|
}
|
188
189
|
if (distributorTypeData.minDiscountPercentage > discountPercentage) {
|
189
|
-
revert
|
190
|
+
revert ErrorDistributionServiceDiscountTooLow(distributorTypeData.minDiscountPercentage.toInt(), discountPercentage.toInt());
|
190
191
|
}
|
191
192
|
if (distributorTypeData.maxDiscountPercentage < discountPercentage) {
|
192
|
-
revert
|
193
|
+
revert ErrorDistributionServiceDiscountTooHigh(distributorTypeData.maxDiscountPercentage.toInt(), discountPercentage.toInt());
|
193
194
|
}
|
194
|
-
if (expiryAt.toInt() - TimestampLib.blockTimestamp().toInt() > distributorTypeData.maxReferralLifetime) {
|
195
|
-
revert
|
195
|
+
if (expiryAt.toInt() - TimestampLib.blockTimestamp().toInt() > distributorTypeData.maxReferralLifetime.toInt()) {
|
196
|
+
revert ErrorDistributionServiceExpiryTooLong(distributorTypeData.maxReferralLifetime, expiryAt);
|
196
197
|
}
|
197
198
|
}
|
198
199
|
|
@@ -8,30 +8,31 @@ 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
17
|
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
|
18
|
+
error ErrorDistributionServiceParentNftIdNotInstance(NftId nftId, NftId parentNftId);
|
19
|
+
error ErrorDistributionServiceCallerNotDistributor(address caller);
|
20
|
+
error ErrorDistributionServiceInvalidReferralId(ReferralId referralId);
|
21
|
+
error ErrorDistributionServiceMaxReferralsExceeded(uint256 maxReferrals);
|
22
|
+
error ErrorDistributionServiceDiscountTooLow(uint256 minDiscountPercentage, uint256 discountPercentage);
|
23
|
+
error ErrorDistributionServiceDiscountTooHigh(uint256 maxDiscountPercentage, uint256 discountPercentage);
|
24
|
+
error ErrorDistributionServiceExpiryTooLong(Seconds maxReferralLifetime, Timestamp expiryAt);
|
25
|
+
error ErrorDistributionServiceInvalidReferral(string code);
|
26
|
+
error ErrorDistributionServiceExpirationInvalid(Timestamp expiryAt);
|
27
|
+
error ErrorDistributionServiceCommissionTooHigh(uint256 commissionPercentage, uint256 maxCommissionPercentage);
|
28
|
+
error ErrorDistributionServiceMinFeeTooHigh(uint256 minFee, uint256 limit);
|
28
29
|
|
29
30
|
error ErrorDistributionServiceCommissionWithdrawAmountExceedsLimit(Amount amount, Amount limit);
|
30
31
|
|
31
32
|
error ErrorDistributionServiceVariableFeesTooHight(uint256 maxDiscountPercentage, uint256 limit);
|
32
33
|
error ErrorDistributionServiceMaxDiscountTooHigh(uint256 maxDiscountPercentage, uint256 limit);
|
33
34
|
|
34
|
-
error
|
35
|
+
error ErrorDistributionServiceReferralInvalid(NftId distributionNftId, ReferralId referralId);
|
35
36
|
error ErrorDistributionServiceInvalidFeeTransferred(Amount transferredDistributionFeeAmount, Amount expectedDistributionFeeAmount);
|
36
37
|
|
37
38
|
event LogDistributionServiceCommissionWithdrawn(NftId distributorNftId, address recipient, address tokenAddress, Amount amount);
|
@@ -42,7 +43,7 @@ interface IDistributionService is IService {
|
|
42
43
|
UFixed maxDiscountPercentage,
|
43
44
|
UFixed commissionPercentage,
|
44
45
|
uint32 maxReferralCount,
|
45
|
-
|
46
|
+
Seconds maxReferralLifetime,
|
46
47
|
bool allowSelfReferrals,
|
47
48
|
bool allowRenewals,
|
48
49
|
bytes memory data
|
@@ -252,8 +252,7 @@ contract FireProduct is
|
|
252
252
|
return _riskMapping[cityName];
|
253
253
|
}
|
254
254
|
_cities.push(cityName);
|
255
|
-
risk =
|
256
|
-
_createRisk(risk, "");
|
255
|
+
risk = _createRisk(bytes32(abi.encodePacked(cityName)), "");
|
257
256
|
_riskMapping[cityName] = risk;
|
258
257
|
}
|
259
258
|
|
@@ -85,11 +85,11 @@ contract SimpleProduct is
|
|
85
85
|
|
86
86
|
|
87
87
|
function createRisk(
|
88
|
-
|
88
|
+
string memory id,
|
89
89
|
bytes memory data
|
90
|
-
) public {
|
91
|
-
_createRisk(
|
92
|
-
id,
|
90
|
+
) public returns (RiskId) {
|
91
|
+
return _createRisk(
|
92
|
+
bytes32(abi.encodePacked(id)),
|
93
93
|
data
|
94
94
|
);
|
95
95
|
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {BasicProductAuthorization} from "../../product/BasicProductAuthorization.sol";
|
5
|
+
import {IAccess} from "../../authorization/IAccess.sol";
|
6
|
+
import {PUBLIC_ROLE} from "../../type/RoleId.sol";
|
7
|
+
import {SimpleProduct} from "./SimpleProduct.sol";
|
8
|
+
|
9
|
+
contract SimpleProductAuthorization
|
10
|
+
is BasicProductAuthorization
|
11
|
+
{
|
12
|
+
constructor(string memory componentName)
|
13
|
+
BasicProductAuthorization(componentName)
|
14
|
+
{}
|
15
|
+
|
16
|
+
function _setupTargetAuthorizations()
|
17
|
+
internal
|
18
|
+
virtual override
|
19
|
+
{
|
20
|
+
super._setupTargetAuthorizations();
|
21
|
+
|
22
|
+
// authorize public role (open access to any account, only allows to lock target)
|
23
|
+
IAccess.FunctionInfo[] storage functions;
|
24
|
+
functions = _authorizeForTarget(getMainTargetName(), PUBLIC_ROLE());
|
25
|
+
_authorize(functions, SimpleProduct.approveTokenHandler.selector, "approveTokenHandler");
|
26
|
+
_authorize(functions, SimpleProduct.setWallet.selector, "setWallet");
|
27
|
+
}
|
28
|
+
}
|
@@ -59,7 +59,7 @@ interface IInstance is
|
|
59
59
|
|
60
60
|
// get products
|
61
61
|
function products() external view returns (uint256 productCount);
|
62
|
-
function
|
62
|
+
function getProductNftId(uint256 idx) external view returns (NftId productNftId);
|
63
63
|
|
64
64
|
// get supporting contracts
|
65
65
|
function getInstanceReader() external view returns (InstanceReader);
|
@@ -219,7 +219,7 @@ contract Instance is
|
|
219
219
|
return _products.length;
|
220
220
|
}
|
221
221
|
|
222
|
-
function
|
222
|
+
function getProductNftId(uint256 idx) external view returns (NftId productNftId) {
|
223
223
|
return _products[idx];
|
224
224
|
}
|
225
225
|
|
@@ -137,19 +137,7 @@ contract InstanceAdmin is
|
|
137
137
|
|
138
138
|
// create other roles
|
139
139
|
IAuthorization authorization = component.getAuthorization();
|
140
|
-
_createRoles(authorization);
|
141
|
-
|
142
|
-
// TODO cleanup
|
143
|
-
// FunctionInfo[] memory functions = new FunctionInfo[](2);
|
144
|
-
// functions[0] = toFunction(TokenHandler.pullToken.selector, "pullToken");
|
145
|
-
// functions[1] = toFunction(TokenHandler.pushToken.selector, "pushToken");
|
146
|
-
|
147
|
-
// // FIXME: make this a bit nicer and work with IAuthorization. Use a specific role, not public - access to TokenHandler must be restricted
|
148
|
-
// _authorizeTargetFunctions(
|
149
|
-
// address(component.getTokenHandler()),
|
150
|
-
// getPublicRole(),
|
151
|
-
// functions);
|
152
|
-
|
140
|
+
_createRoles(authorization);
|
153
141
|
_createTargetAuthorizations(authorization);
|
154
142
|
}
|
155
143
|
|
@@ -215,7 +203,14 @@ contract InstanceAdmin is
|
|
215
203
|
_setTargetClosed(target, locked);
|
216
204
|
}
|
217
205
|
|
218
|
-
|
206
|
+
/// @dev Returns the number of components that have been registered with this instance.
|
207
|
+
function components()
|
208
|
+
external
|
209
|
+
view
|
210
|
+
returns (uint64)
|
211
|
+
{
|
212
|
+
return _components;
|
213
|
+
}
|
219
214
|
|
220
215
|
/// @dev Returns the instance authorization specification used to set up this instance admin.
|
221
216
|
function getInstanceAuthorization()
|
@@ -88,6 +88,18 @@ contract InstanceReader {
|
|
88
88
|
return _instance;
|
89
89
|
}
|
90
90
|
|
91
|
+
function components() public view returns (uint256 componentCount) {
|
92
|
+
return _instance.getInstanceAdmin().components();
|
93
|
+
}
|
94
|
+
|
95
|
+
function products() public view returns (uint256 productCount) {
|
96
|
+
return _instance.products();
|
97
|
+
}
|
98
|
+
|
99
|
+
function getProductNftId(uint256 idx) public view returns (NftId productNftId) {
|
100
|
+
return _instance.getProductNftId(idx);
|
101
|
+
}
|
102
|
+
|
91
103
|
// module specific functions
|
92
104
|
|
93
105
|
function getPolicyInfo(NftId policyNftId)
|
@@ -4,6 +4,7 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {Amount} from "../../type/Amount.sol";
|
5
5
|
import {DistributorType} from "../../type/DistributorType.sol";
|
6
6
|
import {NftId} from "../../type/NftId.sol";
|
7
|
+
import {Seconds} from "../../type/Seconds.sol";
|
7
8
|
import {Timestamp} from "../../type/Timestamp.sol";
|
8
9
|
import {UFixed} from "../../type/UFixed.sol";
|
9
10
|
|
@@ -15,7 +16,7 @@ interface IDistribution {
|
|
15
16
|
UFixed maxDiscountPercentage;
|
16
17
|
UFixed commissionPercentage;
|
17
18
|
uint32 maxReferralCount;
|
18
|
-
|
19
|
+
Seconds maxReferralLifetime;
|
19
20
|
bool allowSelfReferrals;
|
20
21
|
bool allowRenewals;
|
21
22
|
bytes data;
|
@@ -1,23 +1,20 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IRisk} from "../instance/module/IRisk.sol";
|
5
4
|
import {IService} from "../shared/IService.sol";
|
6
5
|
|
7
|
-
import {NftId} from "../type/NftId.sol";
|
8
|
-
import {ReferralId} from "../type/Referral.sol";
|
9
6
|
import {RiskId} from "../type/RiskId.sol";
|
10
7
|
import {StateId} from "../type/StateId.sol";
|
11
|
-
import {Timestamp} from "../type/Timestamp.sol";
|
12
|
-
import {UFixed} from "../type/UFixed.sol";
|
13
|
-
import {Fee} from "../type/Fee.sol";
|
14
8
|
|
15
9
|
interface IRiskService is IService {
|
16
10
|
|
11
|
+
/// @dev Create a new risk with the given id and provided data.
|
12
|
+
/// The key of the risk derived from the risk id in comination with the product NftId.
|
13
|
+
/// Risk data is stored in the instance store.
|
17
14
|
function createRisk(
|
18
|
-
|
15
|
+
bytes32 id,
|
19
16
|
bytes memory data
|
20
|
-
) external;
|
17
|
+
) external returns (RiskId riskId);
|
21
18
|
|
22
19
|
|
23
20
|
function updateRisk(
|
@@ -545,30 +545,21 @@ contract PolicyService is
|
|
545
545
|
}
|
546
546
|
}
|
547
547
|
|
548
|
-
|
549
|
-
/// @dev checks
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
// if (balance < premium) {
|
565
|
-
// revert ErrorPolicyServiceBalanceInsufficient(policyHolder, premium, balance);
|
566
|
-
// }
|
567
|
-
|
568
|
-
// if (allowance < premium) {
|
569
|
-
// revert ErrorPolicyServiceAllowanceInsufficient(policyHolder, tokenHandlerAddress, premium, allowance);
|
570
|
-
// }
|
571
|
-
// }
|
548
|
+
|
549
|
+
/// @dev checks that policy has been collateralized and has been activated.
|
550
|
+
/// does not check if policy has been expired or closed.
|
551
|
+
function _policyHasBeenActivated(
|
552
|
+
StateId policyState,
|
553
|
+
IPolicy.PolicyInfo memory policyInfo
|
554
|
+
)
|
555
|
+
internal
|
556
|
+
view
|
557
|
+
returns (bool)
|
558
|
+
{
|
559
|
+
if (policyState != COLLATERALIZED()) { return false; }
|
560
|
+
if (TimestampLib.blockTimestamp() < policyInfo.activatedAt) { return false; }
|
561
|
+
return true;
|
562
|
+
}
|
572
563
|
|
573
564
|
|
574
565
|
function _policyHolderPolicyActivated(
|
@@ -629,22 +620,6 @@ contract PolicyService is
|
|
629
620
|
}
|
630
621
|
|
631
622
|
|
632
|
-
// TODO cleanup
|
633
|
-
// function _getTokenHandler(
|
634
|
-
// InstanceReader instanceReader,
|
635
|
-
// NftId productNftId
|
636
|
-
// )
|
637
|
-
// internal
|
638
|
-
// virtual
|
639
|
-
// view
|
640
|
-
// returns (
|
641
|
-
// TokenHandler tokenHandler
|
642
|
-
// )
|
643
|
-
// {
|
644
|
-
// tokenHandler = instanceReader.getTokenHandler(productNftId).tokenHandler;
|
645
|
-
// }
|
646
|
-
|
647
|
-
|
648
623
|
function _getDistributionNftAndWallets(
|
649
624
|
InstanceReader instanceReader,
|
650
625
|
NftId productNftId
|
@@ -688,7 +663,7 @@ contract PolicyService is
|
|
688
663
|
PRODUCT(), // caller must be product
|
689
664
|
true); // only active caller
|
690
665
|
|
691
|
-
productNftId = productInfo.nftId;
|
666
|
+
productNftId = productInfo.nftId; // calling product nft id
|
692
667
|
instance = IInstance(instanceAddress);
|
693
668
|
policyInfo = instance.getInstanceReader().getPolicyInfo(policyNftId);
|
694
669
|
|