@etherisc/gif-next 0.0.2-f1fe735-758 → 0.0.2-f2a5ca7-763
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +13 -1
- 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/{shared → authorization}/IAccessAdmin.sol/IAccessAdmin.json +95 -252
- 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/{registry → authorization}/IServiceAuthorization.sol/IServiceAuthorization.json +10 -10
- 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 +106 -90
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +55 -55
- 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 +32 -16
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +703 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +6 -19
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +32 -44
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +35 -96
- 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 +65 -125
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +35 -59
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +73 -79
- 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 +6 -6
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +181 -0
- 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/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 +32 -32
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +34 -34
- 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 +55 -55
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +40 -40
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +7 -202
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/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 +36 -36
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +36 -36
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +32 -32
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +34 -34
- 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 +72 -72
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +54 -54
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +13 -42
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +50 -50
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +43 -43
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +58 -58
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +47 -47
- 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 +20 -20
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +28 -28
- 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 +50 -46
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +0 -183
- 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 +101 -73
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +234 -389
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +27 -27
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +6 -6
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1159 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +24 -16
- 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 +62 -86
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +49 -61
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- 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/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/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/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/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +306 -0
- 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/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/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +6 -6
- 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/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +32 -32
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +44 -44
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +6 -6
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +40 -40
- 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 +26 -26
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +31 -31
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +134 -134
- 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 +55 -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 +117 -14
- 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 +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +2 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.json +2 -2
- 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 +21 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/IVersionable.sol/IVersionable.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +617 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/Versionable.sol/Versionable.json +1 -1
- package/contracts/{shared → authorization}/AccessAdmin.sol +135 -303
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/Authorization.sol +218 -0
- package/contracts/authorization/IAccess.sol +48 -0
- package/contracts/{shared → authorization}/IAccessAdmin.sol +22 -54
- package/contracts/authorization/IAuthorization.sol +54 -0
- package/contracts/authorization/IModuleAuthorization.sol +21 -0
- package/contracts/{registry → authorization}/IServiceAuthorization.sol +5 -5
- package/contracts/authorization/ModuleAuthorization.sol +78 -0
- package/contracts/{registry → authorization}/ServiceAuthorization.sol +17 -17
- 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 +12 -21
- package/contracts/distribution/DistributionServiceManager.sol +2 -5
- package/contracts/distribution/IDistributionComponent.sol +17 -35
- package/contracts/distribution/IDistributionService.sol +5 -1
- package/contracts/instance/{BundleManager.sol → BundleSet.sol} +23 -23
- package/contracts/instance/IInstance.sol +8 -9
- package/contracts/instance/IInstanceService.sol +13 -18
- package/contracts/instance/Instance.sol +61 -70
- package/contracts/instance/InstanceAdmin.sol +202 -267
- package/contracts/instance/InstanceAuthorizationV3.sol +202 -0
- package/contracts/instance/InstanceReader.sol +22 -9
- package/contracts/instance/InstanceService.sol +74 -70
- package/contracts/instance/InstanceServiceManager.sol +2 -6
- package/contracts/instance/InstanceStore.sol +5 -1
- package/contracts/instance/base/{ObjectManager.sol → ObjectSet.sol} +11 -12
- 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/OracleServiceManager.sol +2 -5
- package/contracts/pool/BasicPool.sol +164 -0
- package/contracts/pool/BasicPoolAuthorization.sol +49 -0
- package/contracts/pool/BundleService.sol +14 -26
- package/contracts/pool/BundleServiceManager.sol +2 -5
- package/contracts/pool/IPoolComponent.sol +0 -60
- package/contracts/pool/Pool.sol +143 -131
- package/contracts/pool/PoolService.sol +11 -27
- package/contracts/pool/PoolServiceManager.sol +2 -5
- package/contracts/product/ApplicationService.sol +12 -36
- package/contracts/product/ApplicationServiceManager.sol +2 -2
- package/contracts/product/BasicProduct.sol +82 -0
- package/contracts/product/BasicProductAuthorization.sol +40 -0
- package/contracts/product/ClaimService.sol +5 -31
- package/contracts/product/ClaimServiceManager.sol +2 -2
- package/contracts/product/IProductComponent.sol +6 -9
- package/contracts/product/PolicyServiceManager.sol +2 -5
- package/contracts/product/PricingServiceManager.sol +2 -5
- package/contracts/product/Product.sol +103 -88
- package/contracts/product/ProductService.sol +7 -32
- package/contracts/product/ProductServiceManager.sol +2 -5
- package/contracts/registry/IRegistry.sol +26 -16
- package/contracts/registry/IRegistryService.sol +6 -6
- package/contracts/registry/Registry.sol +81 -87
- package/contracts/registry/RegistryAdmin.sol +118 -88
- package/contracts/registry/RegistryService.sol +4 -18
- package/contracts/registry/RegistryServiceManager.sol +2 -2
- package/contracts/registry/{ReleaseManager.sol → ReleaseRegistry.sol} +97 -113
- package/contracts/registry/ServiceAuthorizationV3.sol +14 -14
- package/contracts/registry/TokenRegistry.sol +2 -2
- package/contracts/shared/ComponentService.sol +19 -58
- package/contracts/shared/ComponentServiceManager.sol +2 -2
- package/contracts/shared/ComponentVerifyingService.sol +1 -1
- package/contracts/shared/IInstanceLinkedComponent.sol +4 -0
- package/contracts/shared/IService.sol +1 -1
- package/contracts/shared/InstanceLinkedComponent.sol +26 -19
- package/contracts/shared/{NftIdSetManager.sol → NftIdSet.sol} +1 -1
- package/contracts/shared/Service.sol +3 -4
- package/contracts/staking/IStaking.sol +1 -2
- package/contracts/staking/IStakingService.sol +12 -5
- package/contracts/staking/Staking.sol +11 -14
- package/contracts/staking/StakingManager.sol +2 -6
- package/contracts/staking/StakingReader.sol +12 -16
- package/contracts/staking/StakingServiceManager.sol +2 -2
- package/contracts/staking/StakingStore.sol +12 -22
- package/contracts/type/ObjectType.sol +37 -7
- package/contracts/type/RoleId.sol +55 -82
- package/contracts/type/UFixed.sol +6 -0
- package/contracts/type/Version.sol +3 -1
- package/contracts/{shared → upgradeability}/ProxyManager.sol +3 -4
- package/contracts/{shared → upgradeability}/UpgradableProxyWithAdmin.sol +1 -3
- package/package.json +3 -3
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +0 -4
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +0 -709
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -228
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +0 -187
- package/artifacts/contracts/registry/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +0 -4
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +0 -4
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +0 -1177
- package/artifacts/contracts/registry/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +0 -4
- package/artifacts/contracts/registry/ServiceAuthorization.sol/ServiceAuthorization.json +0 -190
- package/artifacts/contracts/shared/AccessAdmin.sol/AccessAdmin.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessAdmin.sol/AccessAdmin.json +0 -1559
- 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 -1747
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +0 -1760
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +0 -1838
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +0 -1856
- package/artifacts/contracts/shared/IAccessAdmin.sol/IAccessAdmin.dbg.json +0 -4
- 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/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +0 -4
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +0 -4
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +0 -306
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +0 -4
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +0 -617
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +0 -4
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +0 -129
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +0 -4
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -377
- package/contracts/shared/AccessManagerCustom.sol +0 -741
- package/contracts/shared/AccessManagerExtended.sol +0 -481
- 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
- /package/contracts/{shared → upgradeability}/IVersionable.sol +0 -0
- /package/contracts/{shared → upgradeability}/Versionable.sol +0 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {Authorization} from "../authorization/Authorization.sol";
|
5
|
+
import {BasicOracle} from "./BasicOracle.sol";
|
6
|
+
import {ORACLE} from "../type/ObjectType.sol";
|
7
|
+
import {IAccess} from "../authorization/IAccess.sol";
|
8
|
+
import {IOracle} from "./IOracle.sol";
|
9
|
+
import {PUBLIC_ROLE} from "../../contracts/type/RoleId.sol";
|
10
|
+
import {RoleId} from "../type/RoleId.sol";
|
11
|
+
|
12
|
+
|
13
|
+
contract BasicOracleAuthorization
|
14
|
+
is Authorization
|
15
|
+
{
|
16
|
+
|
17
|
+
constructor(string memory componentName)
|
18
|
+
Authorization(componentName)
|
19
|
+
{}
|
20
|
+
|
21
|
+
function _setupTargets()
|
22
|
+
internal
|
23
|
+
virtual override
|
24
|
+
{
|
25
|
+
// basic component target
|
26
|
+
_addComponentTargetWithRole(ORACLE());
|
27
|
+
}
|
28
|
+
|
29
|
+
|
30
|
+
function _setupTargetAuthorizations()
|
31
|
+
internal
|
32
|
+
virtual override
|
33
|
+
{
|
34
|
+
IAccess.FunctionInfo[] storage functions;
|
35
|
+
|
36
|
+
// authorize public role (open access to any account, only allows to lock target)
|
37
|
+
functions = _authorizeForTarget(getTargetName(), getServiceRole(ORACLE()));
|
38
|
+
_authorize(functions, IOracle.request.selector, "request");
|
39
|
+
_authorize(functions, IOracle.cancel.selector, "cancel");
|
40
|
+
|
41
|
+
// authorize public role (open access to any account, only allows to lock target)
|
42
|
+
functions = _authorizeForTarget(getTargetName(), PUBLIC_ROLE());
|
43
|
+
_authorize(functions, BasicOracle.respond.selector, "respond");
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {NftId} from "../type/NftId.sol";
|
5
|
+
import {RequestId} from "../type/RequestId.sol";
|
5
6
|
import {Timestamp} from "../type/Timestamp.sol";
|
6
7
|
|
7
8
|
|
@@ -17,4 +18,19 @@ interface IOracle {
|
|
17
18
|
Timestamp expiredAt; // expiry timestamp
|
18
19
|
bool isCancelled;
|
19
20
|
}
|
21
|
+
|
22
|
+
|
23
|
+
/// @dev Callback function for oracle service to notify this oracle component to retreive some oracle data.
|
24
|
+
function request(
|
25
|
+
RequestId requestId,
|
26
|
+
NftId requesterId,
|
27
|
+
bytes calldata requestData,
|
28
|
+
Timestamp expiryAt
|
29
|
+
) external;
|
30
|
+
|
31
|
+
|
32
|
+
/// @dev Callback function for oracle service to notify this oracle component that the specified oracle request has ben cancelled by the requestor.
|
33
|
+
function cancel(
|
34
|
+
RequestId requestId
|
35
|
+
) external;
|
20
36
|
}
|
@@ -2,16 +2,17 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {COMPONENT, ORACLE} from "../type/ObjectType.sol";
|
5
|
-
import {
|
6
|
-
import {NftId, NftIdLib} from "../type/NftId.sol";
|
7
|
-
import {InstanceLinkedComponent} from "../shared/InstanceLinkedComponent.sol";
|
5
|
+
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
8
6
|
import {IComponentService} from "../shared/IComponentService.sol";
|
9
7
|
import {IOracleComponent} from "./IOracleComponent.sol";
|
8
|
+
import {IOracleService} from "./IOracleService.sol";
|
10
9
|
import {IRegistry} from "../registry/IRegistry.sol";
|
10
|
+
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
11
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
12
|
+
import {InstanceLinkedComponent} from "../shared/InstanceLinkedComponent.sol";
|
11
13
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
12
14
|
import {RequestId} from "../type/RequestId.sol";
|
13
15
|
import {Timestamp, TimestampLib} from "../type/Timestamp.sol";
|
14
|
-
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
15
16
|
import {UFixed} from "../type/UFixed.sol";
|
16
17
|
|
17
18
|
|
@@ -28,29 +29,6 @@ abstract contract Oracle is
|
|
28
29
|
}
|
29
30
|
|
30
31
|
|
31
|
-
function initializeOracle(
|
32
|
-
address registry,
|
33
|
-
NftId instanceNftId,
|
34
|
-
address initialOwner,
|
35
|
-
string memory name,
|
36
|
-
address token,
|
37
|
-
bytes memory registryData, // writeonly data that will saved in the object info record of the registry
|
38
|
-
bytes memory componentData // component specifidc data
|
39
|
-
)
|
40
|
-
public
|
41
|
-
virtual
|
42
|
-
onlyInitializing()
|
43
|
-
{
|
44
|
-
initializeInstanceLinkedComponent(registry, instanceNftId, name, token, ORACLE(), true, initialOwner, registryData, componentData);
|
45
|
-
|
46
|
-
OracleStorage storage $ = _getOracleStorage();
|
47
|
-
$._oracleService = IOracleService(_getServiceAddress(ORACLE()));
|
48
|
-
$._componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
49
|
-
|
50
|
-
registerInterface(type(IOracleComponent).interfaceId);
|
51
|
-
}
|
52
|
-
|
53
|
-
|
54
32
|
function register()
|
55
33
|
external
|
56
34
|
virtual
|
@@ -60,16 +38,6 @@ abstract contract Oracle is
|
|
60
38
|
}
|
61
39
|
|
62
40
|
|
63
|
-
function isVerifying()
|
64
|
-
external
|
65
|
-
virtual
|
66
|
-
view
|
67
|
-
returns (bool verifying)
|
68
|
-
{
|
69
|
-
return false;
|
70
|
-
}
|
71
|
-
|
72
|
-
|
73
41
|
function request(
|
74
42
|
RequestId requestId,
|
75
43
|
NftId requesterId,
|
@@ -78,7 +46,7 @@ abstract contract Oracle is
|
|
78
46
|
)
|
79
47
|
external
|
80
48
|
virtual
|
81
|
-
|
49
|
+
restricted()
|
82
50
|
{
|
83
51
|
_request(requestId, requesterId, requestData, expiryAt);
|
84
52
|
}
|
@@ -89,16 +57,60 @@ abstract contract Oracle is
|
|
89
57
|
)
|
90
58
|
external
|
91
59
|
virtual
|
92
|
-
|
60
|
+
restricted()
|
93
61
|
{
|
94
62
|
_cancel(requestId);
|
95
63
|
}
|
96
64
|
|
97
65
|
|
98
|
-
/// @dev
|
99
|
-
|
100
|
-
|
101
|
-
|
66
|
+
/// @dev Not relevant for oracle components, always returns false.
|
67
|
+
function isVerifying()
|
68
|
+
external
|
69
|
+
virtual
|
70
|
+
view
|
71
|
+
returns (bool verifying)
|
72
|
+
{
|
73
|
+
return false;
|
74
|
+
}
|
75
|
+
|
76
|
+
|
77
|
+
function _initializeOracle(
|
78
|
+
address registry,
|
79
|
+
NftId instanceNftId,
|
80
|
+
IAuthorization authorization,
|
81
|
+
address initialOwner,
|
82
|
+
string memory name,
|
83
|
+
address token,
|
84
|
+
bytes memory registryData, // writeonly data that will saved in the object info record of the registry
|
85
|
+
bytes memory componentData // component specifidc data
|
86
|
+
)
|
87
|
+
internal
|
88
|
+
virtual
|
89
|
+
onlyInitializing()
|
90
|
+
{
|
91
|
+
_initializeInstanceLinkedComponent(
|
92
|
+
registry,
|
93
|
+
instanceNftId,
|
94
|
+
name,
|
95
|
+
token,
|
96
|
+
ORACLE(),
|
97
|
+
authorization,
|
98
|
+
true,
|
99
|
+
initialOwner,
|
100
|
+
registryData,
|
101
|
+
componentData);
|
102
|
+
|
103
|
+
OracleStorage storage $ = _getOracleStorage();
|
104
|
+
$._oracleService = IOracleService(_getServiceAddress(ORACLE()));
|
105
|
+
$._componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
106
|
+
|
107
|
+
registerInterface(type(IOracleComponent).interfaceId);
|
108
|
+
}
|
109
|
+
|
110
|
+
|
111
|
+
/// @dev Internal function for handling requests.
|
112
|
+
/// Empty implementation.
|
113
|
+
/// Overwrite this function to implement use case specific handling for oracle calls.
|
102
114
|
function _request(
|
103
115
|
RequestId requestId,
|
104
116
|
NftId requesterId,
|
@@ -111,9 +123,9 @@ abstract contract Oracle is
|
|
111
123
|
}
|
112
124
|
|
113
125
|
|
114
|
-
/// @dev
|
115
|
-
///
|
116
|
-
///
|
126
|
+
/// @dev Internal function for cancelling requests.
|
127
|
+
/// Empty implementation.
|
128
|
+
/// Overwrite this function to implement use case specific cancelling.
|
117
129
|
function _cancel(
|
118
130
|
RequestId requestId
|
119
131
|
)
|
@@ -123,9 +135,9 @@ abstract contract Oracle is
|
|
123
135
|
}
|
124
136
|
|
125
137
|
|
126
|
-
/// @dev
|
127
|
-
///
|
128
|
-
/// to handle use case specific response handling.
|
138
|
+
/// @dev Internal function for handling oracle responses.
|
139
|
+
/// Default implementation sends response back to oracle service.
|
140
|
+
/// Use this function in use case specific external/public functions to handle use case specific response handling.
|
129
141
|
function _respond(
|
130
142
|
RequestId requestId,
|
131
143
|
bytes memory responseData
|
@@ -1,12 +1,9 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IVersionable} from "../
|
5
|
-
import {ProxyManager} from "../
|
4
|
+
import {IVersionable} from "../upgradeability/IVersionable.sol";
|
5
|
+
import {ProxyManager} from "../upgradeability/ProxyManager.sol";
|
6
6
|
import {OracleService} from "./OracleService.sol";
|
7
|
-
import {Registry} from "../registry/Registry.sol";
|
8
|
-
import {RegistryService} from "../registry/RegistryService.sol";
|
9
|
-
import {REGISTRY} from "../type/ObjectType.sol";
|
10
7
|
|
11
8
|
contract OracleServiceManager is ProxyManager {
|
12
9
|
|
@@ -0,0 +1,164 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {Amount, AmountLib} from "../type/Amount.sol";
|
5
|
+
import {InstanceLinkedComponent} from "../shared/InstanceLinkedComponent.sol";
|
6
|
+
import {Fee, FeeLib} from "../type/Fee.sol";
|
7
|
+
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
8
|
+
import {IBundleService} from "./IBundleService.sol";
|
9
|
+
import {IPoolComponent} from "./IPoolComponent.sol";
|
10
|
+
import {IPoolService} from "./IPoolService.sol";
|
11
|
+
import {IComponents} from "../instance/module/IComponents.sol";
|
12
|
+
import {IComponentService} from "../shared/IComponentService.sol";
|
13
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
14
|
+
import {BUNDLE, COMPONENT, POOL} from "../type/ObjectType.sol";
|
15
|
+
import {RoleId, PUBLIC_ROLE} from "../type/RoleId.sol";
|
16
|
+
import {Seconds} from "../type/Seconds.sol";
|
17
|
+
import {TokenHandler} from "../shared/TokenHandler.sol";
|
18
|
+
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
19
|
+
|
20
|
+
import {Pool} from "./Pool.sol";
|
21
|
+
|
22
|
+
abstract contract BasicPool is
|
23
|
+
Pool
|
24
|
+
{
|
25
|
+
|
26
|
+
function _initializeBasicPool(
|
27
|
+
address registry,
|
28
|
+
NftId instanceNftId,
|
29
|
+
IAuthorization authorization,
|
30
|
+
address token,
|
31
|
+
string memory name,
|
32
|
+
address initialOwner
|
33
|
+
)
|
34
|
+
internal
|
35
|
+
virtual
|
36
|
+
onlyInitializing()
|
37
|
+
{
|
38
|
+
_initializePool(
|
39
|
+
registry,
|
40
|
+
instanceNftId,
|
41
|
+
name,
|
42
|
+
token,
|
43
|
+
authorization,
|
44
|
+
false, // isInterceptingNftTransfers,
|
45
|
+
initialOwner,
|
46
|
+
"", // registryData
|
47
|
+
""); // componentData
|
48
|
+
}
|
49
|
+
|
50
|
+
function stake(
|
51
|
+
NftId bundleNftId,
|
52
|
+
Amount amount
|
53
|
+
)
|
54
|
+
public
|
55
|
+
virtual
|
56
|
+
restricted()
|
57
|
+
onlyBundleOwner(bundleNftId)
|
58
|
+
{
|
59
|
+
_stake(bundleNftId, amount);
|
60
|
+
}
|
61
|
+
|
62
|
+
|
63
|
+
function unstake(
|
64
|
+
NftId bundleNftId,
|
65
|
+
Amount amount
|
66
|
+
)
|
67
|
+
public
|
68
|
+
virtual
|
69
|
+
restricted()
|
70
|
+
onlyBundleOwner(bundleNftId)
|
71
|
+
{
|
72
|
+
_unstake(bundleNftId, amount);
|
73
|
+
}
|
74
|
+
|
75
|
+
|
76
|
+
function extend(
|
77
|
+
NftId bundleNftId,
|
78
|
+
Seconds lifetimeExtension
|
79
|
+
)
|
80
|
+
public
|
81
|
+
virtual
|
82
|
+
restricted()
|
83
|
+
onlyBundleOwner(bundleNftId)
|
84
|
+
{
|
85
|
+
_extend(bundleNftId, lifetimeExtension);
|
86
|
+
}
|
87
|
+
|
88
|
+
|
89
|
+
function lockBundle(NftId bundleNftId)
|
90
|
+
public
|
91
|
+
virtual
|
92
|
+
restricted()
|
93
|
+
onlyBundleOwner(bundleNftId)
|
94
|
+
{
|
95
|
+
_lockBundle(bundleNftId);
|
96
|
+
}
|
97
|
+
|
98
|
+
|
99
|
+
function unlockBundle(NftId bundleNftId)
|
100
|
+
public
|
101
|
+
virtual
|
102
|
+
restricted()
|
103
|
+
onlyBundleOwner(bundleNftId)
|
104
|
+
{
|
105
|
+
_unlockBundle(bundleNftId);
|
106
|
+
}
|
107
|
+
|
108
|
+
|
109
|
+
function close(NftId bundleNftId)
|
110
|
+
public
|
111
|
+
virtual
|
112
|
+
restricted()
|
113
|
+
onlyBundleOwner(bundleNftId)
|
114
|
+
{
|
115
|
+
_close(bundleNftId);
|
116
|
+
}
|
117
|
+
|
118
|
+
|
119
|
+
function setBundleFee(
|
120
|
+
NftId bundleNftId,
|
121
|
+
Fee memory fee
|
122
|
+
)
|
123
|
+
public
|
124
|
+
virtual
|
125
|
+
restricted()
|
126
|
+
onlyBundleOwner(bundleNftId)
|
127
|
+
{
|
128
|
+
_setBundleFee(bundleNftId, fee);
|
129
|
+
}
|
130
|
+
|
131
|
+
|
132
|
+
function setMaxCapitalAmount(Amount maxCapitalAmount)
|
133
|
+
public
|
134
|
+
virtual
|
135
|
+
restricted()
|
136
|
+
onlyOwner()
|
137
|
+
{
|
138
|
+
_setMaxCapitalAmount(maxCapitalAmount);
|
139
|
+
}
|
140
|
+
|
141
|
+
|
142
|
+
function setBundleOwnerRole(RoleId bundleOwnerRole)
|
143
|
+
public
|
144
|
+
virtual
|
145
|
+
restricted()
|
146
|
+
onlyOwner()
|
147
|
+
{
|
148
|
+
_setBundleOwnerRole(bundleOwnerRole);
|
149
|
+
}
|
150
|
+
|
151
|
+
|
152
|
+
function setFees(
|
153
|
+
Fee memory poolFee,
|
154
|
+
Fee memory stakingFee,
|
155
|
+
Fee memory performanceFee
|
156
|
+
)
|
157
|
+
public
|
158
|
+
virtual
|
159
|
+
restricted()
|
160
|
+
onlyOwner()
|
161
|
+
{
|
162
|
+
_setPoolFees(poolFee, stakingFee, performanceFee);
|
163
|
+
}
|
164
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {Authorization} from "../authorization/Authorization.sol";
|
5
|
+
import {BasicPool} from "./BasicPool.sol";
|
6
|
+
import {IAccess} from "../authorization/IAccess.sol";
|
7
|
+
import {POOL} from "../type/ObjectType.sol";
|
8
|
+
import {PUBLIC_ROLE} from "../../contracts/type/RoleId.sol";
|
9
|
+
import {RoleId} from "../type/RoleId.sol";
|
10
|
+
|
11
|
+
|
12
|
+
contract BasicPoolAuthorization
|
13
|
+
is Authorization
|
14
|
+
{
|
15
|
+
|
16
|
+
constructor(string memory poolName)
|
17
|
+
Authorization(poolName)
|
18
|
+
{}
|
19
|
+
|
20
|
+
function _setupTargets()
|
21
|
+
internal
|
22
|
+
virtual override
|
23
|
+
{
|
24
|
+
_addComponentTargetWithRole(POOL()); // basic pool target
|
25
|
+
}
|
26
|
+
|
27
|
+
|
28
|
+
function _setupTargetAuthorizations()
|
29
|
+
internal
|
30
|
+
virtual override
|
31
|
+
{
|
32
|
+
IAccess.FunctionInfo[] storage functions;
|
33
|
+
|
34
|
+
// authorize public role (open access to any account, only allows to lock target)
|
35
|
+
functions = _authorizeForTarget(getTargetName(), PUBLIC_ROLE());
|
36
|
+
_authorize(functions, BasicPool.stake.selector, "stake");
|
37
|
+
_authorize(functions, BasicPool.unstake.selector, "unstake");
|
38
|
+
_authorize(functions, BasicPool.extend.selector, "extend");
|
39
|
+
_authorize(functions, BasicPool.lockBundle.selector, "lockBundle");
|
40
|
+
_authorize(functions, BasicPool.unlockBundle.selector, "unlockBundle");
|
41
|
+
_authorize(functions, BasicPool.close.selector, "close");
|
42
|
+
_authorize(functions, BasicPool.setBundleFee.selector, "setBundleFee");
|
43
|
+
|
44
|
+
_authorize(functions, BasicPool.setMaxCapitalAmount.selector, "setMaxCapitalAmount");
|
45
|
+
_authorize(functions, BasicPool.setBundleOwnerRole.selector, "setBundleOwnerRole");
|
46
|
+
_authorize(functions, BasicPool.setFees.selector, "setFees");
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
@@ -2,36 +2,24 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {IBundle} from "../instance/module/IBundle.sol";
|
5
|
-
import {
|
5
|
+
import {IBundleService} from "./IBundleService.sol";
|
6
6
|
import {IComponentService} from "../shared/IComponentService.sol";
|
7
7
|
import {IRegistry} from "../registry/IRegistry.sol";
|
8
|
+
import {IRegistryService} from "../registry/IRegistryService.sol";
|
8
9
|
import {IInstance} from "../instance/IInstance.sol";
|
9
10
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
10
11
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
11
12
|
|
12
|
-
import {
|
13
|
-
import {
|
13
|
+
import {Amount, AmountLib} from "../type/Amount.sol";
|
14
|
+
import {BundleSet} from "../instance/BundleSet.sol";
|
15
|
+
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
16
|
+
import {Fee} from "../type/Fee.sol";
|
17
|
+
import {InstanceReader} from "../instance/InstanceReader.sol";
|
14
18
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
15
19
|
import {ObjectType, COMPONENT, POOL, BUNDLE, REGISTRY} from "../type/ObjectType.sol";
|
16
|
-
import {POOL_OWNER_ROLE, RoleId} from "../type/RoleId.sol";
|
17
|
-
import {Pool} from "./Pool.sol";
|
18
|
-
|
19
|
-
import {Amount, AmountLib} from "../type/Amount.sol";
|
20
|
-
import {Fee, FeeLib} from "../type/Fee.sol";
|
21
20
|
import {StateId, ACTIVE, PAUSED, CLOSED, KEEP_STATE} from "../type/StateId.sol";
|
22
21
|
import {Seconds} from "../type/Seconds.sol";
|
23
22
|
import {TimestampLib, zeroTimestamp} from "../type/Timestamp.sol";
|
24
|
-
import {Version, VersionLib} from "../type/Version.sol";
|
25
|
-
import {Versionable} from "../shared/Versionable.sol";
|
26
|
-
|
27
|
-
import {IService} from "../shared/IService.sol";
|
28
|
-
import {Service} from "../shared/Service.sol";
|
29
|
-
import {BundleManager} from "../instance/BundleManager.sol";
|
30
|
-
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
31
|
-
import {IBundleService} from "./IBundleService.sol";
|
32
|
-
import {IRegistryService} from "../registry/IRegistryService.sol";
|
33
|
-
import {InstanceService} from "../instance/InstanceService.sol";
|
34
|
-
import {InstanceReader} from "../instance/InstanceReader.sol";
|
35
23
|
|
36
24
|
string constant BUNDLE_SERVICE_NAME = "BundleService";
|
37
25
|
|
@@ -139,7 +127,7 @@ contract BundleService is
|
|
139
127
|
AmountLib.zero()); // fee amount
|
140
128
|
|
141
129
|
// put bundle under bundle managemet
|
142
|
-
|
130
|
+
BundleSet bundleManager = instance.getBundleSet();
|
143
131
|
bundleManager.add(bundleNftId);
|
144
132
|
|
145
133
|
// TODO add logging
|
@@ -197,7 +185,7 @@ contract BundleService is
|
|
197
185
|
instance.getInstanceStore().updateBundleState(bundleNftId, PAUSED());
|
198
186
|
|
199
187
|
// update set of active bundles
|
200
|
-
|
188
|
+
BundleSet bundleManager = instance.getBundleSet();
|
201
189
|
bundleManager.lock(bundleNftId);
|
202
190
|
|
203
191
|
emit LogBundleServiceBundleLocked(bundleNftId);
|
@@ -214,7 +202,7 @@ contract BundleService is
|
|
214
202
|
instance.getInstanceStore().updateBundleState(bundleNftId, ACTIVE());
|
215
203
|
|
216
204
|
// update set of active bundles
|
217
|
-
|
205
|
+
BundleSet bundleManager = instance.getBundleSet();
|
218
206
|
bundleManager.unlock(bundleNftId);
|
219
207
|
|
220
208
|
emit LogBundleServiceBundleActivated(bundleNftId);
|
@@ -233,7 +221,7 @@ contract BundleService is
|
|
233
221
|
instance.getInstanceStore().updateBundleState(bundleNftId, CLOSED());
|
234
222
|
|
235
223
|
// ensure no open policies attached to bundle
|
236
|
-
|
224
|
+
BundleSet bundleManager = instance.getBundleSet();
|
237
225
|
uint256 openPolicies = bundleManager.activePolicies(bundleNftId);
|
238
226
|
if(openPolicies > 0) {
|
239
227
|
revert ErrorBundleServiceBundleWithOpenPolicies(bundleNftId, openPolicies);
|
@@ -271,7 +259,7 @@ contract BundleService is
|
|
271
259
|
revert ErrorBundleServicePolicyNotCloseable(policyNftId);
|
272
260
|
}
|
273
261
|
|
274
|
-
instance.
|
262
|
+
instance.getBundleSet().unlinkPolicy(policyNftId);
|
275
263
|
}
|
276
264
|
|
277
265
|
/// @dev links policy to bundle
|
@@ -283,10 +271,10 @@ contract BundleService is
|
|
283
271
|
|
284
272
|
// ensure policy has not yet been activated in a previous tx already
|
285
273
|
if (policyInfo.activatedAt.gtz() && policyInfo.activatedAt < TimestampLib.blockTimestamp()) {
|
286
|
-
revert
|
274
|
+
revert BundleSet.ErrorBundleSetPolicyAlreadyActivated(policyNftId);
|
287
275
|
}
|
288
276
|
|
289
|
-
|
277
|
+
BundleSet bundleManager = instance.getBundleSet();
|
290
278
|
bundleManager.linkPolicy(policyNftId);
|
291
279
|
}
|
292
280
|
|
@@ -1,12 +1,9 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IVersionable} from "../
|
5
|
-
import {ProxyManager} from "../
|
4
|
+
import {IVersionable} from "../upgradeability/IVersionable.sol";
|
5
|
+
import {ProxyManager} from "../upgradeability/ProxyManager.sol";
|
6
6
|
import {BundleService} from "./BundleService.sol";
|
7
|
-
import {Registry} from "../registry/Registry.sol";
|
8
|
-
import {RegistryService} from "../registry/RegistryService.sol";
|
9
|
-
import {ObjectType, REGISTRY} from "../type/ObjectType.sol";
|
10
7
|
|
11
8
|
contract BundleServiceManager is ProxyManager {
|
12
9
|
|
@@ -16,70 +16,10 @@ interface IPoolComponent is IInstanceLinkedComponent {
|
|
16
16
|
|
17
17
|
error ErrorPoolNotBundleOwner(NftId bundleNftId, address caller);
|
18
18
|
error ErrorPoolNotPoolService(address caller);
|
19
|
-
|
20
19
|
error ErrorPoolApplicationBundleMismatch(NftId applicationNftId);
|
21
20
|
|
22
21
|
event LogPoolVerifiedByPool(address pool, NftId applicationNftId, Amount collateralizationAmount);
|
23
22
|
|
24
|
-
/// @dev increases the staked tokens by the specified amount
|
25
|
-
/// only the bundle owner may stake tokens
|
26
|
-
/// bundle MUST be in active or locked state
|
27
|
-
function stake(NftId bundleNftId, Amount amount) external;
|
28
|
-
|
29
|
-
/// @dev decreases the staked tokens by the specified amount
|
30
|
-
/// only the bundle owner may unstake tokens from the bundle
|
31
|
-
/// bundle MUST be in active, locked or closed state
|
32
|
-
function unstake(NftId bundleNftId, Amount amount) external;
|
33
|
-
|
34
|
-
/// @dev extends the bundle lifetime of the bundle by the specified time
|
35
|
-
/// only the bundle owner may extend the bundle's lifetime
|
36
|
-
/// bundle MUST be in active or locked state
|
37
|
-
function extend(NftId bundleNftId, Seconds lifetimeExtension) external;
|
38
|
-
|
39
|
-
/// @dev locks the specified bundle
|
40
|
-
/// a bundle to be locked MUST be in active state
|
41
|
-
/// locked bundles may not be used to collateralize any new policy
|
42
|
-
function lockBundle(NftId bundleNftId) external;
|
43
|
-
|
44
|
-
/// @dev unlocks the specified bundle
|
45
|
-
/// a bundle to be unlocked MUST be in locked state
|
46
|
-
function unlockBundle(NftId bundleNftId) external;
|
47
|
-
|
48
|
-
/// @dev close the specified bundle
|
49
|
-
/// a bundle to be closed MUST be in active or locked state
|
50
|
-
/// to close a bundle all all linked policies MUST be in closed state as well
|
51
|
-
/// closing a bundle finalizes the bundle bookkeeping including overall profit calculation
|
52
|
-
/// once a bundle is closed this action cannot be reversed
|
53
|
-
function close(NftId bundleNftId) external;
|
54
|
-
|
55
|
-
/// @dev sets the fee for the specified bundle
|
56
|
-
/// the fee is added on top of the poolFee and deducted from the premium amounts
|
57
|
-
/// via these fees individual bundler owner may earn income per policy in the context of peer to peer pools
|
58
|
-
function setBundleFee(
|
59
|
-
NftId bundleNftId,
|
60
|
-
Fee memory fee
|
61
|
-
) external;
|
62
|
-
|
63
|
-
/// @dev sets the maximum overall capital amound held by this pool
|
64
|
-
/// function may only be called by pool owner
|
65
|
-
function setMaxCapitalAmount(Amount maxCapitalAmount) external;
|
66
|
-
|
67
|
-
/// @dev sets the required role to create/own bundles
|
68
|
-
/// may only be called once after setting up a pool
|
69
|
-
/// may only be called by pool owner
|
70
|
-
function setBundleOwnerRole(RoleId bundleOwnerRole) external;
|
71
|
-
|
72
|
-
/// @dev update pool fees to the specified values
|
73
|
-
/// pool fees: are deducted from the premium amount and goes to the pool owner
|
74
|
-
/// staking fees: are deducted from the staked tokens by a bundle owner and goes to the pool owner
|
75
|
-
/// performance fees: when a bundle is closed a bundle specific profit is calculated
|
76
|
-
/// the performance fee is deducted from this profit and goes to the pool owner
|
77
|
-
function setFees(
|
78
|
-
Fee memory poolFee,
|
79
|
-
Fee memory stakingFee,
|
80
|
-
Fee memory performanceFee
|
81
|
-
) external;
|
82
|
-
|
83
23
|
/// @dev this is a callback function that is called by the product service when underwriting a policy.
|
84
24
|
/// the pool has the option to check the details and object to underwriting by reverting.
|
85
25
|
/// the function is only called for "active" pools that ask to be involved/notified
|