@etherisc/gif-next 0.0.2-7e684ab-059 → 0.0.2-7e8dbef-751
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +338 -19
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +1416 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +4 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +1349 -0
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +818 -0
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +4 -0
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +975 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +4 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +814 -0
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +778 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +331 -1138
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +4 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +650 -0
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +463 -1216
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +708 -0
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +228 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +1701 -0
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +1053 -0
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +734 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +3642 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +318 -0
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +4 -0
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +190 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +256 -0
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +129 -0
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +4 -0
- package/artifacts/contracts/instance/{access/IAccess.sol/IAccess.json → module/IBundle.sol/IBundle.json} +2 -2
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.json +10 -0
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +4 -0
- package/artifacts/contracts/instance/{component/IComponent.sol/IComponent.json → module/IDistribution.sol/IDistribution.json} +2 -2
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +4 -0
- package/artifacts/contracts/instance/{policy → module}/IPolicy.sol/IPolicy.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +4 -0
- package/artifacts/contracts/instance/{pool/IPoolModule.sol/IPool.json → module/IRisk.sol/IRisk.json} +2 -2
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +4 -0
- package/artifacts/contracts/mock/Dip.sol/Dip.json +376 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/{instance/treasury/ITreasury.sol/ITreasury.json → oracle/IOracle.sol/IOracle.json} +2 -2
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +759 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +578 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +1146 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +921 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +722 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +4 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +1105 -0
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +746 -0
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +4 -0
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +690 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +4 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +1154 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +4 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +1065 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +4 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.json +1565 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +1432 -0
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +738 -0
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +4 -0
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +834 -0
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +722 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +4 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +1278 -0
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +810 -0
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +4 -0
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +499 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +759 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +4 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +707 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +4 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +536 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +4 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +995 -0
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +4 -0
- package/artifacts/contracts/product/IProductService.sol/IProductService.json +387 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +1146 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +754 -0
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +4 -0
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +983 -0
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +778 -0
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +4 -0
- package/artifacts/contracts/product/Product.sol/Product.json +1397 -0
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +4 -0
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +679 -0
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +694 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +252 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +744 -26
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +4 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +1110 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +4 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +52 -0
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +1026 -52
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +407 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +1415 -0
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +709 -0
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +1292 -0
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +137 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +661 -0
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.dbg.json +4 -0
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.json +1193 -0
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.dbg.json +4 -0
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.json +1715 -0
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +4 -0
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +1728 -0
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +4 -0
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +1806 -0
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +4 -0
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +1824 -0
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/shared/Component.sol/Component.json +896 -0
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +1490 -0
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +792 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +526 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +4 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +73 -0
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.dbg.json +4 -0
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.json +1562 -0
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.dbg.json +4 -0
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.json +1600 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +631 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +4 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +867 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +705 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +468 -0
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +4 -0
- package/artifacts/contracts/{instance/lifecycle/ILifecycle.sol/ILifecycleModule.json → shared/ILifecycle.sol/ILifecycle.json} +10 -77
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +4 -0
- package/artifacts/contracts/{registry/Registry.sol/Registerable.json → shared/INftOwnable.sol/INftOwnable.json} +42 -77
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +207 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +4 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +181 -0
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/{instance/access/IAccess.sol/IAccessCheckRole.json → shared/IRegistryLinked.sol/IRegistryLinked.json} +11 -11
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +4 -0
- package/artifacts/contracts/{instance/component/ComponentModule.sol/ComponentModule.json → shared/IService.sol/IService.json} +168 -134
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +4 -0
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +55 -0
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +4 -0
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +39 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +1036 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +571 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +4 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +194 -0
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +306 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +4 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +244 -0
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +320 -0
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +617 -0
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +4 -0
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +353 -0
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +71 -0
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +4 -0
- package/artifacts/contracts/{registry/IChainNft.sol/IChainNft.json → shared/Service.sol/Service.json} +260 -218
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +150 -0
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +4 -0
- package/artifacts/contracts/shared/Versionable.sol/Versionable.json +78 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +4 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1438 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +4 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +993 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +444 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +4 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.json +2045 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +777 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +592 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +1324 -0
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +726 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2189 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +571 -0
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +4 -0
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +10 -0
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +4 -0
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +345 -0
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +4 -0
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +225 -0
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +179 -0
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +4 -0
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +104 -0
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +4 -0
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +312 -0
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +4 -0
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +125 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +209 -0
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +4 -0
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +33 -0
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +4 -0
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +105 -0
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +209 -0
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +4 -0
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +142 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +86 -0
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +156 -0
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +4 -0
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +198 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +4 -0
- package/artifacts/contracts/{types → type}/StateId.sol/StateIdLib.json +3 -3
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +4 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +280 -0
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +4 -0
- package/artifacts/contracts/{types/ChainId.sol/ChainIdLib.json → type/UFixed.sol/MathLib.json} +4 -4
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +4 -0
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +479 -0
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +4 -0
- package/artifacts/contracts/type/Version.sol/VersionLib.json +177 -0
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +4 -0
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +49 -0
- package/contracts/distribution/Distribution.sol +261 -0
- package/contracts/distribution/DistributionService.sol +298 -0
- package/contracts/distribution/DistributionServiceManager.sol +42 -0
- package/contracts/distribution/IDistributionComponent.sol +66 -0
- package/contracts/distribution/IDistributionService.sol +81 -0
- package/contracts/instance/BundleManager.sol +126 -0
- package/contracts/instance/IInstance.sol +79 -22
- package/contracts/instance/IInstanceService.sol +81 -0
- package/contracts/instance/Instance.sol +217 -53
- package/contracts/instance/InstanceAdmin.sol +331 -0
- package/contracts/instance/InstanceAuthorizationsLib.sol +377 -0
- package/contracts/instance/InstanceReader.sol +390 -0
- package/contracts/instance/InstanceService.sol +362 -0
- package/contracts/instance/InstanceServiceManager.sol +44 -0
- package/contracts/instance/InstanceStore.sol +281 -0
- package/contracts/instance/base/BalanceStore.sol +118 -0
- package/contracts/instance/base/Cloneable.sol +51 -0
- package/contracts/instance/base/ObjectCounter.sol +21 -0
- package/contracts/instance/base/ObjectManager.sol +82 -0
- package/contracts/instance/module/IAccess.sol +46 -0
- package/contracts/instance/module/IBundle.sol +20 -0
- package/contracts/instance/module/IComponents.sol +52 -0
- package/contracts/instance/module/IDistribution.sol +42 -0
- package/contracts/instance/module/IPolicy.sol +84 -0
- package/contracts/instance/module/IRisk.sol +11 -0
- package/contracts/mock/Dip.sol +26 -0
- package/contracts/oracle/IOracle.sol +20 -0
- package/contracts/oracle/IOracleComponent.sol +32 -0
- package/contracts/oracle/IOracleService.sol +48 -0
- package/contracts/oracle/Oracle.sol +145 -0
- package/contracts/oracle/OracleService.sol +221 -0
- package/contracts/oracle/OracleServiceManager.sol +42 -0
- package/contracts/pool/BundleService.sol +296 -0
- package/contracts/pool/BundleServiceManager.sol +42 -0
- package/contracts/pool/IBundleService.sol +106 -0
- package/contracts/pool/IPoolComponent.sol +112 -0
- package/contracts/pool/IPoolService.sol +150 -0
- package/contracts/pool/Pool.sol +299 -0
- package/contracts/pool/PoolService.sol +453 -0
- package/contracts/pool/PoolServiceManager.sol +42 -0
- package/contracts/product/ApplicationService.sol +254 -0
- package/contracts/product/ApplicationServiceManager.sol +38 -0
- package/contracts/product/ClaimService.sol +442 -0
- package/contracts/product/ClaimServiceManager.sol +38 -0
- package/contracts/product/IApplicationService.sol +62 -0
- package/contracts/product/IClaimService.sol +93 -0
- package/contracts/product/IPolicyService.sol +78 -0
- package/contracts/product/IPricingService.sol +39 -0
- package/contracts/product/IProductComponent.sol +42 -0
- package/contracts/product/IProductService.sol +33 -0
- package/contracts/product/PolicyService.sol +475 -0
- package/contracts/product/PolicyServiceManager.sol +42 -0
- package/contracts/product/PricingService.sol +301 -0
- package/contracts/product/PricingServiceManager.sol +42 -0
- package/contracts/product/Product.sol +377 -0
- package/contracts/product/ProductService.sol +124 -0
- package/contracts/product/ProductServiceManager.sol +42 -0
- package/contracts/registry/ChainNft.sol +144 -62
- package/contracts/registry/IRegistry.sol +99 -42
- package/contracts/registry/IRegistryService.sol +69 -0
- package/contracts/registry/ITransferInterceptor.sol +7 -0
- package/contracts/registry/Registry.sol +521 -127
- package/contracts/registry/RegistryAdmin.sol +237 -0
- package/contracts/registry/RegistryService.sol +266 -0
- package/contracts/registry/RegistryServiceManager.sol +58 -0
- package/contracts/registry/ReleaseManager.sol +599 -0
- package/contracts/registry/ServiceAuthorizationsLib.sol +173 -0
- package/contracts/registry/TokenRegistry.sol +315 -0
- package/contracts/shared/AccessManagerCustom.sol +736 -0
- package/contracts/shared/AccessManagerExtended.sol +470 -0
- package/contracts/shared/AccessManagerExtendedInitializeable.sol +13 -0
- package/contracts/shared/AccessManagerExtendedWithDisable.sol +137 -0
- package/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol +14 -0
- package/contracts/shared/Component.sol +281 -0
- package/contracts/shared/ComponentService.sol +618 -0
- package/contracts/shared/ComponentServiceManager.sol +35 -0
- package/contracts/shared/ComponentVerifyingService.sol +117 -0
- package/contracts/shared/ERC165.sol +27 -0
- package/contracts/shared/IAccessManagerExtended.sol +74 -0
- package/contracts/shared/IAccessManagerExtendedWithDisable.sol +18 -0
- package/contracts/shared/IComponent.sol +70 -0
- package/contracts/shared/IComponentService.sol +102 -0
- package/contracts/shared/IInstanceLinkedComponent.sol +46 -0
- package/contracts/shared/IKeyValueStore.sol +53 -0
- package/contracts/shared/ILifecycle.sol +30 -0
- package/contracts/shared/INftOwnable.sol +23 -0
- package/contracts/shared/IPolicyHolder.sol +45 -0
- package/contracts/shared/IRegisterable.sol +15 -0
- package/contracts/shared/IRegistryLinked.sol +11 -0
- package/contracts/shared/IService.sol +18 -0
- package/contracts/shared/IVersionable.sol +53 -0
- package/contracts/shared/InitializableCustom.sol +177 -0
- package/contracts/shared/InstanceLinkedComponent.sol +144 -0
- package/contracts/shared/KeyValueStore.sol +127 -0
- package/contracts/shared/Lifecycle.sol +128 -0
- package/contracts/shared/NftIdSetManager.sol +65 -0
- package/contracts/shared/NftOwnable.sol +107 -0
- package/contracts/shared/PolicyHolder.sol +102 -0
- package/contracts/shared/ProxyManager.sol +199 -0
- package/contracts/shared/Registerable.sol +75 -0
- package/contracts/shared/RegistryLinked.sol +43 -0
- package/contracts/shared/Service.sol +77 -0
- package/contracts/shared/TokenHandler.sol +58 -0
- package/contracts/shared/UpgradableProxyWithAdmin.sol +16 -0
- package/contracts/shared/Versionable.sol +59 -0
- package/contracts/staking/IStaking.sol +168 -0
- package/contracts/staking/IStakingService.sol +149 -0
- package/contracts/staking/StakeManagerLib.sol +179 -0
- package/contracts/staking/Staking.sol +551 -0
- package/contracts/staking/StakingManager.sol +54 -0
- package/contracts/staking/StakingReader.sol +187 -0
- package/contracts/staking/StakingService.sol +406 -0
- package/contracts/staking/StakingServiceManager.sol +45 -0
- package/contracts/staking/StakingStore.sol +572 -0
- package/contracts/staking/TargetManagerLib.sol +207 -0
- package/contracts/type/AddressSet.sol +58 -0
- package/contracts/type/Amount.sol +128 -0
- package/contracts/{types → type}/Blocknumber.sol +21 -3
- package/contracts/type/ClaimId.sol +75 -0
- package/contracts/type/DistributorType.sol +55 -0
- package/contracts/type/Fee.sol +66 -0
- package/contracts/type/Key32.sol +50 -0
- package/contracts/type/NftId.sol +78 -0
- package/contracts/type/NftIdSet.sol +62 -0
- package/contracts/{types → type}/ObjectType.sol +81 -20
- package/contracts/type/PayoutId.sol +82 -0
- package/contracts/type/Referral.sol +89 -0
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RiskId.sol +43 -0
- package/contracts/type/RoleId.sol +146 -0
- package/contracts/type/Seconds.sol +81 -0
- package/contracts/{types → type}/StateId.sol +46 -6
- package/contracts/{types → type}/Timestamp.sol +36 -6
- package/contracts/type/UFixed.sol +326 -0
- package/contracts/type/Version.sol +108 -0
- package/package.json +12 -5
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +0 -4
- package/artifacts/contracts/components/Component.sol/Component.json +0 -205
- package/artifacts/contracts/components/Component.sol/InstanceLinked.dbg.json +0 -4
- package/artifacts/contracts/components/Component.sol/InstanceLinked.json +0 -35
- package/artifacts/contracts/components/IPool.sol/IPoolComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IPool.sol/IPoolComponent.json +0 -255
- package/artifacts/contracts/components/IProduct.sol/IProductComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IProduct.sol/IProductComponent.json +0 -74
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +0 -4
- package/artifacts/contracts/components/Pool.sol/Pool.json +0 -328
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +0 -4
- package/artifacts/contracts/components/Product.sol/Product.json +0 -346
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +0 -4
- package/artifacts/contracts/experiment/errors/Require.sol/Require.json +0 -105
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +0 -4
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.json +0 -105
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/A.sol/A.json +0 -128
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +0 -42
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/B.sol/B.json +0 -76
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/C.sol/C.json +0 -89
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.json +0 -128
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.json +0 -37
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.json +0 -50
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.json +0 -63
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +0 -59
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.json +0 -124
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.json +0 -74
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +0 -124
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +0 -207
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +0 -4
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +0 -10
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +0 -4
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +0 -10
- package/artifacts/contracts/instance/access/Access.sol/AccessModule.dbg.json +0 -4
- package/artifacts/contracts/instance/access/Access.sol/AccessModule.json +0 -400
- package/artifacts/contracts/instance/access/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessCheckRole.dbg.json +0 -4
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.dbg.json +0 -4
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.json +0 -50
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessModule.dbg.json +0 -4
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessModule.json +0 -336
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentModule.dbg.json +0 -4
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.json +0 -202
- package/artifacts/contracts/instance/component/IComponent.sol/IComponent.dbg.json +0 -4
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.dbg.json +0 -4
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.json +0 -205
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.dbg.json +0 -4
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.json +0 -217
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.json +0 -141
- package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.dbg.json +0 -4
- package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.json +0 -24
- package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycle.dbg.json +0 -4
- package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycle.json +0 -134
- package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycleModule.dbg.json +0 -4
- package/artifacts/contracts/instance/lifecycle/LifecycleModule.sol/LifecycleModule.dbg.json +0 -4
- package/artifacts/contracts/instance/lifecycle/LifecycleModule.sol/LifecycleModule.json +0 -221
- package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicy.dbg.json +0 -4
- package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.dbg.json +0 -4
- package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.json +0 -254
- package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.dbg.json +0 -4
- package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.json +0 -254
- package/artifacts/contracts/instance/pool/IPoolModule.sol/IPool.dbg.json +0 -4
- package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.dbg.json +0 -4
- package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.json +0 -129
- package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.dbg.json +0 -4
- package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.json +0 -155
- package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.dbg.json +0 -4
- package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.json +0 -75
- package/artifacts/contracts/instance/product/IProductService.sol/IProductService.dbg.json +0 -4
- package/artifacts/contracts/instance/product/IProductService.sol/IProductService.json +0 -127
- package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.dbg.json +0 -4
- package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.json +0 -75
- package/artifacts/contracts/instance/product/ProductService.sol/ProductService.dbg.json +0 -4
- package/artifacts/contracts/instance/product/ProductService.sol/ProductService.json +0 -196
- package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasury.dbg.json +0 -4
- package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasuryModule.dbg.json +0 -4
- package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasuryModule.json +0 -490
- package/artifacts/contracts/instance/treasury/TokenHandler.sol/TokenHandler.dbg.json +0 -4
- package/artifacts/contracts/instance/treasury/TokenHandler.sol/TokenHandler.json +0 -45
- package/artifacts/contracts/instance/treasury/TreasuryModule.sol/TreasuryModule.dbg.json +0 -4
- package/artifacts/contracts/instance/treasury/TreasuryModule.sol/TreasuryModule.json +0 -490
- package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +0 -4
- package/artifacts/contracts/registry/IRegistry.sol/IOwnable.dbg.json +0 -4
- package/artifacts/contracts/registry/IRegistry.sol/IOwnable.json +0 -24
- package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.dbg.json +0 -4
- package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.json +0 -166
- package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.dbg.json +0 -4
- package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.json +0 -49
- package/artifacts/contracts/registry/Registry.sol/Registerable.dbg.json +0 -4
- package/artifacts/contracts/registry/Registry.sol/RegistryLinked.dbg.json +0 -4
- package/artifacts/contracts/registry/Registry.sol/RegistryLinked.json +0 -60
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +0 -4
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +0 -174
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +0 -92
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +0 -4
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +0 -92
- package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +0 -4
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +0 -174
- package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.dbg.json +0 -4
- package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.json +0 -479
- package/contracts/components/Component.sol +0 -77
- package/contracts/components/IPool.sol +0 -15
- package/contracts/components/IProduct.sol +0 -16
- package/contracts/components/Pool.sol +0 -52
- package/contracts/components/Product.sol +0 -89
- package/contracts/experiment/errors/Require.sol +0 -38
- package/contracts/experiment/errors/Revert.sol +0 -44
- package/contracts/experiment/inheritance/A.sol +0 -53
- package/contracts/experiment/inheritance/B.sol +0 -28
- package/contracts/experiment/inheritance/C.sol +0 -34
- package/contracts/experiment/inheritance/IA.sol +0 -13
- package/contracts/experiment/inheritance/IB.sol +0 -10
- package/contracts/experiment/inheritance/IC.sol +0 -12
- package/contracts/experiment/statemachine/Dummy.sol +0 -27
- package/contracts/experiment/statemachine/ISM.sol +0 -25
- package/contracts/experiment/statemachine/README.md +0 -112
- package/contracts/experiment/statemachine/SM.sol +0 -57
- package/contracts/experiment/statemachine/SimpleStateMachine.sol +0 -31
- package/contracts/experiment/types/TypeA.sol +0 -47
- package/contracts/experiment/types/TypeB.sol +0 -29
- package/contracts/instance/access/Access.sol +0 -165
- package/contracts/instance/access/IAccess.sol +0 -63
- package/contracts/instance/component/ComponentModule.sol +0 -274
- package/contracts/instance/component/IComponent.sol +0 -74
- package/contracts/instance/lifecycle/ILifecycle.sol +0 -47
- package/contracts/instance/lifecycle/LifecycleModule.sol +0 -88
- package/contracts/instance/policy/IPolicy.sol +0 -50
- package/contracts/instance/policy/PolicyModule.sol +0 -114
- package/contracts/instance/pool/IPoolModule.sol +0 -23
- package/contracts/instance/pool/PoolModule.sol +0 -81
- package/contracts/instance/product/IProductService.sol +0 -36
- package/contracts/instance/product/ProductService.sol +0 -136
- package/contracts/instance/treasury/ITreasury.sol +0 -91
- package/contracts/instance/treasury/TokenHandler.sol +0 -24
- package/contracts/instance/treasury/TreasuryModule.sol +0 -168
- package/contracts/registry/IChainNft.sol +0 -21
- package/contracts/types/ChainId.sol +0 -38
- package/contracts/types/Fee.sol +0 -32
- package/contracts/types/NftId.sol +0 -51
- package/contracts/types/UFixed.sol +0 -210
@@ -0,0 +1,145 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {COMPONENT, ORACLE} from "../type/ObjectType.sol";
|
5
|
+
import {IOracleService} from "./IOracleService.sol";
|
6
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
7
|
+
import {InstanceLinkedComponent} from "../shared/InstanceLinkedComponent.sol";
|
8
|
+
import {IComponentService} from "../shared/IComponentService.sol";
|
9
|
+
import {IOracleComponent} from "./IOracleComponent.sol";
|
10
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
11
|
+
import {InstanceReader} from "../instance/InstanceReader.sol";
|
12
|
+
import {RequestId} from "../type/RequestId.sol";
|
13
|
+
import {Timestamp, TimestampLib} from "../type/Timestamp.sol";
|
14
|
+
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
15
|
+
import {UFixed} from "../type/UFixed.sol";
|
16
|
+
|
17
|
+
|
18
|
+
abstract contract Oracle is
|
19
|
+
InstanceLinkedComponent,
|
20
|
+
IOracleComponent
|
21
|
+
{
|
22
|
+
// keccak256(abi.encode(uint256(keccak256("etherisc.storage.Oracle")) - 1)) & ~bytes32(uint256(0xff));
|
23
|
+
bytes32 public constant ORACLE_STORAGE_LOCATION_V1 = 0xaab7c0ea03d290e56d6c060e0733d3ebcbe647f7694616a2ec52738a64b2f900;
|
24
|
+
|
25
|
+
struct OracleStorage {
|
26
|
+
IComponentService _componentService;
|
27
|
+
IOracleService _oracleService;
|
28
|
+
}
|
29
|
+
|
30
|
+
|
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
|
+
function register()
|
55
|
+
external
|
56
|
+
virtual
|
57
|
+
onlyOwner()
|
58
|
+
{
|
59
|
+
_getOracleStorage()._componentService.registerOracle();
|
60
|
+
}
|
61
|
+
|
62
|
+
|
63
|
+
function isVerifying()
|
64
|
+
external
|
65
|
+
virtual
|
66
|
+
view
|
67
|
+
returns (bool verifying)
|
68
|
+
{
|
69
|
+
return false;
|
70
|
+
}
|
71
|
+
|
72
|
+
|
73
|
+
function request(
|
74
|
+
RequestId requestId,
|
75
|
+
NftId requesterId,
|
76
|
+
bytes calldata requestData,
|
77
|
+
Timestamp expiryAt
|
78
|
+
)
|
79
|
+
external
|
80
|
+
virtual
|
81
|
+
// restricted() // TODO enable: only oracle service
|
82
|
+
{
|
83
|
+
_request(requestId, requesterId, requestData, expiryAt);
|
84
|
+
}
|
85
|
+
|
86
|
+
|
87
|
+
function cancel(
|
88
|
+
RequestId requestId
|
89
|
+
)
|
90
|
+
external
|
91
|
+
virtual
|
92
|
+
// restricted() // TODO enable: only oracle service
|
93
|
+
{
|
94
|
+
_cancel(requestId);
|
95
|
+
}
|
96
|
+
|
97
|
+
|
98
|
+
/// @dev internal function for handling requests.
|
99
|
+
/// empty implementation.
|
100
|
+
/// overwrite this function to implement use case specific handling
|
101
|
+
/// for oracle calls.
|
102
|
+
function _request(
|
103
|
+
RequestId requestId,
|
104
|
+
NftId requesterId,
|
105
|
+
bytes calldata requestData,
|
106
|
+
Timestamp expiryAt
|
107
|
+
)
|
108
|
+
internal
|
109
|
+
virtual
|
110
|
+
{
|
111
|
+
}
|
112
|
+
|
113
|
+
|
114
|
+
/// @dev internal function for cancelling requests.
|
115
|
+
/// empty implementation.
|
116
|
+
/// overwrite this function to implement use case specific cancelling
|
117
|
+
function _cancel(
|
118
|
+
RequestId requestId
|
119
|
+
)
|
120
|
+
internal
|
121
|
+
virtual
|
122
|
+
{
|
123
|
+
}
|
124
|
+
|
125
|
+
|
126
|
+
/// @dev internal function for handling oracle responses.
|
127
|
+
/// use this function in use case specific external/public functions
|
128
|
+
/// to handle use case specific response handling.
|
129
|
+
function _respond(
|
130
|
+
RequestId requestId,
|
131
|
+
bytes memory responseData
|
132
|
+
)
|
133
|
+
internal
|
134
|
+
virtual
|
135
|
+
{
|
136
|
+
_getOracleStorage()._oracleService.respond(
|
137
|
+
requestId, responseData);
|
138
|
+
}
|
139
|
+
|
140
|
+
function _getOracleStorage() private pure returns (OracleStorage storage $) {
|
141
|
+
assembly {
|
142
|
+
$.slot := ORACLE_STORAGE_LOCATION_V1
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
@@ -0,0 +1,221 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
5
|
+
import {IComponent} from "../shared/IComponent.sol";
|
6
|
+
import {IInstance} from "../instance/IInstance.sol";
|
7
|
+
import {IInstanceService} from "../instance/IInstanceService.sol";
|
8
|
+
import {InstanceReader} from "../instance/InstanceReader.sol";
|
9
|
+
import {IOracle} from "./IOracle.sol";
|
10
|
+
import {IOracleComponent} from "./IOracleComponent.sol";
|
11
|
+
import {IOracleService} from "./IOracleService.sol";
|
12
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
13
|
+
import {NftId} from "../type/NftId.sol";
|
14
|
+
import {ObjectType, COMPONENT, ORACLE, INSTANCE} from "../type/ObjectType.sol";
|
15
|
+
import {RequestId} from "../type/RequestId.sol";
|
16
|
+
import {StateId, ACTIVE, FULFILLED, CANCELLED} from "../type/StateId.sol";
|
17
|
+
import {Timestamp, TimestampLib} from "../type/Timestamp.sol";
|
18
|
+
|
19
|
+
|
20
|
+
contract OracleService is
|
21
|
+
ComponentVerifyingService,
|
22
|
+
IOracleService
|
23
|
+
{
|
24
|
+
|
25
|
+
IInstanceService private _instanceService;
|
26
|
+
|
27
|
+
|
28
|
+
function _initialize(
|
29
|
+
address owner,
|
30
|
+
bytes memory data
|
31
|
+
)
|
32
|
+
internal
|
33
|
+
initializer
|
34
|
+
virtual override
|
35
|
+
{
|
36
|
+
address initialOwner;
|
37
|
+
address registryAddress;
|
38
|
+
(registryAddress, initialOwner) = abi.decode(data, (address, address));
|
39
|
+
initializeService(registryAddress, address(0), owner);
|
40
|
+
|
41
|
+
_instanceService = IInstanceService(_getServiceAddress(INSTANCE()));
|
42
|
+
|
43
|
+
registerInterface(type(IOracleService).interfaceId);
|
44
|
+
}
|
45
|
+
|
46
|
+
function getDomain() public pure override returns(ObjectType) {
|
47
|
+
return ORACLE();
|
48
|
+
}
|
49
|
+
|
50
|
+
function request(
|
51
|
+
NftId oracleNftId,
|
52
|
+
bytes calldata requestData,
|
53
|
+
Timestamp expiryAt,
|
54
|
+
string calldata callbackMethodName
|
55
|
+
)
|
56
|
+
external
|
57
|
+
virtual
|
58
|
+
// restricted() // add authz
|
59
|
+
returns (
|
60
|
+
RequestId requestId
|
61
|
+
)
|
62
|
+
{
|
63
|
+
(
|
64
|
+
NftId componentNftId,
|
65
|
+
IRegistry.ObjectInfo memory componentInfo,
|
66
|
+
IInstance instance
|
67
|
+
) = _getAndVerifyActiveComponent(COMPONENT());
|
68
|
+
|
69
|
+
// oracleNftId exists and is active oracle
|
70
|
+
(
|
71
|
+
IRegistry.ObjectInfo memory oracleInfo,
|
72
|
+
) = _getAndVerifyComponentInfo(
|
73
|
+
oracleNftId,
|
74
|
+
ORACLE(),
|
75
|
+
true); // only active
|
76
|
+
|
77
|
+
// check that requester and oracle share same instance
|
78
|
+
if (componentInfo.parentNftId != oracleInfo.parentNftId) {
|
79
|
+
revert ErrorOracleServiceInstanceMismatch(componentInfo.parentNftId, oracleInfo.parentNftId);
|
80
|
+
}
|
81
|
+
|
82
|
+
// check expiriyAt >= now
|
83
|
+
if (expiryAt < TimestampLib.blockTimestamp()) {
|
84
|
+
revert ErrorOracleServiceExpiryInThePast(TimestampLib.blockTimestamp(), expiryAt);
|
85
|
+
}
|
86
|
+
|
87
|
+
// check callbackMethodName.length > 0
|
88
|
+
if (bytes(callbackMethodName).length == 0) {
|
89
|
+
revert ErrorOracleServiceCallbackMethodNameEmpty();
|
90
|
+
}
|
91
|
+
|
92
|
+
// create request info
|
93
|
+
IOracle.RequestInfo memory request = IOracle.RequestInfo({
|
94
|
+
requesterNftId: componentNftId,
|
95
|
+
callbackMethodName: callbackMethodName,
|
96
|
+
oracleNftId: oracleNftId,
|
97
|
+
requestData: requestData,
|
98
|
+
responseData: "",
|
99
|
+
respondedAt: TimestampLib.zero(),
|
100
|
+
expiredAt: expiryAt,
|
101
|
+
isCancelled: false
|
102
|
+
});
|
103
|
+
|
104
|
+
// store request with instance
|
105
|
+
requestId = instance.getInstanceStore().createRequest(request);
|
106
|
+
|
107
|
+
// call oracle component
|
108
|
+
IOracleComponent(oracleInfo.objectAddress).request(
|
109
|
+
requestId,
|
110
|
+
componentNftId,
|
111
|
+
requestData,
|
112
|
+
expiryAt);
|
113
|
+
|
114
|
+
emit LogOracleServiceRequestCreated(requestId, componentNftId, oracleNftId, expiryAt);
|
115
|
+
}
|
116
|
+
|
117
|
+
|
118
|
+
/// @dev respond to oracle request by oracle compnent.
|
119
|
+
/// permissioned: only the oracle component linked to the request id may call this method
|
120
|
+
function respond(
|
121
|
+
RequestId requestId,
|
122
|
+
bytes calldata responseData
|
123
|
+
)
|
124
|
+
external
|
125
|
+
virtual
|
126
|
+
// restricted() // add authz
|
127
|
+
{
|
128
|
+
(
|
129
|
+
NftId oracleNftId,
|
130
|
+
IRegistry.ObjectInfo memory componentInfo,
|
131
|
+
IInstance instance
|
132
|
+
) = _getAndVerifyActiveComponent(ORACLE());
|
133
|
+
|
134
|
+
bool callerIsOracle = true;
|
135
|
+
IOracle.RequestInfo memory request = _checkAndGetRequestInfo(instance, requestId, oracleNftId, callerIsOracle);
|
136
|
+
request.responseData = responseData;
|
137
|
+
request.respondedAt = TimestampLib.blockTimestamp();
|
138
|
+
|
139
|
+
instance.getInstanceStore().updateRequest(requestId, request, FULFILLED());
|
140
|
+
|
141
|
+
// TODO add callback to requesting compnent
|
142
|
+
|
143
|
+
emit LogOracleRequestFulfilled(requestId, oracleNftId);
|
144
|
+
}
|
145
|
+
|
146
|
+
/// @dev notify the oracle component that the specified request has become invalid
|
147
|
+
/// permissioned: only the originator of the request may cancel a request
|
148
|
+
function cancel(RequestId requestId)
|
149
|
+
external
|
150
|
+
virtual
|
151
|
+
// restricted() // add authz
|
152
|
+
{
|
153
|
+
(
|
154
|
+
NftId requesterNftId,
|
155
|
+
IRegistry.ObjectInfo memory componentInfo,
|
156
|
+
IInstance instance
|
157
|
+
) = _getAndVerifyActiveComponent(COMPONENT());
|
158
|
+
|
159
|
+
bool callerIsOracle = false;
|
160
|
+
IOracle.RequestInfo memory request = _checkAndGetRequestInfo(instance, requestId, requesterNftId, callerIsOracle);
|
161
|
+
request.isCancelled = true;
|
162
|
+
|
163
|
+
instance.getInstanceStore().updateRequest(requestId, request, CANCELLED());
|
164
|
+
|
165
|
+
// call oracle component
|
166
|
+
// TODO add check that component is active?
|
167
|
+
address oracleAddress = getRegistry().getObjectInfo(request.oracleNftId).objectAddress;
|
168
|
+
IOracleComponent(oracleAddress).cancel(requestId);
|
169
|
+
|
170
|
+
emit LogOracleRequestCancelled(requestId, requesterNftId);
|
171
|
+
}
|
172
|
+
|
173
|
+
|
174
|
+
function _checkAndGetRequestInfo(
|
175
|
+
IInstance instance,
|
176
|
+
RequestId requestId,
|
177
|
+
NftId callerNftId,
|
178
|
+
bool callerIsOracle
|
179
|
+
)
|
180
|
+
internal
|
181
|
+
virtual
|
182
|
+
view
|
183
|
+
returns (IOracle.RequestInfo memory info)
|
184
|
+
{
|
185
|
+
InstanceReader reader = instance.getInstanceReader();
|
186
|
+
StateId state = reader.getState(requestId.toKey32());
|
187
|
+
|
188
|
+
// check request state
|
189
|
+
if (state != ACTIVE()) {
|
190
|
+
revert ErrorOracleServiceRequestStateNotActive(requestId, state);
|
191
|
+
}
|
192
|
+
|
193
|
+
// check caller against resonsible oracle or requester
|
194
|
+
info = reader.getRequestInfo(requestId);
|
195
|
+
if (callerIsOracle) {
|
196
|
+
if (callerNftId != info.oracleNftId) {
|
197
|
+
revert ErrorOracleServiceCallerNotResponsibleOracle(requestId, info.oracleNftId, callerNftId);
|
198
|
+
}
|
199
|
+
} else {
|
200
|
+
if (callerNftId != info.requesterNftId) {
|
201
|
+
revert ErrorOracleServiceCallerNotRequester(requestId, info.requesterNftId, callerNftId);
|
202
|
+
}
|
203
|
+
}
|
204
|
+
|
205
|
+
// check expiry
|
206
|
+
if (info.expiredAt < TimestampLib.blockTimestamp()) {
|
207
|
+
revert ErrorOracleServiceRequestExpired(requestId, info.expiredAt);
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
|
212
|
+
function _getInstanceForComponent(NftId componentNftId)
|
213
|
+
internal
|
214
|
+
view
|
215
|
+
returns(IInstance instance)
|
216
|
+
{
|
217
|
+
NftId instanceNftId = getRegistry().getObjectInfo(componentNftId).parentNftId;
|
218
|
+
address instanceAddress = getRegistry().getObjectInfo(instanceNftId).objectAddress;
|
219
|
+
return IInstance(instanceAddress);
|
220
|
+
}
|
221
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IVersionable} from "../shared/IVersionable.sol";
|
5
|
+
import {ProxyManager} from "../shared/ProxyManager.sol";
|
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
|
+
|
11
|
+
contract OracleServiceManager is ProxyManager {
|
12
|
+
|
13
|
+
OracleService private _oracleService;
|
14
|
+
|
15
|
+
/// @dev initializes proxy manager with service implementation and deploys instance
|
16
|
+
constructor(
|
17
|
+
address authority,
|
18
|
+
address registryAddress,
|
19
|
+
bytes32 salt
|
20
|
+
)
|
21
|
+
ProxyManager(registryAddress)
|
22
|
+
{
|
23
|
+
OracleService orclSrv = new OracleService{salt: salt}();
|
24
|
+
bytes memory data = abi.encode(registryAddress, address(this), authority);
|
25
|
+
IVersionable versionable = deployDetermenistic(
|
26
|
+
address(orclSrv),
|
27
|
+
data,
|
28
|
+
salt);
|
29
|
+
|
30
|
+
_oracleService = OracleService(address(versionable));
|
31
|
+
}
|
32
|
+
|
33
|
+
//--- view functions ----------------------------------------------------//
|
34
|
+
function getOracleService()
|
35
|
+
external
|
36
|
+
view
|
37
|
+
returns (OracleService oracleService)
|
38
|
+
{
|
39
|
+
return _oracleService;
|
40
|
+
}
|
41
|
+
|
42
|
+
}
|
@@ -0,0 +1,296 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IBundle} from "../instance/module/IBundle.sol";
|
5
|
+
import {IComponents} from "../instance/module/IComponents.sol";
|
6
|
+
import {IComponentService} from "../shared/IComponentService.sol";
|
7
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
8
|
+
import {IInstance} from "../instance/IInstance.sol";
|
9
|
+
import {InstanceStore} from "../instance/InstanceStore.sol";
|
10
|
+
import {IPolicy} from "../instance/module/IPolicy.sol";
|
11
|
+
|
12
|
+
import {IVersionable} from "../shared/IVersionable.sol";
|
13
|
+
import {INftOwnable} from "../shared/INftOwnable.sol";
|
14
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
15
|
+
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
|
+
import {StateId, ACTIVE, PAUSED, CLOSED, KEEP_STATE} from "../type/StateId.sol";
|
22
|
+
import {Seconds} from "../type/Seconds.sol";
|
23
|
+
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
|
+
|
36
|
+
string constant BUNDLE_SERVICE_NAME = "BundleService";
|
37
|
+
|
38
|
+
contract BundleService is
|
39
|
+
ComponentVerifyingService,
|
40
|
+
IBundleService
|
41
|
+
{
|
42
|
+
using NftIdLib for NftId;
|
43
|
+
|
44
|
+
string public constant NAME = "BundleService";
|
45
|
+
|
46
|
+
address private _registryAddress;
|
47
|
+
IRegistryService private _registryService;
|
48
|
+
IComponentService private _componentService;
|
49
|
+
|
50
|
+
function _initialize(
|
51
|
+
address owner,
|
52
|
+
bytes memory data
|
53
|
+
)
|
54
|
+
internal
|
55
|
+
initializer
|
56
|
+
virtual override
|
57
|
+
{
|
58
|
+
address registryAddress;
|
59
|
+
address initialOwner;
|
60
|
+
(registryAddress, initialOwner) = abi.decode(data, (address, address));
|
61
|
+
// TODO while PoolService is not deployed in PoolServiceManager constructor
|
62
|
+
// owner is PoolServiceManager deployer
|
63
|
+
initializeService(registryAddress, address(0), owner);
|
64
|
+
|
65
|
+
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
66
|
+
_componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
67
|
+
|
68
|
+
registerInterface(type(IBundleService).interfaceId);
|
69
|
+
}
|
70
|
+
|
71
|
+
function getDomain() public pure override returns(ObjectType) {
|
72
|
+
return BUNDLE();
|
73
|
+
}
|
74
|
+
|
75
|
+
|
76
|
+
function setFee(
|
77
|
+
NftId bundleNftId,
|
78
|
+
Fee memory fee
|
79
|
+
)
|
80
|
+
external
|
81
|
+
virtual
|
82
|
+
{
|
83
|
+
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
84
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
85
|
+
IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
|
86
|
+
if(bundleInfo.poolNftId.eqz()) {
|
87
|
+
revert ErrorBundleServiceBundleUnknown(bundleNftId);
|
88
|
+
}
|
89
|
+
|
90
|
+
if(bundleInfo.poolNftId != poolNftId) {
|
91
|
+
revert ErrorBundleServiceBundlePoolMismatch(bundleNftId, bundleInfo.poolNftId, poolNftId);
|
92
|
+
}
|
93
|
+
|
94
|
+
bundleInfo.fee = fee;
|
95
|
+
instance.getInstanceStore().updateBundle(bundleNftId, bundleInfo, KEEP_STATE());
|
96
|
+
}
|
97
|
+
|
98
|
+
|
99
|
+
function create(
|
100
|
+
IInstance instance,
|
101
|
+
NftId poolNftId,
|
102
|
+
address owner,
|
103
|
+
Fee memory bundleFee,
|
104
|
+
Amount stakingAmount,
|
105
|
+
Seconds lifetime,
|
106
|
+
bytes calldata filter
|
107
|
+
)
|
108
|
+
external
|
109
|
+
override
|
110
|
+
restricted
|
111
|
+
returns(NftId bundleNftId)
|
112
|
+
{
|
113
|
+
// register bundle with registry
|
114
|
+
bundleNftId = _registryService.registerBundle(
|
115
|
+
IRegistry.ObjectInfo(
|
116
|
+
NftIdLib.zero(),
|
117
|
+
poolNftId,
|
118
|
+
BUNDLE(),
|
119
|
+
false, // intercepting property for bundles is defined on pool
|
120
|
+
address(0),
|
121
|
+
owner,
|
122
|
+
"" // bundle data to be stored in registry
|
123
|
+
)
|
124
|
+
);
|
125
|
+
|
126
|
+
// create bundle info in instance
|
127
|
+
InstanceStore instanceStore = instance.getInstanceStore();
|
128
|
+
instanceStore.createBundle(
|
129
|
+
bundleNftId,
|
130
|
+
IBundle.BundleInfo(
|
131
|
+
poolNftId,
|
132
|
+
bundleFee,
|
133
|
+
filter,
|
134
|
+
lifetime,
|
135
|
+
TimestampLib.blockTimestamp().addSeconds(lifetime),
|
136
|
+
zeroTimestamp()));
|
137
|
+
|
138
|
+
// bundle book keeping
|
139
|
+
_componentService.increaseBundleBalance(
|
140
|
+
instanceStore,
|
141
|
+
bundleNftId,
|
142
|
+
stakingAmount,
|
143
|
+
AmountLib.zero()); // fee amount
|
144
|
+
|
145
|
+
// put bundle under bundle managemet
|
146
|
+
BundleManager bundleManager = instance.getBundleManager();
|
147
|
+
bundleManager.add(bundleNftId);
|
148
|
+
|
149
|
+
// TODO add logging
|
150
|
+
}
|
151
|
+
|
152
|
+
|
153
|
+
// the bundle MUST be unlocked (active) for linking (underwriting) and registered with this instance
|
154
|
+
function lockCollateral(
|
155
|
+
IInstance instance,
|
156
|
+
NftId policyNftId,
|
157
|
+
NftId bundleNftId,
|
158
|
+
Amount collateralAmount // required local amount to collateralize policy
|
159
|
+
)
|
160
|
+
external
|
161
|
+
virtual
|
162
|
+
restricted()
|
163
|
+
{
|
164
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
165
|
+
StateId bundleState = instanceReader.getMetadata(bundleNftId.toKey32(BUNDLE())).state;
|
166
|
+
IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
|
167
|
+
|
168
|
+
// ensure bundle is active and not yet expired
|
169
|
+
if(bundleState != ACTIVE() || bundleInfo.expiredAt < TimestampLib.blockTimestamp()) {
|
170
|
+
revert ErrorBundleServiceBundleNotOpen(bundleNftId, bundleState, bundleInfo.expiredAt);
|
171
|
+
}
|
172
|
+
|
173
|
+
// ensure bundle capacity is sufficent to collateralize policy
|
174
|
+
InstanceStore instanceStore = instance.getInstanceStore();
|
175
|
+
(
|
176
|
+
Amount balanceAmount,
|
177
|
+
Amount lockedAmount,
|
178
|
+
Amount feeAmount
|
179
|
+
) = instanceStore.getAmounts(bundleNftId);
|
180
|
+
|
181
|
+
Amount capacity = balanceAmount - (lockedAmount + feeAmount);
|
182
|
+
if(capacity < collateralAmount) {
|
183
|
+
revert ErrorBundleServiceCapacityInsufficient(bundleNftId, capacity, collateralAmount);
|
184
|
+
}
|
185
|
+
|
186
|
+
// updated locked amount
|
187
|
+
instanceStore.increaseLocked(bundleNftId, collateralAmount);
|
188
|
+
|
189
|
+
// link policy to bundle in bundle manger
|
190
|
+
_linkPolicy(instance, policyNftId);
|
191
|
+
}
|
192
|
+
|
193
|
+
|
194
|
+
function lock(NftId bundleNftId)
|
195
|
+
external
|
196
|
+
virtual
|
197
|
+
{
|
198
|
+
(,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
199
|
+
|
200
|
+
// udpate bundle state
|
201
|
+
instance.getInstanceStore().updateBundleState(bundleNftId, PAUSED());
|
202
|
+
|
203
|
+
// update set of active bundles
|
204
|
+
BundleManager bundleManager = instance.getBundleManager();
|
205
|
+
bundleManager.lock(bundleNftId);
|
206
|
+
|
207
|
+
emit LogBundleServiceBundleLocked(bundleNftId);
|
208
|
+
}
|
209
|
+
|
210
|
+
|
211
|
+
function unlock(NftId bundleNftId)
|
212
|
+
external
|
213
|
+
virtual
|
214
|
+
{
|
215
|
+
(,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
216
|
+
|
217
|
+
// udpate bundle state
|
218
|
+
instance.getInstanceStore().updateBundleState(bundleNftId, ACTIVE());
|
219
|
+
|
220
|
+
// update set of active bundles
|
221
|
+
BundleManager bundleManager = instance.getBundleManager();
|
222
|
+
bundleManager.unlock(bundleNftId);
|
223
|
+
|
224
|
+
emit LogBundleServiceBundleActivated(bundleNftId);
|
225
|
+
}
|
226
|
+
|
227
|
+
|
228
|
+
function close(
|
229
|
+
IInstance instance,
|
230
|
+
NftId bundleNftId
|
231
|
+
)
|
232
|
+
external
|
233
|
+
virtual
|
234
|
+
restricted
|
235
|
+
{
|
236
|
+
// udpate bundle state
|
237
|
+
instance.getInstanceStore().updateBundleState(bundleNftId, CLOSED());
|
238
|
+
|
239
|
+
// ensure no open policies attached to bundle
|
240
|
+
BundleManager bundleManager = instance.getBundleManager();
|
241
|
+
uint256 openPolicies = bundleManager.activePolicies(bundleNftId);
|
242
|
+
if(openPolicies > 0) {
|
243
|
+
revert ErrorBundleServiceBundleWithOpenPolicies(bundleNftId, openPolicies);
|
244
|
+
}
|
245
|
+
|
246
|
+
// update set of active bundles
|
247
|
+
bundleManager.lock(bundleNftId);
|
248
|
+
}
|
249
|
+
|
250
|
+
|
251
|
+
function releaseCollateral(
|
252
|
+
IInstance instance,
|
253
|
+
NftId policyNftId,
|
254
|
+
NftId bundleNftId,
|
255
|
+
Amount collateralAmount
|
256
|
+
)
|
257
|
+
external
|
258
|
+
virtual
|
259
|
+
restricted()
|
260
|
+
{
|
261
|
+
instance.getInstanceStore().decreaseLocked(bundleNftId, collateralAmount);
|
262
|
+
}
|
263
|
+
|
264
|
+
/// @dev links policy to bundle
|
265
|
+
function _linkPolicy(IInstance instance, NftId policyNftId)
|
266
|
+
internal
|
267
|
+
{
|
268
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
269
|
+
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
270
|
+
|
271
|
+
// ensure policy has not yet been activated in a previous tx already
|
272
|
+
if (policyInfo.activatedAt.gtz() && policyInfo.activatedAt < TimestampLib.blockTimestamp()) {
|
273
|
+
revert BundleManager.ErrorBundleManagerPolicyAlreadyActivated(policyNftId);
|
274
|
+
}
|
275
|
+
|
276
|
+
BundleManager bundleManager = instance.getBundleManager();
|
277
|
+
bundleManager.linkPolicy(policyNftId);
|
278
|
+
}
|
279
|
+
|
280
|
+
/// @dev unlinks policy from bundle
|
281
|
+
function unlinkPolicy(
|
282
|
+
IInstance instance,
|
283
|
+
NftId policyNftId
|
284
|
+
)
|
285
|
+
external
|
286
|
+
virtual
|
287
|
+
restricted
|
288
|
+
{
|
289
|
+
// ensure policy is closeable
|
290
|
+
if (!instance.getInstanceReader().policyIsCloseable(policyNftId)) {
|
291
|
+
revert ErrorBundleServicePolicyNotCloseable(policyNftId);
|
292
|
+
}
|
293
|
+
|
294
|
+
instance.getBundleManager().unlinkPolicy(policyNftId);
|
295
|
+
}
|
296
|
+
}
|