@etherisc/gif-next 0.0.2-7f39e38-904 → 0.0.2-7fe9ae1-227
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 +136 -318
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1075 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +810 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +843 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1735 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +2008 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1403 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +817 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.json +10 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1400 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +465 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +407 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +652 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1234 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +844 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +146 -617
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +767 -301
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +267 -116
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +152 -283
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +553 -77
- 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 +1474 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +844 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2043 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +844 -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 +844 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1161 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1637 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +844 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2575 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +844 -0
- package/artifacts/contracts/instance/BaseStore.sol/BaseStore.dbg.json +4 -0
- package/artifacts/contracts/{shared/IKeyValueStore.sol/IKeyValueStore.json → instance/BaseStore.sol/BaseStore.json} +59 -205
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +851 -0
- package/artifacts/contracts/instance/IBaseStore.sol/IBaseStore.dbg.json +4 -0
- package/artifacts/contracts/instance/IBaseStore.sol/IBaseStore.json +304 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +614 -92
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +517 -75
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +639 -237
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +2400 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +872 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +1711 -755
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +509 -224
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +175 -98
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1482 -1911
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.dbg.json +4 -0
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.json +3427 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +866 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +8 -8
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +0 -53
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +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 +192 -0
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +168 -0
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.json +2 -2
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +947 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +849 -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 +762 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +762 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +863 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +1042 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +830 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1232 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +844 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +582 -235
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +257 -94
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +398 -49
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +151 -404
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +770 -365
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +148 -692
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +522 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +947 -525
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +260 -93
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +382 -166
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +201 -90
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1149 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +844 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +502 -230
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +229 -110
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +320 -9
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +369 -18
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +436 -101
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +202 -80
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +291 -274
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
- package/artifacts/contracts/{shared/ComponentVerifyingService.sol/ComponentVerifyingService.json → product/IRiskService.sol/IRiskService.json} +295 -150
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +564 -292
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +783 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +239 -96
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +262 -299
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +193 -114
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +322 -606
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +873 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +794 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +59 -16
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +402 -79
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +125 -146
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.json +24 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +5 -18
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +719 -120
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +2255 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +1137 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +174 -274
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +180 -92
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +2271 -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 +1401 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +705 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +135 -67
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +92 -287
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +632 -542
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +230 -113
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +632 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +40 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +99 -104
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +549 -228
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +138 -140
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +34 -3
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +42 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +15 -47
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +173 -0
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +103 -2
- 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 +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +131 -376
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -62
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +306 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +45 -55
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +19 -141
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +148 -98
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +96 -102
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +585 -12
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +484 -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 +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1558 -246
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +382 -119
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.dbg.json +4 -0
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.json +50 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +1734 -561
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +470 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +232 -113
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +430 -94
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +442 -305
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +181 -93
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2044 -637
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.json +309 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +253 -68
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +122 -5
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +64 -19
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.json +193 -0
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +28 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +4 -4
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +98 -37
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +4 -0
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +47 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +153 -4
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
- 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 +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +125 -7
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +121 -23
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +117 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +148 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +15 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +180 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +37 -5
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +126 -33
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +120 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/IVersionable.sol/IVersionable.json +11 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +672 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +142 -0
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/Versionable.sol/Versionable.json +11 -1
- package/contracts/accounting/AccountingService.sol +274 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +47 -0
- package/contracts/authorization/AccessAdmin.sol +679 -0
- package/contracts/authorization/AccessAdminLib.sol +678 -0
- package/contracts/authorization/AccessManagerCloneable.sol +140 -0
- package/contracts/authorization/Authorization.sol +190 -0
- package/contracts/authorization/IAccess.sol +66 -0
- package/contracts/authorization/IAccessAdmin.sol +142 -0
- package/contracts/authorization/IAuthorization.sol +26 -0
- package/contracts/authorization/IServiceAuthorization.sol +78 -0
- package/contracts/authorization/ServiceAuthorization.sol +300 -0
- package/contracts/distribution/BasicDistribution.sol +140 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +67 -0
- package/contracts/distribution/Distribution.sol +125 -143
- package/contracts/distribution/DistributionService.sol +287 -137
- package/contracts/distribution/DistributionServiceManager.sol +8 -23
- package/contracts/distribution/IDistributionComponent.sol +21 -42
- package/contracts/distribution/IDistributionService.sol +60 -26
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +86 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +35 -0
- package/contracts/examples/fire/FireProduct.sol +433 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +45 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +81 -0
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +133 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +102 -0
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +437 -0
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BaseStore.sol +93 -0
- package/contracts/instance/BundleSet.sol +130 -0
- package/contracts/instance/IBaseStore.sol +37 -0
- package/contracts/instance/IInstance.sol +128 -49
- package/contracts/instance/IInstanceService.sol +82 -46
- package/contracts/instance/Instance.sol +254 -131
- package/contracts/instance/InstanceAdmin.sol +307 -0
- package/contracts/instance/InstanceAuthorizationV3.sol +275 -0
- package/contracts/instance/InstanceReader.sol +477 -237
- package/contracts/instance/InstanceService.sol +391 -244
- package/contracts/instance/InstanceServiceManager.sol +8 -13
- package/contracts/instance/InstanceStore.sol +172 -109
- package/contracts/instance/ProductStore.sol +290 -0
- package/contracts/instance/RiskSet.sol +126 -0
- package/contracts/instance/TargetNames.sol +10 -0
- package/contracts/instance/base/BalanceStore.sol +15 -12
- package/contracts/instance/base/Cloneable.sol +2 -25
- package/contracts/instance/base/ObjectCounter.sol +20 -0
- package/contracts/instance/base/ObjectLifecycle.sol +109 -0
- package/contracts/instance/base/ObjectSet.sol +77 -0
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +29 -21
- package/contracts/instance/module/IDistribution.sol +21 -9
- package/contracts/instance/module/IPolicy.sol +50 -29
- package/contracts/instance/module/IRisk.sol +5 -0
- package/contracts/mock/Dip.sol +1 -1
- package/contracts/oracle/BasicOracle.sol +44 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +53 -0
- package/contracts/oracle/IOracle.sol +41 -0
- package/contracts/oracle/IOracleComponent.sol +33 -0
- package/contracts/oracle/IOracleService.sol +66 -0
- package/contracts/oracle/Oracle.sol +152 -0
- package/contracts/oracle/OracleService.sol +310 -0
- package/contracts/oracle/OracleServiceManager.sol +39 -0
- package/contracts/pool/BasicPool.sol +161 -0
- package/contracts/pool/BasicPoolAuthorization.sol +81 -0
- package/contracts/pool/BundleService.sol +225 -135
- package/contracts/pool/BundleServiceManager.sol +8 -11
- package/contracts/pool/IBundleService.sol +43 -33
- package/contracts/pool/IPoolComponent.sol +20 -70
- package/contracts/pool/IPoolService.sol +98 -75
- package/contracts/pool/Pool.sol +196 -164
- package/contracts/pool/PoolLib.sol +341 -0
- package/contracts/pool/PoolService.sol +444 -254
- package/contracts/pool/PoolServiceManager.sol +6 -9
- package/contracts/product/ApplicationService.sol +159 -86
- package/contracts/product/ApplicationServiceManager.sol +6 -6
- package/contracts/product/BasicProduct.sol +48 -0
- package/contracts/product/BasicProductAuthorization.sol +63 -0
- package/contracts/product/ClaimService.sol +396 -207
- package/contracts/product/ClaimServiceManager.sol +6 -6
- package/contracts/product/IApplicationService.sol +29 -3
- package/contracts/product/IClaimService.sol +51 -8
- package/contracts/product/IPolicyService.sol +61 -37
- package/contracts/product/IPricingService.sol +11 -10
- package/contracts/product/IProductComponent.sol +29 -9
- package/contracts/product/IRiskService.sol +48 -0
- package/contracts/product/PolicyService.sol +450 -278
- package/contracts/product/PolicyServiceLib.sol +139 -0
- package/contracts/product/PolicyServiceManager.sol +6 -9
- package/contracts/product/PricingService.sol +95 -90
- package/contracts/product/PricingServiceManager.sol +6 -9
- package/contracts/product/Product.sol +261 -147
- package/contracts/product/RiskService.sol +189 -0
- package/contracts/product/RiskServiceManager.sol +39 -0
- package/contracts/registry/ChainNft.sol +72 -39
- package/contracts/registry/IRegistry.sol +88 -41
- package/contracts/registry/IRegistryService.sol +4 -10
- package/contracts/registry/IRelease.sol +29 -0
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +389 -231
- package/contracts/registry/RegistryAdmin.sol +173 -0
- package/contracts/registry/RegistryAuthorization.sol +337 -0
- package/contracts/registry/RegistryService.sol +50 -75
- package/contracts/registry/RegistryServiceManager.sol +5 -24
- package/contracts/registry/ReleaseAdmin.sol +199 -0
- package/contracts/registry/ReleaseLifecycle.sol +32 -0
- package/contracts/registry/ReleaseRegistry.sol +525 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +342 -0
- package/contracts/registry/TokenRegistry.sol +73 -110
- package/contracts/shared/Component.sol +72 -148
- package/contracts/shared/ComponentService.sol +466 -370
- package/contracts/shared/ComponentServiceManager.sol +10 -7
- package/contracts/shared/ContractLib.sol +312 -0
- package/contracts/shared/IComponent.sol +7 -23
- package/contracts/shared/IComponentService.sol +51 -31
- package/contracts/shared/IInstanceLinkedComponent.sol +10 -26
- package/contracts/shared/ILifecycle.sol +3 -2
- package/contracts/shared/INftOwnable.sol +5 -1
- package/contracts/shared/IPolicyHolder.sol +12 -22
- package/contracts/shared/IRegisterable.sol +22 -1
- package/contracts/shared/IService.sol +10 -5
- package/contracts/shared/{ERC165.sol → InitializableERC165.sol} +11 -3
- package/contracts/shared/InstanceLinkedComponent.sol +96 -49
- package/contracts/shared/Lifecycle.sol +30 -63
- package/contracts/shared/{NftIdSetManager.sol → NftIdSet.sol} +1 -1
- package/contracts/shared/NftOwnable.sol +35 -24
- package/contracts/shared/PolicyHolder.sol +19 -57
- package/contracts/shared/Registerable.sol +52 -21
- package/contracts/shared/RegistryLinked.sol +9 -14
- package/contracts/shared/Service.sol +31 -41
- package/contracts/shared/TokenHandler.sol +310 -26
- package/contracts/shared/TokenHandlerDeployerLib.sol +20 -0
- package/contracts/staking/IStaking.sol +284 -70
- package/contracts/staking/IStakingService.sol +59 -94
- package/contracts/staking/ITargetLimitHandler.sol +17 -0
- package/contracts/staking/Staking.sol +558 -263
- package/contracts/staking/StakingLib.sol +195 -0
- package/contracts/staking/StakingManager.sol +20 -32
- package/contracts/staking/StakingReader.sol +84 -60
- package/contracts/staking/StakingService.sol +108 -162
- package/contracts/staking/StakingServiceManager.sol +10 -8
- package/contracts/staking/StakingStore.sol +1222 -183
- package/contracts/staking/TargetHandler.sol +132 -0
- package/contracts/staking/TargetManagerLib.sol +95 -40
- package/contracts/type/Amount.sol +43 -3
- package/contracts/type/Blocknumber.sol +24 -23
- package/contracts/type/ChainId.sol +101 -0
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +15 -8
- package/contracts/type/ObjectType.sol +203 -65
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/Referral.sol +1 -0
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RiskId.sol +38 -6
- package/contracts/type/RoleId.sol +121 -84
- package/contracts/type/Seconds.sol +50 -1
- package/contracts/type/Selector.sol +107 -0
- package/contracts/type/StateId.sol +27 -1
- package/contracts/type/String.sol +65 -0
- package/contracts/type/Timestamp.sol +20 -9
- package/contracts/type/UFixed.sol +62 -125
- package/contracts/type/Version.sol +57 -6
- package/contracts/{shared → upgradeability}/IVersionable.sol +3 -0
- package/contracts/{shared → upgradeability}/ProxyManager.sol +102 -51
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +24 -0
- package/contracts/{shared → upgradeability}/Versionable.sol +8 -5
- package/package.json +12 -8
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +0 -4
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +0 -778
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +0 -1348
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -132
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +0 -256
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -237
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +0 -4
- package/artifacts/contracts/product/IProductService.sol/IProductService.json +0 -381
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +0 -673
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +0 -675
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +0 -4
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +0 -322
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +0 -4
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +0 -1151
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +0 -137
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +0 -4
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +0 -4
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +0 -73
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +0 -4
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +0 -581
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +0 -4
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +0 -306
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +0 -4
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +0 -598
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +0 -4
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +0 -129
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +0 -4
- package/artifacts/contracts/staking/IStakingManager.sol/IStakingManager.dbg.json +0 -4
- package/artifacts/contracts/staking/IStakingManager.sol/IStakingManager.json +0 -37
- package/artifacts/contracts/staking/IStakingStore.sol/IStakingStore.dbg.json +0 -4
- package/artifacts/contracts/staking/IStakingStore.sol/IStakingStore.json +0 -357
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -402
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -10
- package/contracts/instance/BundleManager.sol +0 -126
- package/contracts/instance/InstanceAccessManager.sol +0 -543
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -336
- package/contracts/instance/base/ObjectManager.sol +0 -82
- package/contracts/instance/module/IAccess.sol +0 -54
- package/contracts/product/IProductService.sol +0 -33
- package/contracts/product/ProductService.sol +0 -124
- package/contracts/product/ProductServiceManager.sol +0 -42
- package/contracts/registry/RegistryAccessManager.sol +0 -196
- package/contracts/registry/ReleaseManager.sol +0 -563
- package/contracts/registry/ServiceAuthorizationsLib.sol +0 -173
- package/contracts/shared/AccessManagerUpgradeableInitializeable.sol +0 -13
- package/contracts/shared/ComponentVerifyingService.sol +0 -111
- package/contracts/shared/IKeyValueStore.sol +0 -53
- package/contracts/shared/KeyValueStore.sol +0 -130
- package/contracts/shared/UpgradableProxyWithAdmin.sol +0 -16
- package/contracts/staking/IStakingManager.sol +0 -15
- package/contracts/staking/IStakingStore.sol +0 -130
- package/contracts/staking/StakeManagerLib.sol +0 -156
@@ -3,125 +3,82 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {AccessManaged} from "@openzeppelin/contracts/access/manager/AccessManaged.sol";
|
5
5
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
6
|
-
import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
|
7
6
|
|
8
|
-
import {IRegisterable} from "../shared/IRegisterable.sol";
|
9
7
|
import {IRegistry} from "./IRegistry.sol";
|
10
8
|
import {IRegistryLinked} from "../shared/IRegistryLinked.sol";
|
11
|
-
import {
|
12
|
-
|
9
|
+
import {IStaking} from "../staking/IStaking.sol";
|
10
|
+
|
11
|
+
import {ChainId, ChainIdLib} from "../type/ChainId.sol";
|
12
|
+
import {RegistryAdmin} from "./RegistryAdmin.sol";
|
13
13
|
import {VersionPart} from "../type/Version.sol";
|
14
14
|
|
15
|
-
/// @
|
15
|
+
/// @dev The TokenRegistry contract is used to whitelist/manage ERC-20 of tokens per major release.
|
16
|
+
/// Only whitelisted tokens can be used as default tokens for products, distribution and pools components.
|
16
17
|
contract TokenRegistry is
|
17
18
|
AccessManaged,
|
18
19
|
IRegistryLinked
|
19
20
|
{
|
20
|
-
event LogTokenRegistryTokenRegistered(
|
21
|
-
event LogTokenRegistryTokenGlobalStateSet(
|
22
|
-
event LogTokenRegistryTokenStateSet(
|
21
|
+
event LogTokenRegistryTokenRegistered(ChainId chainId, address token, uint256 decimals, string symbol);
|
22
|
+
event LogTokenRegistryTokenGlobalStateSet(ChainId chainId, address token, bool active);
|
23
|
+
event LogTokenRegistryTokenStateSet(ChainId chainId, address token, VersionPart release, bool active);
|
23
24
|
|
24
25
|
error ErrorTokenRegistryChainIdZero();
|
25
26
|
error ErrorTokenRegistryTokenAddressZero();
|
26
27
|
|
27
|
-
error ErrorTokenRegistryNotRemoteToken(
|
28
|
-
error ErrorTokenRegistryTokenAlreadyRegistered(
|
29
|
-
error ErrorTokenRegistryTokenNotContract(
|
30
|
-
error ErrorTokenRegistryTokenNotErc20(
|
28
|
+
error ErrorTokenRegistryNotRemoteToken(ChainId chainId, address token);
|
29
|
+
error ErrorTokenRegistryTokenAlreadyRegistered(ChainId chainId, address token);
|
30
|
+
error ErrorTokenRegistryTokenNotContract(ChainId chainId, address token);
|
31
|
+
error ErrorTokenRegistryTokenNotErc20(ChainId chainId, address token);
|
31
32
|
|
32
|
-
error ErrorTokenRegistryTokenNotRegistered(
|
33
|
-
error ErrorTokenRegistryMajorVersionInvalid(VersionPart
|
33
|
+
error ErrorTokenRegistryTokenNotRegistered(ChainId chainId, address token);
|
34
|
+
error ErrorTokenRegistryMajorVersionInvalid(VersionPart release);
|
34
35
|
|
35
36
|
struct TokenInfo {
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
// slot 0
|
38
|
+
ChainId chainId; // 96
|
39
|
+
address token; // 20
|
40
|
+
uint8 decimals; // 8
|
40
41
|
bool active;
|
42
|
+
// slot 1
|
43
|
+
string symbol;
|
41
44
|
}
|
42
45
|
|
43
|
-
mapping(
|
44
|
-
mapping(
|
46
|
+
mapping(ChainId chainId => mapping(address token => TokenInfo info)) internal _tokenInfo;
|
47
|
+
mapping(ChainId chainId => mapping(address token => mapping(VersionPart release => bool isActive))) internal _active;
|
45
48
|
TokenInfo [] internal _token;
|
46
49
|
|
47
50
|
IRegistry internal _registry;
|
48
|
-
|
51
|
+
ChainId internal _chainId = ChainIdLib.current();
|
49
52
|
IERC20Metadata internal _dipToken;
|
50
53
|
|
51
54
|
/// @dev enforces msg.sender is owner of nft (or initial owner of nft ownable)
|
52
|
-
modifier onlyRegisteredToken(
|
55
|
+
modifier onlyRegisteredToken(ChainId chainId, address token) {
|
53
56
|
if (!isRegistered(chainId, token)) {
|
54
57
|
revert ErrorTokenRegistryTokenNotRegistered(chainId, token);
|
55
58
|
}
|
56
59
|
_;
|
57
60
|
}
|
58
61
|
|
59
|
-
constructor(
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
62
|
+
constructor(IRegistry registry, IERC20Metadata dipToken)
|
63
|
+
AccessManaged(msg.sender)
|
64
|
+
{
|
65
|
+
// set authority
|
66
|
+
address authority = RegistryAdmin(registry.getRegistryAdminAddress()).authority();
|
67
|
+
setAuthority(authority);
|
68
|
+
|
69
|
+
_registry = registry;
|
70
|
+
|
71
|
+
// TODO deal with chains without a dip token
|
72
|
+
_dipToken = _verifyOnchainToken(address(dipToken));
|
69
73
|
|
70
74
|
// register dip token
|
71
|
-
uint256 chainId = block.chainid;
|
72
75
|
_registerToken(
|
73
|
-
|
76
|
+
_chainId,
|
74
77
|
address(_dipToken),
|
75
78
|
_dipToken.decimals(),
|
76
79
|
_dipToken.symbol());
|
77
80
|
}
|
78
81
|
|
79
|
-
// TODO cleanup
|
80
|
-
// function initialize(
|
81
|
-
// address initialOwner
|
82
|
-
// )
|
83
|
-
// public
|
84
|
-
// initializer()
|
85
|
-
// {
|
86
|
-
// initializeNftOwnable(initialOwner, _registryAddress);
|
87
|
-
|
88
|
-
// // initialize release manager
|
89
|
-
// _releaseManager = ReleaseManager(msg.sender);
|
90
|
-
|
91
|
-
|
92
|
-
// // register dip token
|
93
|
-
// uint256 chainId = block.chainid;
|
94
|
-
// _registerToken(
|
95
|
-
// chainId,
|
96
|
-
// address(_dipToken),
|
97
|
-
// _dipToken.decimals(),
|
98
|
-
// _dipToken.symbol());
|
99
|
-
// }
|
100
|
-
|
101
|
-
|
102
|
-
// /// @dev link token registry ownership to nft owner of registry service and register dip token.
|
103
|
-
// function linkToRegistryService()
|
104
|
-
// external
|
105
|
-
// {
|
106
|
-
// // link token registry ownership to registry service
|
107
|
-
// address registryService = getRegistry().getServiceAddress(
|
108
|
-
// REGISTRY(),
|
109
|
-
// _releaseManager.getInitialVersion());
|
110
|
-
|
111
|
-
// _linkToNftOwnable(registryService);
|
112
|
-
|
113
|
-
// // activate dip for initial gif version
|
114
|
-
// // as token registry is created in constructor of release manager
|
115
|
-
// // release manager can not yet be called in constructor of token registry
|
116
|
-
// uint256 chainId = block.chainid;
|
117
|
-
// address dipToken = address(_dipToken);
|
118
|
-
// VersionPart majorVersion = _releaseManager.getInitialVersion();
|
119
|
-
// bool active = true;
|
120
|
-
// _active[chainId][dipToken][majorVersion] = active;
|
121
|
-
|
122
|
-
// emit LogTokenRegistryTokenStateSet(chainId, dipToken, majorVersion, active);
|
123
|
-
// }
|
124
|
-
|
125
82
|
|
126
83
|
/// @dev register an onchain token.
|
127
84
|
/// this function verifies that the provided token address is a contract that implements
|
@@ -130,15 +87,18 @@ contract TokenRegistry is
|
|
130
87
|
external
|
131
88
|
restricted()
|
132
89
|
{
|
90
|
+
// checks
|
133
91
|
IERC20Metadata token = _verifyOnchainToken(tokenAddress);
|
134
|
-
|
92
|
+
|
93
|
+
// effects
|
94
|
+
_registerToken(_chainId, tokenAddress, token.decimals(), token.symbol());
|
135
95
|
}
|
136
96
|
|
137
97
|
|
138
98
|
/// @dev register the remote token with the provided attributes.
|
139
99
|
/// this function may not be used for tokens when chainId == block.chainid.
|
140
100
|
function registerRemoteToken(
|
141
|
-
|
101
|
+
ChainId chainId,
|
142
102
|
address token,
|
143
103
|
uint8 decimals,
|
144
104
|
string memory symbol
|
@@ -146,7 +106,7 @@ contract TokenRegistry is
|
|
146
106
|
external
|
147
107
|
restricted()
|
148
108
|
{
|
149
|
-
if (chainId ==
|
109
|
+
if (chainId == _chainId) {
|
150
110
|
revert ErrorTokenRegistryNotRemoteToken(chainId, token);
|
151
111
|
}
|
152
112
|
|
@@ -158,7 +118,7 @@ contract TokenRegistry is
|
|
158
118
|
/// when setting a token to active=false isActive will return false
|
159
119
|
/// regardless of release specific active value.
|
160
120
|
function setActive(
|
161
|
-
|
121
|
+
ChainId chainId,
|
162
122
|
address token,
|
163
123
|
bool active
|
164
124
|
)
|
@@ -171,32 +131,32 @@ contract TokenRegistry is
|
|
171
131
|
}
|
172
132
|
|
173
133
|
|
174
|
-
/// @dev sets active state for specified token and major version.
|
134
|
+
/// @dev sets active state for specified token and release (major version).
|
175
135
|
/// internally calls setActiveWithVersionCheck() with enforcing version check.
|
176
136
|
/// token state is informative, registry have no clue about used tokens
|
177
137
|
/// component owner is responsible for token selection and operations
|
178
138
|
/// service MUST deny registration of component with inactive token.
|
179
139
|
function setActiveForVersion(
|
180
|
-
|
140
|
+
ChainId chainId,
|
181
141
|
address token,
|
182
|
-
VersionPart
|
142
|
+
VersionPart release,
|
183
143
|
bool active
|
184
144
|
)
|
185
145
|
external
|
186
146
|
restricted()
|
187
147
|
onlyRegisteredToken(chainId, token)
|
188
148
|
{
|
189
|
-
_setActiveWithVersionCheck(chainId, token,
|
149
|
+
_setActiveWithVersionCheck(chainId, token, release, active, true);
|
190
150
|
}
|
191
151
|
|
192
152
|
|
193
153
|
/// @dev as setActiveForVersion() with the option to skip the version check.
|
194
154
|
/// enforcing the version check checks if the provided major version with the release manager.
|
195
|
-
/// the function reverts if the provided
|
155
|
+
/// the function reverts if the provided release is unknown to the release manager.
|
196
156
|
function setActiveWithVersionCheck(
|
197
|
-
|
157
|
+
ChainId chainId,
|
198
158
|
address token,
|
199
|
-
VersionPart
|
159
|
+
VersionPart release,
|
200
160
|
bool active,
|
201
161
|
bool enforceVersionCheck
|
202
162
|
)
|
@@ -204,14 +164,14 @@ contract TokenRegistry is
|
|
204
164
|
restricted()
|
205
165
|
onlyRegisteredToken(chainId, token)
|
206
166
|
{
|
207
|
-
_setActiveWithVersionCheck(chainId, token,
|
167
|
+
_setActiveWithVersionCheck(chainId, token, release, active, enforceVersionCheck);
|
208
168
|
}
|
209
169
|
|
210
170
|
|
211
171
|
function _setActiveWithVersionCheck(
|
212
|
-
|
172
|
+
ChainId chainId,
|
213
173
|
address token,
|
214
|
-
VersionPart
|
174
|
+
VersionPart release,
|
215
175
|
bool active,
|
216
176
|
bool enforceVersionCheck
|
217
177
|
)
|
@@ -219,15 +179,15 @@ contract TokenRegistry is
|
|
219
179
|
{
|
220
180
|
// verify valid major version
|
221
181
|
if(enforceVersionCheck) {
|
222
|
-
uint256 version =
|
223
|
-
if (!getRegistry().
|
224
|
-
revert ErrorTokenRegistryMajorVersionInvalid(
|
182
|
+
uint256 version = release.toInt();
|
183
|
+
if (!getRegistry().isActiveRelease(release)) {
|
184
|
+
revert ErrorTokenRegistryMajorVersionInvalid(release);
|
225
185
|
}
|
226
186
|
}
|
227
187
|
|
228
|
-
_active[chainId][token][
|
188
|
+
_active[chainId][token][release] = active;
|
229
189
|
|
230
|
-
emit LogTokenRegistryTokenStateSet(chainId, token,
|
190
|
+
emit LogTokenRegistryTokenStateSet(chainId, token, release, active);
|
231
191
|
}
|
232
192
|
|
233
193
|
/// @dev returns the dip token for this chain
|
@@ -246,22 +206,26 @@ contract TokenRegistry is
|
|
246
206
|
}
|
247
207
|
|
248
208
|
/// @dev returns the token info for the specified token coordinates.
|
249
|
-
function getTokenInfo(
|
209
|
+
function getTokenInfo(ChainId chainId, address token) external view returns (TokenInfo memory tokenInfo) {
|
250
210
|
return _tokenInfo[chainId][token];
|
251
211
|
}
|
252
212
|
|
253
213
|
/// @dev returns true iff the specified token has been registered for this TokenRegistry contract.
|
254
|
-
function isRegistered(
|
255
|
-
return _tokenInfo[chainId][token].chainId
|
214
|
+
function isRegistered(ChainId chainId, address token) public view returns (bool) {
|
215
|
+
return _tokenInfo[chainId][token].chainId.gtz();
|
256
216
|
}
|
257
217
|
|
258
|
-
/// @dev returns true iff both the token is active for the specfied
|
259
|
-
function isActive(
|
218
|
+
/// @dev returns true iff both the token is active for the specfied release and the global token state is active
|
219
|
+
function isActive(ChainId chainId, address token, VersionPart release) external view returns (bool) {
|
260
220
|
if(!_tokenInfo[chainId][token].active) {
|
261
221
|
return false;
|
262
222
|
}
|
263
223
|
|
264
|
-
return _active[chainId][token][
|
224
|
+
return _active[chainId][token][release];
|
225
|
+
}
|
226
|
+
|
227
|
+
function getDipTokenAddress() external view returns (address) {
|
228
|
+
return address(_dipToken);
|
265
229
|
}
|
266
230
|
|
267
231
|
//--- IRegistryLinked --------------------------------------------------//
|
@@ -283,16 +247,15 @@ contract TokenRegistry is
|
|
283
247
|
returns (IERC20Metadata token)
|
284
248
|
{
|
285
249
|
token = IERC20Metadata(tokenAddress);
|
286
|
-
uint256 chainId = block.chainid;
|
287
250
|
|
288
251
|
// MUST be contract
|
289
252
|
if(tokenAddress.code.length == 0) {
|
290
|
-
revert ErrorTokenRegistryTokenNotContract(
|
253
|
+
revert ErrorTokenRegistryTokenNotContract(ChainIdLib.current(), tokenAddress);
|
291
254
|
}
|
292
255
|
|
293
256
|
// MUST implement required erc20 view functions
|
294
257
|
if(!_implementsErc20Functions(token)) {
|
295
|
-
revert ErrorTokenRegistryTokenNotErc20(
|
258
|
+
revert ErrorTokenRegistryTokenNotErc20(ChainIdLib.current(), tokenAddress);
|
296
259
|
}
|
297
260
|
}
|
298
261
|
|
@@ -325,13 +288,13 @@ contract TokenRegistry is
|
|
325
288
|
/// - token not yet registered
|
326
289
|
/// - chainId not zero
|
327
290
|
/// - token address not zero
|
328
|
-
function _registerToken(
|
291
|
+
function _registerToken(ChainId chainId, address token, uint8 decimals, string memory symbol) internal {
|
329
292
|
|
330
293
|
if (isRegistered(chainId, token)) {
|
331
294
|
revert ErrorTokenRegistryTokenAlreadyRegistered(chainId, token);
|
332
295
|
}
|
333
296
|
|
334
|
-
if(chainId
|
297
|
+
if(chainId.eqz()) {
|
335
298
|
revert ErrorTokenRegistryChainIdZero();
|
336
299
|
}
|
337
300
|
|
@@ -1,29 +1,21 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
4
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
6
5
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
7
|
-
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
8
6
|
|
7
|
+
import {Amount, AmountLib} from "../type/Amount.sol";
|
9
8
|
import {IComponent} from "./IComponent.sol";
|
10
9
|
import {IComponents} from "../instance/module/IComponents.sol";
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {InstanceReader} from "../instance/InstanceReader.sol";
|
15
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
16
|
-
import {NftId, NftIdLib} from "../type/NftId.sol";
|
17
|
-
import {ObjectType, INSTANCE, PRODUCT} from "../type/ObjectType.sol";
|
18
|
-
import {VersionPart} from "../type/Version.sol";
|
10
|
+
import {IComponentService} from "./IComponentService.sol";
|
11
|
+
import {NftId} from "../type/NftId.sol";
|
12
|
+
import {ObjectType, COMPONENT} from "../type/ObjectType.sol";
|
19
13
|
import {Registerable} from "../shared/Registerable.sol";
|
20
|
-
import {RoleId, RoleIdLib} from "../type/RoleId.sol";
|
21
|
-
import {IAccess} from "../instance/module/IAccess.sol";
|
22
14
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
23
|
-
import {
|
15
|
+
import {Version, VersionLib} from "../type/Version.sol";
|
16
|
+
|
24
17
|
|
25
18
|
abstract contract Component is
|
26
|
-
AccessManagedUpgradeable,
|
27
19
|
Registerable,
|
28
20
|
IComponent
|
29
21
|
{
|
@@ -32,11 +24,8 @@ abstract contract Component is
|
|
32
24
|
|
33
25
|
struct ComponentStorage {
|
34
26
|
string _name; // unique (per instance) component name
|
35
|
-
IERC20Metadata _token; // token for this component
|
36
|
-
TokenHandler _tokenHandler;
|
37
|
-
address _wallet;
|
38
27
|
bool _isInterceptor;
|
39
|
-
|
28
|
+
IComponentService _componentService;
|
40
29
|
}
|
41
30
|
|
42
31
|
|
@@ -49,139 +38,64 @@ abstract contract Component is
|
|
49
38
|
|
50
39
|
|
51
40
|
function _getComponentStorage() private pure returns (ComponentStorage storage $) {
|
41
|
+
// solhint-disable-next-line no-inline-assembly
|
52
42
|
assembly {
|
53
43
|
$.slot := COMPONENT_LOCATION_V1
|
54
44
|
}
|
55
45
|
}
|
56
46
|
|
57
|
-
|
47
|
+
|
48
|
+
function __Component_init(
|
58
49
|
address authority,
|
59
50
|
address registry,
|
60
51
|
NftId parentNftId,
|
61
52
|
string memory name,
|
62
|
-
address token,
|
63
53
|
ObjectType componentType,
|
64
54
|
bool isInterceptor,
|
65
55
|
address initialOwner,
|
66
|
-
bytes memory registryData
|
67
|
-
bytes memory componentData // other component specific data
|
56
|
+
bytes memory registryData // writeonly data that will saved in the object info record of the registry
|
68
57
|
)
|
69
|
-
|
58
|
+
internal
|
70
59
|
virtual
|
71
60
|
onlyInitializing()
|
72
61
|
{
|
73
|
-
initializeRegisterable(registry, parentNftId, componentType, isInterceptor, initialOwner, registryData);
|
74
|
-
__AccessManaged_init(authority);
|
75
|
-
|
76
|
-
if (token == address(0)) {
|
77
|
-
revert ErrorComponentTokenAddressZero();
|
78
|
-
}
|
79
|
-
|
80
62
|
if (bytes(name).length == 0) {
|
81
63
|
revert ErrorComponentNameLengthZero();
|
82
64
|
}
|
83
65
|
|
66
|
+
__Registerable_init(
|
67
|
+
authority,
|
68
|
+
registry,
|
69
|
+
parentNftId,
|
70
|
+
componentType,
|
71
|
+
isInterceptor,
|
72
|
+
initialOwner,
|
73
|
+
registryData);
|
74
|
+
|
84
75
|
// set component state
|
85
76
|
ComponentStorage storage $ = _getComponentStorage();
|
86
77
|
$._name = name;
|
87
|
-
$._token = IERC20Metadata(token);
|
88
|
-
$._tokenHandler = TokenHandler(address(0));
|
89
|
-
$._wallet = address(this);
|
90
78
|
$._isInterceptor = isInterceptor;
|
91
|
-
$.
|
92
|
-
|
93
|
-
registerInterface(type(IAccessManaged).interfaceId);
|
94
|
-
registerInterface(type(IComponent).interfaceId);
|
95
|
-
}
|
96
|
-
|
97
|
-
|
98
|
-
function approveTokenHandler(uint256 spendingLimitAmount)
|
99
|
-
external
|
100
|
-
virtual
|
101
|
-
onlyOwner
|
102
|
-
{
|
103
|
-
approveTokenHandler(address(getToken()), spendingLimitAmount);
|
104
|
-
}
|
79
|
+
$._componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
105
80
|
|
106
|
-
|
107
|
-
|
108
|
-
virtual
|
109
|
-
onlyOwner
|
110
|
-
{
|
111
|
-
if(getWallet() != address(this)) {
|
112
|
-
revert ErrorComponentWalletNotComponent();
|
113
|
-
}
|
114
|
-
|
115
|
-
IERC20Metadata(token).approve(
|
116
|
-
address(getTokenHandler()),
|
117
|
-
spendingLimitAmount);
|
118
|
-
|
119
|
-
emit LogComponentTokenHandlerApproved(address(getTokenHandler()), spendingLimitAmount);
|
81
|
+
_registerInterface(type(IAccessManaged).interfaceId);
|
82
|
+
_registerInterface(type(IComponent).interfaceId);
|
120
83
|
}
|
121
84
|
|
122
|
-
function setWallet(address newWallet)
|
123
|
-
external
|
124
|
-
virtual
|
125
|
-
override
|
126
|
-
onlyOwner
|
127
|
-
{
|
128
|
-
// checks
|
129
|
-
address currentWallet = getWallet();
|
130
|
-
IERC20Metadata token = getToken();
|
131
|
-
uint256 currentBalance = token.balanceOf(currentWallet);
|
132
|
-
|
133
|
-
if (currentBalance > 0) {
|
134
|
-
if (currentWallet == address(this)) {
|
135
|
-
// move tokens from component smart contract to external wallet
|
136
|
-
} else {
|
137
|
-
// move tokens from external wallet to component smart contract or another external wallet
|
138
|
-
uint256 allowance = token.allowance(currentWallet, address(this));
|
139
|
-
if (allowance < currentBalance) {
|
140
|
-
revert ErrorComponentWalletAllowanceTooSmall(currentWallet, newWallet, allowance, currentBalance);
|
141
|
-
}
|
142
|
-
}
|
143
|
-
}
|
144
|
-
|
145
|
-
// effects
|
146
|
-
_setWallet(newWallet);
|
147
|
-
|
148
|
-
// interactions
|
149
|
-
if (currentBalance > 0) {
|
150
|
-
// transfer tokens from current wallet to new wallet
|
151
|
-
if (currentWallet == address(this)) {
|
152
|
-
// transferFrom requires self allowance too
|
153
|
-
token.approve(address(this), currentBalance);
|
154
|
-
}
|
155
|
-
|
156
|
-
SafeERC20.safeTransferFrom(token, currentWallet, newWallet, currentBalance);
|
157
|
-
emit LogComponentWalletTokensTransferred(currentWallet, newWallet, currentBalance);
|
158
|
-
}
|
159
|
-
}
|
160
|
-
|
161
|
-
|
162
|
-
/// @dev callback function for nft mints
|
163
|
-
/// may only be called by chain nft contract.
|
164
|
-
/// override internal function _nftMint to implement custom behaviour
|
165
|
-
function nftMint(address to, uint256 tokenId)
|
166
|
-
external
|
167
|
-
onlyChainNft
|
168
|
-
{
|
169
|
-
_nftMint(to, tokenId);
|
170
|
-
}
|
171
85
|
|
172
86
|
/// @dev callback function for nft transfers
|
173
87
|
/// may only be called by chain nft contract.
|
174
88
|
/// override internal function _nftTransferFrom to implement custom behaviour
|
175
|
-
function nftTransferFrom(address from, address to, uint256 tokenId)
|
89
|
+
function nftTransferFrom(address from, address to, uint256 tokenId, address operator)
|
176
90
|
external
|
177
91
|
onlyChainNft
|
178
92
|
{
|
179
|
-
_nftTransferFrom(from, to, tokenId);
|
93
|
+
_nftTransferFrom(from, to, tokenId, operator);
|
180
94
|
}
|
181
95
|
|
182
96
|
|
183
97
|
function getWallet() public view virtual returns (address walletAddress) {
|
184
|
-
return
|
98
|
+
return getTokenHandler().getWallet();
|
185
99
|
}
|
186
100
|
|
187
101
|
function getTokenHandler() public virtual view returns (TokenHandler tokenHandler) {
|
@@ -189,13 +103,17 @@ abstract contract Component is
|
|
189
103
|
}
|
190
104
|
|
191
105
|
function getToken() public view virtual returns (IERC20Metadata token) {
|
192
|
-
return
|
106
|
+
return getTokenHandler().TOKEN();
|
193
107
|
}
|
194
108
|
|
195
109
|
function getName() public view override returns(string memory name) {
|
196
110
|
return getComponentInfo().name;
|
197
111
|
}
|
198
112
|
|
113
|
+
function getVersion() public view virtual returns (Version version) {
|
114
|
+
return VersionLib.toVersion(1, 0, 0);
|
115
|
+
}
|
116
|
+
|
199
117
|
function getComponentInfo() public virtual view returns (IComponents.ComponentInfo memory info) {
|
200
118
|
if (isRegistered()) {
|
201
119
|
return _getComponentInfo();
|
@@ -221,66 +139,72 @@ abstract contract Component is
|
|
221
139
|
|
222
140
|
|
223
141
|
function isRegistered() public virtual view returns (bool) {
|
224
|
-
return getRegistry().
|
142
|
+
return getRegistry().getNftIdForAddress(address(this)).gtz();
|
225
143
|
}
|
226
144
|
|
227
145
|
|
228
|
-
/// @dev
|
229
|
-
///
|
230
|
-
|
146
|
+
/// @dev Approves token hanlder to spend up to the specified amount of tokens.
|
147
|
+
/// Reverts if component wallet is not token handler itself.
|
148
|
+
/// Only component owner (nft holder) is authorizes to call this function.
|
149
|
+
function _approveTokenHandler(IERC20Metadata token, Amount amount)
|
231
150
|
internal
|
232
151
|
virtual
|
233
|
-
|
152
|
+
returns (Amount oldAllowanceAmount)
|
153
|
+
{
|
154
|
+
oldAllowanceAmount = AmountLib.toAmount(
|
155
|
+
token.allowance(address(getTokenHandler()), address(this)));
|
156
|
+
|
157
|
+
_getComponentStorage()._componentService.approveTokenHandler(
|
158
|
+
token,
|
159
|
+
amount);
|
160
|
+
}
|
161
|
+
|
234
162
|
|
235
163
|
/// @dev internal function for nft transfers.
|
236
164
|
/// handling logic that deals with nft transfers need to overwrite this function
|
237
|
-
function _nftTransferFrom(address from, address to, uint256 tokenId)
|
165
|
+
function _nftTransferFrom(address from, address to, uint256 tokenId, address operator)
|
238
166
|
internal
|
239
167
|
virtual
|
240
|
-
|
168
|
+
// solhint-disable-next-line no-empty-blocks
|
169
|
+
{
|
170
|
+
// empty default implementation
|
171
|
+
}
|
241
172
|
|
242
173
|
|
243
|
-
/// @dev
|
174
|
+
/// @dev Sets the components wallet to the specified address.
|
175
|
+
/// Depending on the source of the component information this function needs to be overwritten.
|
244
176
|
/// eg for instance linked components that externally store this information with the instance store contract
|
245
|
-
function _setWallet(
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
if (newWallet == currentWallet) {
|
254
|
-
revert ErrorComponentWalletAddressIsSameAsCurrent();
|
255
|
-
}
|
256
|
-
|
257
|
-
$._wallet = newWallet;
|
258
|
-
emit LogComponentWalletAddressChanged(currentWallet, newWallet);
|
259
|
-
|
177
|
+
function _setWallet(
|
178
|
+
address newWallet
|
179
|
+
)
|
180
|
+
internal
|
181
|
+
virtual
|
182
|
+
{
|
183
|
+
_getComponentStorage()._componentService.setWallet(newWallet);
|
260
184
|
}
|
261
185
|
|
262
|
-
|
263
|
-
/// this function creates and sets a token hanlder for the components tokens
|
264
|
-
function _createAndSetTokenHandler()
|
186
|
+
function _setLocked(bool locked)
|
265
187
|
internal
|
188
|
+
virtual
|
266
189
|
{
|
267
|
-
|
268
|
-
$._tokenHandler = new TokenHandler(address($._token));
|
190
|
+
_getComponentStorage()._componentService.setLocked(locked);
|
269
191
|
}
|
270
192
|
|
193
|
+
|
271
194
|
/// @dev depending on the source of the component information this function needs to be overwritten.
|
272
195
|
/// eg for instance linked components that externally store this information with the instance store contract
|
273
196
|
function _getComponentInfo() internal virtual view returns (IComponents.ComponentInfo memory info) {
|
274
197
|
ComponentStorage storage $ = _getComponentStorage();
|
275
|
-
|
198
|
+
|
276
199
|
return IComponents.ComponentInfo({
|
277
200
|
name: $._name,
|
278
|
-
|
279
|
-
token: $._token,
|
280
|
-
tokenHandler: $._tokenHandler,
|
281
|
-
wallet: $._wallet, // initial wallet address
|
282
|
-
data: $._data // user specific component data
|
201
|
+
tokenHandler: TokenHandler(address(0))
|
283
202
|
});
|
284
203
|
}
|
285
204
|
|
205
|
+
/// @dev returns the service address for the specified domain
|
206
|
+
/// gets address via lookup from registry using the major version form the linked instance
|
207
|
+
function _getServiceAddress(ObjectType domain) internal view returns (address) {
|
208
|
+
return getRegistry().getServiceAddress(domain, getRelease());
|
209
|
+
}
|
286
210
|
}
|