@etherisc/gif-next 0.0.2-7c8d286-020 → 0.0.2-7d488b3-675
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 +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +32 -48
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +26 -34
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +246 -361
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +39 -8
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +23 -96
- 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 +184 -278
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +0 -32
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +109 -33
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +41 -96
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +65 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +106 -142
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +53 -61
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +65 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +20 -40
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +17 -33
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +41 -96
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +59 -75
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +41 -96
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +118 -42
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +41 -96
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +23 -23
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +27 -43
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +41 -96
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +29 -45
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +41 -96
- 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 +7 -85
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +11 -54
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +25 -95
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +405 -512
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +41 -96
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +2 -2
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +63 -86
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +36 -26
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2 -2
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
- 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 +2 -2
- 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/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +2 -2
- 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 +14 -14
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +30 -93
- 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/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +42 -58
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +31 -39
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +41 -96
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +58 -74
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +39 -47
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +22 -38
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +74 -106
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +47 -63
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +26 -71
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +23 -35
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +41 -96
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +80 -96
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +50 -58
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +0 -21
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +0 -21
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +0 -21
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +86 -94
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +18 -452
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +53 -57
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +52 -89
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +36 -44
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +26 -55
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +23 -27
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +350 -440
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +19 -19
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +368 -473
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +124 -128
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- 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/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +102 -63
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +49 -41
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +4 -60
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +24 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +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 +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.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 +9 -74
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +3 -74
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +440 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +57 -141
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +34 -50
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +57 -30
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +29 -124
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +23 -35
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +128 -142
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +14 -24
- 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/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 +2 -2
- 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/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 +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.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 +31 -33
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- 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 +2 -2
- 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/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +2 -56
- 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 +4 -4
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +3 -2
- package/contracts/authorization/AccessAdmin.sol +186 -201
- package/contracts/authorization/AccessManagerCloneable.sol +31 -40
- package/contracts/authorization/Authorization.sol +33 -61
- package/contracts/authorization/IAccessAdmin.sol +36 -63
- package/contracts/authorization/IAuthorization.sol +0 -6
- package/contracts/distribution/BasicDistribution.sol +3 -5
- package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
- package/contracts/distribution/Distribution.sol +47 -4
- package/contracts/distribution/DistributionService.sol +6 -10
- package/contracts/distribution/IDistributionComponent.sol +9 -0
- package/contracts/distribution/IDistributionService.sol +5 -3
- package/contracts/instance/IInstance.sol +8 -43
- package/contracts/instance/IInstanceService.sol +2 -14
- package/contracts/instance/Instance.sol +13 -62
- package/contracts/instance/InstanceAdmin.sol +107 -120
- package/contracts/instance/InstanceAuthorizationV3.sol +21 -43
- package/contracts/instance/InstanceReader.sol +1 -1
- package/contracts/instance/InstanceService.sol +60 -118
- package/contracts/oracle/BasicOracleAuthorization.sol +1 -1
- package/contracts/oracle/OracleService.sol +4 -4
- package/contracts/pool/BasicPoolAuthorization.sol +1 -1
- package/contracts/pool/PoolLib.sol +1 -94
- package/contracts/pool/PoolService.sol +89 -91
- package/contracts/product/ApplicationService.sol +1 -10
- package/contracts/product/BasicProductAuthorization.sol +1 -1
- package/contracts/product/ClaimService.sol +0 -8
- package/contracts/product/IApplicationService.sol +0 -2
- package/contracts/product/IPricingService.sol +0 -1
- package/contracts/product/IRiskService.sol +0 -3
- package/contracts/product/PolicyService.sol +53 -35
- package/contracts/product/PolicyServiceLib.sol +1 -55
- package/contracts/product/PricingService.sol +0 -5
- package/contracts/product/RiskService.sol +0 -10
- package/contracts/registry/RegistryAdmin.sol +229 -133
- package/contracts/registry/ReleaseAdmin.sol +22 -30
- package/contracts/registry/ReleaseRegistry.sol +33 -39
- package/contracts/registry/ServiceAuthorizationV3.sol +3 -88
- package/contracts/shared/Component.sol +6 -6
- package/contracts/shared/ComponentService.sol +29 -33
- package/contracts/shared/ContractLib.sol +0 -28
- package/contracts/shared/IComponentService.sol +6 -4
- package/contracts/shared/InitializableERC165.sol +1 -9
- package/contracts/shared/NftOwnable.sol +1 -2
- package/contracts/shared/Registerable.sol +4 -1
- package/contracts/shared/TokenHandler.sol +4 -5
- package/contracts/staking/IStaking.sol +2 -12
- package/contracts/staking/IStakingService.sol +1 -11
- package/contracts/staking/{StakingLib.sol → StakeManagerLib.sol} +22 -79
- package/contracts/staking/Staking.sol +13 -33
- package/contracts/staking/StakingReader.sol +15 -5
- package/contracts/staking/StakingService.sol +2 -39
- package/contracts/staking/StakingStore.sol +1 -2
- package/contracts/type/ObjectType.sol +14 -5
- package/contracts/type/Version.sol +0 -39
- package/package.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +0 -4
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +0 -673
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +0 -4
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +0 -878
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +0 -469
- package/contracts/authorization/AccessAdminLib.sol +0 -183
- package/contracts/registry/RegistryAuthorization.sol +0 -267
@@ -2,11 +2,12 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {AccessManagerUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagerUpgradeable.sol";
|
5
|
+
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
6
|
import {IAccessManager} from "@openzeppelin/contracts/access/manager/IAccessManager.sol";
|
6
7
|
|
7
8
|
import {InitializableERC165} from "../shared/InitializableERC165.sol";
|
8
9
|
import {RegistryLinked} from "../shared/RegistryLinked.sol";
|
9
|
-
import {VersionPart} from "../type/Version.sol";
|
10
|
+
import {VersionPart, VersionLib} from "../type/Version.sol";
|
10
11
|
|
11
12
|
|
12
13
|
/// @dev An AccessManager based on OpenZeppelin that is cloneable and has a central lock property.
|
@@ -27,7 +28,6 @@ contract AccessManagerCloneable is
|
|
27
28
|
VersionPart private _release;
|
28
29
|
bool private _isLocked;
|
29
30
|
|
30
|
-
|
31
31
|
modifier onlyAdminRole() {
|
32
32
|
(bool isMember, ) = hasRole(ADMIN_ROLE, msg.sender);
|
33
33
|
if(!isMember) {
|
@@ -36,14 +36,12 @@ contract AccessManagerCloneable is
|
|
36
36
|
_;
|
37
37
|
}
|
38
38
|
|
39
|
-
|
40
39
|
function initialize(address admin)
|
41
|
-
|
40
|
+
external
|
42
41
|
initializer()
|
43
42
|
{
|
44
|
-
__ERC165_init();
|
45
43
|
__AccessManager_init(admin);
|
46
|
-
|
44
|
+
_initializeERC165();
|
47
45
|
_registerInterface(type(IAccessManager).interfaceId);
|
48
46
|
}
|
49
47
|
|
@@ -58,27 +56,22 @@ contract AccessManagerCloneable is
|
|
58
56
|
onlyAdminRole
|
59
57
|
reinitializer(uint64(release.toInt()))
|
60
58
|
{
|
61
|
-
|
62
|
-
_checkAndSetRelease(release);
|
59
|
+
_completeSetup(registry, release, true);
|
63
60
|
}
|
64
61
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
// if (verifyRelease) {
|
79
|
-
// _checkAndSetRelease(release);
|
80
|
-
// }
|
81
|
-
// }
|
62
|
+
/// @dev Completes the setup of the access manager.
|
63
|
+
/// Links the access manager to the registry and sets the release version.
|
64
|
+
function completeSetup(
|
65
|
+
address registry,
|
66
|
+
VersionPart release,
|
67
|
+
bool verifyRelease
|
68
|
+
)
|
69
|
+
public
|
70
|
+
onlyAdminRole
|
71
|
+
reinitializer(uint64(release.toInt()))
|
72
|
+
{
|
73
|
+
_completeSetup(registry, release, verifyRelease);
|
74
|
+
}
|
82
75
|
|
83
76
|
/// @dev Returns true if the caller is authorized to call the target with the given selector and the manager lock is not set to locked.
|
84
77
|
/// Feturn values as in OpenZeppelin AccessManager.
|
@@ -96,12 +89,12 @@ contract AccessManagerCloneable is
|
|
96
89
|
uint32 delay
|
97
90
|
)
|
98
91
|
{
|
92
|
+
(immediate, delay) = super.canCall(caller, target, selector);
|
93
|
+
|
99
94
|
// locking of all contracts under control of this access manager
|
100
|
-
if (
|
95
|
+
if (isLocked()) {
|
101
96
|
revert ErrorAccessManagerTargetAdminLocked(target);
|
102
97
|
}
|
103
|
-
|
104
|
-
(immediate, delay) = super.canCall(caller, target, selector);
|
105
98
|
}
|
106
99
|
|
107
100
|
|
@@ -133,18 +126,11 @@ contract AccessManagerCloneable is
|
|
133
126
|
}
|
134
127
|
|
135
128
|
|
136
|
-
function
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
}
|
142
|
-
|
143
|
-
_release = release;
|
144
|
-
}
|
145
|
-
|
146
|
-
|
147
|
-
function _checkAndSetRegistry(address registry)
|
129
|
+
function _completeSetup(
|
130
|
+
address registry,
|
131
|
+
VersionPart release,
|
132
|
+
bool verifyRelease
|
133
|
+
)
|
148
134
|
internal
|
149
135
|
{
|
150
136
|
// checks
|
@@ -152,7 +138,12 @@ contract AccessManagerCloneable is
|
|
152
138
|
revert ErrorAccessManagerRegistryAlreadySet(address(getRegistry()) );
|
153
139
|
}
|
154
140
|
|
141
|
+
if (verifyRelease && !release.isValidRelease()) {
|
142
|
+
revert ErrorAccessManagerInvalidRelease(release);
|
143
|
+
}
|
144
|
+
|
155
145
|
// effects
|
156
146
|
__RegistryLinked_init(registry);
|
147
|
+
_release = release;
|
157
148
|
}
|
158
149
|
}
|
@@ -3,32 +3,27 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IAccess} from "./IAccess.sol";
|
5
5
|
import {IAuthorization} from "./IAuthorization.sol";
|
6
|
-
|
7
|
-
import {InitializableERC165} from "../shared/InitializableERC165.sol";
|
8
|
-
import {ObjectType, ObjectTypeLib} from "../type/ObjectType.sol";
|
6
|
+
import {ObjectType, ObjectTypeLib, PRODUCT, ORACLE, DISTRIBUTION, POOL} from "../type/ObjectType.sol";
|
9
7
|
import {RoleId, RoleIdLib, ADMIN_ROLE} from "../type/RoleId.sol";
|
10
8
|
import {SelectorLib} from "../type/Selector.sol";
|
11
9
|
import {Str, StrLib} from "../type/String.sol";
|
12
10
|
import {TimestampLib} from "../type/Timestamp.sol";
|
13
11
|
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
14
12
|
|
15
|
-
contract Authorization
|
16
|
-
|
17
|
-
IAuthorization
|
13
|
+
contract Authorization
|
14
|
+
is IAuthorization
|
18
15
|
{
|
19
16
|
uint256 public constant GIF_RELEASE = 3;
|
20
17
|
|
21
18
|
string public constant ROLE_NAME_SUFFIX = "Role";
|
22
19
|
string public constant SERVICE_ROLE_NAME_SUFFIX = "ServiceRole";
|
23
20
|
|
24
|
-
uint64 internal _nextGifContractRoleId;
|
25
21
|
ObjectType[] internal _serviceDomains;
|
26
22
|
mapping(ObjectType domain => Str target) internal _serviceTarget;
|
27
23
|
|
28
24
|
string internal _mainTargetName = "Component";
|
29
25
|
string internal _tokenHandlerName = "ComponentTH";
|
30
26
|
|
31
|
-
ObjectType internal _domain;
|
32
27
|
Str internal _mainTarget;
|
33
28
|
Str internal _tokenHandlerTarget;
|
34
29
|
Str[] internal _targets;
|
@@ -45,9 +40,7 @@ contract Authorization is
|
|
45
40
|
|
46
41
|
constructor(
|
47
42
|
string memory mainTargetName,
|
48
|
-
ObjectType targetDomain
|
49
|
-
bool isComponent,
|
50
|
-
bool includeTokenHandler
|
43
|
+
ObjectType targetDomain
|
51
44
|
)
|
52
45
|
{
|
53
46
|
// checks
|
@@ -55,52 +48,45 @@ contract Authorization is
|
|
55
48
|
revert ErrorAuthorizationMainTargetNameEmpty();
|
56
49
|
}
|
57
50
|
|
58
|
-
if (targetDomain
|
51
|
+
if (targetDomain.eqz()) {
|
59
52
|
revert ErrorAuthorizationTargetDomainZero();
|
60
53
|
}
|
61
54
|
|
62
55
|
// effects
|
63
|
-
|
64
|
-
|
65
|
-
_domain = targetDomain;
|
56
|
+
// setup main target, main role id and main role info
|
66
57
|
_mainTargetName = mainTargetName;
|
67
|
-
|
68
|
-
_nextGifContractRoleId = 10;
|
58
|
+
_tokenHandlerName = string(abi.encodePacked(mainTargetName, "TH"));
|
69
59
|
|
70
|
-
|
71
|
-
|
72
|
-
revert ErrorAuthorizationTargetDomainZero();
|
73
|
-
}
|
60
|
+
RoleId mainRoleId = RoleIdLib.toComponentRoleId(targetDomain, 0);
|
61
|
+
string memory mainRolName = _toTargetRoleName(mainTargetName);
|
74
62
|
|
75
|
-
|
76
|
-
|
63
|
+
_addTargetWithRole(
|
64
|
+
_mainTargetName,
|
65
|
+
mainRoleId,
|
66
|
+
mainRolName);
|
77
67
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
68
|
+
_mainTarget = StrLib.toStr(mainTargetName);
|
69
|
+
_targetRole[_mainTarget] = mainRoleId;
|
70
|
+
|
71
|
+
// add token handler target for components
|
72
|
+
if (targetDomain == PRODUCT()
|
73
|
+
|| targetDomain == DISTRIBUTION()
|
74
|
+
|| targetDomain == ORACLE()
|
75
|
+
|| targetDomain == POOL()
|
76
|
+
) {
|
77
|
+
_addTarget(_tokenHandlerName);
|
84
78
|
}
|
79
|
+
|
80
|
+
// setup token handler target
|
81
|
+
_tokenHandlerTarget = StrLib.toStr(_tokenHandlerName);
|
82
|
+
|
85
83
|
// setup use case specific parts
|
86
84
|
_setupServiceTargets();
|
87
85
|
_setupRoles(); // not including main target role
|
88
86
|
_setupTargets(); // not including main target (and token handler target)
|
89
|
-
_setupTargetAuthorizations(); // not including token handler target
|
90
87
|
|
91
|
-
|
92
|
-
|
93
|
-
_tokenHandlerName = string(abi.encodePacked(mainTargetName, "TH"));
|
94
|
-
_tokenHandlerTarget = StrLib.toStr(_tokenHandlerName);
|
95
|
-
_addTarget(_tokenHandlerName);
|
96
|
-
_setupTokenHandlerAuthorizations();
|
97
|
-
}
|
98
|
-
|
99
|
-
_registerInterfaceNotInitializing(type(IAuthorization).interfaceId);
|
100
|
-
}
|
101
|
-
|
102
|
-
function getDomain() external view returns(ObjectType targetDomain) {
|
103
|
-
return _domain;
|
88
|
+
_setupTokenHandlerAuthorizations();
|
89
|
+
_setupTargetAuthorizations(); // not including token handler target
|
104
90
|
}
|
105
91
|
|
106
92
|
function getServiceDomains() external view returns(ObjectType[] memory serviceDomains) {
|
@@ -161,7 +147,7 @@ contract Authorization is
|
|
161
147
|
return target == _mainTarget || _targetExists[target];
|
162
148
|
}
|
163
149
|
|
164
|
-
function getTargetRole(Str target)
|
150
|
+
function getTargetRole(Str target) external view returns(RoleId roleId) {
|
165
151
|
return _targetRole[target];
|
166
152
|
}
|
167
153
|
|
@@ -197,20 +183,6 @@ contract Authorization is
|
|
197
183
|
/// Overwrite this function for use case specific authorizations.
|
198
184
|
function _setupTargetAuthorizations() internal virtual {}
|
199
185
|
|
200
|
-
function _addGifContractTarget(string memory contractName) internal {
|
201
|
-
|
202
|
-
RoleId contractRoleId = RoleIdLib.toRoleId(_nextGifContractRoleId++);
|
203
|
-
string memory contractRoleName = string(
|
204
|
-
abi.encodePacked(
|
205
|
-
contractName,
|
206
|
-
ROLE_NAME_SUFFIX));
|
207
|
-
|
208
|
-
_addTargetWithRole(
|
209
|
-
contractName,
|
210
|
-
contractRoleId,
|
211
|
-
contractRoleName);
|
212
|
-
}
|
213
|
-
|
214
186
|
/// @dev Add the service target role for the specified service domain
|
215
187
|
function _addServiceTargetWithRole(ObjectType serviceDomain) internal {
|
216
188
|
// add service domain
|
@@ -220,7 +192,7 @@ contract Authorization is
|
|
220
192
|
string memory serviceTargetName = ObjectTypeLib.toVersionedName(
|
221
193
|
ObjectTypeLib.toName(serviceDomain),
|
222
194
|
"Service",
|
223
|
-
getRelease());
|
195
|
+
getRelease().toInt());
|
224
196
|
|
225
197
|
_serviceTarget[serviceDomain] = StrLib.toStr(serviceTargetName);
|
226
198
|
|
@@ -228,7 +200,7 @@ contract Authorization is
|
|
228
200
|
string memory serviceRoleName = ObjectTypeLib.toVersionedName(
|
229
201
|
ObjectTypeLib.toName(serviceDomain),
|
230
202
|
"ServiceRole",
|
231
|
-
getRelease());
|
203
|
+
getRelease().toInt());
|
232
204
|
|
233
205
|
_addTargetWithRole(
|
234
206
|
serviceTargetName,
|
@@ -263,7 +235,7 @@ contract Authorization is
|
|
263
235
|
ObjectTypeLib.toVersionedName(
|
264
236
|
ObjectTypeLib.toName(serviceDomain),
|
265
237
|
SERVICE_ROLE_NAME_SUFFIX,
|
266
|
-
getRelease()));
|
238
|
+
getRelease().toInt()));
|
267
239
|
}
|
268
240
|
|
269
241
|
|
@@ -4,12 +4,7 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
5
|
|
6
6
|
import {IAccess} from "./IAccess.sol";
|
7
|
-
import {IAuthorization} from "./IAuthorization.sol";
|
8
7
|
import {IRegistryLinked} from "../shared/IRegistryLinked.sol";
|
9
|
-
import {IRelease} from "../registry/IRelease.sol";
|
10
|
-
|
11
|
-
import {NftId} from "../type/NftId.sol";
|
12
|
-
import {ObjectType} from "../type/ObjectType.sol";
|
13
8
|
import {RoleId} from "../type/RoleId.sol";
|
14
9
|
import {Selector} from "../type/Selector.sol";
|
15
10
|
import {Str} from "../type/String.sol";
|
@@ -18,80 +13,59 @@ import {VersionPart} from "../type/Version.sol";
|
|
18
13
|
interface IAccessAdmin is
|
19
14
|
IAccessManaged,
|
20
15
|
IAccess,
|
21
|
-
IRegistryLinked
|
22
|
-
IRelease
|
16
|
+
IRegistryLinked
|
23
17
|
{
|
24
18
|
|
25
19
|
// roles, targets and functions
|
26
|
-
event LogAccessAdminRoleCreated(
|
27
|
-
event LogAccessAdminTargetCreated(
|
20
|
+
event LogAccessAdminRoleCreated(RoleId roleId, RoleType roleType, RoleId roleAdminId, string name);
|
21
|
+
event LogAccessAdminTargetCreated(address target, string name);
|
28
22
|
|
29
|
-
event LogAccessAdminRoleGranted(
|
30
|
-
event LogAccessAdminRoleRevoked(
|
31
|
-
event LogAccessAdminFunctionGranted(
|
23
|
+
event LogAccessAdminRoleGranted(address account, string roleName);
|
24
|
+
event LogAccessAdminRoleRevoked(address account, string roleName);
|
25
|
+
event LogAccessAdminFunctionGranted(address target, string functionName, string roleName);
|
32
26
|
|
33
27
|
// only deployer modifier
|
34
|
-
error
|
28
|
+
error ErrorNotDeployer();
|
35
29
|
|
36
30
|
// only role admin modifier
|
37
|
-
error
|
31
|
+
error ErrorNotAdminOfRole(RoleId adminRoleId);
|
38
32
|
|
39
33
|
// only role owner modifier
|
40
|
-
error
|
41
|
-
|
42
|
-
// initialization
|
43
|
-
error ErrorAccessAdminNotRegistry(address registry);
|
44
|
-
error ErrorAccessAdminAuthorityNotContract(address authority);
|
45
|
-
error ErrorAccessAdminAccessManagerNotAccessManager(address authority);
|
46
|
-
error ErrorAccessAdminAccessManagerEmptyName();
|
47
|
-
|
48
|
-
// check target
|
49
|
-
error ErrorAccessAdminTargetNotCreated(address target);
|
50
|
-
error ErrorAccessAdminTargetNotRegistered(address target);
|
51
|
-
error ErrorAccessAdminTargetTypeMismatch(address target, ObjectType expectedType, ObjectType actualType);
|
52
|
-
|
53
|
-
// check authorization
|
54
|
-
error ErrorAccessAdminAlreadyInitialized(address authorization);
|
55
|
-
error ErrorAccessAdminNotAuthorization(address authorization);
|
56
|
-
error ErrorAccessAdminDomainMismatch(address authorization, ObjectType expectedDomain, ObjectType actualDomain);
|
57
|
-
error ErrorAccessAdminReleaseMismatch(address authorization, VersionPart expectedRelease, VersionPart actualRelease);
|
58
|
-
|
59
|
-
// link to nft
|
60
|
-
error ErrorAccessAdminNotRegistered(address registerable);
|
34
|
+
error ErrorNotRoleOwner(RoleId roleId);
|
61
35
|
|
62
36
|
// initialize authority
|
63
|
-
error
|
37
|
+
error ErrorAdminRoleMissing();
|
64
38
|
|
65
39
|
// create role
|
66
|
-
error
|
67
|
-
error
|
68
|
-
error
|
69
|
-
error
|
40
|
+
error ErrorRoleAlreadyCreated(RoleId roleId, string name);
|
41
|
+
error ErrorRoleAdminNotExisting(RoleId adminRoleId);
|
42
|
+
error ErrorRoleNameEmpty(RoleId roleId);
|
43
|
+
error ErrorRoleNameAlreadyExists(RoleId roleId, string name, RoleId existingRoleId);
|
70
44
|
|
71
45
|
// grant/revoke/renounce role
|
72
|
-
error
|
73
|
-
error
|
74
|
-
error
|
75
|
-
error
|
76
|
-
error
|
77
|
-
error
|
46
|
+
error ErrorRoleUnknown(RoleId roleId);
|
47
|
+
error ErrorRoleIsLocked(RoleId roleId);
|
48
|
+
error ErrorRoleIsPaused(RoleId roleId);
|
49
|
+
error ErrorRoleMembersLimitReached(RoleId roleId, uint256 memberCountLimit);
|
50
|
+
error ErrorRoleMemberNotContract(RoleId roleId, address notContract);
|
51
|
+
error ErrorRoleMemberRemovalDisabled(RoleId roleId, address expectedMember);
|
78
52
|
|
79
53
|
// create target
|
80
|
-
error
|
81
|
-
error
|
82
|
-
error
|
83
|
-
error
|
84
|
-
error
|
54
|
+
error ErrorTargetAlreadyCreated(address target, string name);
|
55
|
+
error ErrorTargetNameEmpty(address target);
|
56
|
+
error ErrorTargetNameAlreadyExists(address target, string name, address existingTarget);
|
57
|
+
error ErrorTargetNotAccessManaged(address target);
|
58
|
+
error ErrorTargetAuthorityMismatch(address expectedAuthority, address actualAuthority);
|
85
59
|
|
86
60
|
// lock target
|
87
|
-
error
|
88
|
-
error
|
61
|
+
error ErrorTagetNotLockable();
|
62
|
+
error ErrorTargetAlreadyLocked(address target, bool isLocked);
|
89
63
|
|
90
64
|
// authorize target functions
|
91
|
-
error
|
65
|
+
error ErrorAuthorizeForAdminRoleInvalid(address target);
|
92
66
|
|
93
67
|
// check target
|
94
|
-
error
|
68
|
+
error ErrorTargetUnknown(address target);
|
95
69
|
|
96
70
|
/// @dev Set the disabled status of the speicified role.
|
97
71
|
/// Role disabling only prevents the role from being granted to new accounts.
|
@@ -136,11 +110,7 @@ interface IAccessAdmin is
|
|
136
110
|
|
137
111
|
//--- view functions ----------------------------------------------------//
|
138
112
|
|
139
|
-
function
|
140
|
-
function getLinkedNftId() external view returns (NftId linkedNftId);
|
141
|
-
function getLinkedOwner() external view returns (address linkedOwner);
|
142
|
-
|
143
|
-
function isLocked() external view returns (bool locked);
|
113
|
+
function getRelease() external view returns (VersionPart release);
|
144
114
|
|
145
115
|
function roles() external view returns (uint256 numberOfRoles);
|
146
116
|
function getRoleId(uint256 idx) external view returns (RoleId roleId);
|
@@ -148,8 +118,8 @@ interface IAccessAdmin is
|
|
148
118
|
function getPublicRole() external view returns (RoleId roleId);
|
149
119
|
|
150
120
|
function roleExists(RoleId roleId) external view returns (bool exists);
|
151
|
-
function getRoleForName(string memory name) external view returns (RoleId roleId);
|
152
121
|
function getRoleInfo(RoleId roleId) external view returns (RoleInfo memory roleInfo);
|
122
|
+
function getRoleForName(Str name) external view returns (RoleNameInfo memory);
|
153
123
|
|
154
124
|
function hasRole(address account, RoleId roleId) external view returns (bool);
|
155
125
|
function hasAdminRole(address account, RoleId roleId) external view returns (bool);
|
@@ -157,14 +127,17 @@ interface IAccessAdmin is
|
|
157
127
|
function getRoleMember(RoleId roleId, uint256 idx) external view returns (address account);
|
158
128
|
|
159
129
|
function targetExists(address target) external view returns (bool exists);
|
160
|
-
function
|
130
|
+
function isTargetLocked(address target) external view returns (bool locked);
|
161
131
|
function targets() external view returns (uint256 numberOfTargets);
|
162
132
|
function getTargetAddress(uint256 idx) external view returns (address target);
|
163
133
|
function getTargetInfo(address target) external view returns (TargetInfo memory targetInfo);
|
164
|
-
function
|
134
|
+
function getTargetForName(Str name) external view returns (address target);
|
165
135
|
|
166
136
|
function authorizedFunctions(address target) external view returns (uint256 numberOfFunctions);
|
167
137
|
function getAuthorizedFunction(address target, uint256 idx) external view returns (FunctionInfo memory func, RoleId roleId);
|
138
|
+
function canCall(address caller, address target, Selector selector) external view returns (bool can);
|
168
139
|
|
140
|
+
function toRole(RoleId adminRoleId, RoleType roleType, uint32 maxMemberCount, string memory name) external view returns (RoleInfo memory);
|
141
|
+
function toFunction(bytes4 selector, string memory name) external view returns (FunctionInfo memory);
|
169
142
|
function deployer() external view returns (address);
|
170
143
|
}
|
@@ -1,8 +1,6 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
|
-
|
6
4
|
import {IAccess} from "../authorization/IAccess.sol";
|
7
5
|
import {ObjectType} from "../type/ObjectType.sol";
|
8
6
|
import {RoleId} from "../type/RoleId.sol";
|
@@ -10,16 +8,12 @@ import {Str} from "../type/String.sol";
|
|
10
8
|
import {VersionPart} from "../type/Version.sol";
|
11
9
|
|
12
10
|
interface IAuthorization is
|
13
|
-
IERC165,
|
14
11
|
IAccess
|
15
12
|
{
|
16
13
|
|
17
14
|
error ErrorAuthorizationMainTargetNameEmpty();
|
18
15
|
error ErrorAuthorizationTargetDomainZero();
|
19
16
|
|
20
|
-
/// @dev Returns the main domain of the authorization.
|
21
|
-
function getDomain() external view returns(ObjectType targetDomain);
|
22
|
-
|
23
17
|
/// @dev Returns the list of service targets.
|
24
18
|
function getServiceDomains() external view returns(ObjectType[] memory serviceDomains);
|
25
19
|
|
@@ -7,7 +7,7 @@ import {Distribution} from "./Distribution.sol";
|
|
7
7
|
import {DistributorType} from "../type/DistributorType.sol";
|
8
8
|
import {DISTRIBUTOR} from "../type/ObjectType.sol";
|
9
9
|
import {Fee} from "../type/Fee.sol";
|
10
|
-
import {NftId
|
10
|
+
import {NftId} from "../type/NftId.sol";
|
11
11
|
import {ReferralId} from "../type/Referral.sol";
|
12
12
|
import {Seconds} from "../type/Seconds.sol";
|
13
13
|
import {Timestamp} from "../type/Timestamp.sol";
|
@@ -95,7 +95,6 @@ contract BasicDistribution is
|
|
95
95
|
* referral codes need to be unique
|
96
96
|
*/
|
97
97
|
function createReferral(
|
98
|
-
NftId distributorNftId,
|
99
98
|
string memory code,
|
100
99
|
UFixed discountPercentage,
|
101
100
|
uint32 maxReferrals,
|
@@ -105,10 +104,10 @@ contract BasicDistribution is
|
|
105
104
|
external
|
106
105
|
virtual
|
107
106
|
restricted()
|
108
|
-
|
107
|
+
onlyDistributor()
|
109
108
|
returns (ReferralId referralId)
|
110
109
|
{
|
111
|
-
|
110
|
+
NftId distributorNftId = getDistributorNftId(msg.sender);
|
112
111
|
return _createReferral(
|
113
112
|
distributorNftId,
|
114
113
|
code,
|
@@ -134,7 +133,6 @@ contract BasicDistribution is
|
|
134
133
|
registry,
|
135
134
|
instanceNftId,
|
136
135
|
authorization,
|
137
|
-
false,
|
138
136
|
initialOwner,
|
139
137
|
name,
|
140
138
|
token,
|
@@ -10,7 +10,7 @@ import {Amount} from "../type/Amount.sol";
|
|
10
10
|
import {COMPONENT, DISTRIBUTION, DISTRIBUTOR} from "../type/ObjectType.sol";
|
11
11
|
import {DistributorType} from "../type/DistributorType.sol";
|
12
12
|
import {Fee} from "../type/Fee.sol";
|
13
|
-
import {NftId} from "../type/NftId.sol";
|
13
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
14
14
|
import {ReferralId, ReferralStatus, ReferralLib} from "../type/Referral.sol";
|
15
15
|
import {InstanceLinkedComponent} from "../shared/InstanceLinkedComponent.sol";
|
16
16
|
import {Seconds} from "../type/Seconds.sol";
|
@@ -28,8 +28,17 @@ abstract contract Distribution is
|
|
28
28
|
struct DistributionStorage {
|
29
29
|
IComponentService _componentService;
|
30
30
|
IDistributionService _distributionService;
|
31
|
+
mapping(address distributor => NftId distributorNftId) _distributorNftId;
|
31
32
|
}
|
32
33
|
|
34
|
+
modifier onlyDistributor() {
|
35
|
+
if (!isDistributor(msg.sender)) {
|
36
|
+
revert ErrorDistributionNotDistributor(msg.sender);
|
37
|
+
}
|
38
|
+
_;
|
39
|
+
}
|
40
|
+
|
41
|
+
|
33
42
|
function processRenewal(
|
34
43
|
ReferralId referralId,
|
35
44
|
uint256 feeAmount
|
@@ -47,6 +56,7 @@ abstract contract Distribution is
|
|
47
56
|
external
|
48
57
|
virtual
|
49
58
|
restricted()
|
59
|
+
onlyDistributor()
|
50
60
|
onlyNftOfType(distributorNftId, DISTRIBUTOR())
|
51
61
|
onlyNftOwner(distributorNftId)
|
52
62
|
returns (Amount withdrawnAmount)
|
@@ -54,6 +64,27 @@ abstract contract Distribution is
|
|
54
64
|
return _withdrawCommission(distributorNftId, amount);
|
55
65
|
}
|
56
66
|
|
67
|
+
|
68
|
+
function isDistributor(address candidate)
|
69
|
+
public
|
70
|
+
view
|
71
|
+
returns (bool)
|
72
|
+
{
|
73
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
74
|
+
return $._distributorNftId[candidate].gtz();
|
75
|
+
}
|
76
|
+
|
77
|
+
|
78
|
+
function getDistributorNftId(address distributor)
|
79
|
+
public
|
80
|
+
view
|
81
|
+
returns (NftId distributorNftId)
|
82
|
+
{
|
83
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
84
|
+
return $._distributorNftId[distributor];
|
85
|
+
}
|
86
|
+
|
87
|
+
|
57
88
|
function getDiscountPercentage(string memory referralCode)
|
58
89
|
external
|
59
90
|
view
|
@@ -104,7 +135,6 @@ abstract contract Distribution is
|
|
104
135
|
address registry,
|
105
136
|
NftId productNftId,
|
106
137
|
IAuthorization authorization,
|
107
|
-
bool isInterceptor,
|
108
138
|
address initialOwner,
|
109
139
|
string memory name,
|
110
140
|
address token,
|
@@ -118,10 +148,10 @@ abstract contract Distribution is
|
|
118
148
|
registry,
|
119
149
|
productNftId,
|
120
150
|
name,
|
121
|
-
token,
|
151
|
+
token,
|
122
152
|
DISTRIBUTION(),
|
123
153
|
authorization,
|
124
|
-
|
154
|
+
true,
|
125
155
|
initialOwner,
|
126
156
|
componentData);
|
127
157
|
|
@@ -185,11 +215,16 @@ abstract contract Distribution is
|
|
185
215
|
returns(NftId distributorNftId)
|
186
216
|
{
|
187
217
|
DistributionStorage storage $ = _getDistributionStorage();
|
218
|
+
if($._distributorNftId[distributor].gtz()) {
|
219
|
+
revert ErrorDistributionAlreadyDistributor(distributor, $._distributorNftId[distributor]);
|
220
|
+
}
|
188
221
|
|
189
222
|
distributorNftId = $._distributionService.createDistributor(
|
190
223
|
distributor,
|
191
224
|
distributorType,
|
192
225
|
data);
|
226
|
+
|
227
|
+
$._distributorNftId[distributor] = distributorNftId;
|
193
228
|
}
|
194
229
|
|
195
230
|
/// @dev Uptates the distributor type for the specified distributor.
|
@@ -238,6 +273,14 @@ abstract contract Distribution is
|
|
238
273
|
return _getDistributionStorage()._distributionService.withdrawCommission(distributorNftId, amount);
|
239
274
|
}
|
240
275
|
|
276
|
+
function _nftTransferFrom(address from, address to, uint256 tokenId, address operator) internal virtual override {
|
277
|
+
// keep track of distributor nft owner
|
278
|
+
emit LogDistributorUpdated(to, operator);
|
279
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
280
|
+
$._distributorNftId[from] = NftIdLib.zero();
|
281
|
+
$._distributorNftId[to] = NftIdLib.toNftId(tokenId);
|
282
|
+
}
|
283
|
+
|
241
284
|
function _getDistributionStorage() private pure returns (DistributionStorage storage $) {
|
242
285
|
assembly {
|
243
286
|
$.slot := DISTRIBUTION_STORAGE_LOCATION_V1
|