@etherisc/gif-next 0.0.2-b3e9a44-364 → 0.0.2-b43fece-589
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/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 +138 -94
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +77 -17
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +78 -58
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +120 -86
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +64 -60
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +65 -58
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +13 -0
- 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 +119 -135
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +114 -22
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +218 -159
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +81 -25
- 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 +140 -96
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +121 -77
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +197 -145
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +508 -177
- 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 +37 -31
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +13 -84
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +46 -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 +94 -79
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +56 -130
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +32 -40
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +174 -103
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- 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/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 +119 -75
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +77 -17
- 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 +60 -53
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +27 -9
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +73 -53
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +70 -47
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +32 -36
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +73 -81
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +114 -22
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +125 -119
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +57 -69
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +32 -15
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +60 -92
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +90 -88
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +73 -92
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +149 -158
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +40 -52
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +50 -32
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +29 -33
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +118 -54
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +77 -17
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +106 -88
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +56 -60
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +13 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +13 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +13 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +70 -57
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +105 -54
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +13 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +80 -62
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +45 -49
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +133 -115
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +42 -46
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +118 -54
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +44 -26
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +26 -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 +0 -15
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +98 -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 +38 -53
- 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 +129 -61
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +25 -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 +52 -28
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +334 -155
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +67 -63
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +26 -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 +39 -28
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +305 -19
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +60 -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/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +13 -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 +13 -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 +73 -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/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/Registerable.sol/Registerable.json +50 -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 +26 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +39 -28
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +13 -0
- 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 +122 -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 +52 -42
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +50 -32
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +29 -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/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- 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/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- 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/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/UFixedLib.dbg.json +1 -1
- 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 +12 -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 +106 -38
- 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 +0 -1
- package/contracts/distribution/Distribution.sol +4 -15
- package/contracts/distribution/DistributionService.sol +14 -7
- package/contracts/distribution/IDistributionComponent.sol +1 -1
- package/contracts/examples/fire/FirePool.sol +19 -8
- package/contracts/examples/fire/FireProduct.sol +32 -12
- package/contracts/examples/fire/FireProductAuthorization.sol +1 -2
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +4 -4
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -4
- package/contracts/examples/unpermissioned/SimplePool.sol +11 -6
- package/contracts/examples/unpermissioned/SimpleProduct.sol +17 -23
- 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 +16 -27
- package/contracts/instance/InstanceAuthorizationV3.sol +9 -19
- package/contracts/instance/InstanceService.sol +14 -68
- package/contracts/instance/module/IComponents.sol +7 -4
- 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 +20 -14
- package/contracts/pool/BasicPool.sol +22 -12
- package/contracts/pool/BasicPoolAuthorization.sol +12 -2
- package/contracts/pool/BundleService.sol +63 -39
- package/contracts/pool/IBundleService.sol +2 -5
- package/contracts/pool/IPoolComponent.sol +1 -7
- package/contracts/pool/IPoolService.sol +23 -22
- package/contracts/pool/Pool.sol +111 -123
- package/contracts/pool/PoolService.sol +186 -128
- package/contracts/product/ApplicationService.sol +9 -1
- package/contracts/product/BasicProduct.sol +8 -12
- package/contracts/product/BasicProductAuthorization.sol +0 -1
- package/contracts/product/ClaimService.sol +82 -51
- package/contracts/product/IPricingService.sol +9 -9
- package/contracts/product/IProductComponent.sol +6 -0
- package/contracts/product/PolicyService.sol +15 -10
- package/contracts/product/PricingService.sol +7 -7
- package/contracts/product/Product.sol +51 -54
- package/contracts/registry/ChainNft.sol +6 -9
- package/contracts/registry/IRegistry.sol +0 -3
- package/contracts/registry/IRegistryService.sol +6 -4
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +6 -4
- package/contracts/registry/RegistryAdmin.sol +7 -23
- package/contracts/registry/RegistryService.sol +37 -55
- package/contracts/registry/ReleaseLifecycle.sol +6 -3
- package/contracts/registry/ReleaseRegistry.sol +201 -191
- package/contracts/registry/ServiceAuthorizationV3.sol +20 -15
- package/contracts/shared/Component.sol +25 -21
- package/contracts/shared/ComponentService.sol +235 -131
- package/contracts/shared/ComponentVerifyingService.sol +22 -14
- 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/IRegisterable.sol +11 -0
- package/contracts/shared/InstanceLinkedComponent.sol +67 -25
- package/contracts/shared/KeyValueStore.sol +1 -1
- package/contracts/shared/Lifecycle.sol +15 -4
- package/contracts/shared/NftOwnable.sol +8 -4
- package/contracts/shared/Registerable.sol +15 -7
- package/contracts/shared/Service.sol +4 -7
- package/contracts/staking/Staking.sol +2 -3
- package/contracts/staking/StakingService.sol +14 -0
- package/contracts/type/RiskId.sol +1 -1
- package/contracts/type/RoleId.sol +0 -12
- package/contracts/type/StateId.sol +14 -1
- package/contracts/upgradeability/ProxyManager.sol +2 -1
- package/package.json +1 -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/contracts/authorization/IModuleAuthorization.sol +0 -21
- package/contracts/authorization/ModuleAuthorization.sol +0 -78
@@ -6,11 +6,13 @@ import {Amount, AmountLib} from "../../type/Amount.sol";
|
|
6
6
|
import {BasicProduct} from "../../product/BasicProduct.sol";
|
7
7
|
import {ClaimId} from "../../type/ClaimId.sol";
|
8
8
|
import {DamageLevel, DAMAGE_SMALL, DAMAGE_MEDIUM, DAMAGE_LARGE} from "./DamageLevel.sol";
|
9
|
+
import {FeeLib} from "../../type/Fee.sol";
|
9
10
|
import {IAuthorization} from "../../authorization/IAuthorization.sol";
|
11
|
+
import {IComponents} from "../../instance/module/IComponents.sol";
|
10
12
|
import {IPolicy} from "../../instance/module/IPolicy.sol";
|
11
|
-
import {NftId} from "../../type/NftId.sol";
|
13
|
+
import {NftId, NftIdLib} from "../../type/NftId.sol";
|
12
14
|
import {PayoutId} from "../../type/PayoutId.sol";
|
13
|
-
import {POLICY} from "../../type/ObjectType.sol";
|
15
|
+
import {POLICY, BUNDLE} from "../../type/ObjectType.sol";
|
14
16
|
import {ReferralLib} from "../../type/Referral.sol";
|
15
17
|
import {RiskId, RiskIdLib} from "../../type/RiskId.sol";
|
16
18
|
import {Seconds} from "../../type/Seconds.sol";
|
@@ -65,27 +67,25 @@ contract FireProduct is
|
|
65
67
|
NftId instanceNftid,
|
66
68
|
string memory componentName,
|
67
69
|
address token,
|
68
|
-
address pool,
|
69
70
|
IAuthorization authorization
|
70
71
|
)
|
71
72
|
{
|
72
73
|
address initialOwner = msg.sender;
|
74
|
+
|
73
75
|
_initialize(
|
74
76
|
registry,
|
75
77
|
instanceNftid,
|
76
78
|
componentName,
|
77
79
|
token,
|
78
|
-
pool,
|
79
80
|
authorization,
|
80
81
|
initialOwner);
|
81
82
|
}
|
82
83
|
|
83
84
|
function _initialize(
|
84
85
|
address registry,
|
85
|
-
NftId
|
86
|
+
NftId instanceNftId,
|
86
87
|
string memory componentName,
|
87
88
|
address token,
|
88
|
-
address pool,
|
89
89
|
IAuthorization authorization,
|
90
90
|
address initialOwner
|
91
91
|
)
|
@@ -94,14 +94,28 @@ contract FireProduct is
|
|
94
94
|
{
|
95
95
|
_initializeBasicProduct(
|
96
96
|
registry,
|
97
|
-
|
98
|
-
authorization,
|
99
|
-
initialOwner,
|
97
|
+
instanceNftId,
|
100
98
|
componentName,
|
101
99
|
token,
|
102
|
-
|
103
|
-
|
104
|
-
|
100
|
+
IComponents.ProductInfo({
|
101
|
+
isProcessingFundedClaims: false,
|
102
|
+
isInterceptingPolicyTransfers: false,
|
103
|
+
hasDistribution: false,
|
104
|
+
expectedNumberOfOracles: 0,
|
105
|
+
numberOfOracles: 0,
|
106
|
+
poolNftId: NftIdLib.zero(),
|
107
|
+
distributionNftId: NftIdLib.zero(),
|
108
|
+
oracleNftId: new NftId[](0),
|
109
|
+
productFee: FeeLib.zero(),
|
110
|
+
processingFee: FeeLib.zero(),
|
111
|
+
distributionFee: FeeLib.zero(),
|
112
|
+
minDistributionOwnerFee: FeeLib.zero(),
|
113
|
+
poolFee: FeeLib.zero(),
|
114
|
+
stakingFee: FeeLib.zero(),
|
115
|
+
performanceFee: FeeLib.zero()
|
116
|
+
}),
|
117
|
+
authorization,
|
118
|
+
initialOwner); // number of oracles
|
105
119
|
}
|
106
120
|
|
107
121
|
function cities() public view returns (uint256) {
|
@@ -156,6 +170,7 @@ contract FireProduct is
|
|
156
170
|
)
|
157
171
|
public
|
158
172
|
view
|
173
|
+
onlyNftOfType(bundleNftId, BUNDLE())
|
159
174
|
returns (Amount premiumAmount)
|
160
175
|
{
|
161
176
|
RiskId risk = _riskMapping[cityName];
|
@@ -197,6 +212,7 @@ contract FireProduct is
|
|
197
212
|
)
|
198
213
|
public
|
199
214
|
restricted()
|
215
|
+
onlyNftOfType(bundleNftId, BUNDLE())
|
200
216
|
returns (NftId policyNftId)
|
201
217
|
{
|
202
218
|
address applicationOwner = msg.sender;
|
@@ -246,6 +262,7 @@ contract FireProduct is
|
|
246
262
|
public
|
247
263
|
restricted()
|
248
264
|
onlyOwner()
|
265
|
+
onlyNftOfType(policyNftId, POLICY())
|
249
266
|
{
|
250
267
|
_createPolicy(policyNftId, activateAt);
|
251
268
|
_collectPremium(policyNftId, activateAt);
|
@@ -258,6 +275,7 @@ contract FireProduct is
|
|
258
275
|
public
|
259
276
|
restricted()
|
260
277
|
onlyOwner()
|
278
|
+
onlyNftOfType(policyNftId, POLICY())
|
261
279
|
{
|
262
280
|
_decline(policyNftId);
|
263
281
|
}
|
@@ -269,6 +287,7 @@ contract FireProduct is
|
|
269
287
|
public
|
270
288
|
restricted()
|
271
289
|
onlyOwner()
|
290
|
+
onlyNftOfType(policyNftId, POLICY())
|
272
291
|
returns (Timestamp)
|
273
292
|
{
|
274
293
|
return _expire(policyNftId, expireAt);
|
@@ -280,6 +299,7 @@ contract FireProduct is
|
|
280
299
|
public
|
281
300
|
restricted()
|
282
301
|
onlyOwner()
|
302
|
+
onlyNftOfType(policyNftId, POLICY())
|
283
303
|
{
|
284
304
|
_close(policyNftId);
|
285
305
|
}
|
@@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {BasicProductAuthorization} from "../../product/BasicProductAuthorization.sol";
|
5
5
|
import {FireProduct} from "./FireProduct.sol";
|
6
6
|
import {IAccess} from "../../../contracts/authorization/IAccess.sol";
|
7
|
-
import {
|
7
|
+
import {PUBLIC_ROLE} from "../../../contracts/type/RoleId.sol";
|
8
8
|
|
9
9
|
|
10
10
|
contract FireProductAuthorization
|
@@ -36,7 +36,6 @@ contract FireProductAuthorization
|
|
36
36
|
// only policy nft owner
|
37
37
|
_authorize(functions, FireProduct.submitClaim.selector, "submitClaim");
|
38
38
|
|
39
|
-
functions = _authorizeForTarget(getTargetName(), PRODUCT_OWNER_ROLE());
|
40
39
|
// TODO: add custom role for fire reporter
|
41
40
|
_authorize(functions, FireProduct.reportFire.selector, "reportFire");
|
42
41
|
}
|
@@ -12,7 +12,7 @@ contract SimpleDistribution is
|
|
12
12
|
|
13
13
|
constructor(
|
14
14
|
address registry,
|
15
|
-
NftId
|
15
|
+
NftId productNftId,
|
16
16
|
IAuthorization authorization,
|
17
17
|
address initialOwner,
|
18
18
|
address token
|
@@ -20,7 +20,7 @@ contract SimpleDistribution is
|
|
20
20
|
{
|
21
21
|
initialize(
|
22
22
|
registry,
|
23
|
-
|
23
|
+
productNftId,
|
24
24
|
authorization,
|
25
25
|
initialOwner,
|
26
26
|
"SimpleDistribution",
|
@@ -29,7 +29,7 @@ contract SimpleDistribution is
|
|
29
29
|
|
30
30
|
function initialize(
|
31
31
|
address registry,
|
32
|
-
NftId
|
32
|
+
NftId productNftId,
|
33
33
|
IAuthorization authorization,
|
34
34
|
address initialOwner,
|
35
35
|
string memory name,
|
@@ -41,7 +41,7 @@ contract SimpleDistribution is
|
|
41
41
|
{
|
42
42
|
_initializeBasicDistribution(
|
43
43
|
registry,
|
44
|
-
|
44
|
+
productNftId,
|
45
45
|
authorization,
|
46
46
|
initialOwner,
|
47
47
|
name,
|
@@ -32,7 +32,7 @@ contract SimpleOracle is
|
|
32
32
|
|
33
33
|
constructor(
|
34
34
|
address registry,
|
35
|
-
NftId
|
35
|
+
NftId productNftId,
|
36
36
|
IAuthorization authorization,
|
37
37
|
address initialOwner,
|
38
38
|
address token
|
@@ -40,7 +40,7 @@ contract SimpleOracle is
|
|
40
40
|
{
|
41
41
|
initialize(
|
42
42
|
registry,
|
43
|
-
|
43
|
+
productNftId,
|
44
44
|
authorization,
|
45
45
|
initialOwner,
|
46
46
|
"SimpleOracle",
|
@@ -50,7 +50,7 @@ contract SimpleOracle is
|
|
50
50
|
|
51
51
|
function initialize(
|
52
52
|
address registry,
|
53
|
-
NftId
|
53
|
+
NftId productNftId,
|
54
54
|
IAuthorization authorization,
|
55
55
|
address initialOwner,
|
56
56
|
string memory name,
|
@@ -62,7 +62,7 @@ contract SimpleOracle is
|
|
62
62
|
{
|
63
63
|
_initializeBasicOracle(
|
64
64
|
registry,
|
65
|
-
|
65
|
+
productNftId,
|
66
66
|
authorization,
|
67
67
|
initialOwner,
|
68
68
|
name,
|
@@ -6,6 +6,7 @@ import {BasicPool} from "../../pool/BasicPool.sol";
|
|
6
6
|
import {BasicPoolAuthorization} from "../../pool/BasicPoolAuthorization.sol";
|
7
7
|
import {Fee} from "../../type/Fee.sol";
|
8
8
|
import {IAuthorization} from "../../authorization/IAuthorization.sol";
|
9
|
+
import {IComponents} from "../../instance/module/IComponents.sol";
|
9
10
|
import {NftId} from "../../type/NftId.sol";
|
10
11
|
import {Seconds} from "../../type/Timestamp.sol";
|
11
12
|
import {UFixed} from "../../type/UFixed.sol";
|
@@ -16,16 +17,18 @@ contract SimplePool is
|
|
16
17
|
|
17
18
|
constructor(
|
18
19
|
address registry,
|
19
|
-
NftId
|
20
|
+
NftId productNftId,
|
20
21
|
address token,
|
22
|
+
IComponents.PoolInfo memory poolInfo,
|
21
23
|
IAuthorization authorization,
|
22
24
|
address initialOwner
|
23
25
|
)
|
24
26
|
{
|
25
27
|
initialize(
|
26
28
|
registry,
|
27
|
-
|
29
|
+
productNftId,
|
28
30
|
token,
|
31
|
+
poolInfo,
|
29
32
|
authorization,
|
30
33
|
initialOwner
|
31
34
|
);
|
@@ -33,8 +36,9 @@ contract SimplePool is
|
|
33
36
|
|
34
37
|
function initialize(
|
35
38
|
address registry,
|
36
|
-
NftId
|
39
|
+
NftId productNftId,
|
37
40
|
address token,
|
41
|
+
IComponents.PoolInfo memory poolInfo,
|
38
42
|
IAuthorization authorization,
|
39
43
|
address initialOwner
|
40
44
|
)
|
@@ -44,10 +48,11 @@ contract SimplePool is
|
|
44
48
|
{
|
45
49
|
_initializeBasicPool(
|
46
50
|
registry,
|
47
|
-
|
48
|
-
authorization,
|
49
|
-
token,
|
51
|
+
productNftId,
|
50
52
|
"SimplePool",
|
53
|
+
token,
|
54
|
+
poolInfo,
|
55
|
+
authorization,
|
51
56
|
initialOwner);
|
52
57
|
}
|
53
58
|
|
@@ -5,6 +5,7 @@ import {Amount, AmountLib} from "../../type/Amount.sol";
|
|
5
5
|
import {BasicProduct} from "../../product/BasicProduct.sol";
|
6
6
|
import {ClaimId} from "../../type/ClaimId.sol";
|
7
7
|
import {IAuthorization} from "../../authorization/IAuthorization.sol";
|
8
|
+
import {IComponents} from "../../instance/module/IComponents.sol";
|
8
9
|
import {IOracleService} from "../../oracle/IOracleService.sol";
|
9
10
|
import {ORACLE} from "../../type/ObjectType.sol";
|
10
11
|
import {NftId} from "../../type/NftId.sol";
|
@@ -32,38 +33,33 @@ contract SimpleProduct is
|
|
32
33
|
|
33
34
|
constructor(
|
34
35
|
address registry,
|
35
|
-
NftId
|
36
|
-
|
37
|
-
address initialOwner,
|
36
|
+
NftId instanceNftId,
|
37
|
+
string memory name,
|
38
38
|
address token,
|
39
|
-
|
40
|
-
|
41
|
-
address
|
39
|
+
IComponents.ProductInfo memory productInfo,
|
40
|
+
IAuthorization authorization,
|
41
|
+
address initialOwner
|
42
42
|
)
|
43
43
|
{
|
44
44
|
initialize(
|
45
45
|
registry,
|
46
|
-
|
47
|
-
|
48
|
-
initialOwner,
|
49
|
-
"SimpleProduct",
|
46
|
+
instanceNftId,
|
47
|
+
name,
|
50
48
|
token,
|
51
|
-
|
52
|
-
|
53
|
-
|
49
|
+
productInfo,
|
50
|
+
authorization,
|
51
|
+
initialOwner);
|
54
52
|
}
|
55
53
|
|
56
54
|
|
57
55
|
function initialize(
|
58
56
|
address registry,
|
59
57
|
NftId instanceNftid,
|
60
|
-
IAuthorization authorization,
|
61
|
-
address initialOwner,
|
62
58
|
string memory name,
|
63
59
|
address token,
|
64
|
-
|
65
|
-
|
66
|
-
address
|
60
|
+
IComponents.ProductInfo memory productInfo,
|
61
|
+
IAuthorization authorization,
|
62
|
+
address initialOwner
|
67
63
|
)
|
68
64
|
public
|
69
65
|
virtual
|
@@ -72,13 +68,11 @@ contract SimpleProduct is
|
|
72
68
|
_initializeBasicProduct(
|
73
69
|
registry,
|
74
70
|
instanceNftid,
|
75
|
-
authorization,
|
76
|
-
initialOwner,
|
77
71
|
name,
|
78
72
|
token,
|
79
|
-
|
80
|
-
|
81
|
-
|
73
|
+
productInfo,
|
74
|
+
authorization,
|
75
|
+
initialOwner);
|
82
76
|
|
83
77
|
_oracleService = IOracleService(_getServiceAddress(ORACLE()));
|
84
78
|
}
|
@@ -10,6 +10,7 @@ import {InstanceReader} from "./InstanceReader.sol";
|
|
10
10
|
import {InstanceStore} from "./InstanceStore.sol";
|
11
11
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
12
12
|
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
13
|
+
import {NftId} from "../type/NftId.sol";
|
13
14
|
import {RoleId} from "../type/RoleId.sol";
|
14
15
|
import {Seconds} from "../type/Seconds.sol";
|
15
16
|
import {UFixed} from "../type/UFixed.sol";
|
@@ -38,6 +39,9 @@ interface IInstance is
|
|
38
39
|
uint64 requestsCount;
|
39
40
|
}
|
40
41
|
|
42
|
+
/// @dev Register a product with the instance.
|
43
|
+
function registerProduct(address product) external returns (NftId productNftId);
|
44
|
+
|
41
45
|
function createRole(string memory roleName, string memory adminName) external returns (RoleId roleId, RoleId admin);
|
42
46
|
function grantRole(RoleId roleId, address account) external;
|
43
47
|
function revokeRole(RoleId roleId, address account) external;
|
@@ -55,7 +59,6 @@ interface IInstance is
|
|
55
59
|
function withdrawStakingRewardReserves(Amount dipAmount) external returns (Amount newBalance);
|
56
60
|
|
57
61
|
// get instance release and supporting contracts
|
58
|
-
function getMajorVersion() external pure returns (VersionPart majorVersion);
|
59
62
|
function getInstanceReader() external view returns (InstanceReader);
|
60
63
|
function getBundleSet() external view returns (BundleSet);
|
61
64
|
function getInstanceAdmin() external view returns (InstanceAdmin);
|
@@ -68,25 +68,5 @@ interface IInstanceService is IService {
|
|
68
68
|
/// @dev Defunds the staking reward reserves for the specified target.
|
69
69
|
function withdrawStakingRewardReserves(Amount dipAmount) external returns (Amount newBalance);
|
70
70
|
|
71
|
-
/// @dev Sets up the component authorization for the specified instance.
|
72
|
-
/// The authorization is based on the authz specification provided by the component via getAuthorization.
|
73
|
-
function initializeAuthorization(NftId instanceNftId, IInstanceLinkedComponent component) external;
|
74
|
-
|
75
|
-
function createComponentTarget(
|
76
|
-
NftId instanceNftId,
|
77
|
-
address targetAddress,
|
78
|
-
string memory targetName,
|
79
|
-
bytes4[][] memory selectors,
|
80
|
-
RoleId[] memory roles
|
81
|
-
) external;
|
82
|
-
|
83
|
-
function createGifTarget(
|
84
|
-
NftId instanceNftId,
|
85
|
-
address targetAddress,
|
86
|
-
string memory targetName,
|
87
|
-
bytes4[][] memory selectors,
|
88
|
-
RoleId[] memory roles
|
89
|
-
) external;
|
90
|
-
|
91
71
|
function setComponentLocked(bool locked) external;
|
92
72
|
}
|
@@ -5,13 +5,15 @@ import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/acce
|
|
5
5
|
|
6
6
|
import {Amount} from "../type/Amount.sol";
|
7
7
|
import {BundleSet} from "./BundleSet.sol";
|
8
|
+
import {COMPONENT, INSTANCE} from "../type/ObjectType.sol";
|
8
9
|
import {IInstance} from "./IInstance.sol";
|
10
|
+
import {IComponentService} from "../shared/IComponentService.sol";
|
9
11
|
import {IInstanceService} from "./IInstanceService.sol";
|
10
12
|
import {InstanceReader} from "./InstanceReader.sol";
|
11
13
|
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
12
14
|
import {InstanceStore} from "./InstanceStore.sol";
|
13
|
-
import {INSTANCE} from "../type/ObjectType.sol";
|
14
15
|
import {IRegistry} from "../registry/IRegistry.sol";
|
16
|
+
import {NftId} from "../type/NftId.sol";
|
15
17
|
import {Registerable} from "../shared/Registerable.sol";
|
16
18
|
import {RoleId} from "../type/RoleId.sol";
|
17
19
|
import {Seconds} from "../type/Seconds.sol";
|
@@ -23,10 +25,9 @@ contract Instance is
|
|
23
25
|
AccessManagedUpgradeable,
|
24
26
|
Registerable
|
25
27
|
{
|
26
|
-
uint256 public constant GIF_MAJOR_VERSION = 3;
|
27
|
-
|
28
28
|
bool private _initialized;
|
29
29
|
|
30
|
+
IComponentService internal _componentService;
|
30
31
|
IInstanceService internal _instanceService;
|
31
32
|
InstanceAdmin internal _instanceAdmin;
|
32
33
|
InstanceReader internal _instanceReader;
|
@@ -53,7 +54,6 @@ contract Instance is
|
|
53
54
|
{
|
54
55
|
_instanceAdmin = instanceAdmin;
|
55
56
|
if(_instanceAdmin.authority() == address(0)) {
|
56
|
-
// TODO rename error
|
57
57
|
revert ErrorInstanceInstanceAdminZero();
|
58
58
|
}
|
59
59
|
|
@@ -79,19 +79,32 @@ contract Instance is
|
|
79
79
|
_bundleManager.initialize();
|
80
80
|
_instanceReader.initialize();
|
81
81
|
|
82
|
+
_componentService = IComponentService(
|
83
|
+
getRegistry().getServiceAddress(
|
84
|
+
COMPONENT(),
|
85
|
+
getRelease()));
|
86
|
+
|
82
87
|
_instanceService = IInstanceService(
|
83
88
|
getRegistry().getServiceAddress(
|
84
89
|
INSTANCE(),
|
85
|
-
|
90
|
+
getRelease()));
|
86
91
|
|
87
92
|
_registerInterface(type(IInstance).interfaceId);
|
88
93
|
}
|
89
94
|
|
95
|
+
//--- ProductRegistration ----------------------------------------------//
|
96
|
+
function registerProduct(address product)
|
97
|
+
external
|
98
|
+
onlyOwner()
|
99
|
+
returns (NftId productNftId)
|
100
|
+
{
|
101
|
+
return _componentService.registerProduct(product);
|
102
|
+
}
|
103
|
+
|
90
104
|
//--- Staking ----------------------------------------------------------//
|
91
105
|
|
92
106
|
function setStakingLockingPeriod(Seconds stakeLockingPeriod)
|
93
107
|
external
|
94
|
-
// TODO decide if onlyOwner or restricted to instance owner role is better
|
95
108
|
onlyOwner()
|
96
109
|
{
|
97
110
|
_instanceService.setStakingLockingPeriod(stakeLockingPeriod);
|
@@ -178,13 +191,7 @@ contract Instance is
|
|
178
191
|
|
179
192
|
//--- ITransferInterceptor ----------------------------------------------//
|
180
193
|
|
181
|
-
|
182
|
-
function nftMint(address to, uint256 tokenId) external onlyChainNft {
|
183
|
-
// TODO refactor
|
184
|
-
// _instanceAdmin.transferInstanceOwnerRole(address(0), to);
|
185
|
-
}
|
186
|
-
|
187
|
-
function nftTransferFrom(address from, address to, uint256 tokenId) external onlyChainNft {
|
194
|
+
function nftTransferFrom(address from, address to, uint256 tokenId, address operator) external onlyChainNft {
|
188
195
|
// TODO refactor
|
189
196
|
// _instanceAdmin.transferInstanceOwnerRole(from, to);
|
190
197
|
}
|
@@ -221,9 +228,5 @@ contract Instance is
|
|
221
228
|
return _instanceStore;
|
222
229
|
}
|
223
230
|
|
224
|
-
function getMajorVersion() public pure returns (VersionPart majorVersion) {
|
225
|
-
return VersionPartLib.toVersionPart(GIF_MAJOR_VERSION);
|
226
|
-
}
|
227
|
-
|
228
231
|
//--- internal view/pure functions --------------------------------------//
|
229
232
|
}
|
@@ -7,13 +7,13 @@ import {AccessAdmin} from "../authorization/AccessAdmin.sol";
|
|
7
7
|
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
8
8
|
import {IAccessAdmin} from "../authorization/IAccessAdmin.sol";
|
9
9
|
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
10
|
-
import {
|
11
|
-
import {
|
10
|
+
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
11
|
+
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
12
12
|
import {IRegistry} from "../registry/IRegistry.sol";
|
13
13
|
import {IInstance} from "./IInstance.sol";
|
14
14
|
import {IService} from "../shared/IService.sol";
|
15
15
|
import {ObjectType, ObjectTypeLib, ALL, POOL, RELEASE} from "../type/ObjectType.sol";
|
16
|
-
import {RoleId, RoleIdLib, ADMIN_ROLE, PUBLIC_ROLE
|
16
|
+
import {RoleId, RoleIdLib, ADMIN_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
|
17
17
|
import {Str, StrLib} from "../type/String.sol";
|
18
18
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
19
19
|
import {VersionPart} from "../type/Version.sol";
|
@@ -38,12 +38,12 @@ contract InstanceAdmin is
|
|
38
38
|
IRegistry internal _registry;
|
39
39
|
uint64 _idNext;
|
40
40
|
|
41
|
-
|
41
|
+
IAuthorization _instanceAuthorization;
|
42
42
|
|
43
43
|
/// @dev Only used for master instance admin.
|
44
44
|
/// Contracts created via constructor come with disabled initializers.
|
45
45
|
constructor(
|
46
|
-
|
46
|
+
IAuthorization instanceAuthorization
|
47
47
|
)
|
48
48
|
AccessAdmin()
|
49
49
|
{
|
@@ -56,7 +56,7 @@ contract InstanceAdmin is
|
|
56
56
|
/// Important: Initialization of this instance admin is only complete after calling function initializeInstance.
|
57
57
|
function initialize(
|
58
58
|
AccessManagerCloneable accessManager,
|
59
|
-
|
59
|
+
IAuthorization instanceAuthorization
|
60
60
|
)
|
61
61
|
external
|
62
62
|
initializer()
|
@@ -68,7 +68,7 @@ contract InstanceAdmin is
|
|
68
68
|
_createAdminAndPublicRoles();
|
69
69
|
|
70
70
|
// store instance authorization specification
|
71
|
-
_instanceAuthorization =
|
71
|
+
_instanceAuthorization = IAuthorization(instanceAuthorization);
|
72
72
|
}
|
73
73
|
|
74
74
|
function _checkTargetIsReadyForAuthorization(address target)
|
@@ -96,7 +96,7 @@ contract InstanceAdmin is
|
|
96
96
|
_registry = _instance.getRegistry();
|
97
97
|
|
98
98
|
// check matching releases
|
99
|
-
if (_instanceAuthorization.getRelease() != _instance.
|
99
|
+
if (_instanceAuthorization.getRelease() != _instance.getRelease()) {
|
100
100
|
revert ErrorInstanceAdminReleaseMismatch();
|
101
101
|
}
|
102
102
|
|
@@ -104,22 +104,22 @@ contract InstanceAdmin is
|
|
104
104
|
_createRoles(_instanceAuthorization);
|
105
105
|
_createModuleTargetsWithRoles();
|
106
106
|
_createTargetAuthorizations(_instanceAuthorization);
|
107
|
-
|
108
|
-
// grant component owner roles to instance owner
|
109
|
-
_grantComponentOwnerRoles();
|
110
107
|
}
|
111
108
|
|
112
109
|
|
113
110
|
/// @dev Initializes the authorization for the specified component.
|
114
111
|
/// Important: The component MUST be registered.
|
115
112
|
function initializeComponentAuthorization(
|
116
|
-
|
117
|
-
IAuthorization authorization
|
113
|
+
IInstanceLinkedComponent component
|
118
114
|
)
|
119
115
|
external
|
120
116
|
{
|
121
117
|
_checkTargetIsReadyForAuthorization(address(component));
|
122
118
|
|
119
|
+
// get authorization specification
|
120
|
+
IAuthorization authorization = component.getAuthorization();
|
121
|
+
|
122
|
+
// create roles
|
123
123
|
_createRoles(authorization);
|
124
124
|
|
125
125
|
// create component target
|
@@ -135,12 +135,12 @@ contract InstanceAdmin is
|
|
135
135
|
true,
|
136
136
|
false);
|
137
137
|
|
138
|
-
// FIXME: make this a bit nicer and work with IAuthorization. Use a specific role, not public - access to TokenHandler must be restricted
|
139
138
|
FunctionInfo[] memory functions = new FunctionInfo[](3);
|
140
139
|
functions[0] = toFunction(TokenHandler.collectTokens.selector, "collectTokens");
|
141
140
|
functions[1] = toFunction(TokenHandler.collectTokensToThreeRecipients.selector, "collectTokensToThreeRecipients");
|
142
141
|
functions[2] = toFunction(TokenHandler.distributeTokens.selector, "distributeTokens");
|
143
142
|
|
143
|
+
// FIXME: make this a bit nicer and work with IAuthorization. Use a specific role, not public - access to TokenHandler must be restricted
|
144
144
|
_authorizeTargetFunctions(
|
145
145
|
address(component.getTokenHandler()),
|
146
146
|
getPublicRole(),
|
@@ -148,23 +148,12 @@ contract InstanceAdmin is
|
|
148
148
|
|
149
149
|
_grantRoleToAccount(
|
150
150
|
authorization.getTargetRole(
|
151
|
-
authorization.
|
151
|
+
authorization.getMainTarget()),
|
152
152
|
address(component));
|
153
153
|
|
154
154
|
_createTargetAuthorizations(authorization);
|
155
155
|
}
|
156
156
|
|
157
|
-
|
158
|
-
function _grantComponentOwnerRoles()
|
159
|
-
internal
|
160
|
-
{
|
161
|
-
address instanceOwner = _registry.ownerOf(_instance.getNftId());
|
162
|
-
_grantRoleToAccount(DISTRIBUTION_OWNER_ROLE(), instanceOwner);
|
163
|
-
_grantRoleToAccount(ORACLE_OWNER_ROLE(), instanceOwner);
|
164
|
-
_grantRoleToAccount(POOL_OWNER_ROLE(), instanceOwner);
|
165
|
-
_grantRoleToAccount(PRODUCT_OWNER_ROLE(), instanceOwner);
|
166
|
-
}
|
167
|
-
|
168
157
|
/// @dev Creates a custom role
|
169
158
|
// TODO implement
|
170
159
|
// function createRole()
|
@@ -188,7 +177,7 @@ contract InstanceAdmin is
|
|
188
177
|
function getInstanceAuthorization()
|
189
178
|
external
|
190
179
|
view
|
191
|
-
returns (
|
180
|
+
returns (IAuthorization instanceAuthorizaion)
|
192
181
|
{
|
193
182
|
return _instanceAuthorization;
|
194
183
|
}
|