@etherisc/gif-next 0.0.2-ed4dd55 → 0.0.2-edc2c3a-751
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +427 -9
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1293 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
- package/artifacts/contracts/{registry/IRegistry.sol/IOwnable.json → authorization/AccessAdmin.sol/IAccessManagedChecker.json} +4 -4
- 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 +414 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/{instance/access → authorization}/IAccess.sol/IAccess.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1060 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +295 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +167 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +4 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +1196 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +253 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1292 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +470 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +986 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +4 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +1494 -0
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +862 -0
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +4 -0
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +885 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +4 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +984 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1441 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +502 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +1991 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +470 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +1429 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +470 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1145 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1605 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +502 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2293 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +470 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +808 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +342 -514
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +4 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +709 -0
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +475 -580
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1684 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +574 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +2286 -0
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +1018 -0
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +746 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +3668 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +810 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +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 +137 -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/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +223 -0
- 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 +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/{pool/IPoolModule.sol/IPool.json → module/IBundle.sol/IBundle.json} +2 -2
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +4 -0
- package/artifacts/contracts/instance/{component/IComponent.sol/IComponent.json → module/IComponents.sol/IComponents.json} +2 -2
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.json +10 -0
- 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/module/IRisk.sol/IRisk.json +10 -0
- 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/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +929 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +478 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +52 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +744 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +709 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +845 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +990 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +766 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1222 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +502 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +4 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +1360 -0
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +822 -0
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +4 -0
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +922 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +4 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +877 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +4 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +1285 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +4 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.json +997 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +1619 -0
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +794 -0
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +4 -0
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +806 -0
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +730 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1116 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +470 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +4 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +1439 -0
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +858 -0
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +4 -0
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +573 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +942 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +4 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +944 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +4 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +578 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +4 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +973 -0
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +429 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +1313 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +810 -0
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +4 -0
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +923 -0
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +786 -0
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +4 -0
- package/artifacts/contracts/product/Product.sol/Product.json +1074 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +638 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +718 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +295 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +1030 -123
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +4 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +1019 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +4 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +39 -0
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +1535 -161
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1899 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +1262 -0
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +737 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +205 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1067 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +272 -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/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/shared/Component.sol/Component.json +677 -0
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +1908 -0
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +850 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +474 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +488 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/{instance/component/IComponent.sol/IInstanceLinked.json → shared/ContractLib.sol/IInstanceAdminHelper.json} +5 -5
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/{instance/access/IAccess.sol/IAccessCheckRole.json → shared/ContractLib.sol/ITargetHelper.json} +4 -9
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +602 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +4 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +1467 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +679 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +510 -0
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +4 -0
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +146 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +4 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +147 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +175 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +4 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +210 -0
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/{registry/IRegistry.sol → shared/IRegistryLinked.sol}/IRegistryLinked.json +5 -19
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +4 -0
- package/artifacts/contracts/shared/IService.sol/IService.json +375 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +4 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +53 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +767 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +538 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +4 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +174 -0
- 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 +4 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +209 -0
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +198 -0
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +4 -0
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +322 -0
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +58 -0
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +4 -0
- package/artifacts/contracts/shared/Service.sol/Service.json +442 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +822 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +395 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +172 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +4 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1417 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +4 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +1043 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +440 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +4 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.json +1816 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +205 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +780 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +587 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +1265 -0
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +734 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2283 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +607 -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 +398 -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 +203 -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 +317 -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/Key32Set.sol/LibKey32Set.dbg.json +4 -0
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +228 -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 +239 -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 +180 -0
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +369 -0
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +4 -0
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +246 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +105 -0
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +4 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +312 -0
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +4 -0
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +548 -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 +68 -0
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.json +55 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +618 -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/upgradeability/Versionable.sol/Versionable.json +78 -0
- package/contracts/authorization/AccessAdmin.sol +615 -0
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/Authorization.sol +289 -0
- package/contracts/authorization/IAccess.sol +49 -0
- package/contracts/authorization/IAccessAdmin.sol +137 -0
- package/contracts/authorization/IAuthorization.sol +60 -0
- package/contracts/authorization/IServiceAuthorization.sol +40 -0
- package/contracts/authorization/ReleaseAccessManager.sol +38 -0
- package/contracts/authorization/ServiceAuthorization.sol +106 -0
- package/contracts/distribution/BasicDistribution.sol +139 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +47 -0
- package/contracts/distribution/Distribution.sol +287 -0
- package/contracts/distribution/DistributionService.sol +354 -0
- package/contracts/distribution/DistributionServiceManager.sol +39 -0
- package/contracts/distribution/IDistributionComponent.sol +52 -0
- package/contracts/distribution/IDistributionService.sol +100 -0
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +90 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +35 -0
- package/contracts/examples/fire/FireProduct.sol +436 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +45 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +57 -0
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +137 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +107 -0
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +352 -0
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +130 -0
- package/contracts/instance/IInstance.sol +66 -15
- package/contracts/instance/IInstanceService.sol +70 -0
- package/contracts/instance/Instance.sol +221 -45
- package/contracts/instance/InstanceAdmin.sol +288 -0
- package/contracts/instance/InstanceAuthorizationV3.sol +218 -0
- package/contracts/instance/InstanceReader.sol +581 -0
- package/contracts/instance/InstanceService.sol +392 -0
- package/contracts/instance/InstanceServiceManager.sol +39 -0
- package/contracts/instance/InstanceStore.sol +287 -0
- package/contracts/instance/RiskSet.sol +119 -0
- package/contracts/instance/base/BalanceStore.sol +123 -0
- package/contracts/instance/base/Cloneable.sol +28 -0
- package/contracts/instance/base/ObjectCounter.sol +20 -0
- package/contracts/instance/base/ObjectLifecycle.sol +111 -0
- package/contracts/instance/base/ObjectSet.sol +78 -0
- package/contracts/instance/module/IAccess.sol +46 -0
- package/contracts/instance/module/IBundle.sol +20 -0
- package/contracts/instance/module/IComponents.sol +50 -0
- package/contracts/instance/module/IDistribution.sol +41 -0
- package/contracts/instance/module/IPolicy.sol +85 -0
- package/contracts/instance/module/IRisk.sol +12 -0
- package/contracts/mock/Dip.sol +26 -0
- package/contracts/oracle/BasicOracle.sol +47 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +46 -0
- package/contracts/oracle/IOracle.sol +36 -0
- package/contracts/oracle/IOracleComponent.sol +33 -0
- package/contracts/oracle/IOracleService.sol +66 -0
- package/contracts/oracle/Oracle.sol +156 -0
- package/contracts/oracle/OracleService.sol +309 -0
- package/contracts/oracle/OracleServiceManager.sol +39 -0
- package/contracts/pool/BasicPool.sol +175 -0
- package/contracts/pool/BasicPoolAuthorization.sol +68 -0
- package/contracts/pool/BundleService.sol +423 -0
- package/contracts/pool/BundleServiceManager.sol +39 -0
- package/contracts/pool/IBundleService.sol +122 -0
- package/contracts/pool/IPoolComponent.sol +62 -0
- package/contracts/pool/IPoolService.sol +153 -0
- package/contracts/pool/Pool.sol +345 -0
- package/contracts/pool/PoolService.sol +612 -0
- package/contracts/pool/PoolServiceManager.sol +39 -0
- package/contracts/product/ApplicationService.sol +259 -0
- package/contracts/product/ApplicationServiceManager.sol +38 -0
- package/contracts/product/BasicProduct.sol +49 -0
- package/contracts/product/BasicProductAuthorization.sol +41 -0
- package/contracts/product/ClaimService.sol +614 -0
- package/contracts/product/ClaimServiceManager.sol +38 -0
- package/contracts/product/IApplicationService.sol +66 -0
- package/contracts/product/IClaimService.sol +123 -0
- package/contracts/product/IPolicyService.sol +90 -0
- package/contracts/product/IPricingService.sol +39 -0
- package/contracts/product/IProductComponent.sol +59 -0
- package/contracts/product/IRiskService.sol +33 -0
- package/contracts/product/PolicyService.sol +733 -0
- package/contracts/product/PolicyServiceManager.sol +39 -0
- package/contracts/product/PricingService.sol +300 -0
- package/contracts/product/PricingServiceManager.sol +39 -0
- package/contracts/product/Product.sol +427 -0
- package/contracts/product/RiskService.sol +107 -0
- package/contracts/product/RiskServiceManager.sol +39 -0
- package/contracts/registry/ChainNft.sol +176 -100
- package/contracts/registry/IRegistry.sol +156 -51
- package/contracts/registry/IRegistryService.sol +62 -0
- package/contracts/registry/ITransferInterceptor.sol +6 -0
- package/contracts/registry/Registry.sol +660 -111
- package/contracts/registry/RegistryAdmin.sol +457 -0
- package/contracts/registry/RegistryService.sol +241 -0
- package/contracts/registry/RegistryServiceManager.sol +53 -0
- package/contracts/registry/ReleaseLifecycle.sol +30 -0
- package/contracts/registry/ReleaseRegistry.sol +486 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +176 -0
- package/contracts/registry/TokenRegistry.sol +315 -0
- package/contracts/shared/Component.sol +219 -0
- package/contracts/shared/ComponentService.sol +869 -0
- package/contracts/shared/ComponentServiceManager.sol +38 -0
- package/contracts/shared/ComponentVerifyingService.sol +128 -0
- package/contracts/shared/ContractLib.sol +224 -0
- package/contracts/shared/IComponent.sol +62 -0
- package/contracts/shared/IComponentService.sol +134 -0
- package/contracts/shared/IInstanceLinkedComponent.sol +30 -0
- package/contracts/shared/IKeyValueStore.sol +54 -0
- package/contracts/shared/ILifecycle.sol +31 -0
- package/contracts/shared/INftOwnable.sol +25 -0
- package/contracts/shared/IPolicyHolder.sol +35 -0
- package/contracts/shared/IRegisterable.sol +26 -0
- package/contracts/shared/IRegistryLinked.sol +11 -0
- package/contracts/shared/IService.sol +25 -0
- package/contracts/shared/InitializableERC165.sol +27 -0
- package/contracts/shared/InstanceLinkedComponent.sol +197 -0
- package/contracts/shared/KeyValueStore.sol +131 -0
- package/contracts/shared/Lifecycle.sol +88 -0
- package/contracts/shared/NftIdSet.sol +65 -0
- package/contracts/shared/NftOwnable.sol +127 -0
- package/contracts/shared/PolicyHolder.sol +62 -0
- package/contracts/shared/Registerable.sol +83 -0
- package/contracts/shared/RegistryLinked.sol +38 -0
- package/contracts/shared/Service.sol +84 -0
- package/contracts/shared/TokenHandler.sol +389 -0
- package/contracts/shared/TokenHandlerDeployerLib.sol +20 -0
- package/contracts/staking/IStaking.sol +173 -0
- package/contracts/staking/IStakingService.sol +157 -0
- package/contracts/staking/StakeManagerLib.sol +224 -0
- package/contracts/staking/Staking.sol +515 -0
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +52 -0
- package/contracts/staking/StakingReader.sol +190 -0
- package/contracts/staking/StakingService.sol +440 -0
- package/contracts/staking/StakingServiceManager.sol +44 -0
- package/contracts/staking/StakingStore.sol +605 -0
- package/contracts/staking/TargetManagerLib.sol +211 -0
- package/contracts/type/AddressSet.sol +58 -0
- package/contracts/type/Amount.sol +150 -0
- package/contracts/type/Blocknumber.sol +142 -0
- package/contracts/type/ClaimId.sol +80 -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/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +85 -0
- package/contracts/type/NftIdSet.sol +62 -0
- package/contracts/type/ObjectType.sol +278 -0
- package/contracts/type/PayoutId.sol +82 -0
- package/contracts/type/Referral.sol +90 -0
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RiskId.sol +69 -0
- package/contracts/type/RoleId.sol +162 -0
- package/contracts/type/Seconds.sol +101 -0
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/StateId.sol +149 -0
- package/contracts/type/String.sol +53 -0
- package/contracts/type/Timestamp.sol +146 -0
- package/contracts/type/UFixed.sol +245 -0
- package/contracts/type/Version.sol +110 -0
- package/contracts/upgradeability/IVersionable.sol +53 -0
- package/contracts/upgradeability/ProxyManager.sol +232 -0
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +14 -0
- package/contracts/upgradeability/Versionable.sol +59 -0
- package/package.json +26 -7
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +0 -4
- package/artifacts/contracts/components/Component.sol/Component.json +0 -179
- 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 -179
- package/artifacts/contracts/components/IProduct.sol/IProductComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IProduct.sol/IProductComponent.json +0 -192
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +0 -4
- package/artifacts/contracts/components/Pool.sol/Pool.json +0 -195
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +0 -4
- package/artifacts/contracts/components/Product.sol/Product.json +0 -213
- 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/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/ComponentModule.json +0 -327
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.json +0 -105
- 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 -179
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.dbg.json +0 -4
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.json +0 -245
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.json +0 -94
- package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.dbg.json +0 -4
- 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 -231
- package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.dbg.json +0 -4
- package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.json +0 -231
- 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 -149
- package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.dbg.json +0 -4
- package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.json +0 -162
- 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 -114
- 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 -125
- package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +0 -4
- package/artifacts/contracts/registry/IChainNft.sol/IChainNft.json +0 -452
- package/artifacts/contracts/registry/IRegistry.sol/IOwnable.dbg.json +0 -4
- 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/Registry.sol/Registerable.dbg.json +0 -4
- package/artifacts/contracts/registry/Registry.sol/Registerable.json +0 -166
- 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/ChainId.sol/ChainIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.json +0 -10
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +0 -10
- package/contracts/components/Component.sol +0 -62
- package/contracts/components/IPool.sol +0 -9
- package/contracts/components/IProduct.sol +0 -11
- package/contracts/components/Pool.sol +0 -29
- package/contracts/components/Product.sol +0 -65
- package/contracts/experiment/inheritance/A.sol +0 -56
- package/contracts/experiment/inheritance/B.sol +0 -23
- package/contracts/experiment/inheritance/C.sol +0 -28
- package/contracts/experiment/inheritance/IA.sol +0 -18
- package/contracts/experiment/inheritance/IB.sol +0 -9
- package/contracts/experiment/inheritance/IC.sol +0 -11
- package/contracts/experiment/types/TypeA.sol +0 -42
- package/contracts/experiment/types/TypeB.sol +0 -24
- package/contracts/instance/access/Access.sol +0 -218
- package/contracts/instance/access/IAccess.sol +0 -83
- package/contracts/instance/component/ComponentModule.sol +0 -259
- package/contracts/instance/component/IComponent.sol +0 -94
- package/contracts/instance/policy/IPolicy.sol +0 -66
- package/contracts/instance/policy/PolicyModule.sol +0 -106
- package/contracts/instance/pool/IPoolModule.sol +0 -40
- package/contracts/instance/pool/PoolModule.sol +0 -83
- package/contracts/instance/product/IProductService.sol +0 -45
- package/contracts/instance/product/ProductService.sol +0 -105
- package/contracts/registry/IChainNft.sol +0 -18
- package/contracts/types/ChainId.sol +0 -24
- package/contracts/types/NftId.sol +0 -25
@@ -0,0 +1,149 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
// uint96 allows for chain ids up to 13 digits
|
5
|
+
type StateId is uint8;
|
6
|
+
|
7
|
+
// type bindings
|
8
|
+
using {
|
9
|
+
eqStateId as ==,
|
10
|
+
neStateId as !=,
|
11
|
+
StateIdLib.eqz,
|
12
|
+
StateIdLib.eq,
|
13
|
+
StateIdLib.gtz,
|
14
|
+
StateIdLib.toInt
|
15
|
+
} for StateId global;
|
16
|
+
|
17
|
+
// general pure free functions
|
18
|
+
|
19
|
+
function INITIAL() pure returns (StateId) {
|
20
|
+
return toStateId(1);
|
21
|
+
}
|
22
|
+
|
23
|
+
function SCHEDULED() pure returns (StateId) {
|
24
|
+
return toStateId(2);
|
25
|
+
}
|
26
|
+
|
27
|
+
function DEPLOYING() pure returns (StateId) {
|
28
|
+
return toStateId(3);
|
29
|
+
}
|
30
|
+
|
31
|
+
function DEPLOYED() pure returns (StateId) {
|
32
|
+
return toStateId(4);
|
33
|
+
}
|
34
|
+
|
35
|
+
function ACTIVE() pure returns (StateId) {
|
36
|
+
return toStateId(5);
|
37
|
+
}
|
38
|
+
|
39
|
+
function SKIPPED() pure returns (StateId) {
|
40
|
+
return toStateId(6);
|
41
|
+
}
|
42
|
+
|
43
|
+
function APPLIED() pure returns (StateId) {
|
44
|
+
return toStateId(10);
|
45
|
+
}
|
46
|
+
|
47
|
+
function REVOKED() pure returns (StateId) {
|
48
|
+
return toStateId(20);
|
49
|
+
}
|
50
|
+
|
51
|
+
function DECLINED() pure returns (StateId) {
|
52
|
+
return toStateId(30);
|
53
|
+
}
|
54
|
+
|
55
|
+
function COLLATERALIZED() pure returns (StateId) {
|
56
|
+
return toStateId(40);
|
57
|
+
}
|
58
|
+
|
59
|
+
function SUBMITTED() pure returns (StateId) {
|
60
|
+
return toStateId(50);
|
61
|
+
}
|
62
|
+
|
63
|
+
function CONFIRMED() pure returns (StateId) {
|
64
|
+
return toStateId(51);
|
65
|
+
}
|
66
|
+
|
67
|
+
function EXPECTED() pure returns (StateId) {
|
68
|
+
return toStateId(60);
|
69
|
+
}
|
70
|
+
|
71
|
+
function FULFILLED() pure returns (StateId) {
|
72
|
+
return toStateId(70);
|
73
|
+
}
|
74
|
+
|
75
|
+
function FAILED() pure returns (StateId) {
|
76
|
+
return toStateId(7);
|
77
|
+
}
|
78
|
+
|
79
|
+
function CANCELLED() pure returns (StateId) {
|
80
|
+
return toStateId(72);
|
81
|
+
}
|
82
|
+
|
83
|
+
function PAUSED() pure returns (StateId) {
|
84
|
+
return toStateId(110);
|
85
|
+
}
|
86
|
+
|
87
|
+
function CLOSED() pure returns (StateId) {
|
88
|
+
return toStateId(200);
|
89
|
+
}
|
90
|
+
|
91
|
+
function ARCHIVED() pure returns (StateId) {
|
92
|
+
return toStateId(210);
|
93
|
+
}
|
94
|
+
|
95
|
+
function PAID() pure returns (StateId) {
|
96
|
+
return toStateId(220);
|
97
|
+
}
|
98
|
+
|
99
|
+
function KEEP_STATE() pure returns (StateId) {
|
100
|
+
return toStateId(type(uint8).max);
|
101
|
+
}
|
102
|
+
|
103
|
+
/// @dev Converts the uint8 to a StateId.
|
104
|
+
function toStateId(uint256 id) pure returns (StateId) {
|
105
|
+
return StateId.wrap(uint8(id));
|
106
|
+
}
|
107
|
+
|
108
|
+
// TODO move to StateIdLib and rename to zero()
|
109
|
+
/// @dev Return the StateId zero (0)
|
110
|
+
function zeroStateId() pure returns (StateId) {
|
111
|
+
return StateId.wrap(0);
|
112
|
+
}
|
113
|
+
|
114
|
+
// pure free functions for operators
|
115
|
+
function eqStateId(StateId a, StateId b) pure returns (bool isSame) {
|
116
|
+
return StateId.unwrap(a) == StateId.unwrap(b);
|
117
|
+
}
|
118
|
+
|
119
|
+
function neStateId(StateId a, StateId b) pure returns (bool isDifferent) {
|
120
|
+
return StateId.unwrap(a) != StateId.unwrap(b);
|
121
|
+
}
|
122
|
+
|
123
|
+
// library functions that operate on user defined type
|
124
|
+
library StateIdLib {
|
125
|
+
|
126
|
+
function zero() public pure returns (StateId) {
|
127
|
+
return StateId.wrap(0);
|
128
|
+
}
|
129
|
+
|
130
|
+
/// @dev Converts the NftId to a uint256.
|
131
|
+
function toInt(StateId stateId) public pure returns (uint96) {
|
132
|
+
return uint96(StateId.unwrap(stateId));
|
133
|
+
}
|
134
|
+
|
135
|
+
/// @dev Returns true if the value is non-zero (> 0).
|
136
|
+
function gtz(StateId a) public pure returns (bool) {
|
137
|
+
return StateId.unwrap(a) > 0;
|
138
|
+
}
|
139
|
+
|
140
|
+
/// @dev Returns true if the value is zero (== 0).
|
141
|
+
function eqz(StateId a) public pure returns (bool) {
|
142
|
+
return StateId.unwrap(a) == 0;
|
143
|
+
}
|
144
|
+
|
145
|
+
/// @dev Returns true if the values are equal (==).
|
146
|
+
function eq(StateId a, StateId b) public pure returns (bool isSame) {
|
147
|
+
return eqStateId(a, b);
|
148
|
+
}
|
149
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {ShortString, ShortStrings} from "@openzeppelin/contracts/utils/ShortStrings.sol";
|
5
|
+
|
6
|
+
type Str is bytes32;
|
7
|
+
|
8
|
+
using {
|
9
|
+
StrEq as ==,
|
10
|
+
StrNe as !=,
|
11
|
+
StrLib.toString,
|
12
|
+
StrLib.length
|
13
|
+
} for Str global;
|
14
|
+
|
15
|
+
function StrEq(Str s1, Str s2) pure returns (bool) {
|
16
|
+
return StrLib.eq(s1, s2);
|
17
|
+
}
|
18
|
+
|
19
|
+
function StrNe(Str s1, Str s2) pure returns (bool) {
|
20
|
+
return StrLib.ne(s1, s2);
|
21
|
+
}
|
22
|
+
|
23
|
+
library StrLib {
|
24
|
+
|
25
|
+
|
26
|
+
/// @dev converts the provided string into a short string.
|
27
|
+
/// uses ShortStrings.toShortString
|
28
|
+
function toStr(string memory str) public pure returns (Str) {
|
29
|
+
return Str.wrap(ShortString.unwrap(ShortStrings.toShortString(str)));
|
30
|
+
}
|
31
|
+
|
32
|
+
/// @dev return true iff s1 equals s2
|
33
|
+
function eq(Str s1, Str s2) public pure returns (bool) {
|
34
|
+
return Str.unwrap(s1) == Str.unwrap(s2);
|
35
|
+
}
|
36
|
+
|
37
|
+
/// @dev return true iff s1 differs from s2
|
38
|
+
function ne(Str s1, Str s2) public pure returns (bool) {
|
39
|
+
return Str.unwrap(s1) != Str.unwrap(s2);
|
40
|
+
}
|
41
|
+
|
42
|
+
/// @dev converts the provided short string into a string.
|
43
|
+
/// uses ShortStrings.toString
|
44
|
+
function toString(Str str) public pure returns (string memory) {
|
45
|
+
return ShortStrings.toString(ShortString.wrap(Str.unwrap(str)));
|
46
|
+
}
|
47
|
+
|
48
|
+
/// @dev converts the provided short string into a string.
|
49
|
+
/// uses ShortStrings.byteLength
|
50
|
+
function length(Str str) public pure returns (uint256 byteLength) {
|
51
|
+
return ShortStrings.byteLength(ShortString.wrap(Str.unwrap(str)));
|
52
|
+
}
|
53
|
+
}
|
@@ -0,0 +1,146 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {Seconds} from "./Seconds.sol";
|
5
|
+
|
6
|
+
type Timestamp is uint40;
|
7
|
+
|
8
|
+
using {
|
9
|
+
gtTimestamp as >,
|
10
|
+
gteTimestamp as >=,
|
11
|
+
ltTimestamp as <,
|
12
|
+
lteTimestamp as <=,
|
13
|
+
eqTimestamp as ==,
|
14
|
+
neTimestamp as !=,
|
15
|
+
TimestampLib.eq,
|
16
|
+
TimestampLib.ne,
|
17
|
+
TimestampLib.gt,
|
18
|
+
TimestampLib.gte,
|
19
|
+
TimestampLib.lt,
|
20
|
+
TimestampLib.lte,
|
21
|
+
TimestampLib.gtz,
|
22
|
+
TimestampLib.eqz,
|
23
|
+
TimestampLib.addSeconds,
|
24
|
+
TimestampLib.toInt
|
25
|
+
} for Timestamp global;
|
26
|
+
|
27
|
+
/// @dev return true if Timestamp a is after Timestamp b
|
28
|
+
function gtTimestamp(Timestamp a, Timestamp b) pure returns (bool) {
|
29
|
+
return Timestamp.unwrap(a) > Timestamp.unwrap(b);
|
30
|
+
}
|
31
|
+
|
32
|
+
/// @dev return true if Timestamp a is after or equal to Timestamp b
|
33
|
+
function gteTimestamp(Timestamp a, Timestamp b) pure returns (bool) {
|
34
|
+
return Timestamp.unwrap(a) >= Timestamp.unwrap(b);
|
35
|
+
}
|
36
|
+
|
37
|
+
/// @dev return true if Timestamp a is before Timestamp b
|
38
|
+
function ltTimestamp(Timestamp a, Timestamp b) pure returns (bool) {
|
39
|
+
return Timestamp.unwrap(a) < Timestamp.unwrap(b);
|
40
|
+
}
|
41
|
+
|
42
|
+
/// @dev return true if Timestamp a is before or equal to Timestamp b
|
43
|
+
function lteTimestamp(Timestamp a, Timestamp b) pure returns (bool) {
|
44
|
+
return Timestamp.unwrap(a) <= Timestamp.unwrap(b);
|
45
|
+
}
|
46
|
+
|
47
|
+
/// @dev return true if Timestamp a is equal to Timestamp b
|
48
|
+
function eqTimestamp(Timestamp a, Timestamp b) pure returns (bool) {
|
49
|
+
return Timestamp.unwrap(a) == Timestamp.unwrap(b);
|
50
|
+
}
|
51
|
+
|
52
|
+
/// @dev return true if Timestamp a is not equal to Timestamp b
|
53
|
+
function neTimestamp(Timestamp a, Timestamp b) pure returns (bool) {
|
54
|
+
return Timestamp.unwrap(a) != Timestamp.unwrap(b);
|
55
|
+
}
|
56
|
+
|
57
|
+
/// @dev Converts the uint256 to a Timestamp.
|
58
|
+
function toTimestamp(uint256 timestamp) pure returns (Timestamp) {
|
59
|
+
return TimestampLib.toTimestamp(timestamp);
|
60
|
+
}
|
61
|
+
|
62
|
+
// TODO move to TimestampLib and rename to zero()
|
63
|
+
/// @dev Return the Timestamp zero (0)
|
64
|
+
function zeroTimestamp() pure returns (Timestamp) {
|
65
|
+
return Timestamp.wrap(0);
|
66
|
+
}
|
67
|
+
|
68
|
+
library TimestampLib {
|
69
|
+
|
70
|
+
function zero() public pure returns (Timestamp) {
|
71
|
+
return Timestamp.wrap(0);
|
72
|
+
}
|
73
|
+
|
74
|
+
function max() public pure returns (Timestamp) {
|
75
|
+
return Timestamp.wrap(type(uint40).max);
|
76
|
+
}
|
77
|
+
|
78
|
+
function blockTimestamp() public view returns (Timestamp) {
|
79
|
+
return Timestamp.wrap(uint40(block.timestamp));
|
80
|
+
}
|
81
|
+
|
82
|
+
function toTimestamp(uint256 timestamp) public pure returns (Timestamp) {
|
83
|
+
return Timestamp.wrap(uint40(timestamp));
|
84
|
+
}
|
85
|
+
|
86
|
+
/// @dev return true if Timestamp a is after Timestamp b
|
87
|
+
function gt(Timestamp a, Timestamp b) public pure returns (bool isAfter) {
|
88
|
+
return gtTimestamp(a, b);
|
89
|
+
}
|
90
|
+
|
91
|
+
/// @dev return true if Timestamp a is after or the same than Timestamp b
|
92
|
+
function gte(
|
93
|
+
Timestamp a,
|
94
|
+
Timestamp b
|
95
|
+
) public pure returns (bool isAfterOrSame) {
|
96
|
+
return gteTimestamp(a, b);
|
97
|
+
}
|
98
|
+
|
99
|
+
/// @dev return true if Timestamp a is before Timestamp b
|
100
|
+
function lt(Timestamp a, Timestamp b) public pure returns (bool isBefore) {
|
101
|
+
return ltTimestamp(a, b);
|
102
|
+
}
|
103
|
+
|
104
|
+
/// @dev return true if Timestamp a is before or the same than Timestamp b
|
105
|
+
function lte(
|
106
|
+
Timestamp a,
|
107
|
+
Timestamp b
|
108
|
+
) public pure returns (bool isBeforeOrSame) {
|
109
|
+
return lteTimestamp(a, b);
|
110
|
+
}
|
111
|
+
|
112
|
+
/// @dev return true if Timestamp a is equal to Timestamp b
|
113
|
+
function eq(Timestamp a, Timestamp b) public pure returns (bool isSame) {
|
114
|
+
return eqTimestamp(a, b);
|
115
|
+
}
|
116
|
+
|
117
|
+
/// @dev return true if Timestamp a is not equal to Timestamp b
|
118
|
+
function ne(
|
119
|
+
Timestamp a,
|
120
|
+
Timestamp b
|
121
|
+
) public pure returns (bool isDifferent) {
|
122
|
+
return neTimestamp(a, b);
|
123
|
+
}
|
124
|
+
|
125
|
+
/// @dev return true if Timestamp equals 0
|
126
|
+
function eqz(Timestamp timestamp) public pure returns (bool) {
|
127
|
+
return Timestamp.unwrap(timestamp) == 0;
|
128
|
+
}
|
129
|
+
|
130
|
+
/// @dev return true if Timestamp is larger than 0
|
131
|
+
function gtz(Timestamp timestamp) public pure returns (bool) {
|
132
|
+
return Timestamp.unwrap(timestamp) > 0;
|
133
|
+
}
|
134
|
+
|
135
|
+
/// @dev return true if Timestamp a is not equal to Timestamp b
|
136
|
+
function addSeconds(
|
137
|
+
Timestamp timestamp,
|
138
|
+
Seconds duration
|
139
|
+
) public pure returns (Timestamp) {
|
140
|
+
return toTimestamp(Timestamp.unwrap(timestamp) + duration.toInt());
|
141
|
+
}
|
142
|
+
|
143
|
+
function toInt(Timestamp timestamp) public pure returns (uint256) {
|
144
|
+
return uint256(uint40(Timestamp.unwrap(timestamp)));
|
145
|
+
}
|
146
|
+
}
|
@@ -0,0 +1,245 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
|
5
|
+
|
6
|
+
/// @dev UFixed is a fixed point number with 18 decimals precision.
|
7
|
+
type UFixed is uint256;
|
8
|
+
|
9
|
+
using {
|
10
|
+
addUFixed as +,
|
11
|
+
subUFixed as -,
|
12
|
+
mulUFixed as *,
|
13
|
+
divUFixed as /,
|
14
|
+
gtUFixed as >,
|
15
|
+
gteUFixed as >=,
|
16
|
+
ltUFixed as <,
|
17
|
+
lteUFixed as <=,
|
18
|
+
eqUFixed as ==,
|
19
|
+
neUFixed as !=,
|
20
|
+
UFixedLib.gt,
|
21
|
+
UFixedLib.gtz,
|
22
|
+
UFixedLib.toInt,
|
23
|
+
UFixedLib.toInt1000
|
24
|
+
} for UFixed global;
|
25
|
+
|
26
|
+
// TODO move to UFixedLib and rename to zero()
|
27
|
+
function zeroUFixed() pure returns (UFixed zero) {
|
28
|
+
return UFixed.wrap(0);
|
29
|
+
}
|
30
|
+
|
31
|
+
function addUFixed(UFixed a, UFixed b) pure returns (UFixed) {
|
32
|
+
return UFixed.wrap(UFixed.unwrap(a) + UFixed.unwrap(b));
|
33
|
+
}
|
34
|
+
|
35
|
+
function subUFixed(UFixed a, UFixed b) pure returns (UFixed) {
|
36
|
+
if (a < b) {
|
37
|
+
revert UFixedLib.UFixedLibNegativeResult();
|
38
|
+
}
|
39
|
+
return UFixed.wrap(UFixed.unwrap(a) - UFixed.unwrap(b));
|
40
|
+
}
|
41
|
+
|
42
|
+
function mulUFixed(UFixed a, UFixed b) pure returns (UFixed) {
|
43
|
+
return
|
44
|
+
UFixed.wrap(Math.mulDiv(UFixed.unwrap(a), UFixed.unwrap(b), 10 ** 18));
|
45
|
+
}
|
46
|
+
|
47
|
+
function divUFixed(UFixed a, UFixed b) pure returns (UFixed) {
|
48
|
+
if (UFixed.unwrap(b) == 0) {
|
49
|
+
revert UFixedLib.UFixedLibDivisionByZero();
|
50
|
+
}
|
51
|
+
|
52
|
+
return
|
53
|
+
UFixed.wrap(Math.mulDiv(UFixed.unwrap(a), 10 ** 18, UFixed.unwrap(b)));
|
54
|
+
}
|
55
|
+
|
56
|
+
function gtUFixed(UFixed a, UFixed b) pure returns (bool isGreaterThan) {
|
57
|
+
return UFixed.unwrap(a) > UFixed.unwrap(b);
|
58
|
+
}
|
59
|
+
|
60
|
+
function gteUFixed(UFixed a, UFixed b) pure returns (bool isGreaterThan) {
|
61
|
+
return UFixed.unwrap(a) >= UFixed.unwrap(b);
|
62
|
+
}
|
63
|
+
|
64
|
+
function ltUFixed(UFixed a, UFixed b) pure returns (bool isGreaterThan) {
|
65
|
+
return UFixed.unwrap(a) < UFixed.unwrap(b);
|
66
|
+
}
|
67
|
+
|
68
|
+
function lteUFixed(UFixed a, UFixed b) pure returns (bool isGreaterThan) {
|
69
|
+
return UFixed.unwrap(a) <= UFixed.unwrap(b);
|
70
|
+
}
|
71
|
+
|
72
|
+
function eqUFixed(UFixed a, UFixed b) pure returns (bool isEqual) {
|
73
|
+
return UFixed.unwrap(a) == UFixed.unwrap(b);
|
74
|
+
}
|
75
|
+
|
76
|
+
function neUFixed(UFixed a, UFixed b) pure returns (bool isEqual) {
|
77
|
+
return UFixed.unwrap(a) != UFixed.unwrap(b);
|
78
|
+
}
|
79
|
+
|
80
|
+
function gtzUFixed(UFixed a) pure returns (bool isZero) {
|
81
|
+
return UFixed.unwrap(a) > 0;
|
82
|
+
}
|
83
|
+
|
84
|
+
function eqzUFixed(UFixed a) pure returns (bool isZero) {
|
85
|
+
return UFixed.unwrap(a) == 0;
|
86
|
+
}
|
87
|
+
|
88
|
+
function deltaUFixed(UFixed a, UFixed b) pure returns (UFixed) {
|
89
|
+
if (a > b) {
|
90
|
+
return a - b;
|
91
|
+
}
|
92
|
+
|
93
|
+
return b - a;
|
94
|
+
}
|
95
|
+
|
96
|
+
library UFixedLib {
|
97
|
+
error UFixedLibNegativeResult();
|
98
|
+
error UFixedLibDivisionByZero();
|
99
|
+
|
100
|
+
error UFixedLibExponentTooSmall(int8 exp);
|
101
|
+
error UFixedLibExponentTooLarge(int8 exp);
|
102
|
+
|
103
|
+
int8 public constant EXP = 18;
|
104
|
+
uint256 public constant MULTIPLIER = 10 ** uint256(int256(EXP));
|
105
|
+
uint256 public constant MULTIPLIER_HALF = MULTIPLIER / 2;
|
106
|
+
|
107
|
+
/// @dev returns the rounding mode DOWN - 0.4 becomes 0, 0.5 becomes 0, 0.6 becomes 0
|
108
|
+
function ROUNDING_DOWN() public pure returns (uint8) {
|
109
|
+
return uint8(0);
|
110
|
+
}
|
111
|
+
|
112
|
+
/// @dev returns the rounding mode UP - 0.4 becomes 1, 0.5 becomes 1, 0.6 becomes 1
|
113
|
+
function ROUNDING_UP() public pure returns (uint8) {
|
114
|
+
return uint8(1);
|
115
|
+
}
|
116
|
+
|
117
|
+
/// @dev returns the rounding mode HALF_UP - 0.4 becomes 0, 0.5 becomes 1, 0.6 becomes 1
|
118
|
+
function ROUNDING_HALF_UP() public pure returns (uint8) {
|
119
|
+
return uint8(2);
|
120
|
+
}
|
121
|
+
|
122
|
+
/// @dev Converts the uint256 to a UFixed.
|
123
|
+
function toUFixed(uint256 a) public pure returns (UFixed) {
|
124
|
+
return UFixed.wrap(a * MULTIPLIER);
|
125
|
+
}
|
126
|
+
|
127
|
+
/// @dev Converts the uint256 to a UFixed with given exponent.
|
128
|
+
function toUFixed(uint256 a, int8 exp) public pure returns (UFixed) {
|
129
|
+
if (EXP + exp < 0) {
|
130
|
+
revert UFixedLibExponentTooSmall(exp);
|
131
|
+
}
|
132
|
+
if (EXP + exp > 64) {
|
133
|
+
revert UFixedLibExponentTooLarge(exp);
|
134
|
+
}
|
135
|
+
|
136
|
+
return UFixed.wrap(a * 10 ** uint8(EXP + exp));
|
137
|
+
}
|
138
|
+
|
139
|
+
/// @dev returns the decimals precision of the UFixed type
|
140
|
+
function decimals() public pure returns (uint256) {
|
141
|
+
return uint8(EXP);
|
142
|
+
}
|
143
|
+
|
144
|
+
/// @dev Converts a UFixed to a uint256.
|
145
|
+
function toInt(UFixed a) public pure returns (uint256) {
|
146
|
+
return toIntWithRounding(a, ROUNDING_HALF_UP());
|
147
|
+
}
|
148
|
+
|
149
|
+
/// @dev Converts a UFixed to a uint256.
|
150
|
+
function toInt1000(UFixed a) public pure returns (uint256) {
|
151
|
+
return toIntWithRounding(toUFixed(1000) * a, ROUNDING_HALF_UP());
|
152
|
+
}
|
153
|
+
|
154
|
+
/// @dev Converts a UFixed to a uint256 with given rounding mode.
|
155
|
+
function toIntWithRounding(UFixed a, uint8 rounding) public pure returns (uint256) {
|
156
|
+
if (rounding == ROUNDING_HALF_UP()) {
|
157
|
+
return
|
158
|
+
Math.mulDiv(
|
159
|
+
UFixed.unwrap(a) + MULTIPLIER_HALF,
|
160
|
+
1,
|
161
|
+
MULTIPLIER,
|
162
|
+
Math.Rounding.Floor
|
163
|
+
);
|
164
|
+
} else if (rounding == ROUNDING_DOWN()) {
|
165
|
+
return
|
166
|
+
Math.mulDiv(
|
167
|
+
UFixed.unwrap(a),
|
168
|
+
1,
|
169
|
+
MULTIPLIER,
|
170
|
+
Math.Rounding.Floor
|
171
|
+
);
|
172
|
+
} else {
|
173
|
+
return
|
174
|
+
Math.mulDiv(UFixed.unwrap(a), 1, MULTIPLIER, Math.Rounding.Ceil);
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
/// @dev adds two UFixed numbers
|
179
|
+
function add(UFixed a, UFixed b) public pure returns (UFixed) {
|
180
|
+
return addUFixed(a, b);
|
181
|
+
}
|
182
|
+
|
183
|
+
/// @dev subtracts two UFixed numbers
|
184
|
+
function sub(UFixed a, UFixed b) public pure returns (UFixed) {
|
185
|
+
return subUFixed(a, b);
|
186
|
+
}
|
187
|
+
|
188
|
+
/// @dev multiplies two UFixed numbers
|
189
|
+
function mul(UFixed a, UFixed b) public pure returns (UFixed) {
|
190
|
+
return mulUFixed(a, b);
|
191
|
+
}
|
192
|
+
|
193
|
+
/// @dev divides two UFixed numbers
|
194
|
+
function div(UFixed a, UFixed b) public pure returns (UFixed) {
|
195
|
+
return divUFixed(a, b);
|
196
|
+
}
|
197
|
+
|
198
|
+
/// @dev return true if UFixed a is greater than UFixed b
|
199
|
+
function gt(UFixed a, UFixed b) public pure returns (bool isGreaterThan) {
|
200
|
+
return gtUFixed(a, b);
|
201
|
+
}
|
202
|
+
|
203
|
+
/// @dev return true if UFixed a is greater than or equal to UFixed b
|
204
|
+
function gte(UFixed a, UFixed b) public pure returns (bool isGreaterThan) {
|
205
|
+
return gteUFixed(a, b);
|
206
|
+
}
|
207
|
+
|
208
|
+
/// @dev return true if UFixed a is less than UFixed b
|
209
|
+
function lt(UFixed a, UFixed b) public pure returns (bool isGreaterThan) {
|
210
|
+
return ltUFixed(a, b);
|
211
|
+
}
|
212
|
+
|
213
|
+
/// @dev return true if UFixed a is less than or equal to UFixed b
|
214
|
+
function lte(UFixed a, UFixed b) public pure returns (bool isGreaterThan) {
|
215
|
+
return lteUFixed(a, b);
|
216
|
+
}
|
217
|
+
|
218
|
+
/// @dev return true if UFixed a is equal to UFixed b
|
219
|
+
function eq(UFixed a, UFixed b) public pure returns (bool isEqual) {
|
220
|
+
return eqUFixed(a, b);
|
221
|
+
}
|
222
|
+
|
223
|
+
/// @dev return true if UFixed a is not zero
|
224
|
+
function gtz(UFixed a) public pure returns (bool isZero) {
|
225
|
+
return gtzUFixed(a);
|
226
|
+
}
|
227
|
+
|
228
|
+
/// @dev return true if UFixed a is zero
|
229
|
+
function eqz(UFixed a) public pure returns (bool isZero) {
|
230
|
+
return eqzUFixed(a);
|
231
|
+
}
|
232
|
+
|
233
|
+
function zero() public pure returns (UFixed) {
|
234
|
+
return UFixed.wrap(0);
|
235
|
+
}
|
236
|
+
|
237
|
+
function one() public pure returns (UFixed) {
|
238
|
+
return UFixed.wrap(MULTIPLIER);
|
239
|
+
}
|
240
|
+
|
241
|
+
/// @dev return the absolute delta between two UFixed numbers
|
242
|
+
function delta(UFixed a, UFixed b) public pure returns (UFixed) {
|
243
|
+
return deltaUFixed(a, b);
|
244
|
+
}
|
245
|
+
}
|
@@ -0,0 +1,110 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
type VersionPart is uint8;
|
5
|
+
|
6
|
+
using {
|
7
|
+
versionPartGt as >,
|
8
|
+
versionPartEq as ==,
|
9
|
+
versionPartNe as !=,
|
10
|
+
VersionPartLib.eqz,
|
11
|
+
VersionPartLib.toInt
|
12
|
+
}
|
13
|
+
for VersionPart global;
|
14
|
+
|
15
|
+
function versionPartGt(VersionPart a, VersionPart b) pure returns(bool isGreaterThan) { return VersionPart.unwrap(a) > VersionPart.unwrap(b); }
|
16
|
+
function versionPartEq(VersionPart a, VersionPart b) pure returns(bool isSame) { return VersionPart.unwrap(a) == VersionPart.unwrap(b); }
|
17
|
+
function versionPartNe(VersionPart a, VersionPart b) pure returns(bool isSame) { return VersionPart.unwrap(a) != VersionPart.unwrap(b); }
|
18
|
+
|
19
|
+
library VersionPartLib {
|
20
|
+
function eqz(VersionPart a) external pure returns(bool) { return VersionPart.unwrap(a) == 0; }
|
21
|
+
function toInt(VersionPart a) external pure returns(uint256) { return VersionPart.unwrap(a); }
|
22
|
+
function toVersionPart(uint256 a) external pure returns(VersionPart) { return VersionPart.wrap(uint8(a)); }
|
23
|
+
}
|
24
|
+
|
25
|
+
type Version is uint24; // contains major,minor,patch version parts
|
26
|
+
|
27
|
+
using {
|
28
|
+
versionGt as >,
|
29
|
+
versionEq as ==,
|
30
|
+
VersionLib.toInt,
|
31
|
+
VersionLib.toUint64,
|
32
|
+
VersionLib.toMajorPart,
|
33
|
+
VersionLib.toVersionParts
|
34
|
+
}
|
35
|
+
for Version global;
|
36
|
+
|
37
|
+
function versionGt(Version a, Version b) pure returns(bool isGreaterThan) { return Version.unwrap(a) > Version.unwrap(b); }
|
38
|
+
function versionEq(Version a, Version b) pure returns(bool isSame) { return Version.unwrap(a) == Version.unwrap(b); }
|
39
|
+
|
40
|
+
library VersionLib {
|
41
|
+
function toInt(Version version) external pure returns(uint) { return Version.unwrap(version); }
|
42
|
+
|
43
|
+
function toUint64(Version version) external pure returns(uint64) { return Version.unwrap(version); }
|
44
|
+
|
45
|
+
function toMajorPart(Version version)
|
46
|
+
external
|
47
|
+
pure
|
48
|
+
returns(VersionPart major)
|
49
|
+
{
|
50
|
+
uint24 versionInt = Version.unwrap(version);
|
51
|
+
uint8 majorInt = uint8(versionInt >> 16);
|
52
|
+
return VersionPart.wrap(majorInt);
|
53
|
+
}
|
54
|
+
|
55
|
+
function toVersionParts(Version version)
|
56
|
+
external
|
57
|
+
pure
|
58
|
+
returns(
|
59
|
+
VersionPart major,
|
60
|
+
VersionPart minor,
|
61
|
+
VersionPart patch
|
62
|
+
)
|
63
|
+
{
|
64
|
+
uint24 versionInt = Version.unwrap(version);
|
65
|
+
uint8 majorInt = uint8(versionInt >> 16);
|
66
|
+
|
67
|
+
versionInt -= majorInt << 16;
|
68
|
+
uint8 minorInt = uint8(versionInt >> 8);
|
69
|
+
uint8 patchInt = uint8(versionInt - (minorInt << 8));
|
70
|
+
|
71
|
+
return (
|
72
|
+
VersionPart.wrap(majorInt),
|
73
|
+
VersionPart.wrap(minorInt),
|
74
|
+
VersionPart.wrap(patchInt)
|
75
|
+
);
|
76
|
+
}
|
77
|
+
|
78
|
+
function toVersionPart(uint256 versionPart) external pure returns(VersionPart) {
|
79
|
+
return VersionPart.wrap(uint8(versionPart));
|
80
|
+
}
|
81
|
+
|
82
|
+
function toVersion(
|
83
|
+
uint256 major,
|
84
|
+
uint256 minor,
|
85
|
+
uint256 patch
|
86
|
+
)
|
87
|
+
external
|
88
|
+
pure
|
89
|
+
returns(Version)
|
90
|
+
{
|
91
|
+
require(
|
92
|
+
major < 256 && minor < 256 && patch < 256,
|
93
|
+
"ERROR:VRS-010:VERSION_PART_TOO_BIG");
|
94
|
+
|
95
|
+
return Version.wrap(
|
96
|
+
uint24(
|
97
|
+
(major << 16) + (minor << 8) + patch));
|
98
|
+
}
|
99
|
+
|
100
|
+
// TODO check for overflow?
|
101
|
+
function toVersion(uint64 versionNumber) external pure returns(Version) {
|
102
|
+
//assert(versionNumber <= type(Version).max);
|
103
|
+
return Version.wrap(uint24(versionNumber));
|
104
|
+
}
|
105
|
+
|
106
|
+
// TODO rename to zero()
|
107
|
+
function zeroVersion() external pure returns(Version) {
|
108
|
+
return Version.wrap(0);
|
109
|
+
}
|
110
|
+
}
|