@etherisc/gif-next 0.0.2-e802d97-251 → 0.0.2-e83e4a5-207
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +18 -2
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1253 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1206 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +358 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.json +10 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1032 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +258 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +290 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +148 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +390 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +190 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1505 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +410 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +17 -242
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +138 -93
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +65 -57
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +71 -146
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +45 -16
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +33 -108
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +58 -78
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +147 -40
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +72 -140
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1208 -290
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +601 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +110 -76
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +210 -103
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +49 -49
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +84 -135
- 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/Cloneable.sol/Cloneable.json +0 -53
- 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 +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +182 -0
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +3 -78
- 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/mock/Dip.sol/Dip.json +2 -2
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +1155 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +418 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +43 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +13 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +13 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +13 -96
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +66 -29
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +44 -32
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1477 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +410 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +78 -49
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +50 -42
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +13 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +7 -202
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +13 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +7 -303
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +62 -41
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +42 -38
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +66 -37
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +44 -36
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1299 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +410 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +106 -69
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +64 -52
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +13 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +13 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +13 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +13 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +13 -42
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.json +13 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +84 -47
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +53 -41
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +92 -63
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +57 -49
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +13 -153
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +54 -25
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +38 -30
- 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 +0 -44
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +13 -0
- 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 +24 -68
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1505 -166
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +50 -13
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +37 -25
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +164 -0
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +185 -318
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +214 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +4 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +82 -85
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +52 -60
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +13 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +2 -2
- 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/IComponentService.sol/IComponentService.json +13 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +13 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +11 -5
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +0 -5
- 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/IService.sol/IService.json +13 -0
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +13 -53
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +15 -89
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +4 -65
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +22 -22
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +6 -6
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +6 -6
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +14 -14
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +8 -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 +13 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +6 -6
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +49 -7
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +44 -28
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +44 -84
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +164 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +40 -56
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +6 -6
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +92 -73
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +39 -47
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +197 -149
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +22 -22
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +8 -8
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +2 -2
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +4 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +4 -4
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +12 -12
- 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/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +4 -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 +136 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +4 -4
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +4 -4
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +4 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +219 -6
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +2 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +4 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +21 -2
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +2 -2
- package/contracts/authorization/AccessAdmin.sol +591 -0
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/Authorization.sol +218 -0
- package/contracts/authorization/IAccess.sol +48 -0
- package/contracts/authorization/IAccessAdmin.sol +136 -0
- package/contracts/authorization/IAuthorization.sol +54 -0
- package/contracts/authorization/IModuleAuthorization.sol +21 -0
- package/contracts/authorization/IServiceAuthorization.sol +38 -0
- package/contracts/authorization/ModuleAuthorization.sol +78 -0
- package/contracts/authorization/ServiceAuthorization.sol +90 -0
- package/contracts/distribution/BasicDistribution.sol +149 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +43 -0
- package/contracts/distribution/Distribution.sol +126 -104
- package/contracts/distribution/DistributionService.sol +13 -9
- package/contracts/distribution/IDistributionComponent.sol +17 -35
- package/contracts/distribution/IDistributionService.sol +5 -1
- package/contracts/instance/IInstance.sol +11 -7
- package/contracts/instance/IInstanceService.sol +29 -18
- package/contracts/instance/Instance.sol +103 -85
- package/contracts/instance/InstanceAdmin.sol +202 -267
- package/contracts/instance/InstanceAuthorizationV3.sol +202 -0
- package/contracts/instance/InstanceReader.sol +24 -9
- package/contracts/instance/InstanceService.sol +151 -70
- package/contracts/instance/InstanceStore.sol +15 -20
- package/contracts/instance/base/BalanceStore.sol +11 -6
- package/contracts/instance/base/Cloneable.sol +2 -25
- package/contracts/instance/base/ObjectLifecycle.sol +106 -0
- package/contracts/instance/base/ObjectManager.sol +7 -10
- package/contracts/oracle/BasicOracle.sol +48 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +46 -0
- package/contracts/oracle/IOracle.sol +16 -0
- package/contracts/oracle/Oracle.sol +61 -49
- package/contracts/oracle/OracleService.sol +5 -4
- package/contracts/pool/BasicPool.sol +164 -0
- package/contracts/pool/BasicPoolAuthorization.sol +49 -0
- package/contracts/pool/BundleService.sol +19 -19
- package/contracts/pool/IPoolComponent.sol +0 -60
- package/contracts/pool/Pool.sol +143 -131
- package/contracts/pool/PoolService.sol +7 -8
- package/contracts/product/ApplicationService.sol +5 -5
- package/contracts/product/BasicProduct.sol +82 -0
- package/contracts/product/BasicProductAuthorization.sol +40 -0
- package/contracts/product/ClaimService.sol +5 -5
- package/contracts/product/IProductComponent.sol +6 -9
- package/contracts/product/PolicyService.sol +5 -5
- package/contracts/product/PricingService.sol +4 -5
- package/contracts/product/Product.sol +103 -88
- package/contracts/product/ProductService.sol +5 -5
- package/contracts/registry/IRegistry.sol +5 -8
- package/contracts/registry/Registry.sol +6 -4
- package/contracts/registry/RegistryAdmin.sol +276 -148
- package/contracts/registry/RegistryService.sol +5 -5
- package/contracts/registry/RegistryServiceManager.sol +0 -5
- package/contracts/registry/ReleaseLifecycle.sol +27 -0
- package/contracts/registry/ReleaseManager.sol +161 -274
- package/contracts/registry/ServiceAuthorizationV3.sol +200 -0
- package/contracts/shared/ComponentService.sol +24 -61
- package/contracts/shared/ComponentVerifyingService.sol +1 -1
- package/contracts/shared/IInstanceLinkedComponent.sol +4 -0
- package/contracts/shared/IKeyValueStore.sol +1 -0
- package/contracts/shared/ILifecycle.sol +1 -2
- package/contracts/shared/IService.sol +7 -0
- package/contracts/shared/InstanceLinkedComponent.sol +26 -19
- package/contracts/shared/KeyValueStore.sol +6 -2
- package/contracts/shared/Lifecycle.sol +16 -69
- package/contracts/shared/Service.sol +27 -21
- package/contracts/staking/IStakingService.sol +11 -7
- package/contracts/staking/StakeManagerLib.sol +52 -0
- package/contracts/staking/Staking.sol +58 -96
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingService.sol +61 -56
- package/contracts/staking/StakingServiceManager.sol +0 -1
- package/contracts/staking/StakingStore.sol +82 -39
- package/contracts/type/ObjectType.sol +169 -62
- package/contracts/type/RoleId.sol +103 -75
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/String.sol +53 -0
- package/contracts/type/UFixed.sol +6 -0
- package/package.json +4 -1
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -228
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +0 -137
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.json +0 -1193
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.json +0 -1715
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +0 -1728
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +0 -1806
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +0 -1824
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.dbg.json +0 -4
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.json +0 -1562
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.dbg.json +0 -4
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.json +0 -1600
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -377
- package/contracts/registry/ServiceAuthorizationsLib.sol +0 -173
- package/contracts/shared/AccessManagerCustom.sol +0 -736
- package/contracts/shared/AccessManagerExtended.sol +0 -470
- package/contracts/shared/AccessManagerExtendedInitializeable.sol +0 -13
- package/contracts/shared/AccessManagerExtendedWithDisable.sol +0 -137
- package/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol +0 -14
- package/contracts/shared/IAccessManagerExtended.sol +0 -74
- package/contracts/shared/IAccessManagerExtendedWithDisable.sol +0 -18
@@ -11,56 +11,38 @@ import {Timestamp} from "../type/Timestamp.sol";
|
|
11
11
|
|
12
12
|
interface IDistributionComponent is IInstanceLinkedComponent {
|
13
13
|
|
14
|
+
error ErrorDistributionNotDistributor(address distributor);
|
15
|
+
error ErrorDistributionAlreadyDistributor(address distributor, NftId distributorNftId);
|
16
|
+
|
14
17
|
event LogDistributorUpdated(address to, address caller);
|
15
18
|
|
16
|
-
|
17
|
-
|
18
|
-
Fee memory minDistributionOwnerFee
|
19
|
-
) external;
|
19
|
+
/// @dev Returns true iff the provided address is registered as a distributor with this distribution component.
|
20
|
+
function isDistributor(address candidate) external view returns (bool);
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
UFixed minDiscountPercentage,
|
24
|
-
UFixed maxDiscountPercentage,
|
25
|
-
UFixed commissionPercentage,
|
26
|
-
uint32 maxReferralCount,
|
27
|
-
uint32 maxReferralLifetime,
|
28
|
-
bool allowSelfReferrals,
|
29
|
-
bool allowRenewals,
|
30
|
-
bytes memory data
|
31
|
-
) external returns (DistributorType distributorType);
|
22
|
+
/// @dev Returns the distributor Nft Id for the provided address
|
23
|
+
function getDistributorNftId(address distributor) external view returns (NftId distributorNftId);
|
32
24
|
|
33
|
-
function
|
34
|
-
|
35
|
-
|
36
|
-
bytes memory data
|
37
|
-
) external returns(NftId distributorNftId);
|
25
|
+
function getDiscountPercentage(
|
26
|
+
string memory referralCode
|
27
|
+
) external view returns (UFixed discountPercentage, ReferralStatus status);
|
38
28
|
|
39
|
-
function
|
40
|
-
|
41
|
-
|
42
|
-
bytes memory data
|
43
|
-
) external;
|
29
|
+
function getReferralId(
|
30
|
+
string memory referralCode
|
31
|
+
) external returns (ReferralId referralId);
|
44
32
|
|
45
33
|
function calculateRenewalFeeAmount(
|
46
34
|
ReferralId referralId,
|
47
35
|
uint256 netPremiumAmount
|
48
36
|
) external view returns (uint256 feeAmount);
|
49
37
|
|
50
|
-
/// @dev
|
38
|
+
/// @dev Callback function to process a renewal of a policy.
|
39
|
+
/// The default implementation is empty.
|
40
|
+
/// Overwrite this function to implement a use case specific behaviour.
|
51
41
|
function processRenewal(
|
52
42
|
ReferralId referralId,
|
53
43
|
uint256 feeAmount
|
54
44
|
) external;
|
55
45
|
|
56
|
-
|
57
|
-
string memory referralCode
|
58
|
-
) external view returns (UFixed discountPercentage, ReferralStatus status);
|
59
|
-
|
60
|
-
function getReferralId(
|
61
|
-
string memory referralCode
|
62
|
-
) external returns (ReferralId referralId);
|
63
|
-
|
64
|
-
/// @dev returns true iff the component needs to be called when selling/renewing policis
|
46
|
+
/// @dev Returns true to ensure component is called when transferring distributor Nft Ids.
|
65
47
|
function isVerifying() external view returns (bool verifying);
|
66
48
|
}
|
@@ -13,6 +13,7 @@ import {Timestamp} from "../type/Timestamp.sol";
|
|
13
13
|
|
14
14
|
|
15
15
|
interface IDistributionService is IService {
|
16
|
+
|
16
17
|
error ErrorDistributionServiceCallerNotRegistered(address caller);
|
17
18
|
error ErrorIDistributionServiceParentNftIdNotInstance(NftId nftId, NftId parentNftId);
|
18
19
|
error ErrorIDistributionServiceCallerNotDistributor(address caller);
|
@@ -25,7 +26,10 @@ interface IDistributionService is IService {
|
|
25
26
|
error ErrorIDistributionServiceExpirationInvalid(Timestamp expiryAt);
|
26
27
|
error ErrorIDistributionServiceCommissionTooHigh(uint256 commissionPercentage, uint256 maxCommissionPercentage);
|
27
28
|
error ErrorIDistributionServiceMinFeeTooHigh(uint256 minFee, uint256 limit);
|
28
|
-
|
29
|
+
|
30
|
+
error ErrorDistributionServiceVariableFeesTooHight(uint256 maxDiscountPercentage, uint256 limit);
|
31
|
+
error ErrorDistributionServiceMaxDiscountTooHigh(uint256 maxDiscountPercentage, uint256 limit);
|
32
|
+
|
29
33
|
error ErrorIDistributionServiceReferralInvalid(NftId distributionNftId, ReferralId referralId);
|
30
34
|
error ErrorDistributionServiceInvalidFeeTransferred(Amount transferredDistributionFeeAmount, Amount expectedDistributionFeeAmount);
|
31
35
|
|
@@ -3,6 +3,7 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
5
|
|
6
|
+
import {Amount} from "../type/Amount.sol";
|
6
7
|
import {ClaimId} from "../type/ClaimId.sol";
|
7
8
|
import {DistributorType} from "../type/DistributorType.sol";
|
8
9
|
import {PayoutId} from "../type/PayoutId.sol";
|
@@ -13,8 +14,9 @@ import {RiskId} from "../type/RiskId.sol";
|
|
13
14
|
import {VersionPart} from "../type/Version.sol";
|
14
15
|
import {Key32} from "../type/Key32.sol";
|
15
16
|
import {RoleId} from "../type/RoleId.sol";
|
17
|
+
import {Seconds} from "../type/Seconds.sol";
|
18
|
+
import {UFixed} from "../type/UFixed.sol";
|
16
19
|
|
17
|
-
import {AccessManagerExtendedInitializeable} from "../shared/AccessManagerExtendedInitializeable.sol";
|
18
20
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
19
21
|
|
20
22
|
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
@@ -67,16 +69,18 @@ interface IInstance is
|
|
67
69
|
function setTargetFunctionRole(string memory targetName, bytes4[] calldata selectors, RoleId roleId) external;
|
68
70
|
function setTargetLocked(address target, bool locked) external;
|
69
71
|
|
70
|
-
function
|
71
|
-
function
|
72
|
-
function
|
73
|
-
function getPolicyService() external view returns (IPolicyService);
|
74
|
-
function getBundleService() external view returns (IBundleService);
|
72
|
+
function setStakingLockingPeriod(Seconds stakeLockingPeriod) external;
|
73
|
+
function setStakingRewardRate(UFixed rewardRate) external;
|
74
|
+
function refillStakingRewardReserves(Amount dipAmount) external;
|
75
75
|
|
76
|
+
/// @dev Defunds the staking reward reserves for the specified target.
|
77
|
+
/// Permissioned: only the target owner may call this function.
|
78
|
+
function withdrawStakingRewardReserves(Amount dipAmount) external returns (Amount newBalance);
|
79
|
+
|
80
|
+
// get instance release and supporting contracts
|
76
81
|
function getMajorVersion() external pure returns (VersionPart majorVersion);
|
77
82
|
function getInstanceReader() external view returns (InstanceReader);
|
78
83
|
function getBundleManager() external view returns (BundleManager);
|
79
84
|
function getInstanceAdmin() external view returns (InstanceAdmin);
|
80
85
|
function getInstanceStore() external view returns (InstanceStore);
|
81
|
-
function getInstanceAccessManager() external view returns (AccessManagerExtendedInitializeable);
|
82
86
|
}
|
@@ -1,23 +1,28 @@
|
|
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 {BundleManager} from "./BundleManager.sol";
|
6
|
+
import {Instance} from "./Instance.sol";
|
7
|
+
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
8
|
+
import {IService} from "../shared/IService.sol";
|
4
9
|
import {NftId} from "../type/NftId.sol";
|
5
10
|
import {ObjectType} from "../type/ObjectType.sol";
|
6
11
|
import {RoleId} from "../type/RoleId.sol";
|
7
|
-
import {
|
8
|
-
|
9
|
-
import {
|
10
|
-
import {Instance} from "./Instance.sol";
|
11
|
-
import {InstanceReader} from "./InstanceReader.sol";
|
12
|
-
import {BundleManager} from "./BundleManager.sol";
|
13
|
-
import {InstanceStore} from "./InstanceStore.sol";
|
12
|
+
import {Seconds} from "../type/Seconds.sol";
|
13
|
+
import {UFixed} from "../type/UFixed.sol";
|
14
|
+
import {VersionPart} from "../type/Version.sol";
|
14
15
|
|
15
16
|
interface IInstanceService is IService {
|
16
17
|
|
18
|
+
// onlyInstance
|
19
|
+
error ErrorInstanceServiceNotRegistered(address instance);
|
20
|
+
error ErrorInstanceServiceNotInstance(address instance, ObjectType objectType);
|
21
|
+
error ErrorInstanceServiceInstanceVersionMismatch(address instance, VersionPart instanceVersion);
|
22
|
+
|
17
23
|
error ErrorInstanceServiceComponentNotInstanceLinked(address component);
|
18
24
|
|
19
25
|
error ErrorInstanceServiceMasterInstanceAlreadySet();
|
20
|
-
error ErrorInstanceServiceMasterInstanceAccessManagerAlreadySet();
|
21
26
|
error ErrorInstanceServiceMasterInstanceAdminAlreadySet();
|
22
27
|
error ErrorInstanceServiceMasterBundleManagerAlreadySet();
|
23
28
|
error ErrorInstanceServiceInstanceAddressZero();
|
@@ -27,6 +32,7 @@ interface IInstanceService is IService {
|
|
27
32
|
error ErrorInstanceServiceInstanceReaderSameAsMasterInstanceReader();
|
28
33
|
error ErrorInstanceServiceInstanceReaderInstanceMismatch();
|
29
34
|
|
35
|
+
error ErrorInstanceServiceAccessManagerZero();
|
30
36
|
error ErrorInstanceServiceInstanceAdminZero();
|
31
37
|
error ErrorInstanceServiceInstanceReaderZero();
|
32
38
|
error ErrorInstanceServiceBundleManagerZero();
|
@@ -39,28 +45,33 @@ interface IInstanceService is IService {
|
|
39
45
|
error ErrorInstanceServiceInstanceStoreAuthorityMismatch();
|
40
46
|
|
41
47
|
error ErrorInstanceServiceRequestUnauhorized(address caller);
|
42
|
-
error
|
48
|
+
error ErrorInstanceServiceNotInstanceNftId(NftId nftId);
|
43
49
|
error ErrorInstanceServiceComponentNotRegistered(address componentAddress);
|
44
50
|
error ErrorInstanceServiceInstanceComponentMismatch(NftId instanceNftId, NftId componentNftId);
|
45
51
|
error ErrorInstanceServiceInvalidComponentType(address componentAddress, ObjectType expectedType, ObjectType componentType);
|
46
52
|
|
47
|
-
event LogInstanceCloned(
|
48
|
-
address clonedOzAccessManager,
|
49
|
-
address clonedInstanceAccessManager,
|
50
|
-
address clonedInstance,
|
51
|
-
address clonedInstanceStore,
|
52
|
-
address clonedBundleManager,
|
53
|
-
address clonedInstanceReader,
|
54
|
-
NftId clonedInstanceNftId
|
55
|
-
);
|
53
|
+
event LogInstanceCloned(NftId instanceNftId, address instance);
|
56
54
|
|
57
55
|
function createInstanceClone()
|
58
56
|
external
|
59
57
|
returns (
|
58
|
+
// TODO check if Instance can be changed to IInstance
|
60
59
|
Instance clonedInstance,
|
61
60
|
NftId instanceNftId
|
62
61
|
);
|
63
62
|
|
63
|
+
|
64
|
+
function setStakingLockingPeriod(Seconds stakeLockingPeriod) external;
|
65
|
+
function setStakingRewardRate(UFixed rewardRate) external;
|
66
|
+
function refillStakingRewardReserves(address rewardProvider, Amount dipAmount) external;
|
67
|
+
|
68
|
+
/// @dev Defunds the staking reward reserves for the specified target.
|
69
|
+
function withdrawStakingRewardReserves(Amount dipAmount) external returns (Amount newBalance);
|
70
|
+
|
71
|
+
/// @dev Sets up the component authorization for the specified instance.
|
72
|
+
/// The authorization is based on the authz specification provided by the component via getAuthorization.
|
73
|
+
function initializeAuthorization(NftId instanceNftId, IInstanceLinkedComponent component) external;
|
74
|
+
|
64
75
|
function createComponentTarget(
|
65
76
|
NftId instanceNftId,
|
66
77
|
address targetAddress,
|
@@ -3,24 +3,27 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
5
|
|
6
|
+
import {Amount} from "../type/Amount.sol";
|
6
7
|
import {Key32} from "../type/Key32.sol";
|
7
8
|
import {NftId} from "../type/NftId.sol";
|
8
9
|
import {RiskId} from "../type/RiskId.sol";
|
9
10
|
import {ObjectType, BUNDLE, DISTRIBUTION, INSTANCE, POLICY, POOL, ROLE, PRODUCT, TARGET, COMPONENT, DISTRIBUTOR, DISTRIBUTOR_TYPE} from "../type/ObjectType.sol";
|
10
|
-
import {RoleId
|
11
|
-
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
11
|
+
import {RoleId} from "../type/RoleId.sol";
|
12
12
|
import {ClaimId} from "../type/ClaimId.sol";
|
13
13
|
import {ReferralId} from "../type/Referral.sol";
|
14
14
|
import {PayoutId} from "../type/PayoutId.sol";
|
15
15
|
import {DistributorType} from "../type/DistributorType.sol";
|
16
|
+
import {Seconds} from "../type/Seconds.sol";
|
17
|
+
import {UFixed} from "../type/UFixed.sol";
|
18
|
+
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
16
19
|
|
17
20
|
import {Registerable} from "../shared/Registerable.sol";
|
18
21
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
19
|
-
import {AccessManagerExtendedInitializeable} from "../shared/AccessManagerExtendedInitializeable.sol";
|
20
22
|
|
21
23
|
import {IRegistry} from "../registry/IRegistry.sol";
|
22
24
|
|
23
25
|
import {IInstance} from "./IInstance.sol";
|
26
|
+
import {IInstanceService} from "./IInstanceService.sol";
|
24
27
|
import {InstanceReader} from "./InstanceReader.sol";
|
25
28
|
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
26
29
|
import {BundleManager} from "./BundleManager.sol";
|
@@ -49,6 +52,7 @@ contract Instance is
|
|
49
52
|
|
50
53
|
bool private _initialized;
|
51
54
|
|
55
|
+
IInstanceService internal _instanceService;
|
52
56
|
InstanceAdmin internal _instanceAdmin;
|
53
57
|
InstanceReader internal _instanceReader;
|
54
58
|
BundleManager internal _bundleManager;
|
@@ -61,53 +65,120 @@ contract Instance is
|
|
61
65
|
_;
|
62
66
|
}
|
63
67
|
|
64
|
-
function initialize(
|
68
|
+
function initialize(
|
69
|
+
InstanceAdmin instanceAdmin,
|
70
|
+
InstanceStore instanceStore,
|
71
|
+
BundleManager bundleManager,
|
72
|
+
InstanceReader instanceReader,
|
73
|
+
IRegistry registry,
|
74
|
+
address initialOwner
|
75
|
+
)
|
65
76
|
external
|
66
77
|
initializer()
|
67
78
|
{
|
68
|
-
|
79
|
+
_instanceAdmin = instanceAdmin;
|
80
|
+
if(_instanceAdmin.authority() == address(0)) {
|
81
|
+
// TODO rename error
|
69
82
|
revert ErrorInstanceInstanceAdminZero();
|
70
83
|
}
|
71
84
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
85
|
+
// set authority to instance admin authority
|
86
|
+
__AccessManaged_init(_instanceAdmin.authority());
|
87
|
+
|
88
|
+
// setup instance object info
|
89
|
+
initializeRegisterable(
|
90
|
+
address(registry),
|
91
|
+
registry.getNftId(),
|
92
|
+
INSTANCE(),
|
93
|
+
true,
|
94
|
+
initialOwner,
|
95
|
+
"");
|
96
|
+
|
97
|
+
// store instance supporting contracts
|
98
|
+
_instanceStore = instanceStore;
|
99
|
+
_bundleManager = bundleManager;
|
100
|
+
_instanceReader = instanceReader;
|
101
|
+
|
102
|
+
// initialize instance supporting contracts
|
103
|
+
_instanceStore.initialize();
|
104
|
+
_bundleManager.initialize();
|
105
|
+
_instanceReader.initialize();
|
106
|
+
|
107
|
+
_instanceService = IInstanceService(
|
108
|
+
getRegistry().getServiceAddress(
|
109
|
+
INSTANCE(),
|
110
|
+
getMajorVersion()));
|
76
111
|
|
77
112
|
registerInterface(type(IInstance).interfaceId);
|
78
113
|
}
|
79
114
|
|
115
|
+
//--- Staking ----------------------------------------------------------//
|
116
|
+
|
117
|
+
function setStakingLockingPeriod(Seconds stakeLockingPeriod)
|
118
|
+
external
|
119
|
+
// TODO decide if onlyOwner or restricted to instance owner role is better
|
120
|
+
onlyOwner()
|
121
|
+
{
|
122
|
+
_instanceService.setStakingLockingPeriod(stakeLockingPeriod);
|
123
|
+
}
|
124
|
+
|
125
|
+
function setStakingRewardRate(UFixed rewardRate)
|
126
|
+
external
|
127
|
+
onlyOwner()
|
128
|
+
{
|
129
|
+
_instanceService.setStakingRewardRate(rewardRate);
|
130
|
+
}
|
131
|
+
|
132
|
+
function refillStakingRewardReserves(Amount dipAmount)
|
133
|
+
external
|
134
|
+
onlyOwner()
|
135
|
+
{
|
136
|
+
address instanceOwner = msg.sender;
|
137
|
+
_instanceService.refillStakingRewardReserves(instanceOwner, dipAmount);
|
138
|
+
}
|
139
|
+
|
140
|
+
function withdrawStakingRewardReserves(Amount dipAmount)
|
141
|
+
external
|
142
|
+
onlyOwner()
|
143
|
+
returns (Amount newBalance)
|
144
|
+
{
|
145
|
+
return _instanceService.withdrawStakingRewardReserves(dipAmount);
|
146
|
+
}
|
147
|
+
|
80
148
|
//--- Roles ------------------------------------------------------------//
|
81
149
|
|
82
150
|
function createRole(string memory roleName, string memory adminName)
|
83
151
|
external
|
84
|
-
|
152
|
+
onlyOwner()
|
85
153
|
returns (RoleId roleId, RoleId admin)
|
86
154
|
{
|
87
|
-
|
155
|
+
// TODO refactor
|
156
|
+
// (roleId, admin) = _instanceAdmin.createRole(roleName, adminName);
|
88
157
|
}
|
89
158
|
|
90
159
|
function grantRole(RoleId roleId, address account)
|
91
160
|
external
|
92
|
-
|
161
|
+
onlyOwner()
|
93
162
|
{
|
94
|
-
|
163
|
+
_instanceAdmin.grantRole(roleId, account);
|
95
164
|
}
|
96
165
|
|
97
166
|
function revokeRole(RoleId roleId, address account)
|
98
167
|
external
|
99
|
-
|
168
|
+
onlyOwner()
|
100
169
|
{
|
101
|
-
|
170
|
+
// TODO refactor
|
171
|
+
// AccessManagerExtendedInitializeable(authority()).revokeRole(roleId.toInt(), account);
|
102
172
|
}
|
103
173
|
|
104
174
|
//--- Targets ------------------------------------------------------------//
|
105
175
|
|
106
176
|
function createTarget(address target, string memory name)
|
107
177
|
external
|
108
|
-
|
178
|
+
onlyOwner()
|
109
179
|
{
|
110
|
-
|
180
|
+
// TODO refactor
|
181
|
+
// _instanceAdmin.createTarget(target, name);
|
111
182
|
}
|
112
183
|
|
113
184
|
function setTargetFunctionRole(
|
@@ -116,59 +187,40 @@ contract Instance is
|
|
116
187
|
RoleId roleId
|
117
188
|
)
|
118
189
|
external
|
119
|
-
|
190
|
+
onlyOwner()
|
120
191
|
{
|
121
|
-
|
192
|
+
// TODO refactor
|
193
|
+
// _instanceAdmin.setTargetFunctionRoleByInstance(targetName, selectors, roleId);
|
122
194
|
}
|
123
195
|
|
124
196
|
function setTargetLocked(address target, bool locked)
|
125
197
|
external
|
126
|
-
|
198
|
+
onlyOwner()
|
127
199
|
{
|
128
|
-
|
200
|
+
// TODO refactor
|
201
|
+
// _instanceAdmin.setTargetLockedByInstance(target, locked);
|
129
202
|
}
|
130
203
|
|
131
204
|
//--- ITransferInterceptor ----------------------------------------------//
|
132
205
|
|
133
206
|
// TODO interception of child components nfts
|
134
207
|
function nftMint(address to, uint256 tokenId) external onlyChainNft {
|
135
|
-
|
208
|
+
// TODO refactor
|
209
|
+
// _instanceAdmin.transferInstanceOwnerRole(address(0), to);
|
136
210
|
}
|
137
211
|
|
138
212
|
function nftTransferFrom(address from, address to, uint256 tokenId) external onlyChainNft {
|
139
|
-
|
213
|
+
// TODO refactor
|
214
|
+
// _instanceAdmin.transferInstanceOwnerRole(from, to);
|
140
215
|
}
|
141
216
|
|
142
|
-
//function nftBurn(address from, uint256 tokenId) external onlyChainNft {
|
143
|
-
//_instanceAdmin.transferInstanceOwnerRole(from, address(0));
|
144
|
-
//}
|
145
|
-
|
146
217
|
//--- initial setup functions -------------------------------------------//
|
147
218
|
|
148
|
-
function setInstanceAdmin(InstanceAdmin accessManager) external restricted {
|
149
|
-
if(address(_instanceAdmin) != address(0)) {
|
150
|
-
revert ErrorInstanceInstanceAdminAlreadySet(address(_instanceAdmin));
|
151
|
-
}
|
152
|
-
if(accessManager.authority() != authority()) {
|
153
|
-
revert ErrorInstanceInstanceAdminAuthorityMismatch(authority());
|
154
|
-
}
|
155
|
-
_instanceAdmin = accessManager;
|
156
|
-
}
|
157
|
-
|
158
|
-
function setBundleManager(BundleManager bundleManager) external restricted() {
|
159
|
-
if(address(_bundleManager) != address(0)) {
|
160
|
-
revert ErrorInstanceBundleManagerAlreadySet(address(_bundleManager));
|
161
|
-
}
|
162
|
-
if(bundleManager.getInstance() != Instance(this)) {
|
163
|
-
revert ErrorInstanceBundleManagerInstanceMismatch(address(this));
|
164
|
-
}
|
165
|
-
if(bundleManager.authority() != authority()) {
|
166
|
-
revert ErrorInstanceBundleManagerAuthorityMismatch(authority());
|
167
|
-
}
|
168
|
-
_bundleManager = bundleManager;
|
169
|
-
}
|
170
219
|
|
171
|
-
function setInstanceReader(InstanceReader instanceReader)
|
220
|
+
function setInstanceReader(InstanceReader instanceReader)
|
221
|
+
external
|
222
|
+
restricted()
|
223
|
+
{
|
172
224
|
if(instanceReader.getInstance() != Instance(this)) {
|
173
225
|
revert ErrorInstanceInstanceReaderInstanceMismatch(address(this));
|
174
226
|
}
|
@@ -190,47 +242,13 @@ contract Instance is
|
|
190
242
|
return _instanceAdmin;
|
191
243
|
}
|
192
244
|
|
193
|
-
function getInstanceAccessManager() external view returns (AccessManagerExtendedInitializeable) {
|
194
|
-
return AccessManagerExtendedInitializeable(authority());
|
195
|
-
}
|
196
|
-
|
197
|
-
function setInstanceStore(InstanceStore instanceStore) external restricted {
|
198
|
-
if(address(_instanceStore) != address(0)) {
|
199
|
-
revert ErrorInstanceInstanceStoreAlreadySet(address(_instanceStore));
|
200
|
-
}
|
201
|
-
if(instanceStore.authority() != authority()) {
|
202
|
-
revert ErrorInstanceInstanceStoreAuthorityMismatch(authority());
|
203
|
-
}
|
204
|
-
_instanceStore = instanceStore;
|
205
|
-
}
|
206
|
-
|
207
245
|
function getInstanceStore() external view returns (InstanceStore) {
|
208
246
|
return _instanceStore;
|
209
247
|
}
|
210
248
|
|
211
|
-
function getMajorVersion()
|
249
|
+
function getMajorVersion() public pure returns (VersionPart majorVersion) {
|
212
250
|
return VersionPartLib.toVersionPart(GIF_MAJOR_VERSION);
|
213
251
|
}
|
214
252
|
|
215
|
-
function getDistributionService() external view returns (IDistributionService) {
|
216
|
-
return IDistributionService(getRegistry().getServiceAddress(DISTRIBUTION(), VersionPart.wrap(3)));
|
217
|
-
}
|
218
|
-
|
219
|
-
function getProductService() external view returns (IProductService) {
|
220
|
-
return IProductService(getRegistry().getServiceAddress(PRODUCT(), VersionPart.wrap(3)));
|
221
|
-
}
|
222
|
-
|
223
|
-
function getPoolService() external view returns (IPoolService) {
|
224
|
-
return IPoolService(getRegistry().getServiceAddress(POOL(), VersionPart.wrap(3)));
|
225
|
-
}
|
226
|
-
|
227
|
-
function getPolicyService() external view returns (IPolicyService) {
|
228
|
-
return IPolicyService(getRegistry().getServiceAddress(POLICY(), VersionPart.wrap(3)));
|
229
|
-
}
|
230
|
-
|
231
|
-
function getBundleService() external view returns (IBundleService) {
|
232
|
-
return IBundleService(getRegistry().getServiceAddress(BUNDLE(), VersionPart.wrap(3)));
|
233
|
-
}
|
234
|
-
|
235
253
|
//--- internal view/pure functions --------------------------------------//
|
236
254
|
}
|