@etherisc/gif-next 0.0.2-de7c770-422 → 0.0.2-de9ede4-391
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +28 -7
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1000 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +746 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +767 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +103 -63
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +67 -11
- 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 +60 -32
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +40 -3
- 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/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +4 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +1196 -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 +159 -209
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +82 -22
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +99 -125
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +180 -86
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +139 -64
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +87 -108
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +52 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1441 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +502 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +1991 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +470 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +187 -169
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +470 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +131 -157
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +282 -194
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +502 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +564 -249
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +470 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +147 -42
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +116 -48
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +53 -101
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +149 -60
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +196 -138
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +58 -85
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +687 -84
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +118 -148
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +107 -44
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +475 -116
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +810 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +46 -5
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +119 -169
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +84 -24
- 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 +82 -103
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +43 -9
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +95 -121
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +147 -79
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +127 -40
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +115 -141
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +114 -22
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +148 -150
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +121 -70
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +48 -33
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +102 -134
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +272 -185
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +115 -152
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +413 -263
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +144 -45
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +119 -45
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +103 -40
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +158 -138
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +82 -22
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +200 -86
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +144 -61
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +63 -7
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +64 -8
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +178 -19
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +80 -51
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +141 -116
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +29 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +328 -119
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +150 -55
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +170 -107
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +119 -48
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +154 -134
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +81 -26
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +101 -34
- 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 +91 -15
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +114 -35
- 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 +135 -51
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +220 -182
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +94 -172
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +99 -32
- 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 +123 -225
- 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 +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +72 -80
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +483 -477
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +141 -76
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +47 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +488 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +61 -64
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +425 -261
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +82 -103
- 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 +16 -6
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +29 -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 +29 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +94 -120
- 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 +18 -8
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +66 -8
- 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 +47 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +388 -35
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +395 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +88 -24
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +79 -100
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +29 -21
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +3 -3
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +158 -170
- 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 +120 -54
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +7 -12
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +87 -53
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +103 -36
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +145 -104
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +3 -3
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +33 -9
- 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 +3 -3
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +4 -0
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +23 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +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 +99 -5
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/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/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +16 -3
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +79 -27
- 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 +263 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +45 -0
- package/contracts/authorization/AccessAdmin.sol +82 -56
- package/contracts/authorization/Authorization.sol +111 -39
- package/contracts/authorization/IAccess.sol +1 -0
- package/contracts/authorization/IAccessAdmin.sol +4 -3
- package/contracts/authorization/IAuthorization.sol +13 -7
- package/contracts/authorization/IServiceAuthorization.sol +3 -1
- package/contracts/authorization/ReleaseAccessManager.sol +38 -0
- package/contracts/authorization/ServiceAuthorization.sol +26 -10
- package/contracts/distribution/BasicDistribution.sol +8 -7
- package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
- package/contracts/distribution/Distribution.sol +32 -40
- package/contracts/distribution/DistributionService.sol +86 -65
- package/contracts/distribution/DistributionServiceManager.sol +6 -6
- package/contracts/distribution/IDistributionComponent.sol +1 -1
- package/contracts/distribution/IDistributionService.sol +5 -6
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +90 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +35 -0
- package/contracts/examples/fire/FireProduct.sol +436 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +45 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +11 -4
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -4
- package/contracts/examples/unpermissioned/SimplePool.sol +37 -6
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +24 -23
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +38 -34
- package/contracts/instance/IInstance.sol +11 -3
- package/contracts/instance/IInstanceService.sol +7 -29
- package/contracts/instance/Instance.sol +36 -26
- package/contracts/instance/InstanceAdmin.sol +57 -54
- package/contracts/instance/InstanceAuthorizationV3.sol +50 -32
- package/contracts/instance/InstanceReader.sol +187 -21
- package/contracts/instance/InstanceService.sol +54 -129
- package/contracts/instance/InstanceServiceManager.sol +6 -7
- package/contracts/instance/InstanceStore.sol +12 -2
- package/contracts/instance/RiskSet.sol +119 -0
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +2 -1
- package/contracts/instance/base/ObjectSet.sol +24 -25
- package/contracts/instance/module/IComponents.sol +20 -7
- package/contracts/instance/module/IPolicy.sol +4 -3
- package/contracts/instance/module/IRisk.sol +1 -0
- package/contracts/oracle/BasicOracle.sol +0 -1
- package/contracts/oracle/IOracleService.sol +2 -1
- package/contracts/oracle/Oracle.sol +4 -15
- package/contracts/oracle/OracleService.sol +110 -80
- package/contracts/oracle/OracleServiceManager.sol +6 -6
- package/contracts/pool/BasicPool.sol +33 -24
- package/contracts/pool/BasicPoolAuthorization.sol +12 -2
- package/contracts/pool/BundleService.sol +74 -87
- package/contracts/pool/BundleServiceManager.sol +6 -6
- package/contracts/pool/IBundleService.sol +2 -15
- package/contracts/pool/IPoolComponent.sol +19 -15
- package/contracts/pool/IPoolService.sol +30 -37
- package/contracts/pool/Pool.sol +141 -122
- package/contracts/pool/PoolService.sol +263 -157
- package/contracts/pool/PoolServiceManager.sol +4 -4
- package/contracts/product/ApplicationService.sol +31 -20
- package/contracts/product/ApplicationServiceManager.sol +4 -4
- package/contracts/product/BasicProduct.sol +8 -12
- package/contracts/product/BasicProductAuthorization.sol +1 -3
- package/contracts/product/ClaimService.sol +233 -106
- package/contracts/product/ClaimServiceManager.sol +4 -4
- package/contracts/product/IApplicationService.sol +5 -2
- package/contracts/product/IClaimService.sol +3 -2
- package/contracts/product/IPolicyService.sol +25 -8
- package/contracts/product/IPricingService.sol +9 -9
- package/contracts/product/IProductComponent.sol +23 -3
- package/contracts/product/PolicyService.sol +361 -198
- package/contracts/product/PolicyServiceManager.sol +4 -4
- package/contracts/product/PricingService.sol +10 -11
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +76 -74
- package/contracts/product/RiskService.sol +16 -6
- package/contracts/product/RiskServiceManager.sol +4 -4
- package/contracts/registry/ChainNft.sol +10 -11
- package/contracts/registry/IRegistry.sol +8 -3
- package/contracts/registry/IRegistryService.sol +5 -12
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +29 -6
- package/contracts/registry/RegistryAdmin.sol +29 -36
- package/contracts/registry/RegistryService.sol +33 -44
- package/contracts/registry/RegistryServiceManager.sol +2 -2
- package/contracts/registry/ReleaseLifecycle.sol +6 -3
- package/contracts/registry/ReleaseRegistry.sol +205 -210
- package/contracts/registry/ServiceAuthorizationV3.sol +58 -50
- package/contracts/shared/Component.sol +56 -105
- package/contracts/shared/ComponentService.sol +384 -329
- package/contracts/shared/ComponentServiceManager.sol +8 -5
- package/contracts/shared/ComponentVerifyingService.sol +27 -16
- package/contracts/shared/ContractLib.sol +224 -0
- package/contracts/shared/IComponent.sol +6 -14
- package/contracts/shared/IComponentService.sol +45 -37
- package/contracts/shared/IInstanceLinkedComponent.sol +3 -22
- package/contracts/shared/ILifecycle.sol +3 -1
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IPolicyHolder.sol +12 -13
- package/contracts/shared/IRegisterable.sol +11 -0
- package/contracts/shared/InstanceLinkedComponent.sol +68 -43
- package/contracts/shared/KeyValueStore.sol +1 -1
- package/contracts/shared/Lifecycle.sol +15 -4
- package/contracts/shared/NftOwnable.sol +23 -3
- package/contracts/shared/PolicyHolder.sol +11 -5
- package/contracts/shared/Registerable.sol +15 -7
- package/contracts/shared/RegistryLinked.sol +6 -12
- package/contracts/shared/Service.sol +16 -14
- package/contracts/shared/TokenHandler.sol +316 -66
- package/contracts/shared/TokenHandlerDeployerLib.sol +10 -2
- package/contracts/staking/IStaking.sol +9 -4
- package/contracts/staking/IStakingService.sol +0 -3
- package/contracts/staking/Staking.sol +42 -25
- package/contracts/staking/StakingManager.sol +8 -6
- package/contracts/staking/StakingReader.sol +12 -5
- package/contracts/staking/StakingService.sol +56 -23
- package/contracts/staking/StakingServiceManager.sol +2 -2
- package/contracts/type/Amount.sol +15 -0
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +7 -0
- package/contracts/type/ObjectType.sol +14 -0
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/RiskId.sol +30 -4
- package/contracts/type/RoleId.sol +0 -12
- package/contracts/type/StateId.sol +14 -1
- package/contracts/type/UFixed.sol +13 -119
- package/contracts/upgradeability/ProxyManager.sol +68 -34
- package/contracts/upgradeability/Versionable.sol +2 -2
- package/package.json +4 -3
- 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/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- 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/shared/InitializableCustom.sol +0 -177
@@ -2,7 +2,7 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {Amount} from "../type/Amount.sol";
|
5
|
-
import {COMPONENT, DISTRIBUTION} from "../type/ObjectType.sol";
|
5
|
+
import {COMPONENT, DISTRIBUTION, DISTRIBUTOR} from "../type/ObjectType.sol";
|
6
6
|
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
7
7
|
import {IDistributionService} from "./IDistributionService.sol";
|
8
8
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
@@ -36,13 +36,30 @@ abstract contract Distribution is
|
|
36
36
|
_;
|
37
37
|
}
|
38
38
|
|
39
|
-
|
39
|
+
|
40
|
+
function processRenewal(
|
41
|
+
ReferralId referralId,
|
42
|
+
uint256 feeAmount
|
43
|
+
)
|
40
44
|
external
|
41
45
|
virtual
|
42
|
-
|
46
|
+
restricted()
|
43
47
|
{
|
44
|
-
|
45
|
-
|
48
|
+
// default is no action
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
/// @inheritdoc IDistributionComponent
|
53
|
+
function withdrawCommission(NftId distributorNftId, Amount amount)
|
54
|
+
external
|
55
|
+
virtual
|
56
|
+
restricted()
|
57
|
+
onlyDistributor()
|
58
|
+
onlyNftOfType(distributorNftId, DISTRIBUTOR())
|
59
|
+
onlyNftOwner(distributorNftId)
|
60
|
+
returns (Amount withdrawnAmount)
|
61
|
+
{
|
62
|
+
return _withdrawCommission(distributorNftId, amount);
|
46
63
|
}
|
47
64
|
|
48
65
|
|
@@ -106,42 +123,19 @@ abstract contract Distribution is
|
|
106
123
|
}
|
107
124
|
|
108
125
|
|
109
|
-
function processRenewal(
|
110
|
-
ReferralId referralId,
|
111
|
-
uint256 feeAmount
|
112
|
-
)
|
113
|
-
external
|
114
|
-
virtual
|
115
|
-
restricted()
|
116
|
-
{
|
117
|
-
// default is no action
|
118
|
-
}
|
119
|
-
|
120
126
|
/// @dev Returns true iff the component needs to be called when selling/renewing policis
|
121
127
|
function isVerifying() external pure returns (bool verifying) {
|
122
128
|
return true;
|
123
129
|
}
|
124
130
|
|
125
|
-
|
126
|
-
function withdrawCommission(NftId distributorNftId, Amount amount)
|
127
|
-
external
|
128
|
-
virtual
|
129
|
-
restricted()
|
130
|
-
onlyDistributor()
|
131
|
-
onlyNftOwner(distributorNftId)
|
132
|
-
returns (Amount withdrawnAmount)
|
133
|
-
{
|
134
|
-
return _withdrawCommission(distributorNftId, amount);
|
135
|
-
}
|
136
|
-
|
131
|
+
|
137
132
|
function _initializeDistribution(
|
138
133
|
address registry,
|
139
|
-
NftId
|
134
|
+
NftId productNftId,
|
140
135
|
IAuthorization authorization,
|
141
136
|
address initialOwner,
|
142
137
|
string memory name,
|
143
138
|
address token,
|
144
|
-
bytes memory registryData, // writeonly data that will saved in the object info record of the registry
|
145
139
|
bytes memory componentData // component specifidc data
|
146
140
|
)
|
147
141
|
internal
|
@@ -150,14 +144,13 @@ abstract contract Distribution is
|
|
150
144
|
{
|
151
145
|
_initializeInstanceLinkedComponent(
|
152
146
|
registry,
|
153
|
-
|
147
|
+
productNftId,
|
154
148
|
name,
|
155
149
|
token,
|
156
150
|
DISTRIBUTION(),
|
157
151
|
authorization,
|
158
152
|
true,
|
159
153
|
initialOwner,
|
160
|
-
registryData,
|
161
154
|
componentData);
|
162
155
|
|
163
156
|
DistributionStorage storage $ = _getDistributionStorage();
|
@@ -233,7 +226,7 @@ abstract contract Distribution is
|
|
233
226
|
}
|
234
227
|
|
235
228
|
/// @dev Uptates the distributor type for the specified distributor.
|
236
|
-
function
|
229
|
+
function _changeDistributorType(
|
237
230
|
NftId distributorNftId,
|
238
231
|
DistributorType distributorType,
|
239
232
|
bytes memory data
|
@@ -242,11 +235,10 @@ abstract contract Distribution is
|
|
242
235
|
virtual
|
243
236
|
{
|
244
237
|
DistributionStorage storage $ = _getDistributionStorage();
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
// data);
|
238
|
+
$._distributionService.changeDistributorType(
|
239
|
+
distributorNftId,
|
240
|
+
distributorType,
|
241
|
+
data);
|
250
242
|
}
|
251
243
|
|
252
244
|
/// @dev Create a new referral code for the provided distributor.
|
@@ -279,9 +271,9 @@ abstract contract Distribution is
|
|
279
271
|
return _getDistributionStorage()._distributionService.withdrawCommission(distributorNftId, amount);
|
280
272
|
}
|
281
273
|
|
282
|
-
function _nftTransferFrom(address from, address to, uint256 tokenId) internal virtual override {
|
274
|
+
function _nftTransferFrom(address from, address to, uint256 tokenId, address operator) internal virtual override {
|
283
275
|
// keep track of distributor nft owner
|
284
|
-
emit LogDistributorUpdated(to,
|
276
|
+
emit LogDistributorUpdated(to, operator);
|
285
277
|
DistributionStorage storage $ = _getDistributionStorage();
|
286
278
|
$._distributorNftId[from] = NftIdLib.zero();
|
287
279
|
$._distributorNftId[to] = NftIdLib.toNftId(tokenId);
|
@@ -1,6 +1,7 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {IAccountingService} from "../accounting/IAccountingService.sol";
|
4
5
|
import {IRegistry} from "../registry/IRegistry.sol";
|
5
6
|
import {IInstance} from "../instance/IInstance.sol";
|
6
7
|
import {IComponentService} from "../shared/IComponentService.sol";
|
@@ -13,7 +14,7 @@ import {IPolicy} from "../instance/module/IPolicy.sol";
|
|
13
14
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
14
15
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
15
16
|
import {KEEP_STATE} from "../type/StateId.sol";
|
16
|
-
import {ObjectType, COMPONENT, DISTRIBUTION, INSTANCE, DISTRIBUTION, DISTRIBUTOR, REGISTRY} from "../type/ObjectType.sol";
|
17
|
+
import {ObjectType, ACCOUNTING, COMPONENT, DISTRIBUTION, INSTANCE, DISTRIBUTION, DISTRIBUTOR, REGISTRY} from "../type/ObjectType.sol";
|
17
18
|
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
18
19
|
import {IDistributionService} from "./IDistributionService.sol";
|
19
20
|
import {UFixed} from "../type/UFixed.sol";
|
@@ -28,6 +29,7 @@ contract DistributionService is
|
|
28
29
|
ComponentVerifyingService,
|
29
30
|
IDistributionService
|
30
31
|
{
|
32
|
+
IAccountingService private _accountingService;
|
31
33
|
IComponentService private _componentService;
|
32
34
|
IInstanceService private _instanceService;
|
33
35
|
IRegistryService private _registryService;
|
@@ -40,13 +42,14 @@ contract DistributionService is
|
|
40
42
|
virtual override
|
41
43
|
initializer()
|
42
44
|
{
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
// owner is DistributionServiceManager deployer
|
48
|
-
_initializeService(registryAddress, address(0), owner);
|
45
|
+
(
|
46
|
+
address registryAddress,
|
47
|
+
address authority
|
48
|
+
) = abi.decode(data, (address, address));
|
49
49
|
|
50
|
+
_initializeService(registryAddress, authority, owner);
|
51
|
+
|
52
|
+
_accountingService = IAccountingService(_getServiceAddress(ACCOUNTING()));
|
50
53
|
_componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
51
54
|
_instanceService = IInstanceService(_getServiceAddress(INSTANCE()));
|
52
55
|
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
@@ -70,10 +73,10 @@ contract DistributionService is
|
|
70
73
|
returns (DistributorType distributorType)
|
71
74
|
{
|
72
75
|
(NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
|
73
|
-
InstanceReader instanceReader = instance.getInstanceReader();
|
76
|
+
// InstanceReader instanceReader = instance.getInstanceReader();
|
74
77
|
|
75
78
|
{
|
76
|
-
NftId productNftId = _getProductNftId(
|
79
|
+
NftId productNftId = _getProductNftId(distributionNftId);
|
77
80
|
IComponents.ProductInfo memory productInfo = instance.getInstanceReader().getProductInfo(productNftId);
|
78
81
|
|
79
82
|
UFixed variableDistributionFees = productInfo.distributionFee.fractionalFee;
|
@@ -136,21 +139,20 @@ contract DistributionService is
|
|
136
139
|
instance.getInstanceStore().createDistributor(distributorNftId, info);
|
137
140
|
}
|
138
141
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
// }
|
142
|
+
function changeDistributorType(
|
143
|
+
NftId distributorNftId,
|
144
|
+
DistributorType distributorType,
|
145
|
+
bytes memory data
|
146
|
+
)
|
147
|
+
external
|
148
|
+
virtual
|
149
|
+
{
|
150
|
+
(,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
|
151
|
+
IDistribution.DistributorInfo memory distributorInfo = instance.getInstanceReader().getDistributorInfo(distributorNftId);
|
152
|
+
distributorInfo.distributorType = distributorType;
|
153
|
+
distributorInfo.data = data;
|
154
|
+
instance.getInstanceStore().updateDistributor(distributorNftId, distributorInfo, KEEP_STATE());
|
155
|
+
}
|
154
156
|
|
155
157
|
|
156
158
|
function createReferral(
|
@@ -163,6 +165,7 @@ contract DistributionService is
|
|
163
165
|
)
|
164
166
|
external
|
165
167
|
virtual
|
168
|
+
onlyNftOfType(distributorNftId, DISTRIBUTOR())
|
166
169
|
returns (ReferralId referralId)
|
167
170
|
{
|
168
171
|
(NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
|
@@ -170,40 +173,43 @@ contract DistributionService is
|
|
170
173
|
if (bytes(code).length == 0) {
|
171
174
|
revert ErrorIDistributionServiceInvalidReferral(code);
|
172
175
|
}
|
173
|
-
if (expiryAt.eqz()) {
|
176
|
+
if (expiryAt.eqz() || expiryAt.lte(TimestampLib.blockTimestamp())) {
|
174
177
|
revert ErrorIDistributionServiceExpirationInvalid(expiryAt);
|
175
178
|
}
|
176
179
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
+
{
|
181
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
182
|
+
DistributorType distributorType = instanceReader.getDistributorInfo(distributorNftId).distributorType;
|
183
|
+
IDistribution.DistributorTypeInfo memory distributorTypeData = instanceReader.getDistributorTypeInfo(distributorType);
|
180
184
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
185
|
+
if (distributorTypeData.maxReferralCount < maxReferrals) {
|
186
|
+
revert ErrorIDistributionServiceMaxReferralsExceeded(distributorTypeData.maxReferralCount);
|
187
|
+
}
|
188
|
+
if (distributorTypeData.minDiscountPercentage > discountPercentage) {
|
189
|
+
revert ErrorIDistributionServiceDiscountTooLow(distributorTypeData.minDiscountPercentage.toInt(), discountPercentage.toInt());
|
190
|
+
}
|
191
|
+
if (distributorTypeData.maxDiscountPercentage < discountPercentage) {
|
192
|
+
revert ErrorIDistributionServiceDiscountTooHigh(distributorTypeData.maxDiscountPercentage.toInt(), discountPercentage.toInt());
|
193
|
+
}
|
194
|
+
if (expiryAt.toInt() - TimestampLib.blockTimestamp().toInt() > distributorTypeData.maxReferralLifetime) {
|
195
|
+
revert ErrorIDistributionServiceExpiryTooLong(distributorTypeData.maxReferralLifetime, expiryAt.toInt());
|
196
|
+
}
|
192
197
|
}
|
193
198
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
199
|
+
{
|
200
|
+
referralId = ReferralLib.toReferralId(distributionNftId, code);
|
201
|
+
IDistribution.ReferralInfo memory info = IDistribution.ReferralInfo(
|
202
|
+
distributorNftId,
|
203
|
+
code,
|
204
|
+
discountPercentage,
|
205
|
+
maxReferrals,
|
206
|
+
0, // used referrals
|
207
|
+
expiryAt,
|
208
|
+
data
|
209
|
+
);
|
210
|
+
|
211
|
+
instance.getInstanceStore().createReferral(referralId, info);
|
212
|
+
}
|
207
213
|
}
|
208
214
|
|
209
215
|
/// @inheritdoc IDistributionService
|
@@ -213,10 +219,14 @@ contract DistributionService is
|
|
213
219
|
)
|
214
220
|
external
|
215
221
|
virtual
|
216
|
-
restricted
|
222
|
+
restricted()
|
223
|
+
onlyNftOfType(distributionNftId, DISTRIBUTION())
|
217
224
|
{
|
218
225
|
if (referralIsValid(distributionNftId, referralId)) {
|
219
|
-
|
226
|
+
IRegistry registry = getRegistry();
|
227
|
+
IRegistry.ObjectInfo memory distributionInfo = registry.getObjectInfo(distributionNftId);
|
228
|
+
IInstance instance = _getInstanceForComponent(registry, distributionInfo.parentNftId);
|
229
|
+
|
220
230
|
// update book keeping for referral info
|
221
231
|
IDistribution.ReferralInfo memory referralInfo = instance.getInstanceReader().getReferralInfo(referralId);
|
222
232
|
referralInfo.usedReferrals += 1;
|
@@ -231,9 +241,12 @@ contract DistributionService is
|
|
231
241
|
)
|
232
242
|
external
|
233
243
|
virtual
|
234
|
-
restricted
|
244
|
+
restricted()
|
245
|
+
onlyNftOfType(distributionNftId, DISTRIBUTION())
|
235
246
|
{
|
236
|
-
|
247
|
+
IRegistry registry = getRegistry();
|
248
|
+
IRegistry.ObjectInfo memory distributionInfo = registry.getObjectInfo(distributionNftId);
|
249
|
+
IInstance instance = _getInstanceForComponent(registry, distributionInfo.parentNftId);
|
237
250
|
InstanceReader reader = instance.getInstanceReader();
|
238
251
|
InstanceStore store = instance.getInstanceStore();
|
239
252
|
|
@@ -245,12 +258,12 @@ contract DistributionService is
|
|
245
258
|
|
246
259
|
// increase distribution balance by commission amount and distribution owner fee
|
247
260
|
Amount commissionAmount = premium.commissionAmount;
|
248
|
-
|
261
|
+
_accountingService.increaseDistributionBalance(store, distributionNftId, commissionAmount, distributionOwnerFee);
|
249
262
|
|
250
263
|
// update book keeping for referral info
|
251
264
|
IDistribution.ReferralInfo memory referralInfo = reader.getReferralInfo(referralId);
|
252
265
|
|
253
|
-
|
266
|
+
_accountingService.increaseDistributorBalance(store, referralInfo.distributorNftId, AmountLib.zero(), commissionAmount);
|
254
267
|
|
255
268
|
// update book keeping for distributor info
|
256
269
|
IDistribution.DistributorInfo memory distributorInfo = reader.getDistributorInfo(referralInfo.distributorNftId);
|
@@ -258,7 +271,7 @@ contract DistributionService is
|
|
258
271
|
store.updateDistributor(referralInfo.distributorNftId, distributorInfo, KEEP_STATE());
|
259
272
|
} else {
|
260
273
|
// increase distribution balance by distribution owner fee
|
261
|
-
|
274
|
+
_accountingService.increaseDistributionBalance(store, distributionNftId, AmountLib.zero(), distributionOwnerFee);
|
262
275
|
}
|
263
276
|
}
|
264
277
|
|
@@ -267,13 +280,14 @@ contract DistributionService is
|
|
267
280
|
public
|
268
281
|
virtual
|
269
282
|
// TODO: restricted() (once #462 is done)
|
283
|
+
onlyNftOfType(distributorNftId, DISTRIBUTOR())
|
270
284
|
returns (Amount withdrawnAmount)
|
271
285
|
{
|
272
286
|
(NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
|
273
287
|
InstanceReader reader = instance.getInstanceReader();
|
274
288
|
|
275
289
|
IComponents.ComponentInfo memory distributionInfo = reader.getComponentInfo(distributionNftId);
|
276
|
-
address distributionWallet = distributionInfo.
|
290
|
+
address distributionWallet = distributionInfo.tokenHandler.getWallet();
|
277
291
|
|
278
292
|
Amount commissionAmount = reader.getFeeAmount(distributorNftId);
|
279
293
|
|
@@ -291,9 +305,9 @@ contract DistributionService is
|
|
291
305
|
{
|
292
306
|
InstanceStore store = instance.getInstanceStore();
|
293
307
|
// decrease fee counter for distribution balance
|
294
|
-
|
308
|
+
_accountingService.decreaseDistributionBalance(store, distributionNftId, withdrawnAmount, AmountLib.zero());
|
295
309
|
// decrease fee counter for distributor fee
|
296
|
-
|
310
|
+
_accountingService.decreaseDistributorBalance(store, distributorNftId, AmountLib.zero(), withdrawnAmount);
|
297
311
|
}
|
298
312
|
|
299
313
|
// transfer amount to distributor
|
@@ -304,12 +318,19 @@ contract DistributionService is
|
|
304
318
|
}
|
305
319
|
}
|
306
320
|
|
307
|
-
function referralIsValid(NftId distributionNftId, ReferralId referralId)
|
321
|
+
function referralIsValid(NftId distributionNftId, ReferralId referralId)
|
322
|
+
public
|
323
|
+
view
|
324
|
+
onlyNftOfType(distributionNftId, DISTRIBUTION())
|
325
|
+
returns (bool isValid)
|
326
|
+
{
|
308
327
|
if (distributionNftId.eqz() || referralId.eqz()) {
|
309
328
|
return false;
|
310
329
|
}
|
311
330
|
|
312
|
-
|
331
|
+
IRegistry registry = getRegistry();
|
332
|
+
IRegistry.ObjectInfo memory distributionInfo = registry.getObjectInfo(distributionNftId);
|
333
|
+
IInstance instance = _getInstanceForComponent(registry, distributionInfo.parentNftId);
|
313
334
|
IDistribution.ReferralInfo memory info = instance.getInstanceReader().getReferralInfo(referralId);
|
314
335
|
|
315
336
|
if (info.distributorNftId.eqz()) {
|
@@ -326,7 +347,7 @@ contract DistributionService is
|
|
326
347
|
returns(IInstance instance)
|
327
348
|
{
|
328
349
|
NftId instanceNftId = getRegistry().getObjectInfo(distributionNftId).parentNftId;
|
329
|
-
address instanceAddress = getRegistry().
|
350
|
+
address instanceAddress = getRegistry().getObjectAddress(instanceNftId);
|
330
351
|
return IInstance(instanceAddress);
|
331
352
|
}
|
332
353
|
|
@@ -12,15 +12,15 @@ contract DistributionServiceManager is ProxyManager {
|
|
12
12
|
/// @dev initializes proxy manager with distribution service implementation and deploys instance
|
13
13
|
constructor(
|
14
14
|
address authority,
|
15
|
-
address
|
15
|
+
address registry,
|
16
16
|
bytes32 salt
|
17
17
|
)
|
18
|
-
ProxyManager(registryAddress)
|
19
18
|
{
|
20
|
-
DistributionService
|
21
|
-
bytes memory data = abi.encode(
|
22
|
-
IVersionable versionable =
|
23
|
-
|
19
|
+
DistributionService svc = new DistributionService{salt: salt}();
|
20
|
+
bytes memory data = abi.encode(registry, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registry,
|
23
|
+
address(svc),
|
24
24
|
data,
|
25
25
|
salt);
|
26
26
|
|
@@ -12,7 +12,7 @@ interface IDistributionComponent is IInstanceLinkedComponent {
|
|
12
12
|
error ErrorDistributionNotDistributor(address distributor);
|
13
13
|
error ErrorDistributionAlreadyDistributor(address distributor, NftId distributorNftId);
|
14
14
|
|
15
|
-
event LogDistributorUpdated(address to, address
|
15
|
+
event LogDistributorUpdated(address to, address operator);
|
16
16
|
|
17
17
|
/// @dev Returns true iff the provided address is registered as a distributor with this distribution component.
|
18
18
|
function isDistributor(address candidate) external view returns (bool);
|
@@ -56,12 +56,11 @@ interface IDistributionService is IService {
|
|
56
56
|
bytes memory data
|
57
57
|
) external returns (NftId distributorNftId);
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
// ) external;
|
59
|
+
function changeDistributorType(
|
60
|
+
NftId distributorNftId,
|
61
|
+
DistributorType distributorType,
|
62
|
+
bytes memory data
|
63
|
+
) external;
|
65
64
|
|
66
65
|
function createReferral(
|
67
66
|
NftId distributorNftId,
|
@@ -0,0 +1,59 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
type DamageLevel is uint8;
|
5
|
+
|
6
|
+
// type bindings
|
7
|
+
using {
|
8
|
+
DamageLevelLib.eq,
|
9
|
+
DamageLevelLib.eqz,
|
10
|
+
DamageLevelLib.toInt
|
11
|
+
} for DamageLevel global;
|
12
|
+
|
13
|
+
// solhint-disable-next-line func-name-mixedcase
|
14
|
+
function DAMAGE_SMALL() pure returns (DamageLevel) {
|
15
|
+
return DamageLevel.wrap(1);
|
16
|
+
}
|
17
|
+
|
18
|
+
// solhint-disable-next-line func-name-mixedcase
|
19
|
+
function DAMAGE_MEDIUM() pure returns (DamageLevel) {
|
20
|
+
return DamageLevel.wrap(2);
|
21
|
+
}
|
22
|
+
|
23
|
+
// solhint-disable-next-line func-name-mixedcase
|
24
|
+
function DAMAGE_LARGE() pure returns (DamageLevel) {
|
25
|
+
return DamageLevel.wrap(3);
|
26
|
+
}
|
27
|
+
|
28
|
+
library DamageLevelLib {
|
29
|
+
|
30
|
+
error ErrorDamageLeveLibInvalidDamageLevel(uint8 damageLevel);
|
31
|
+
|
32
|
+
function zero() internal pure returns (DamageLevel) {
|
33
|
+
return DamageLevel.wrap(0);
|
34
|
+
}
|
35
|
+
|
36
|
+
function toDamageLevel(uint8 damage) internal pure returns (DamageLevel) {
|
37
|
+
if (damage == 1) {
|
38
|
+
return DAMAGE_SMALL();
|
39
|
+
} else if (damage == 2) {
|
40
|
+
return DAMAGE_MEDIUM();
|
41
|
+
} else if (damage == 3) {
|
42
|
+
return DAMAGE_LARGE();
|
43
|
+
} else {
|
44
|
+
revert ErrorDamageLeveLibInvalidDamageLevel(damage);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
function toInt(DamageLevel damageLevel) internal pure returns (uint8) {
|
49
|
+
return uint8(DamageLevel.unwrap(damageLevel));
|
50
|
+
}
|
51
|
+
|
52
|
+
function eq(DamageLevel a, DamageLevel b) internal pure returns (bool) {
|
53
|
+
return DamageLevel.unwrap(a) == DamageLevel.unwrap(b);
|
54
|
+
}
|
55
|
+
|
56
|
+
function eqz(DamageLevel a) internal pure returns (bool) {
|
57
|
+
return DamageLevel.unwrap(a) == 0;
|
58
|
+
}
|
59
|
+
}
|
@@ -0,0 +1,90 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
|
+
|
6
|
+
import {Amount, AmountLib} from "../../type/Amount.sol";
|
7
|
+
import {BasicPool} from "../../pool/BasicPool.sol";
|
8
|
+
import {Fee} from "../../type/Fee.sol";
|
9
|
+
import {IAuthorization} from "../../authorization/IAuthorization.sol";
|
10
|
+
import {IComponents} from "../../instance/module/IComponents.sol";
|
11
|
+
import {NftId} from "../../type/NftId.sol";
|
12
|
+
import {Seconds} from "../../type/Timestamp.sol";
|
13
|
+
import {UFixed, UFixedLib} from "../../type/UFixed.sol";
|
14
|
+
|
15
|
+
contract FirePool is
|
16
|
+
BasicPool
|
17
|
+
{
|
18
|
+
constructor(
|
19
|
+
address registry,
|
20
|
+
NftId fireProductNftId,
|
21
|
+
string memory componentName,
|
22
|
+
address token,
|
23
|
+
IAuthorization authorization
|
24
|
+
)
|
25
|
+
{
|
26
|
+
address initialOwner = msg.sender;
|
27
|
+
_intialize(
|
28
|
+
registry,
|
29
|
+
fireProductNftId,
|
30
|
+
componentName,
|
31
|
+
token,
|
32
|
+
IComponents.PoolInfo({
|
33
|
+
maxBalanceAmount: AmountLib.max(),
|
34
|
+
isInterceptingBundleTransfers: false,
|
35
|
+
isProcessingConfirmedClaims: false,
|
36
|
+
isExternallyManaged: false,
|
37
|
+
isVerifyingApplications: false,
|
38
|
+
collateralizationLevel: UFixedLib.one(),
|
39
|
+
retentionLevel: UFixedLib.one()
|
40
|
+
}),
|
41
|
+
authorization,
|
42
|
+
initialOwner);
|
43
|
+
}
|
44
|
+
|
45
|
+
function _intialize(
|
46
|
+
address registry,
|
47
|
+
NftId fireProductNftId,
|
48
|
+
string memory componentName,
|
49
|
+
address token,
|
50
|
+
IComponents.PoolInfo memory poolInfo,
|
51
|
+
IAuthorization authorization,
|
52
|
+
address initialOwner
|
53
|
+
)
|
54
|
+
internal
|
55
|
+
initializer
|
56
|
+
{
|
57
|
+
_initializeBasicPool(
|
58
|
+
registry,
|
59
|
+
fireProductNftId,
|
60
|
+
componentName,
|
61
|
+
token,
|
62
|
+
poolInfo,
|
63
|
+
authorization,
|
64
|
+
initialOwner);
|
65
|
+
}
|
66
|
+
|
67
|
+
function createBundle(
|
68
|
+
Fee memory fee,
|
69
|
+
Amount initialAmount,
|
70
|
+
Seconds lifetime
|
71
|
+
)
|
72
|
+
external
|
73
|
+
virtual
|
74
|
+
restricted()
|
75
|
+
returns(NftId bundleNftId, Amount netStakedAmount)
|
76
|
+
{
|
77
|
+
address owner = msg.sender;
|
78
|
+
bundleNftId = _createBundle(
|
79
|
+
owner,
|
80
|
+
fee,
|
81
|
+
lifetime,
|
82
|
+
"" // filter
|
83
|
+
);
|
84
|
+
netStakedAmount = _stake(bundleNftId, initialAmount);
|
85
|
+
}
|
86
|
+
|
87
|
+
function approveTokenHandler(IERC20Metadata token, Amount amount) external restricted() onlyOwner() { _approveTokenHandler(token, amount); }
|
88
|
+
function setLocked(bool locked) external onlyOwner() { _setLocked(locked); }
|
89
|
+
function setWallet(address newWallet) external restricted() onlyOwner() { _setWallet(newWallet); }
|
90
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
4
|
+
pragma solidity ^0.8.20;
|
5
|
+
|
6
|
+
import {BasicPoolAuthorization} from "../../pool/BasicPoolAuthorization.sol";
|
7
|
+
import {FirePool} from "./FirePool.sol";
|
8
|
+
import {IAccess} from "../../../contracts/authorization/IAccess.sol";
|
9
|
+
import {PUBLIC_ROLE} from "../../../contracts/type/RoleId.sol";
|
10
|
+
|
11
|
+
contract FirePoolAuthorization
|
12
|
+
is BasicPoolAuthorization
|
13
|
+
{
|
14
|
+
|
15
|
+
constructor(string memory poolName)
|
16
|
+
BasicPoolAuthorization(poolName)
|
17
|
+
{}
|
18
|
+
|
19
|
+
|
20
|
+
function _setupTargetAuthorizations()
|
21
|
+
internal
|
22
|
+
virtual override
|
23
|
+
{
|
24
|
+
super._setupTargetAuthorizations();
|
25
|
+
IAccess.FunctionInfo[] storage functions;
|
26
|
+
|
27
|
+
// authorize public role (open access to any account, only allows to lock target)
|
28
|
+
functions = _authorizeForTarget(getTargetName(), PUBLIC_ROLE());
|
29
|
+
// TODO: FirePool.createBundle must require a custom role (e.g. INVESTOR) instead of PUBLIC_ROLE
|
30
|
+
_authorize(functions, FirePool.approveTokenHandler.selector, "approveTokenHandler");
|
31
|
+
_authorize(functions, FirePool.createBundle.selector, "createBundle");
|
32
|
+
}
|
33
|
+
|
34
|
+
}
|
35
|
+
|