@etherisc/gif-next 0.0.2-abde86b-349 → 0.0.2-acc7efa-771
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 +154 -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 +94 -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 +72 -60
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +81 -58
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +29 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1501 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +470 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2042 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +470 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +156 -96
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +137 -77
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +213 -135
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +518 -171
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +53 -31
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +29 -84
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +62 -40
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +148 -118
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +57 -97
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +113 -130
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +72 -130
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +48 -40
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +174 -103
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +46 -5
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +135 -75
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +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 +76 -53
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +43 -9
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +89 -53
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +86 -47
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +48 -36
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +89 -71
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +82 -22
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +180 -82
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +90 -58
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +53 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +76 -58
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +136 -120
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +89 -58
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +209 -180
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +63 -47
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +66 -32
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +45 -33
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +134 -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 +167 -82
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +82 -58
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +29 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +56 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +58 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +80 -51
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +121 -54
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +29 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +139 -60
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +67 -47
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +149 -107
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +61 -45
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +134 -54
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +60 -26
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +42 -30
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +48 -15
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +114 -35
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +5 -18
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +92 -51
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +193 -165
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +145 -61
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +41 -29
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +47 -6
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +121 -223
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +66 -8
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +68 -28
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +350 -155
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +83 -63
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +42 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +2 -2
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +55 -28
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +321 -19
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +76 -53
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +36 -0
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +36 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +16 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +29 -0
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +29 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +89 -53
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +42 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +18 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +66 -8
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +42 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +55 -28
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +29 -21
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +2 -2
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +138 -78
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +46 -5
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +68 -42
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +7 -12
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +66 -53
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +45 -33
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +144 -103
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +32 -8
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +28 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +2 -2
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +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 +60 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +15 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/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 +28 -12
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +65 -61
- package/contracts/authorization/Authorization.sol +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 +2 -1
- package/contracts/distribution/Distribution.sol +6 -16
- package/contracts/distribution/DistributionService.sol +52 -34
- package/contracts/distribution/IDistributionComponent.sol +1 -1
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +87 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +34 -0
- package/contracts/examples/fire/FireProduct.sol +428 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +44 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +4 -4
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -4
- package/contracts/examples/unpermissioned/SimplePool.sol +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/InstanceReader.sol +9 -33
- package/contracts/instance/InstanceService.sol +13 -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 +37 -27
- package/contracts/pool/BasicPool.sol +18 -28
- package/contracts/pool/BasicPoolAuthorization.sol +0 -1
- package/contracts/pool/BundleService.sol +24 -1
- package/contracts/pool/IBundleService.sol +9 -0
- package/contracts/pool/IPoolService.sol +2 -6
- package/contracts/pool/Pool.sol +17 -41
- package/contracts/pool/PoolService.sol +41 -64
- package/contracts/product/BasicProduct.sol +8 -12
- package/contracts/product/BasicProductAuthorization.sol +0 -1
- package/contracts/product/ClaimService.sol +46 -28
- package/contracts/product/IClaimService.sol +2 -1
- package/contracts/product/IPolicyService.sol +3 -0
- package/contracts/product/IPricingService.sol +9 -9
- package/contracts/product/IProductComponent.sol +6 -0
- package/contracts/product/PolicyService.sol +50 -13
- package/contracts/product/PricingService.sol +4 -7
- package/contracts/product/Product.sol +54 -55
- package/contracts/registry/ChainNft.sol +6 -9
- package/contracts/registry/IRegistry.sol +4 -3
- package/contracts/registry/IRegistryService.sol +6 -4
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +14 -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 +14 -19
- package/contracts/shared/Component.sol +25 -28
- package/contracts/shared/ComponentService.sol +224 -130
- package/contracts/shared/ComponentVerifyingService.sol +22 -12
- package/contracts/shared/IComponent.sol +6 -2
- package/contracts/shared/IComponentService.sol +25 -13
- package/contracts/shared/IInstanceLinkedComponent.sol +3 -11
- package/contracts/shared/ILifecycle.sol +3 -1
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IRegisterable.sol +11 -0
- package/contracts/shared/InstanceLinkedComponent.sol +67 -25
- package/contracts/shared/KeyValueStore.sol +1 -1
- package/contracts/shared/Lifecycle.sol +15 -4
- package/contracts/shared/NftOwnable.sol +19 -3
- package/contracts/shared/Registerable.sol +15 -5
- package/contracts/shared/Service.sol +4 -7
- package/contracts/staking/IStakingService.sol +0 -3
- package/contracts/staking/Staking.sol +2 -3
- package/contracts/staking/StakingReader.sol +12 -5
- package/contracts/staking/StakingService.sol +1 -15
- package/contracts/type/Amount.sol +15 -0
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/NftId.sol +1 -0
- package/contracts/type/ObjectType.sol +1 -0
- package/contracts/type/RiskId.sol +15 -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 +2 -1
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +0 -290
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +0 -390
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- package/contracts/authorization/IModuleAuthorization.sol +0 -21
- package/contracts/authorization/ModuleAuthorization.sol +0 -78
- package/contracts/shared/InitializableCustom.sol +0 -177
@@ -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
|
}
|
@@ -5,44 +5,33 @@ import {
|
|
5
5
|
PRODUCT, ORACLE, POOL, INSTANCE, COMPONENT, DISTRIBUTION, APPLICATION, POLICY, CLAIM, BUNDLE
|
6
6
|
} from "../../contracts/type/ObjectType.sol";
|
7
7
|
|
8
|
-
import {
|
9
|
-
DISTRIBUTION_OWNER_ROLE, ORACLE_OWNER_ROLE, POOL_OWNER_ROLE, PRODUCT_OWNER_ROLE
|
10
|
-
} from "../../contracts/type/RoleId.sol";
|
11
|
-
|
12
8
|
import {BundleSet} from "../instance/BundleSet.sol";
|
13
9
|
import {IAccess} from "../authorization/IAccess.sol";
|
14
10
|
import {Instance} from "../instance/Instance.sol";
|
15
11
|
import {InstanceAdmin} from "../instance/InstanceAdmin.sol";
|
16
12
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
17
|
-
import {
|
13
|
+
import {Authorization} from "../authorization/Authorization.sol";
|
18
14
|
|
19
15
|
|
20
16
|
contract InstanceAuthorizationV3
|
21
|
-
is
|
17
|
+
is Authorization
|
22
18
|
{
|
23
19
|
|
20
|
+
string public constant INSTANCE_ROLE_NAME = "InstanceRole";
|
21
|
+
|
24
22
|
string public constant INSTANCE_TARGET_NAME = "Instance";
|
25
23
|
string public constant INSTANCE_STORE_TARGET_NAME = "InstanceStore";
|
26
24
|
string public constant INSTANCE_ADMIN_TARGET_NAME = "InstanceAdmin";
|
27
25
|
string public constant BUNDLE_SET_TARGET_NAME = "BundleSet";
|
28
26
|
|
29
|
-
|
30
|
-
string public constant DISTRIBUTION_OWNER_ROLE_NAME = "DistributionOwnerRole";
|
31
|
-
string public constant ORACLE_OWNER_ROLE_NAME = "OracleOwnerRole";
|
32
|
-
string public constant POOL_OWNER_ROLE_NAME = "PoolOwnerRole";
|
33
|
-
string public constant PRODUCT_OWNER_ROLE_NAME = "ProductOwnerRole";
|
34
|
-
|
35
|
-
constructor() ModuleAuthorization(INSTANCE_TARGET_NAME) {}
|
27
|
+
constructor() Authorization(INSTANCE_TARGET_NAME) {}
|
36
28
|
|
37
29
|
|
38
30
|
function _setupRoles()
|
39
31
|
internal
|
40
32
|
override
|
41
33
|
{
|
42
|
-
|
43
|
-
_addGifRole(ORACLE_OWNER_ROLE(), ORACLE_OWNER_ROLE_NAME);
|
44
|
-
_addGifRole(POOL_OWNER_ROLE(), POOL_OWNER_ROLE_NAME);
|
45
|
-
_addGifRole(PRODUCT_OWNER_ROLE(), PRODUCT_OWNER_ROLE_NAME);
|
34
|
+
// empty implementation
|
46
35
|
}
|
47
36
|
|
48
37
|
|
@@ -53,7 +42,7 @@ contract InstanceAuthorizationV3
|
|
53
42
|
// instance target
|
54
43
|
_addTargetWithRole(
|
55
44
|
INSTANCE_TARGET_NAME,
|
56
|
-
|
45
|
+
_toTargetRoleId(INSTANCE()),
|
57
46
|
INSTANCE_ROLE_NAME);
|
58
47
|
|
59
48
|
// instance supporting targets
|
@@ -83,6 +72,7 @@ contract InstanceAuthorizationV3
|
|
83
72
|
_setupInstanceAdminAuthorization();
|
84
73
|
_setupInstanceStoreAuthorization();
|
85
74
|
_setupBundleSetAuthorization();
|
75
|
+
|
86
76
|
}
|
87
77
|
|
88
78
|
|
@@ -118,7 +108,7 @@ contract InstanceAuthorizationV3
|
|
118
108
|
IAccess.FunctionInfo[] storage functions;
|
119
109
|
|
120
110
|
// authorize instance role
|
121
|
-
functions = _authorizeForTarget(INSTANCE_ADMIN_TARGET_NAME,
|
111
|
+
functions = _authorizeForTarget(INSTANCE_ADMIN_TARGET_NAME, _toTargetRoleId(INSTANCE()));
|
122
112
|
_authorize(functions, InstanceAdmin.grantRole.selector, "grantRole");
|
123
113
|
|
124
114
|
// authorize instance service role
|
@@ -126,7 +126,6 @@ contract InstanceReader {
|
|
126
126
|
return _store.getState(toBundleKey(bundleNftId));
|
127
127
|
}
|
128
128
|
|
129
|
-
|
130
129
|
/// @dev Returns true iff policy is active.
|
131
130
|
function policyIsActive(NftId policyNftId)
|
132
131
|
public
|
@@ -143,37 +142,6 @@ contract InstanceReader {
|
|
143
142
|
return true;
|
144
143
|
}
|
145
144
|
|
146
|
-
|
147
|
-
/// @dev Returns true iff policy may be closed.
|
148
|
-
/// A policy can be closed all conditions below are met
|
149
|
-
/// - policy exists
|
150
|
-
/// - has been activated
|
151
|
-
/// - is not yet closed
|
152
|
-
/// - has no open claims
|
153
|
-
/// - claim amount matches sum insured amount or is expired
|
154
|
-
function policyIsCloseable(NftId policyNftId)
|
155
|
-
public
|
156
|
-
view
|
157
|
-
returns (bool isCloseable)
|
158
|
-
{
|
159
|
-
IPolicy.PolicyInfo memory info = getPolicyInfo(policyNftId);
|
160
|
-
|
161
|
-
if (info.productNftId.eqz()) { return false; } // not closeable: policy does not exist (or does not belong to this instance)
|
162
|
-
if (info.activatedAt.eqz()) { return false; } // not closeable: not yet activated
|
163
|
-
if (info.closedAt.gtz()) { return false; } // not closeable: already closed
|
164
|
-
if (info.openClaimsCount > 0) { return false; } // not closeable: has open claims
|
165
|
-
|
166
|
-
// closeable: if sum of claims matches sum insured a policy may be closed prior to the expiry date
|
167
|
-
if (info.claimAmount == info.sumInsuredAmount) { return true; }
|
168
|
-
|
169
|
-
// not closeable: not yet expired
|
170
|
-
if (TimestampLib.blockTimestamp() < info.expiredAt) { return false; }
|
171
|
-
|
172
|
-
// all conditionsl to close the policy are met
|
173
|
-
return true;
|
174
|
-
}
|
175
|
-
|
176
|
-
|
177
145
|
function claims(NftId policyNftId)
|
178
146
|
public
|
179
147
|
view
|
@@ -191,7 +159,6 @@ contract InstanceReader {
|
|
191
159
|
return ClaimIdLib.toClaimId(idx + 1);
|
192
160
|
}
|
193
161
|
|
194
|
-
|
195
162
|
function getClaimInfo(NftId policyNftId, ClaimId claimId)
|
196
163
|
public
|
197
164
|
view
|
@@ -231,6 +198,15 @@ contract InstanceReader {
|
|
231
198
|
}
|
232
199
|
|
233
200
|
|
201
|
+
function getRemainingClaimableAmount(NftId policyNftId)
|
202
|
+
public
|
203
|
+
view
|
204
|
+
returns (Amount remainingClaimableAmount)
|
205
|
+
{
|
206
|
+
IPolicy.PolicyInfo memory info = getPolicyInfo(policyNftId);
|
207
|
+
return info.sumInsuredAmount - info.claimAmount;
|
208
|
+
}
|
209
|
+
|
234
210
|
function getPayoutInfo(NftId policyNftId, PayoutId payoutId)
|
235
211
|
public
|
236
212
|
view
|
@@ -12,7 +12,7 @@ import {NftId} from "../type/NftId.sol";
|
|
12
12
|
import {RoleId} from "../type/RoleId.sol";
|
13
13
|
import {SecondsLib} from "../type/Seconds.sol";
|
14
14
|
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
15
|
-
import {ADMIN_ROLE
|
15
|
+
import {ADMIN_ROLE} from "../type/RoleId.sol";
|
16
16
|
import {ObjectType, INSTANCE, BUNDLE, APPLICATION, CLAIM, DISTRIBUTION, INSTANCE, POLICY, POOL, PRODUCT, REGISTRY, STAKING} from "../type/ObjectType.sol";
|
17
17
|
|
18
18
|
import {Service} from "../shared/Service.sol";
|
@@ -29,7 +29,6 @@ import {IStakingService} from "../staking/IStakingService.sol";
|
|
29
29
|
import {TargetManagerLib} from "../staking/TargetManagerLib.sol";
|
30
30
|
|
31
31
|
import {Instance} from "./Instance.sol";
|
32
|
-
import {IModuleAuthorization} from "../authorization/IModuleAuthorization.sol";
|
33
32
|
import {IInstance} from "./IInstance.sol";
|
34
33
|
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
35
34
|
import {IInstanceService} from "./IInstanceService.sol";
|
@@ -70,7 +69,7 @@ contract InstanceService is
|
|
70
69
|
revert ErrorInstanceServiceNotInstance(instanceAddress, objectType);
|
71
70
|
}
|
72
71
|
|
73
|
-
VersionPart instanceVersion = IInstance(instanceAddress).
|
72
|
+
VersionPart instanceVersion = IInstance(instanceAddress).getRelease();
|
74
73
|
if (instanceVersion != getVersion().toMajorPart()) {
|
75
74
|
revert ErrorInstanceServiceInstanceVersionMismatch(instanceAddress, instanceVersion);
|
76
75
|
}
|
@@ -277,67 +276,6 @@ contract InstanceService is
|
|
277
276
|
instance.setInstanceReader(upgradedInstanceReaderClone);
|
278
277
|
}
|
279
278
|
|
280
|
-
|
281
|
-
function createGifTarget(
|
282
|
-
NftId instanceNftId,
|
283
|
-
address targetAddress,
|
284
|
-
string memory targetName,
|
285
|
-
bytes4[][] memory selectors,
|
286
|
-
RoleId[] memory roles
|
287
|
-
)
|
288
|
-
external
|
289
|
-
virtual
|
290
|
-
restricted()
|
291
|
-
{
|
292
|
-
_createGifTarget(
|
293
|
-
instanceNftId,
|
294
|
-
targetAddress,
|
295
|
-
targetName,
|
296
|
-
roles,
|
297
|
-
selectors
|
298
|
-
);
|
299
|
-
}
|
300
|
-
|
301
|
-
|
302
|
-
function initializeAuthorization(
|
303
|
-
NftId instanceNftId,
|
304
|
-
IInstanceLinkedComponent component
|
305
|
-
)
|
306
|
-
external
|
307
|
-
virtual
|
308
|
-
restricted()
|
309
|
-
{
|
310
|
-
(IInstance instance, ) = _validateInstanceAndComponent(
|
311
|
-
instanceNftId,
|
312
|
-
address(component));
|
313
|
-
|
314
|
-
InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
|
315
|
-
instanceAdmin.initializeComponentAuthorization(
|
316
|
-
component,
|
317
|
-
component.getAuthorization());
|
318
|
-
}
|
319
|
-
|
320
|
-
|
321
|
-
function createComponentTarget(
|
322
|
-
NftId instanceNftId,
|
323
|
-
address targetAddress,
|
324
|
-
string memory targetName,
|
325
|
-
bytes4[][] memory selectors,
|
326
|
-
RoleId[] memory roles
|
327
|
-
)
|
328
|
-
external
|
329
|
-
virtual
|
330
|
-
restricted()
|
331
|
-
{
|
332
|
-
_createGifTarget(
|
333
|
-
instanceNftId,
|
334
|
-
targetAddress,
|
335
|
-
targetName,
|
336
|
-
roles,
|
337
|
-
selectors
|
338
|
-
);
|
339
|
-
}
|
340
|
-
|
341
279
|
/// @dev create new cloned instance admin
|
342
280
|
/// function used to setup a new instance
|
343
281
|
function _createInstanceAdmin()
|
@@ -449,13 +387,20 @@ contract InstanceService is
|
|
449
387
|
revert ErrorInstanceServiceNotInstanceNftId(instanceNftId);
|
450
388
|
}
|
451
389
|
|
452
|
-
|
453
|
-
|
454
|
-
|
390
|
+
if (registry.getNftIdForAddress(componentAddress).gtz()) {
|
391
|
+
IRegistry.ObjectInfo memory componentInfo = registry.getObjectInfo(componentAddress);
|
392
|
+
|
393
|
+
if(componentInfo.parentNftId != instanceNftId) {
|
394
|
+
revert ErrorInstanceServiceInstanceComponentMismatch(instanceNftId, componentInfo.nftId);
|
395
|
+
}
|
396
|
+
|
397
|
+
componentNftId = componentInfo.nftId;
|
398
|
+
} else {
|
399
|
+
|
455
400
|
}
|
456
401
|
|
457
402
|
instance = Instance(instanceInfo.objectAddress);
|
458
|
-
|
403
|
+
|
459
404
|
}
|
460
405
|
|
461
406
|
// From IService
|
@@ -14,7 +14,6 @@ interface IComponents {
|
|
14
14
|
|
15
15
|
struct ComponentInfo {
|
16
16
|
string name; // component name (needs to be unique per instance)
|
17
|
-
NftId productNftId;
|
18
17
|
IERC20Metadata token;
|
19
18
|
TokenHandler tokenHandler;
|
20
19
|
address wallet;
|
@@ -22,9 +21,14 @@ interface IComponents {
|
|
22
21
|
}
|
23
22
|
|
24
23
|
struct ProductInfo {
|
25
|
-
NftId distributionNftId;
|
26
|
-
NftId poolNftId;
|
27
24
|
bool isProcessingFundedClaims; // custom logic to react to pool events for funded claims
|
25
|
+
bool isInterceptingPolicyTransfers; // custom logic for policy nft transfers
|
26
|
+
bool hasDistribution; // flag to indicate if distribution is enabled
|
27
|
+
uint8 expectedNumberOfOracles; // expected number of oracles
|
28
|
+
uint8 numberOfOracles; // actual number of oracles
|
29
|
+
NftId poolNftId; // mandatory
|
30
|
+
NftId distributionNftId; // 0..1 (optional)
|
31
|
+
NftId [] oracleNftId; // 0..n (optional)
|
28
32
|
Fee productFee; // product fee on net premium
|
29
33
|
Fee processingFee; // product fee on payout amounts
|
30
34
|
Fee distributionFee; // distribution fee for sales that do not include commissions
|
@@ -37,7 +41,6 @@ interface IComponents {
|
|
37
41
|
|
38
42
|
struct PoolInfo {
|
39
43
|
Amount maxBalanceAmount; // max balance amount allowed for pool
|
40
|
-
RoleId bundleOwnerRole; // the required role for bundle owners
|
41
44
|
bool isInterceptingBundleTransfers; // custom logic for bundle nft transfers
|
42
45
|
bool isProcessingConfirmedClaims; // custom logic for claims confirmation
|
43
46
|
bool isExternallyManaged; // funding bundles is restricted to book keeping, actual funds may be provided as needed to support payouts
|
@@ -3,6 +3,7 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IService} from "../shared/IService.sol";
|
5
5
|
import {NftId} from "../type/NftId.sol";
|
6
|
+
import {ObjectType} from "../type/ObjectType.sol";
|
6
7
|
import {RequestId} from "../type/RequestId.sol";
|
7
8
|
import {StateId} from "../type/StateId.sol";
|
8
9
|
import {Timestamp} from "../type/Timestamp.sol";
|
@@ -17,7 +18,7 @@ interface IOracleService is IService {
|
|
17
18
|
event LogOracleServiceRequestCancelled(RequestId requestId, NftId requesterNftId);
|
18
19
|
|
19
20
|
// create request
|
20
|
-
error
|
21
|
+
error ErrorOracleServiceProductMismatch(ObjectType callerObjectType, NftId productNft, NftId oracleParentNftId);
|
21
22
|
error ErrorOracleServiceExpiryInThePast(Timestamp blockTimestamp, Timestamp expiryAt);
|
22
23
|
error ErrorOracleServiceCallbackMethodNameEmpty();
|
23
24
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {Amount} from "../type/Amount.sol";
|
5
|
-
import {COMPONENT, ORACLE} from "../type/ObjectType.sol";
|
5
|
+
import {COMPONENT, PRODUCT, ORACLE} from "../type/ObjectType.sol";
|
6
6
|
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
7
7
|
import {IComponentService} from "../shared/IComponentService.sol";
|
8
8
|
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
@@ -27,15 +27,6 @@ abstract contract Oracle is
|
|
27
27
|
}
|
28
28
|
|
29
29
|
|
30
|
-
function register()
|
31
|
-
external
|
32
|
-
virtual
|
33
|
-
onlyOwner()
|
34
|
-
{
|
35
|
-
_getOracleStorage()._componentService.registerOracle();
|
36
|
-
}
|
37
|
-
|
38
|
-
|
39
30
|
function request(
|
40
31
|
RequestId requestId,
|
41
32
|
NftId requesterId,
|
@@ -86,12 +77,11 @@ abstract contract Oracle is
|
|
86
77
|
|
87
78
|
function _initializeOracle(
|
88
79
|
address registry,
|
89
|
-
NftId
|
80
|
+
NftId productNftId,
|
90
81
|
IAuthorization authorization,
|
91
82
|
address initialOwner,
|
92
83
|
string memory name,
|
93
84
|
address token,
|
94
|
-
bytes memory registryData, // writeonly data that will saved in the object info record of the registry
|
95
85
|
bytes memory componentData // component specifidc data
|
96
86
|
)
|
97
87
|
internal
|
@@ -100,19 +90,18 @@ abstract contract Oracle is
|
|
100
90
|
{
|
101
91
|
_initializeInstanceLinkedComponent(
|
102
92
|
registry,
|
103
|
-
|
93
|
+
productNftId,
|
104
94
|
name,
|
105
95
|
token,
|
106
96
|
ORACLE(),
|
107
97
|
authorization,
|
108
98
|
true,
|
109
99
|
initialOwner,
|
110
|
-
registryData,
|
111
100
|
componentData);
|
112
101
|
|
113
102
|
OracleStorage storage $ = _getOracleStorage();
|
114
|
-
$._oracleService = IOracleService(_getServiceAddress(ORACLE()));
|
115
103
|
$._componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
104
|
+
$._oracleService = IOracleService(_getServiceAddress(ORACLE()));
|
116
105
|
|
117
106
|
_registerInterface(type(IOracleComponent).interfaceId);
|
118
107
|
}
|