@etherisc/gif-next 0.0.2-df73b56-462 → 0.0.2-dfb8aa3-070
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +96 -37
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +67 -11
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +60 -13
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +40 -3
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +19 -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 +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +68 -5
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +154 -94
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +82 -22
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +94 -58
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +136 -86
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +80 -60
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +81 -58
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +29 -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 +1538 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +470 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2072 -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 +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +156 -96
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +137 -77
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +153 -106
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +241 -129
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +53 -31
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +29 -84
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +62 -40
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +148 -118
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +57 -97
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +275 -77
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +72 -130
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +48 -40
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +175 -104
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +46 -5
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +135 -75
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +84 -24
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +76 -53
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +43 -9
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +89 -53
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +86 -47
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +48 -36
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +89 -66
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +82 -22
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +180 -82
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +90 -58
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +53 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +76 -53
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +200 -115
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +89 -53
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +312 -161
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +81 -41
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +66 -32
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +45 -33
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +145 -73
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +82 -22
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +175 -90
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +82 -58
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +29 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +64 -8
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +58 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +80 -51
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +132 -73
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +29 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +139 -60
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +67 -47
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +149 -107
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +61 -45
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +145 -73
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +60 -26
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +42 -30
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +67 -15
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +114 -35
- 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 +111 -51
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +193 -165
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +73 -172
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +41 -29
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +47 -6
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +121 -223
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +66 -8
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +68 -28
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +350 -155
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +83 -63
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +42 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +2 -2
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +55 -28
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +321 -19
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +76 -53
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +36 -0
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +36 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +16 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +29 -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 +29 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +89 -53
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +42 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +18 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +3 -3
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +66 -8
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +42 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +55 -28
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +29 -21
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +2 -2
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +138 -78
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +46 -5
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +68 -42
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +7 -12
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +66 -53
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +45 -33
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +144 -103
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +32 -8
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- 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 +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +2 -2
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- 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 +2 -2
- 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 +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +60 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- 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 +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +15 -2
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +28 -12
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +65 -61
- package/contracts/authorization/Authorization.sol +111 -39
- package/contracts/authorization/IAccess.sol +1 -0
- package/contracts/authorization/IAccessAdmin.sol +4 -2
- package/contracts/authorization/IAuthorization.sol +13 -7
- package/contracts/authorization/IServiceAuthorization.sol +3 -1
- package/contracts/authorization/ReleaseAccessManager.sol +38 -0
- package/contracts/authorization/ServiceAuthorization.sol +26 -10
- package/contracts/distribution/BasicDistribution.sol +2 -1
- package/contracts/distribution/Distribution.sol +6 -16
- package/contracts/distribution/DistributionService.sol +55 -36
- package/contracts/distribution/IDistributionComponent.sol +1 -1
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +73 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +34 -0
- package/contracts/examples/fire/FireProduct.sol +415 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +44 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +4 -4
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -4
- package/contracts/examples/unpermissioned/SimplePool.sol +4 -4
- package/contracts/examples/unpermissioned/SimpleProduct.sol +10 -10
- package/contracts/instance/IInstance.sol +4 -1
- package/contracts/instance/IInstanceService.sol +0 -20
- package/contracts/instance/Instance.sol +20 -17
- package/contracts/instance/InstanceAdmin.sol +22 -30
- package/contracts/instance/InstanceAuthorizationV3.sol +9 -19
- package/contracts/instance/InstanceReader.sol +83 -18
- package/contracts/instance/InstanceService.sol +15 -70
- package/contracts/instance/module/IComponents.sol +6 -3
- package/contracts/instance/module/IPolicy.sol +2 -2
- package/contracts/oracle/BasicOracle.sol +0 -1
- package/contracts/oracle/IOracleService.sol +2 -1
- package/contracts/oracle/Oracle.sol +4 -15
- package/contracts/oracle/OracleService.sol +39 -29
- package/contracts/pool/BasicPool.sol +14 -26
- package/contracts/pool/BasicPoolAuthorization.sol +0 -1
- package/contracts/pool/BundleService.sol +75 -20
- package/contracts/pool/IBundleService.sol +9 -0
- package/contracts/pool/IPoolService.sol +21 -14
- package/contracts/pool/Pool.sol +22 -29
- package/contracts/pool/PoolService.sol +116 -80
- package/contracts/product/ApplicationService.sol +16 -4
- package/contracts/product/BasicProduct.sol +6 -6
- package/contracts/product/BasicProductAuthorization.sol +0 -1
- package/contracts/product/ClaimService.sol +108 -69
- package/contracts/product/IClaimService.sol +3 -2
- package/contracts/product/IPolicyService.sol +3 -0
- package/contracts/product/IPricingService.sol +9 -9
- package/contracts/product/IProductComponent.sol +23 -3
- package/contracts/product/PolicyService.sol +66 -21
- package/contracts/product/PricingService.sol +8 -8
- package/contracts/product/Product.sol +81 -52
- package/contracts/registry/ChainNft.sol +6 -9
- package/contracts/registry/IRegistry.sol +6 -3
- package/contracts/registry/IRegistryService.sol +5 -12
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +21 -6
- package/contracts/registry/RegistryAdmin.sol +7 -23
- package/contracts/registry/RegistryService.sol +33 -44
- package/contracts/registry/ReleaseLifecycle.sol +6 -3
- package/contracts/registry/ReleaseRegistry.sol +201 -191
- package/contracts/registry/ServiceAuthorizationV3.sol +14 -19
- package/contracts/shared/Component.sol +25 -28
- package/contracts/shared/ComponentService.sol +235 -131
- package/contracts/shared/ComponentVerifyingService.sol +22 -13
- package/contracts/shared/IComponent.sol +6 -2
- package/contracts/shared/IComponentService.sol +25 -13
- package/contracts/shared/IInstanceLinkedComponent.sol +3 -11
- package/contracts/shared/ILifecycle.sol +3 -1
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IRegisterable.sol +11 -0
- package/contracts/shared/InstanceLinkedComponent.sol +68 -27
- package/contracts/shared/KeyValueStore.sol +1 -1
- package/contracts/shared/Lifecycle.sol +15 -4
- package/contracts/shared/NftOwnable.sol +23 -3
- package/contracts/shared/PolicyHolder.sol +4 -0
- package/contracts/shared/Registerable.sol +15 -5
- package/contracts/shared/Service.sol +4 -7
- package/contracts/staking/IStakingService.sol +0 -3
- package/contracts/staking/Staking.sol +2 -3
- package/contracts/staking/StakingReader.sol +12 -5
- package/contracts/staking/StakingService.sol +15 -15
- package/contracts/type/Amount.sol +15 -0
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/NftId.sol +1 -0
- package/contracts/type/ObjectType.sol +1 -0
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/RiskId.sol +15 -1
- package/contracts/type/RoleId.sol +0 -12
- package/contracts/type/StateId.sol +14 -1
- package/contracts/type/UFixed.sol +4 -0
- package/contracts/upgradeability/ProxyManager.sol +2 -1
- package/package.json +2 -1
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +0 -290
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +0 -390
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- package/contracts/authorization/IModuleAuthorization.sol +0 -21
- package/contracts/authorization/ModuleAuthorization.sol +0 -78
- package/contracts/shared/InitializableCustom.sol +0 -177
@@ -1,38 +1,35 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
|
+
|
4
6
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
5
7
|
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
8
|
+
import {ContractLib} from "../shared/ContractLib.sol";
|
6
9
|
import {Fee, FeeLib} from "../type/Fee.sol";
|
7
10
|
import {IComponents} from "../instance/module/IComponents.sol";
|
8
11
|
import {IComponentService} from "./IComponentService.sol";
|
9
12
|
import {IInstance} from "../instance/IInstance.sol";
|
10
13
|
import {IInstanceLinkedComponent} from "./IInstanceLinkedComponent.sol";
|
14
|
+
import {InstanceAdmin} from "../instance/InstanceAdmin.sol";
|
11
15
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
12
16
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
13
17
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
18
|
+
import {IRegisterable} from "../shared/IRegisterable.sol";
|
14
19
|
import {IPoolComponent} from "../pool/IPoolComponent.sol";
|
15
20
|
import {IProductComponent} from "../product/IProductComponent.sol";
|
16
21
|
import {IRegistry} from "../registry/IRegistry.sol";
|
17
22
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
18
23
|
import {KEEP_STATE} from "../type/StateId.sol";
|
19
24
|
import {NftId} from "../type/NftId.sol";
|
20
|
-
import {ObjectType, REGISTRY, COMPONENT, DISTRIBUTION, INSTANCE, ORACLE, POOL, PRODUCT} from "../type/ObjectType.sol";
|
21
|
-
import {RoleId
|
25
|
+
import {ObjectType, REGISTRY, BUNDLE, COMPONENT, DISTRIBUTION, DISTRIBUTOR, INSTANCE, ORACLE, POOL, PRODUCT} from "../type/ObjectType.sol";
|
26
|
+
import {RoleId} from "../type/RoleId.sol";
|
22
27
|
import {TokenHandlerDeployerLib} from "../shared/TokenHandlerDeployerLib.sol";
|
23
28
|
|
24
29
|
contract ComponentService is
|
25
30
|
ComponentVerifyingService,
|
26
31
|
IComponentService
|
27
32
|
{
|
28
|
-
error ErrorComponentServiceAlreadyRegistered(address component);
|
29
|
-
error ErrorComponentServiceNotComponent(address component);
|
30
|
-
error ErrorComponentServiceInvalidType(address component, ObjectType requiredType, ObjectType componentType);
|
31
|
-
error ErrorComponentServiceSenderNotOwner(address component, address initialOwner, address sender);
|
32
|
-
error ErrorComponentServiceExpectedRoleMissing(NftId instanceNftId, RoleId requiredRole, address sender);
|
33
|
-
error ErrorComponentServiceComponentLocked(address component);
|
34
|
-
error ErrorComponentServiceSenderNotService(address sender);
|
35
|
-
error ErrorComponentServiceComponentTypeInvalid(address component, ObjectType expectedType, ObjectType foundType);
|
36
33
|
|
37
34
|
bool private constant INCREASE = true;
|
38
35
|
bool private constant DECREASE = false;
|
@@ -40,6 +37,14 @@ contract ComponentService is
|
|
40
37
|
IRegistryService private _registryService;
|
41
38
|
IInstanceService private _instanceService;
|
42
39
|
|
40
|
+
modifier onlyComponent(address component) {
|
41
|
+
if (!ContractLib.supportsInterface(component, type(IInstanceLinkedComponent).interfaceId)) {
|
42
|
+
revert ErrorComponentServiceNotInstanceLinkedComponent(component);
|
43
|
+
}
|
44
|
+
_;
|
45
|
+
}
|
46
|
+
|
47
|
+
|
43
48
|
function _initialize(
|
44
49
|
address owner,
|
45
50
|
bytes memory data
|
@@ -63,6 +68,29 @@ contract ComponentService is
|
|
63
68
|
|
64
69
|
//-------- component ----------------------------------------------------//
|
65
70
|
|
71
|
+
function registerComponent(address component)
|
72
|
+
external
|
73
|
+
virtual
|
74
|
+
onlyComponent(component)
|
75
|
+
returns (NftId componentNftId)
|
76
|
+
{
|
77
|
+
// type specific registration
|
78
|
+
ObjectType componentType = IInstanceLinkedComponent(component).getInitialInfo().objectType;
|
79
|
+
if (componentType == POOL()) {
|
80
|
+
return _registerPool(component);
|
81
|
+
}
|
82
|
+
if (componentType == DISTRIBUTION()) {
|
83
|
+
return _registerDistribution(component);
|
84
|
+
}
|
85
|
+
if (componentType == ORACLE()) {
|
86
|
+
return _registerOracle(component);
|
87
|
+
}
|
88
|
+
|
89
|
+
// fail
|
90
|
+
revert ErrorComponentServiceTypeNotSupported(component, componentType);
|
91
|
+
}
|
92
|
+
|
93
|
+
|
66
94
|
function setWallet(address newWallet) external virtual {
|
67
95
|
(NftId componentNftId,, IInstance instance) = _getAndVerifyActiveComponent(COMPONENT());
|
68
96
|
IComponents.ComponentInfo memory info = instance.getInstanceReader().getComponentInfo(componentNftId);
|
@@ -125,29 +153,29 @@ contract ComponentService is
|
|
125
153
|
|
126
154
|
//-------- product ------------------------------------------------------//
|
127
155
|
|
128
|
-
function registerProduct()
|
156
|
+
function registerProduct(address productAddress)
|
129
157
|
external
|
130
158
|
virtual
|
159
|
+
onlyComponent(productAddress)
|
160
|
+
returns (NftId productNftId)
|
131
161
|
{
|
132
|
-
address contractAddress = msg.sender;
|
133
|
-
|
134
162
|
// register/create component setup
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
// create
|
145
|
-
|
146
|
-
|
163
|
+
InstanceAdmin instanceAdmin;
|
164
|
+
InstanceStore instanceStore;
|
165
|
+
(, instanceAdmin, instanceStore,, productNftId) = _register(
|
166
|
+
productAddress,
|
167
|
+
PRODUCT());
|
168
|
+
|
169
|
+
// get product
|
170
|
+
IProductComponent product = IProductComponent(productAddress);
|
171
|
+
|
172
|
+
// create info
|
173
|
+
instanceStore.createProduct(
|
174
|
+
productNftId,
|
175
|
+
product.getInitialProductInfo());
|
147
176
|
|
148
|
-
//
|
149
|
-
|
150
|
-
_linkToProduct(instanceReader, instanceStore, productInfo.poolNftId, productNftId);
|
177
|
+
// authorize
|
178
|
+
instanceAdmin.initializeComponentAuthorization(product);
|
151
179
|
}
|
152
180
|
|
153
181
|
|
@@ -192,6 +220,7 @@ contract ComponentService is
|
|
192
220
|
// TODO re-enable once role granting is stable and fixed
|
193
221
|
// restricted()
|
194
222
|
{
|
223
|
+
_checkNftType(productNftId, PRODUCT());
|
195
224
|
_changeTargetBalance(INCREASE, instanceStore, productNftId, AmountLib.zero(), feeAmount);
|
196
225
|
}
|
197
226
|
|
@@ -202,23 +231,43 @@ contract ComponentService is
|
|
202
231
|
// TODO re-enable once role granting is stable and fixed
|
203
232
|
// restricted()
|
204
233
|
{
|
234
|
+
_checkNftType(productNftId, PRODUCT());
|
205
235
|
_changeTargetBalance(DECREASE, instanceStore, productNftId, AmountLib.zero(), feeAmount);
|
206
236
|
}
|
207
237
|
|
208
238
|
//-------- distribution -------------------------------------------------//
|
209
239
|
|
210
240
|
/// @dev registers the sending component as a distribution component
|
211
|
-
function
|
212
|
-
|
241
|
+
function _registerDistribution(address distributioAddress)
|
242
|
+
internal
|
213
243
|
virtual
|
244
|
+
returns (NftId distributionNftId)
|
214
245
|
{
|
215
|
-
address contractAddress = msg.sender;
|
216
|
-
|
217
246
|
// register/create component info
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
247
|
+
InstanceReader instanceReader;
|
248
|
+
InstanceAdmin instanceAdmin;
|
249
|
+
InstanceStore instanceStore;
|
250
|
+
NftId productNftId;
|
251
|
+
(instanceReader, instanceAdmin, instanceStore, productNftId, distributionNftId) = _register(
|
252
|
+
distributioAddress,
|
253
|
+
DISTRIBUTION());
|
254
|
+
|
255
|
+
// check product is still expecting a distribution registration
|
256
|
+
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
257
|
+
if (!productInfo.hasDistribution) {
|
258
|
+
revert ErrorProductServiceNoDistributionExpected(productNftId);
|
259
|
+
}
|
260
|
+
if (productInfo.distributionNftId.gtz()) {
|
261
|
+
revert ErrorProductServiceDistributionAlreadyRegistered(productNftId, productInfo.distributionNftId);
|
262
|
+
}
|
263
|
+
|
264
|
+
// set distribution in product info
|
265
|
+
productInfo.distributionNftId = distributionNftId;
|
266
|
+
instanceStore.updateProduct(productNftId, productInfo, KEEP_STATE());
|
267
|
+
|
268
|
+
// authorize
|
269
|
+
instanceAdmin.initializeComponentAuthorization(
|
270
|
+
IInstanceLinkedComponent(distributioAddress));
|
222
271
|
}
|
223
272
|
|
224
273
|
|
@@ -265,6 +314,7 @@ contract ComponentService is
|
|
265
314
|
// TODO re-enable once role granting is stable and fixed
|
266
315
|
// restricted()
|
267
316
|
{
|
317
|
+
_checkNftType(distributionNftId, DISTRIBUTION());
|
268
318
|
_changeTargetBalance(INCREASE, instanceStore, distributionNftId, amount, feeAmount);
|
269
319
|
}
|
270
320
|
|
@@ -280,6 +330,7 @@ contract ComponentService is
|
|
280
330
|
// TODO re-enable once role granting is stable and fixed
|
281
331
|
// restricted()
|
282
332
|
{
|
333
|
+
_checkNftType(distributionNftId, DISTRIBUTION());
|
283
334
|
_changeTargetBalance(DECREASE, instanceStore, distributionNftId, amount, feeAmount);
|
284
335
|
}
|
285
336
|
|
@@ -296,6 +347,7 @@ contract ComponentService is
|
|
296
347
|
// TODO re-enable once role granting is stable and fixed
|
297
348
|
// restricted()
|
298
349
|
{
|
350
|
+
_checkNftType(distributorNftId, DISTRIBUTOR());
|
299
351
|
_changeTargetBalance(INCREASE, instanceStore, distributorNftId, amount, feeAmount);
|
300
352
|
}
|
301
353
|
|
@@ -310,51 +362,81 @@ contract ComponentService is
|
|
310
362
|
// TODO re-enable once role granting is stable and fixed
|
311
363
|
// restricted()
|
312
364
|
{
|
365
|
+
_checkNftType(distributorNftId, DISTRIBUTOR());
|
313
366
|
_changeTargetBalance(DECREASE, instanceStore, distributorNftId, amount, feeAmount);
|
314
367
|
}
|
315
368
|
|
316
369
|
//-------- oracle -------------------------------------------------------//
|
317
370
|
|
318
|
-
function
|
319
|
-
|
371
|
+
function _registerOracle(address oracleAddress)
|
372
|
+
internal
|
320
373
|
virtual
|
374
|
+
returns (NftId oracleNftId)
|
321
375
|
{
|
322
|
-
address contractAddress = msg.sender;
|
323
|
-
|
324
376
|
// register/create component setup
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
377
|
+
InstanceReader instanceReader;
|
378
|
+
InstanceAdmin instanceAdmin;
|
379
|
+
InstanceStore instanceStore;
|
380
|
+
NftId productNftId;
|
381
|
+
|
382
|
+
(instanceReader, instanceAdmin, instanceStore, productNftId, oracleNftId) =_register(
|
383
|
+
oracleAddress,
|
384
|
+
ORACLE());
|
385
|
+
|
386
|
+
// check product is still expecting an oracle registration
|
387
|
+
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
388
|
+
if (productInfo.expectedNumberOfOracles == 0) {
|
389
|
+
revert ErrorProductServiceNoOraclesExpected(productNftId);
|
390
|
+
}
|
391
|
+
if (productInfo.numberOfOracles == productInfo.expectedNumberOfOracles) {
|
392
|
+
revert ErrorProductServiceOraclesAlreadyRegistered(productNftId, productInfo.expectedNumberOfOracles);
|
393
|
+
}
|
394
|
+
|
395
|
+
// update/add oracle to product info
|
396
|
+
productInfo.oracleNftId[productInfo.numberOfOracles] = oracleNftId;
|
397
|
+
productInfo.numberOfOracles++;
|
398
|
+
instanceStore.updateProduct(productNftId, productInfo, KEEP_STATE());
|
399
|
+
|
400
|
+
// authorize
|
401
|
+
instanceAdmin.initializeComponentAuthorization(
|
402
|
+
IInstanceLinkedComponent(oracleAddress));
|
333
403
|
}
|
334
404
|
|
335
405
|
//-------- pool ---------------------------------------------------------//
|
336
406
|
|
337
|
-
function
|
338
|
-
|
407
|
+
function _registerPool(address poolAddress)
|
408
|
+
internal
|
339
409
|
virtual
|
410
|
+
returns (NftId poolNftId)
|
340
411
|
{
|
341
|
-
address contractAddress = msg.sender;
|
342
|
-
|
343
412
|
// register/create component setup
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
413
|
+
InstanceReader instanceReader;
|
414
|
+
InstanceAdmin instanceAdmin;
|
415
|
+
InstanceStore instanceStore;
|
416
|
+
NftId productNftId;
|
417
|
+
|
418
|
+
(instanceReader, instanceAdmin, instanceStore, productNftId, poolNftId) =_register(
|
419
|
+
poolAddress,
|
420
|
+
POOL());
|
421
|
+
|
422
|
+
// check product is still expecting a pool registration
|
423
|
+
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
424
|
+
if (productInfo.poolNftId.gtz()) {
|
425
|
+
revert ErrorProductServicePoolAlreadyRegistered(productNftId, productInfo.poolNftId);
|
426
|
+
}
|
352
427
|
|
353
428
|
// create info
|
429
|
+
IPoolComponent pool = IPoolComponent(poolAddress);
|
354
430
|
instanceStore.createPool(
|
355
|
-
|
356
|
-
|
357
|
-
|
431
|
+
poolNftId,
|
432
|
+
pool.getInitialPoolInfo());
|
433
|
+
|
434
|
+
// update pool in product info
|
435
|
+
productInfo.poolNftId = poolNftId;
|
436
|
+
instanceStore.updateProduct(productNftId, productInfo, KEEP_STATE());
|
437
|
+
|
438
|
+
// authorize
|
439
|
+
instanceAdmin.initializeComponentAuthorization(pool);
|
358
440
|
}
|
359
441
|
|
360
442
|
|
@@ -409,6 +491,7 @@ contract ComponentService is
|
|
409
491
|
// TODO re-enable once role granting is stable and fixed
|
410
492
|
// restricted()
|
411
493
|
{
|
494
|
+
_checkNftType(poolNftId, POOL());
|
412
495
|
_changeTargetBalance(INCREASE, instanceStore, poolNftId, amount, feeAmount);
|
413
496
|
}
|
414
497
|
|
@@ -423,6 +506,7 @@ contract ComponentService is
|
|
423
506
|
// TODO re-enable once role granting is stable and fixed
|
424
507
|
// restricted()
|
425
508
|
{
|
509
|
+
_checkNftType(poolNftId, POOL());
|
426
510
|
_changeTargetBalance(DECREASE, instanceStore, poolNftId, amount, feeAmount);
|
427
511
|
}
|
428
512
|
|
@@ -439,6 +523,7 @@ contract ComponentService is
|
|
439
523
|
// TODO re-enable once role granting is stable and fixed
|
440
524
|
// restricted()
|
441
525
|
{
|
526
|
+
_checkNftType(bundleNftId, BUNDLE());
|
442
527
|
_changeTargetBalance(INCREASE, instanceStore, bundleNftId, amount, feeAmount);
|
443
528
|
}
|
444
529
|
|
@@ -453,6 +538,7 @@ contract ComponentService is
|
|
453
538
|
// TODO re-enable once role granting is stable and fixed
|
454
539
|
// restricted()
|
455
540
|
{
|
541
|
+
_checkNftType(bundleNftId, BUNDLE());
|
456
542
|
_changeTargetBalance(DECREASE, instanceStore, bundleNftId, amount, feeAmount);
|
457
543
|
}
|
458
544
|
|
@@ -480,76 +566,67 @@ contract ComponentService is
|
|
480
566
|
}
|
481
567
|
}
|
482
568
|
|
483
|
-
/// @dev
|
569
|
+
/// @dev Registers the component represented by the provided address.
|
484
570
|
function _register(
|
485
571
|
address componentAddress, // address of component to register
|
486
|
-
ObjectType requiredType
|
487
|
-
RoleId requiredRole // role required for comonent owner for registration
|
572
|
+
ObjectType requiredType // required type for component for registration
|
488
573
|
)
|
489
574
|
internal
|
490
575
|
virtual
|
491
576
|
returns (
|
492
577
|
InstanceReader instanceReader,
|
578
|
+
InstanceAdmin instanceAdmin,
|
493
579
|
InstanceStore instanceStore,
|
580
|
+
NftId parentNftId,
|
494
581
|
NftId componentNftId
|
495
582
|
)
|
496
583
|
{
|
584
|
+
NftId instanceNftId;
|
585
|
+
IInstance instance;
|
586
|
+
IInstanceLinkedComponent component;
|
587
|
+
address initialOwner;
|
588
|
+
|
497
589
|
(
|
498
|
-
|
499
|
-
|
500
|
-
|
590
|
+
instanceNftId,
|
591
|
+
instance,
|
592
|
+
parentNftId,
|
593
|
+
component,
|
594
|
+
initialOwner
|
501
595
|
) = _getAndVerifyRegisterableComponent(
|
596
|
+
getRegistry(),
|
502
597
|
componentAddress,
|
503
|
-
requiredType
|
504
|
-
requiredRole);
|
598
|
+
requiredType);
|
505
599
|
|
506
|
-
//
|
507
|
-
componentNftId = _registryService.registerComponent(
|
508
|
-
component,
|
509
|
-
requiredType,
|
510
|
-
owner).nftId;
|
511
|
-
|
512
|
-
component.linkToRegisteredNftId();
|
513
|
-
|
514
|
-
// save amended component info with instance
|
600
|
+
// get instance supporting contracts (as function return values)
|
515
601
|
instanceReader = instance.getInstanceReader();
|
602
|
+
instanceAdmin = instance.getInstanceAdmin();
|
516
603
|
instanceStore = instance.getInstanceStore();
|
517
604
|
|
605
|
+
// register with registry
|
606
|
+
if (requiredType == PRODUCT()) {
|
607
|
+
componentNftId = _registryService.registerProduct(
|
608
|
+
component, initialOwner).nftId;
|
609
|
+
} else {
|
610
|
+
componentNftId = _registryService.registerProductLinkedComponent(
|
611
|
+
component, requiredType, initialOwner).nftId;
|
612
|
+
}
|
613
|
+
|
614
|
+
// deploy and wire token handler
|
518
615
|
IComponents.ComponentInfo memory componentInfo = component.getInitialComponentInfo();
|
616
|
+
IERC20Metadata token = componentInfo.token;
|
519
617
|
componentInfo.tokenHandler = TokenHandlerDeployerLib.deployTokenHandler(
|
520
|
-
address(
|
521
|
-
address(
|
618
|
+
address(token),
|
619
|
+
address(instanceAdmin.authority()));
|
522
620
|
|
621
|
+
// register component with instance
|
523
622
|
instanceStore.createComponent(
|
524
|
-
|
623
|
+
componentNftId,
|
525
624
|
componentInfo);
|
526
625
|
|
527
|
-
//
|
528
|
-
|
529
|
-
instance.getNftId(),
|
530
|
-
component);
|
626
|
+
// link component contract to nft id
|
627
|
+
component.linkToRegisteredNftId();
|
531
628
|
|
532
|
-
|
533
|
-
}
|
534
|
-
|
535
|
-
|
536
|
-
/// @dev link the component info corresponding to the componentNftId to the provided productNftId
|
537
|
-
function _linkToProduct(
|
538
|
-
InstanceReader instanceReader,
|
539
|
-
InstanceStore instanceStore,
|
540
|
-
NftId componentNftId,
|
541
|
-
NftId productNftId
|
542
|
-
)
|
543
|
-
internal
|
544
|
-
{
|
545
|
-
// only link components that are registered
|
546
|
-
if(componentNftId.eqz()) {
|
547
|
-
return;
|
548
|
-
}
|
549
|
-
|
550
|
-
IComponents.ComponentInfo memory componentInfo = instanceReader.getComponentInfo(componentNftId);
|
551
|
-
componentInfo.productNftId = productNftId;
|
552
|
-
instanceStore.updateComponent(componentNftId, componentInfo, KEEP_STATE());
|
629
|
+
emit LogComponentServiceRegistered(instanceNftId, componentNftId, requiredType, address(component), address(token), initialOwner);
|
553
630
|
}
|
554
631
|
|
555
632
|
|
@@ -568,12 +645,6 @@ contract ComponentService is
|
|
568
645
|
}
|
569
646
|
|
570
647
|
|
571
|
-
function _createSelectors(bytes4 selector) internal pure returns (bytes4[] memory selectors) {
|
572
|
-
selectors = new bytes4[](1);
|
573
|
-
selectors[0] = selector;
|
574
|
-
}
|
575
|
-
|
576
|
-
|
577
648
|
function _getLinkedProductInfo(
|
578
649
|
InstanceReader instanceReader,
|
579
650
|
NftId componentNftId
|
@@ -585,37 +656,45 @@ contract ComponentService is
|
|
585
656
|
IComponents.ProductInfo memory info
|
586
657
|
)
|
587
658
|
{
|
588
|
-
productNftId =
|
659
|
+
productNftId = _getProductNftId(componentNftId);
|
589
660
|
info = instanceReader.getProductInfo(productNftId);
|
590
661
|
}
|
591
662
|
|
592
663
|
|
593
|
-
/// @dev
|
594
|
-
///
|
595
|
-
/// - the
|
664
|
+
/// @dev Based on the provided component address required type the component
|
665
|
+
/// and related instance contract this function reverts iff:
|
666
|
+
/// - the sender is not registered
|
596
667
|
/// - the component contract does not support IInstanceLinkedComponent
|
597
668
|
/// - the component type does not match with the required type
|
598
|
-
/// - the
|
669
|
+
/// - the component has already been registered
|
599
670
|
function _getAndVerifyRegisterableComponent(
|
671
|
+
IRegistry registry,
|
600
672
|
address componentAddress,
|
601
|
-
ObjectType requiredType
|
602
|
-
RoleId requiredRole
|
673
|
+
ObjectType requiredType
|
603
674
|
)
|
604
675
|
internal
|
605
676
|
view
|
606
677
|
returns (
|
678
|
+
NftId instanceNftId,
|
607
679
|
IInstance instance,
|
680
|
+
NftId parentNftId,
|
608
681
|
IInstanceLinkedComponent component,
|
609
|
-
address
|
682
|
+
address initialOwner
|
610
683
|
)
|
611
684
|
{
|
612
|
-
// check
|
613
|
-
|
614
|
-
if(
|
615
|
-
revert
|
685
|
+
// check sender (instance or product) is registered
|
686
|
+
IRegistry.ObjectInfo memory senderInfo = registry.getObjectInfo(msg.sender);
|
687
|
+
if (senderInfo.nftId.eqz()) {
|
688
|
+
revert ErrorComponentServiceSenderNotRegistered(msg.sender);
|
616
689
|
}
|
617
690
|
|
691
|
+
// the sender is the parent of the component to be registered
|
692
|
+
// an instance caller wanting to register a product - or -
|
693
|
+
// a product caller wantint go register a distribution, oracle or pool
|
694
|
+
parentNftId = senderInfo.nftId;
|
695
|
+
|
618
696
|
// check component is of required type
|
697
|
+
component = IInstanceLinkedComponent(componentAddress);
|
619
698
|
IRegistry.ObjectInfo memory info = component.getInitialInfo();
|
620
699
|
if(info.objectType != requiredType) {
|
621
700
|
revert ErrorComponentServiceInvalidType(componentAddress, requiredType, info.objectType);
|
@@ -626,15 +705,40 @@ contract ComponentService is
|
|
626
705
|
revert ErrorComponentServiceAlreadyRegistered(componentAddress);
|
627
706
|
}
|
628
707
|
|
629
|
-
// check
|
630
|
-
|
631
|
-
|
708
|
+
// check release matches
|
709
|
+
address parentAddress = registry.getObjectAddress(parentNftId);
|
710
|
+
if (component.getRelease() != IRegisterable(parentAddress).getRelease()) {
|
711
|
+
revert ErrorComponentServiceReleaseMismatch(componentAddress, component.getRelease(), IRegisterable(parentAddress).getRelease());
|
712
|
+
}
|
632
713
|
|
633
|
-
|
634
|
-
|
714
|
+
// check component belongs to same product cluster
|
715
|
+
// parent of product must be instance, parent of other componet types must be product
|
716
|
+
if (info.parentNftId != senderInfo.nftId) {
|
717
|
+
revert ErrorComponentServiceSenderNotComponentParent(senderInfo.nftId, info.parentNftId);
|
635
718
|
}
|
719
|
+
|
720
|
+
// verify parent is registered instance
|
721
|
+
if (requiredType == PRODUCT()) {
|
722
|
+
if (senderInfo.objectType != INSTANCE()) {
|
723
|
+
revert ErrorComponentServiceParentNotInstance(senderInfo.nftId, senderInfo.objectType);
|
724
|
+
}
|
725
|
+
|
726
|
+
instanceNftId = senderInfo.nftId;
|
727
|
+
// verify parent is registered product
|
728
|
+
} else {
|
729
|
+
if (senderInfo.objectType != PRODUCT()) {
|
730
|
+
revert ErrorComponentServiceParentNotProduct(senderInfo.nftId, senderInfo.objectType);
|
731
|
+
}
|
732
|
+
|
733
|
+
instanceNftId = senderInfo.parentNftId;
|
734
|
+
}
|
735
|
+
|
736
|
+
// get initial owner and instance
|
737
|
+
initialOwner = info.initialOwner;
|
738
|
+
instance = _getInstance(registry, instanceNftId);
|
636
739
|
}
|
637
740
|
|
741
|
+
|
638
742
|
function _getDomain() internal pure virtual override returns(ObjectType) {
|
639
743
|
return COMPONENT();
|
640
744
|
}
|
@@ -12,7 +12,6 @@ import {Service} from "../shared/Service.sol";
|
|
12
12
|
abstract contract ComponentVerifyingService is
|
13
13
|
Service
|
14
14
|
{
|
15
|
-
|
16
15
|
error ErrorComponentVerifyingServiceComponentTypeInvalid(NftId componentNftId, ObjectType expectedType, ObjectType actualType);
|
17
16
|
error ErrorComponentVerifyingServiceComponentIsLocked(NftId componentNftId);
|
18
17
|
|
@@ -83,7 +82,7 @@ abstract contract ComponentVerifyingService is
|
|
83
82
|
}
|
84
83
|
}
|
85
84
|
|
86
|
-
instance =
|
85
|
+
instance = _getInstanceForComponent(registry, info);
|
87
86
|
|
88
87
|
// ensure component is not locked
|
89
88
|
if (onlyActive) {
|
@@ -94,24 +93,34 @@ abstract contract ComponentVerifyingService is
|
|
94
93
|
}
|
95
94
|
|
96
95
|
|
97
|
-
|
98
|
-
function _getProductNftId(
|
99
|
-
InstanceReader instanceReader,
|
100
|
-
NftId componentNftId
|
101
|
-
)
|
96
|
+
function _getInstanceForComponent(IRegistry registry, IRegistry.ObjectInfo memory componentInfo)
|
102
97
|
internal
|
103
|
-
virtual
|
104
98
|
view
|
105
|
-
returns (
|
99
|
+
returns (IInstance instance)
|
106
100
|
{
|
107
|
-
|
101
|
+
// parent of product is instance
|
102
|
+
if (componentInfo.objectType == PRODUCT()) {
|
103
|
+
instance = _getInstance(registry, componentInfo.parentNftId);
|
104
|
+
// parent of other types is product
|
105
|
+
} else {
|
106
|
+
instance = _getInstance(
|
107
|
+
registry,
|
108
|
+
registry.getObjectInfo(
|
109
|
+
componentInfo.parentNftId).parentNftId);
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
|
114
|
+
/// @dev returns the product nft id from the registry.
|
115
|
+
/// assumes the component nft id is valid and represents a product linked component.
|
116
|
+
function _getProductNftId(NftId componentNftId) internal view returns (NftId productNftId) {
|
117
|
+
productNftId = getRegistry().getObjectInfo(componentNftId).parentNftId;
|
108
118
|
}
|
109
119
|
|
110
120
|
|
111
121
|
/// @dev returns an IInstance contract reference for the specified instance nft id
|
112
|
-
function _getInstance(NftId instanceNftId) internal view returns (IInstance) {
|
122
|
+
function _getInstance(IRegistry registry, NftId instanceNftId) internal view returns (IInstance) {
|
113
123
|
return IInstance(
|
114
|
-
|
115
|
-
instanceNftId).objectAddress);
|
124
|
+
registry.getObjectAddress(instanceNftId));
|
116
125
|
}
|
117
126
|
}
|
@@ -17,17 +17,21 @@ interface IComponent is
|
|
17
17
|
IRegisterable,
|
18
18
|
ITransferInterceptor
|
19
19
|
{
|
20
|
+
error ErrorComponentProductNftIdZero();
|
21
|
+
error ErrorComponentProductNftIdNonzero();
|
22
|
+
error ErrorComponentNameLengthZero();
|
23
|
+
|
20
24
|
error ErrorComponentNotChainNft(address caller);
|
21
25
|
|
26
|
+
error ErrorComponentTokenAddressNonzero();
|
22
27
|
error ErrorComponentTokenAddressZero();
|
23
|
-
error ErrorComponentNameLengthZero();
|
24
28
|
error ErrorComponentWalletAddressZero();
|
25
29
|
error ErrorComponentWalletAddressIsSameAsCurrent();
|
26
30
|
error ErrorComponentWalletNotComponent();
|
27
31
|
|
28
32
|
event LogComponentWalletAddressChanged(address oldWallet, address newWallet);
|
29
33
|
event LogComponentWalletTokensTransferred(address from, address to, uint256 amount);
|
30
|
-
event LogComponentTokenHandlerApproved(address token, Amount limit);
|
34
|
+
event LogComponentTokenHandlerApproved(address token, Amount limit, bool isMaxAmount);
|
31
35
|
|
32
36
|
/// @dev approves token hanlder to spend up to the specified amount of tokens
|
33
37
|
/// reverts if component wallet is not component itself
|