@etherisc/gif-next 0.0.2-f634e5c-828 → 0.0.2-f677999-878
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1007 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +744 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +791 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +148 -62
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +233 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +149 -21
- 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 +82 -12
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +68 -13
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +79 -67
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +152 -33
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +51 -39
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +231 -186
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +57 -51
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +38 -26
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +119 -73
- 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 +102 -42
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +127 -40
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +257 -190
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +152 -33
- 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 +150 -56
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +589 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +95 -63
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +111 -48
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +589 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +315 -150
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +589 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +88 -45
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +54 -21
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +53 -3
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +80 -40
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +344 -99
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +127 -40
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +351 -198
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +65 -58
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +20 -22
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +422 -352
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +96 -53
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +16 -5
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +168 -0
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +68 -56
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +126 -35
- 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 +38 -26
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +27 -3
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +52 -40
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +75 -68
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +25 -27
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +51 -39
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +127 -40
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +102 -201
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +33 -55
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +38 -80
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +38 -26
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +120 -175
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +51 -39
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +456 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +236 -281
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +61 -47
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +57 -50
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +16 -18
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +157 -130
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +152 -33
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +244 -187
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +55 -65
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +27 -3
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +142 -20
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +105 -68
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +27 -3
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +144 -117
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +37 -7
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +193 -173
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +293 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +45 -47
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +85 -78
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +31 -33
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +157 -130
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +102 -81
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +33 -19
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +26 -2
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +31 -7
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.json +24 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +64 -40
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +250 -221
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +51 -44
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +11 -13
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +1849 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +315 -49
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +4 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +51 -39
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +105 -442
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +40 -70
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +27 -16
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +57 -4
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +40 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +38 -26
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +27 -291
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +38 -26
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +120 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +27 -3
- 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 +51 -39
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +118 -62
- 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 +27 -16
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +63 -162
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +118 -29
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +32 -32
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +38 -26
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +56 -3
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +32 -32
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +90 -57
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +27 -19
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +4 -4
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +87 -51
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +18 -20
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +128 -128
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +22 -22
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +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 +30 -6
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +79 -15
- 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/SelectorLib.json +21 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +47 -2
- 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 +2 -2
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +262 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +45 -0
- package/contracts/authorization/AccessAdmin.sol +156 -82
- package/contracts/authorization/AccessManagerCloneable.sol +136 -3
- package/contracts/authorization/Authorization.sol +277 -229
- package/contracts/authorization/IAccessAdmin.sol +13 -7
- package/contracts/authorization/IAuthorization.sol +15 -1
- package/contracts/distribution/BasicDistribution.sol +11 -9
- package/contracts/distribution/BasicDistributionAuthorization.sol +21 -8
- package/contracts/distribution/Distribution.sol +37 -32
- package/contracts/distribution/DistributionService.sol +59 -33
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/distribution/IDistributionService.sol +16 -13
- package/contracts/examples/fire/FirePool.sol +6 -2
- package/contracts/examples/fire/FirePoolAuthorization.sol +2 -1
- package/contracts/examples/fire/FireProduct.sol +9 -3
- package/contracts/examples/fire/FireProductAuthorization.sol +2 -1
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +29 -9
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +7 -9
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +36 -4
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +4 -4
- package/contracts/instance/IInstance.sol +6 -7
- package/contracts/instance/IInstanceService.sol +2 -0
- package/contracts/instance/Instance.sol +19 -11
- package/contracts/instance/InstanceAdmin.sol +213 -64
- package/contracts/instance/InstanceAuthorizationV3.sol +18 -23
- package/contracts/instance/InstanceReader.sol +91 -35
- package/contracts/instance/InstanceService.sol +43 -31
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +13 -2
- package/contracts/instance/RiskSet.sol +11 -12
- package/contracts/instance/base/ObjectLifecycle.sol +4 -2
- package/contracts/instance/base/ObjectSet.sol +7 -8
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IComponents.sol +3 -2
- package/contracts/instance/module/IDistribution.sol +5 -2
- package/contracts/instance/module/IRisk.sol +2 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +3 -12
- package/contracts/oracle/Oracle.sol +1 -1
- package/contracts/oracle/OracleService.sol +16 -15
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPoolAuthorization.sol +21 -13
- package/contracts/pool/BundleService.sol +35 -63
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/IBundleService.sol +13 -20
- package/contracts/pool/IPoolService.sol +50 -38
- package/contracts/pool/Pool.sol +9 -9
- package/contracts/pool/PoolLib.sol +216 -0
- package/contracts/pool/PoolService.sol +307 -162
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +3 -3
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +2 -0
- package/contracts/product/BasicProductAuthorization.sol +24 -10
- package/contracts/product/ClaimService.sol +157 -139
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IClaimService.sol +14 -2
- package/contracts/product/IPolicyService.sol +11 -6
- package/contracts/product/IProductComponent.sol +4 -1
- package/contracts/product/IRiskService.sol +5 -8
- package/contracts/product/PolicyService.sol +95 -146
- package/contracts/product/PolicyServiceLib.sol +65 -0
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +23 -19
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +55 -13
- package/contracts/product/RiskService.sol +66 -29
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/IRegistry.sol +8 -15
- package/contracts/registry/IRelease.sol +26 -0
- package/contracts/registry/Registry.sol +7 -2
- package/contracts/registry/RegistryAdmin.sol +129 -226
- package/contracts/registry/RegistryService.sol +3 -3
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +245 -0
- package/contracts/registry/ReleaseLifecycle.sol +2 -0
- package/contracts/registry/ReleaseRegistry.sol +124 -99
- package/contracts/registry/ServiceAuthorizationV3.sol +85 -14
- package/contracts/registry/TokenRegistry.sol +6 -8
- package/contracts/shared/Component.sol +32 -27
- package/contracts/shared/ComponentService.sol +89 -266
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ComponentVerifyingService.sol +1 -1
- package/contracts/shared/ContractLib.sol +32 -3
- package/contracts/shared/IComponent.sol +3 -9
- package/contracts/shared/IComponentService.sol +1 -23
- package/contracts/shared/IRegisterable.sol +15 -4
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InstanceLinkedComponent.sol +3 -3
- package/contracts/shared/NftOwnable.sol +4 -4
- package/contracts/shared/PolicyHolder.sol +1 -1
- package/contracts/shared/Registerable.sol +45 -19
- package/contracts/shared/RegistryLinked.sol +1 -1
- package/contracts/shared/Service.sol +8 -27
- package/contracts/shared/TokenHandler.sol +40 -88
- package/contracts/staking/IStaking.sol +0 -8
- package/contracts/staking/IStakingService.sol +8 -0
- package/contracts/staking/StakeManagerLib.sol +1 -1
- package/contracts/staking/Staking.sol +34 -13
- package/contracts/staking/StakingReader.sol +1 -1
- package/contracts/staking/StakingService.sol +32 -42
- package/contracts/staking/StakingServiceManager.sol +5 -4
- package/contracts/type/ObjectType.sol +46 -21
- package/contracts/type/RiskId.sol +9 -3
- package/contracts/type/RoleId.sol +24 -4
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/Timestamp.sol +0 -5
- package/contracts/type/Version.sol +15 -5
- package/contracts/upgradeability/ProxyManager.sol +1 -1
- package/package.json +2 -2
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +0 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +0 -1196
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -129
- package/contracts/authorization/ReleaseAccessManager.sol +0 -38
- package/contracts/instance/module/IAccess.sol +0 -46
@@ -31,6 +31,7 @@ interface IStakingService is IService
|
|
31
31
|
event LogStakingServiceRewardsClaimed(NftId stakeNftId, address stakeOwner, Amount rewardsClaimedAmount);
|
32
32
|
|
33
33
|
// modifiers
|
34
|
+
error ErrorStakingServiceNotStakingOwner(address account);
|
34
35
|
error ErrorStakingServiceNotStaking(address stakingAddress);
|
35
36
|
error ErrorStakingServiceNotSupportingIStaking(address stakingAddress);
|
36
37
|
|
@@ -48,6 +49,13 @@ interface IStakingService is IService
|
|
48
49
|
// function setProtocolLockingPeriod(Seconds lockingPeriod) external;
|
49
50
|
// TODO also make sure that protocol rewards can be refilled and withdrawn
|
50
51
|
|
52
|
+
/// @dev Approves the staking token handler.
|
53
|
+
/// Reverts if the staking token handler wallet is not the token handler itself.
|
54
|
+
function approveTokenHandler(
|
55
|
+
IERC20Metadata token,
|
56
|
+
Amount amount
|
57
|
+
) external;
|
58
|
+
|
51
59
|
/// @dev creates/registers an on-chain instance staking target.
|
52
60
|
/// function granted to instance service
|
53
61
|
function createInstanceTarget(
|
@@ -51,7 +51,7 @@ library StakeManagerLib {
|
|
51
51
|
|
52
52
|
// TODO check that additional dip, rewards and rewards increment
|
53
53
|
// are still ok with max target staking amount
|
54
|
-
NftId targetNftId = registry.
|
54
|
+
NftId targetNftId = registry.getParentNftId(stakeNftId);
|
55
55
|
|
56
56
|
stakingStore.restakeRewards(
|
57
57
|
stakeNftId,
|
@@ -5,6 +5,7 @@ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IER
|
|
5
5
|
|
6
6
|
import {IRegistry} from "../registry/IRegistry.sol";
|
7
7
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
8
|
+
import {IRelease} from "../registry/IRelease.sol";
|
8
9
|
import {IStaking} from "./IStaking.sol";
|
9
10
|
import {IVersionable} from "../upgradeability/IVersionable.sol";
|
10
11
|
|
@@ -15,6 +16,7 @@ import {IComponentService} from "../shared/IComponentService.sol";
|
|
15
16
|
import {NftId} from "../type/NftId.sol";
|
16
17
|
import {ObjectType, COMPONENT, STAKING} from "../type/ObjectType.sol";
|
17
18
|
import {Seconds} from "../type/Seconds.sol";
|
19
|
+
import {Registerable} from "../shared/Registerable.sol";
|
18
20
|
import {StakeManagerLib} from "./StakeManagerLib.sol";
|
19
21
|
import {StakingReader} from "./StakingReader.sol";
|
20
22
|
import {StakingStore} from "./StakingStore.sol";
|
@@ -24,7 +26,7 @@ import {TokenHandler} from "../shared/TokenHandler.sol";
|
|
24
26
|
import {TokenHandlerDeployerLib} from "../shared/TokenHandlerDeployerLib.sol";
|
25
27
|
import {TokenRegistry} from "../registry/TokenRegistry.sol";
|
26
28
|
import {UFixed} from "../type/UFixed.sol";
|
27
|
-
import {Version, VersionLib} from "../type/Version.sol";
|
29
|
+
import {Version, VersionLib, VersionPart, VersionPartLib} from "../type/Version.sol";
|
28
30
|
import {Versionable} from "../upgradeability/Versionable.sol";
|
29
31
|
|
30
32
|
contract Staking is
|
@@ -38,7 +40,6 @@ contract Staking is
|
|
38
40
|
bytes32 public constant STAKING_LOCATION_V1 = 0xafe8d4462b2ed26a47154f4b8f6d1497d2f772496965791d25bd456e342b7f00;
|
39
41
|
|
40
42
|
struct StakingStorage {
|
41
|
-
IRegistryService _registryService;
|
42
43
|
TokenRegistry _tokenRegistry;
|
43
44
|
TokenHandler _tokenHandler;
|
44
45
|
StakingStore _store;
|
@@ -77,6 +78,16 @@ contract Staking is
|
|
77
78
|
getRegistry().getAuthority());
|
78
79
|
}
|
79
80
|
|
81
|
+
|
82
|
+
function approveTokenHandler(IERC20Metadata token, Amount amount)
|
83
|
+
public
|
84
|
+
restricted()
|
85
|
+
onlyOwner()
|
86
|
+
{
|
87
|
+
_approveTokenHandler(token, amount);
|
88
|
+
}
|
89
|
+
|
90
|
+
|
80
91
|
// set/update staking reader
|
81
92
|
function setStakingReader(StakingReader stakingReader)
|
82
93
|
external
|
@@ -407,14 +418,24 @@ contract Staking is
|
|
407
418
|
return _getStakingStorage()._tokenHandler;
|
408
419
|
}
|
409
420
|
|
410
|
-
// from
|
421
|
+
// from IRegisterable
|
422
|
+
function getRelease()
|
423
|
+
public
|
424
|
+
pure
|
425
|
+
virtual override (IRelease, Registerable)
|
426
|
+
returns(VersionPart)
|
427
|
+
{
|
428
|
+
return VersionPartLib.toVersionPart(3);
|
429
|
+
}
|
430
|
+
|
431
|
+
// from IVersionable
|
411
432
|
function getVersion()
|
412
433
|
public
|
413
434
|
pure
|
414
|
-
virtual override (IVersionable, Versionable)
|
435
|
+
virtual override (Component, IVersionable, Versionable)
|
415
436
|
returns(Version)
|
416
437
|
{
|
417
|
-
return VersionLib.toVersion(
|
438
|
+
return VersionLib.toVersion(3,0,0);
|
418
439
|
}
|
419
440
|
|
420
441
|
//--- internal functions ------------------------------------------------//
|
@@ -447,7 +468,7 @@ contract Staking is
|
|
447
468
|
internal
|
448
469
|
virtual override
|
449
470
|
{
|
450
|
-
IComponentService(_getServiceAddress(
|
471
|
+
IComponentService(_getServiceAddress(STAKING())).approveTokenHandler(
|
451
472
|
token,
|
452
473
|
amount);
|
453
474
|
}
|
@@ -474,6 +495,13 @@ contract Staking is
|
|
474
495
|
TokenRegistry tokenRegistry = TokenRegistry(tokenRegistryAddress);
|
475
496
|
address dipTokenAddress = tokenRegistry.getDipTokenAddress();
|
476
497
|
|
498
|
+
// wiring to external contracts
|
499
|
+
StakingStorage storage $ = _getStakingStorage();
|
500
|
+
$._protocolNftId = registry.getProtocolNftId();
|
501
|
+
$._store = StakingStore(stakingStoreAddress);
|
502
|
+
$._reader = StakingStore(stakingStoreAddress).getStakingReader();
|
503
|
+
$._tokenRegistry = TokenRegistry(tokenRegistryAddress);
|
504
|
+
|
477
505
|
_initializeComponent(
|
478
506
|
authority,
|
479
507
|
registryAddress,
|
@@ -486,13 +514,6 @@ contract Staking is
|
|
486
514
|
"", // registry data
|
487
515
|
""); // component data
|
488
516
|
|
489
|
-
// wiring to external contracts
|
490
|
-
StakingStorage storage $ = _getStakingStorage();
|
491
|
-
$._protocolNftId = getRegistry().getProtocolNftId();
|
492
|
-
$._store = StakingStore(stakingStoreAddress);
|
493
|
-
$._reader = StakingStore(stakingStoreAddress).getStakingReader();
|
494
|
-
$._tokenRegistry = TokenRegistry(tokenRegistryAddress);
|
495
|
-
|
496
517
|
_registerInterface(type(IStaking).interfaceId);
|
497
518
|
}
|
498
519
|
|
@@ -32,6 +32,28 @@ contract StakingService is
|
|
32
32
|
TokenHandler _tokenHandler;
|
33
33
|
}
|
34
34
|
|
35
|
+
|
36
|
+
modifier onlyStaking() {
|
37
|
+
if (msg.sender != address(_getStakingServiceStorage()._staking)) {
|
38
|
+
revert ErrorStakingServiceNotStaking(msg.sender);
|
39
|
+
}
|
40
|
+
_;
|
41
|
+
}
|
42
|
+
|
43
|
+
|
44
|
+
function approveTokenHandler(
|
45
|
+
IERC20Metadata token,
|
46
|
+
Amount amount
|
47
|
+
)
|
48
|
+
external
|
49
|
+
virtual
|
50
|
+
onlyStaking()
|
51
|
+
{
|
52
|
+
_getStakingServiceStorage()._tokenHandler.approve(
|
53
|
+
token, amount);
|
54
|
+
}
|
55
|
+
|
56
|
+
|
35
57
|
function createInstanceTarget(
|
36
58
|
NftId targetNftId,
|
37
59
|
Seconds initialLockingPeriod,
|
@@ -113,8 +135,7 @@ contract StakingService is
|
|
113
135
|
// transfer withdrawal amount to target owner
|
114
136
|
address instanceOwner = getRegistry().ownerOf(instanceNftId);
|
115
137
|
emit LogStakingServiceRewardReservesDecreased(instanceNftId, instanceOwner, dipAmount, newBalance);
|
116
|
-
|
117
|
-
$._staking.getTokenHandler(),
|
138
|
+
$._tokenHandler.pushToken(
|
118
139
|
instanceOwner,
|
119
140
|
dipAmount);
|
120
141
|
}
|
@@ -162,39 +183,11 @@ contract StakingService is
|
|
162
183
|
emit LogStakingServiceStakeCreated(stakeNftId, targetNftId, stakeOwner, dipAmount);
|
163
184
|
|
164
185
|
// collect staked dip by staking
|
165
|
-
|
166
|
-
$._staking.getTokenHandler(),
|
186
|
+
$._tokenHandler.pullToken(
|
167
187
|
stakeOwner,
|
168
188
|
dipAmount);
|
169
189
|
}
|
170
190
|
|
171
|
-
function _collectToken(
|
172
|
-
TokenHandler tokenHandler,
|
173
|
-
address from,
|
174
|
-
Amount amount
|
175
|
-
)
|
176
|
-
internal
|
177
|
-
virtual
|
178
|
-
{
|
179
|
-
tokenHandler.collectTokens(
|
180
|
-
from,
|
181
|
-
amount);
|
182
|
-
}
|
183
|
-
|
184
|
-
function _distributeToken(
|
185
|
-
TokenHandler tokenHandler,
|
186
|
-
address to,
|
187
|
-
Amount amount
|
188
|
-
)
|
189
|
-
internal
|
190
|
-
virtual
|
191
|
-
{
|
192
|
-
tokenHandler.distributeTokens(
|
193
|
-
tokenHandler.getWallet(),
|
194
|
-
to,
|
195
|
-
amount);
|
196
|
-
}
|
197
|
-
|
198
191
|
|
199
192
|
function stake(
|
200
193
|
NftId stakeNftId,
|
@@ -218,8 +211,7 @@ contract StakingService is
|
|
218
211
|
// collect staked dip by staking
|
219
212
|
if (dipAmount.gtz()) {
|
220
213
|
emit LogStakingServiceStakeIncreased(stakeNftId, stakeOwner, dipAmount, stakeBalance);
|
221
|
-
|
222
|
-
$._staking.getTokenHandler(),
|
214
|
+
$._tokenHandler.pullToken(
|
223
215
|
stakeOwner,
|
224
216
|
dipAmount);
|
225
217
|
}
|
@@ -274,8 +266,7 @@ contract StakingService is
|
|
274
266
|
|
275
267
|
Amount rewardsClaimedAmount = $._staking.claimRewards(stakeNftId);
|
276
268
|
emit LogStakingServiceRewardsClaimed(stakeNftId, stakeOwner, rewardsClaimedAmount);
|
277
|
-
|
278
|
-
$._staking.getTokenHandler(),
|
269
|
+
$._tokenHandler.pushToken(
|
279
270
|
stakeOwner,
|
280
271
|
rewardsClaimedAmount);
|
281
272
|
}
|
@@ -300,7 +291,7 @@ contract StakingService is
|
|
300
291
|
Amount totalAmount = unstakedAmount + rewardsClaimedAmount;
|
301
292
|
emit LogStakingServiceUnstaked(stakeNftId, stakeOwner, totalAmount);
|
302
293
|
|
303
|
-
$.
|
294
|
+
$._tokenHandler.pushToken(
|
304
295
|
stakeOwner,
|
305
296
|
totalAmount);
|
306
297
|
}
|
@@ -359,15 +350,15 @@ contract StakingService is
|
|
359
350
|
{
|
360
351
|
(
|
361
352
|
address authority,
|
362
|
-
address
|
363
|
-
address
|
353
|
+
address registry,
|
354
|
+
address staking
|
364
355
|
) = abi.decode(data, (address, address, address));
|
365
356
|
|
366
|
-
|
357
|
+
__Service_init(authority, registry, owner);
|
367
358
|
|
368
359
|
StakingServiceStorage storage $ = _getStakingServiceStorage();
|
369
360
|
$._registryService = RegistryService(_getServiceAddress(REGISTRY()));
|
370
|
-
$._staking = _registerStaking(
|
361
|
+
$._staking = _registerStaking(staking);
|
371
362
|
$._dip = $._staking.getToken();
|
372
363
|
$._tokenHandler = $._staking.getTokenHandler();
|
373
364
|
|
@@ -420,8 +411,7 @@ contract StakingService is
|
|
420
411
|
emit LogStakingServiceRewardReservesIncreased(targetNftId, rewardProvider, dipAmount, newBalance);
|
421
412
|
|
422
413
|
// collect reward dip from provider
|
423
|
-
|
424
|
-
$._staking.getTokenHandler(),
|
414
|
+
$._tokenHandler.pullToken(
|
425
415
|
rewardProvider,
|
426
416
|
dipAmount);
|
427
417
|
}
|
@@ -15,17 +15,18 @@ contract StakingServiceManager is
|
|
15
15
|
/// @dev initializes proxy manager with service implementation
|
16
16
|
constructor(
|
17
17
|
address authority,
|
18
|
-
address
|
18
|
+
address registry,
|
19
19
|
bytes32 salt
|
20
20
|
)
|
21
21
|
{
|
22
22
|
StakingService svc = new StakingService();
|
23
23
|
bytes memory data = abi.encode(
|
24
24
|
authority,
|
25
|
-
|
26
|
-
IRegistry(
|
25
|
+
registry,
|
26
|
+
IRegistry(registry).getStakingAddress());
|
27
|
+
|
27
28
|
IVersionable versionable = initialize(
|
28
|
-
|
29
|
+
registry,
|
29
30
|
address(svc),
|
30
31
|
data,
|
31
32
|
salt);
|
@@ -44,10 +44,16 @@ function INSTANCE() pure returns (ObjectType) {
|
|
44
44
|
return ObjectType.wrap(10);
|
45
45
|
}
|
46
46
|
|
47
|
+
/// @dev Generic component object type.
|
48
|
+
/// Component role id range is 11-19.
|
49
|
+
/// Stick to this range for new component object types.
|
47
50
|
function COMPONENT() pure returns (ObjectType) {
|
48
51
|
return ObjectType.wrap(11);
|
49
52
|
}
|
50
53
|
|
54
|
+
/// @dev Product object type.
|
55
|
+
/// IMPORTANT the actual value has an influence on the corresponding role id (RoleIdLib.sol).
|
56
|
+
/// Do not change this value without updating the corresponding role id calculation.
|
51
57
|
function PRODUCT() pure returns (ObjectType) {
|
52
58
|
return ObjectType.wrap(12);
|
53
59
|
}
|
@@ -64,6 +70,8 @@ function POOL() pure returns (ObjectType) {
|
|
64
70
|
return ObjectType.wrap(15);
|
65
71
|
}
|
66
72
|
|
73
|
+
/// @dev Application object type.
|
74
|
+
/// Range for NFT objects created thorugh components is 20-29.
|
67
75
|
function APPLICATION() pure returns (ObjectType) {
|
68
76
|
return ObjectType.wrap(20);
|
69
77
|
}
|
@@ -72,54 +80,69 @@ function POLICY() pure returns (ObjectType) {
|
|
72
80
|
return ObjectType.wrap(21);
|
73
81
|
}
|
74
82
|
|
75
|
-
function
|
83
|
+
function BUNDLE() pure returns (ObjectType) {
|
76
84
|
return ObjectType.wrap(22);
|
77
85
|
}
|
78
86
|
|
79
|
-
function
|
87
|
+
function DISTRIBUTOR() pure returns (ObjectType) {
|
80
88
|
return ObjectType.wrap(23);
|
81
89
|
}
|
82
90
|
|
83
|
-
|
84
|
-
|
91
|
+
/// @dev Stake object type.
|
92
|
+
/// NFT object type is 30
|
93
|
+
function STAKE() pure returns (ObjectType) {
|
94
|
+
return ObjectType.wrap(30);
|
85
95
|
}
|
86
96
|
|
87
|
-
|
88
|
-
|
97
|
+
/// @dev Staking target object type.
|
98
|
+
function TARGET() pure returns (ObjectType) {
|
99
|
+
return ObjectType.wrap(31);
|
100
|
+
}
|
101
|
+
|
102
|
+
/// @dev Accounting object type.
|
103
|
+
/// Range for non-NFT types created through components is 40+
|
104
|
+
function ACCOUNTING() pure returns (ObjectType) {
|
105
|
+
return ObjectType.wrap(40);
|
106
|
+
}
|
107
|
+
|
108
|
+
function FEE() pure returns (ObjectType) {
|
109
|
+
return ObjectType.wrap(41);
|
89
110
|
}
|
90
111
|
|
91
112
|
function PRICE() pure returns (ObjectType) {
|
92
|
-
return ObjectType.wrap(
|
113
|
+
return ObjectType.wrap(42);
|
93
114
|
}
|
94
115
|
|
95
|
-
function
|
96
|
-
return ObjectType.wrap(
|
116
|
+
function PREMIUM() pure returns (ObjectType) {
|
117
|
+
return ObjectType.wrap(43);
|
97
118
|
}
|
98
119
|
|
99
|
-
function
|
100
|
-
return ObjectType.wrap(
|
120
|
+
function RISK() pure returns (ObjectType) {
|
121
|
+
return ObjectType.wrap(44);
|
101
122
|
}
|
102
123
|
|
103
|
-
function
|
104
|
-
return ObjectType.wrap(
|
124
|
+
function CLAIM() pure returns (ObjectType) {
|
125
|
+
return ObjectType.wrap(45);
|
105
126
|
}
|
106
127
|
|
107
|
-
function
|
108
|
-
return ObjectType.wrap(
|
128
|
+
function PAYOUT() pure returns (ObjectType) {
|
129
|
+
return ObjectType.wrap(46);
|
109
130
|
}
|
110
131
|
|
111
|
-
function
|
112
|
-
return ObjectType.wrap(
|
132
|
+
function REQUEST() pure returns (ObjectType) {
|
133
|
+
return ObjectType.wrap(47);
|
113
134
|
}
|
114
135
|
|
115
|
-
function
|
116
|
-
return ObjectType.wrap(
|
136
|
+
function DISTRIBUTOR_TYPE() pure returns (ObjectType) {
|
137
|
+
return ObjectType.wrap(48);
|
117
138
|
}
|
118
139
|
|
119
|
-
function
|
120
|
-
return ObjectType.wrap(
|
140
|
+
function REFERRAL() pure returns (ObjectType) {
|
141
|
+
return ObjectType.wrap(49);
|
121
142
|
}
|
122
143
|
|
144
|
+
|
145
|
+
|
123
146
|
/// @dev Object type that includes any other object type.
|
124
147
|
/// Note that eq()/'==' does not take this property into account.
|
125
148
|
function ALL() pure returns (ObjectType) {
|
@@ -204,6 +227,8 @@ library ObjectTypeLib {
|
|
204
227
|
return "Bundle";
|
205
228
|
} else if (objectType == RISK()) {
|
206
229
|
return "Risk";
|
230
|
+
} else if (objectType == ACCOUNTING()) {
|
231
|
+
return "Accounting";
|
207
232
|
}
|
208
233
|
|
209
234
|
// fallback: ObjectType<obect-type-int>
|
@@ -2,6 +2,7 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {Key32, KeyId, Key32Lib} from "./Key32.sol";
|
5
|
+
import {NftId} from "./NftId.sol";
|
5
6
|
import {RISK} from "./ObjectType.sol";
|
6
7
|
|
7
8
|
type RiskId is bytes8;
|
@@ -12,6 +13,7 @@ using {
|
|
12
13
|
neRiskId as !=,
|
13
14
|
RiskIdLib.eq,
|
14
15
|
RiskIdLib.eqz,
|
16
|
+
RiskIdLib.gtz,
|
15
17
|
RiskIdLib.toInt,
|
16
18
|
RiskIdLib.toKeyId,
|
17
19
|
RiskIdLib.toKey32
|
@@ -39,9 +41,9 @@ library RiskIdLib {
|
|
39
41
|
return uint64(RiskId.unwrap(riskId));
|
40
42
|
}
|
41
43
|
|
42
|
-
// @dev Converts a risk id string into a risk id.
|
43
|
-
function toRiskId(
|
44
|
-
return RiskId.wrap(bytes8(keccak256(abi.encode(risk))));
|
44
|
+
// @dev Converts a risk id string with a product NftId into a risk id.
|
45
|
+
function toRiskId(NftId productNftId, bytes32 risk) public pure returns (RiskId) {
|
46
|
+
return RiskId.wrap(bytes8(keccak256(abi.encode(productNftId, risk))));
|
45
47
|
}
|
46
48
|
|
47
49
|
/// @dev Returns the key32 value for the specified risk id.
|
@@ -66,4 +68,8 @@ library RiskIdLib {
|
|
66
68
|
function eqz(RiskId a) public pure returns (bool isZero) {
|
67
69
|
return eqRiskId(a, zero());
|
68
70
|
}
|
71
|
+
|
72
|
+
function gtz(RiskId a) public pure returns (bool isZero) {
|
73
|
+
return uint64(RiskId.unwrap(a)) > 0;
|
74
|
+
}
|
69
75
|
}
|
@@ -11,9 +11,11 @@ type RoleId is uint64;
|
|
11
11
|
using {
|
12
12
|
eqRoleId as ==,
|
13
13
|
neRoleId as !=,
|
14
|
+
RoleIdLib.toInt,
|
14
15
|
RoleIdLib.eqz,
|
15
16
|
RoleIdLib.gtz,
|
16
|
-
RoleIdLib.
|
17
|
+
RoleIdLib.isComponentRole,
|
18
|
+
RoleIdLib.isCustomRole
|
17
19
|
// RoleIdLib.toKey32
|
18
20
|
} for RoleId global;
|
19
21
|
|
@@ -54,6 +56,9 @@ function GIF_MANAGER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2)
|
|
54
56
|
/// @dev role for registering remote staking targets and reporting remote total value locked amounts.
|
55
57
|
function GIF_REMOTE_MANAGER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(3); }
|
56
58
|
|
59
|
+
/// @dev role assigned to release registry, release specfic to lock/unlock a release
|
60
|
+
function RELEASE_REGISTRY_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(4); }
|
61
|
+
|
57
62
|
//--- GIF core contract roles (range: 200 - 9'900) --------------------------//
|
58
63
|
// created and assigned during initial deployment for registry and staking
|
59
64
|
// granting for instances and components in instance service
|
@@ -72,6 +77,8 @@ function GIF_REMOTE_MANAGER_ROLE() pure returns (RoleId) { return RoleIdLib.toRo
|
|
72
77
|
// - application service role (version 3): 2003
|
73
78
|
|
74
79
|
//--- GIF component contract roles (range 12'001 - 19'099) ------------------//
|
80
|
+
// the min value of 12'001 is based on the following calculation:
|
81
|
+
// object type * 1000 + 1 where the lowest object type is 12 (product)
|
75
82
|
// assigned at component registration time
|
76
83
|
// object type * 1000 + instane specific component counter
|
77
84
|
// on any instance a maximum number of 999 components may be deployed
|
@@ -92,8 +99,10 @@ library RoleIdLib {
|
|
92
99
|
|
93
100
|
uint64 public constant ALL_VERSIONS = 99;
|
94
101
|
uint64 public constant SERVICE_DOMAIN_ROLE_FACTOR = 100;
|
95
|
-
uint64 public constant COMPONENT_ROLE_FACTOR =
|
96
|
-
uint64 public constant
|
102
|
+
uint64 public constant COMPONENT_ROLE_FACTOR = 1000;
|
103
|
+
uint64 public constant COMPONENT_ROLE_MIN_INT = 12000;
|
104
|
+
uint64 public constant COMPONENT_ROLE_MAX_INT = 19000;
|
105
|
+
uint64 public constant CUSTOM_ROLE_MIN_INT = 1000000;
|
97
106
|
|
98
107
|
/// @dev Converts the RoleId to a uint.
|
99
108
|
function zero() public pure returns (RoleId) {
|
@@ -112,7 +121,7 @@ library RoleIdLib {
|
|
112
121
|
|
113
122
|
/// @dev Converts an uint into a custom role id.
|
114
123
|
function toCustomRoleId(uint64 index) public pure returns (RoleId) {
|
115
|
-
return toRoleId(
|
124
|
+
return toRoleId(CUSTOM_ROLE_MIN_INT + index);
|
116
125
|
}
|
117
126
|
|
118
127
|
/// @dev Converts the role id to a uint.
|
@@ -150,6 +159,17 @@ library RoleIdLib {
|
|
150
159
|
return RoleId.unwrap(a) == 0;
|
151
160
|
}
|
152
161
|
|
162
|
+
/// @dev Returns true iff the role id is a component role.
|
163
|
+
function isComponentRole(RoleId roleId) public pure returns (bool) {
|
164
|
+
uint64 roleIdInt = RoleId.unwrap(roleId);
|
165
|
+
return roleIdInt >= COMPONENT_ROLE_MIN_INT && roleIdInt <= COMPONENT_ROLE_MAX_INT;
|
166
|
+
}
|
167
|
+
|
168
|
+
/// @dev Returns true iff the role id is a custom role.
|
169
|
+
function isCustomRole(RoleId roleId) public pure returns (bool) {
|
170
|
+
return RoleId.unwrap(roleId) >= CUSTOM_ROLE_MIN_INT;
|
171
|
+
}
|
172
|
+
|
153
173
|
/// @dev Returns the key32 value for the specified id and object type.
|
154
174
|
function toKey32(RoleId a) public pure returns (Key32 key) {
|
155
175
|
return Key32Lib.toKey32(ROLE(), toKeyId(a));
|
@@ -8,6 +8,7 @@ using {
|
|
8
8
|
eqSelector as ==,
|
9
9
|
neSelector as !=,
|
10
10
|
SelectorLib.toBytes4,
|
11
|
+
SelectorLib.toString,
|
11
12
|
SelectorLib.eqz
|
12
13
|
} for Selector global;
|
13
14
|
|
@@ -46,6 +47,10 @@ library SelectorLib {
|
|
46
47
|
function toBytes4(Selector s) public pure returns (bytes4) {
|
47
48
|
return Selector.unwrap(s);
|
48
49
|
}
|
50
|
+
|
51
|
+
function toString(Selector s) public pure returns (string memory) {
|
52
|
+
return string(abi.encode(Selector.unwrap(s)));
|
53
|
+
}
|
49
54
|
}
|
50
55
|
|
51
56
|
// selector specific set library
|
@@ -54,11 +54,6 @@ function neTimestamp(Timestamp a, Timestamp b) pure returns (bool) {
|
|
54
54
|
return Timestamp.unwrap(a) != Timestamp.unwrap(b);
|
55
55
|
}
|
56
56
|
|
57
|
-
/// @dev Converts the uint256 to a Timestamp.
|
58
|
-
function toTimestamp(uint256 timestamp) pure returns (Timestamp) {
|
59
|
-
return TimestampLib.toTimestamp(timestamp);
|
60
|
-
}
|
61
|
-
|
62
57
|
// TODO move to TimestampLib and rename to zero()
|
63
58
|
/// @dev Return the Timestamp zero (0)
|
64
59
|
function zeroTimestamp() pure returns (Timestamp) {
|
@@ -8,7 +8,8 @@ using {
|
|
8
8
|
versionPartEq as ==,
|
9
9
|
versionPartNe as !=,
|
10
10
|
VersionPartLib.eqz,
|
11
|
-
VersionPartLib.toInt
|
11
|
+
VersionPartLib.toInt,
|
12
|
+
VersionPartLib.isValidRelease
|
12
13
|
}
|
13
14
|
for VersionPart global;
|
14
15
|
|
@@ -17,9 +18,17 @@ function versionPartEq(VersionPart a, VersionPart b) pure returns(bool isSame) {
|
|
17
18
|
function versionPartNe(VersionPart a, VersionPart b) pure returns(bool isSame) { return VersionPart.unwrap(a) != VersionPart.unwrap(b); }
|
18
19
|
|
19
20
|
library VersionPartLib {
|
21
|
+
function releaseMin() public pure returns (VersionPart) { return toVersionPart(3); }
|
22
|
+
function releaseMax() public pure returns (VersionPart) { return toVersionPart(99); }
|
23
|
+
|
24
|
+
function isValidRelease(VersionPart release) external pure returns(bool) {
|
25
|
+
uint256 releaseInt = VersionPart.unwrap(release);
|
26
|
+
return 3 <= releaseInt && releaseInt <= 99;
|
27
|
+
}
|
28
|
+
|
20
29
|
function eqz(VersionPart a) external pure returns(bool) { return VersionPart.unwrap(a) == 0; }
|
21
30
|
function toInt(VersionPart a) external pure returns(uint256) { return VersionPart.unwrap(a); }
|
22
|
-
function toVersionPart(uint256 a)
|
31
|
+
function toVersionPart(uint256 a) public pure returns(VersionPart) { return VersionPart.wrap(uint8(a)); }
|
23
32
|
}
|
24
33
|
|
25
34
|
type Version is uint24; // contains major,minor,patch version parts
|
@@ -38,6 +47,7 @@ function versionGt(Version a, Version b) pure returns(bool isGreaterThan) { retu
|
|
38
47
|
function versionEq(Version a, Version b) pure returns(bool isSame) { return Version.unwrap(a) == Version.unwrap(b); }
|
39
48
|
|
40
49
|
library VersionLib {
|
50
|
+
|
41
51
|
function toInt(Version version) external pure returns(uint) { return Version.unwrap(version); }
|
42
52
|
|
43
53
|
function toUint64(Version version) external pure returns(uint64) { return Version.unwrap(version); }
|
@@ -75,9 +85,9 @@ library VersionLib {
|
|
75
85
|
);
|
76
86
|
}
|
77
87
|
|
78
|
-
function toVersionPart(uint256 versionPart)
|
79
|
-
|
80
|
-
}
|
88
|
+
// function toVersionPart(uint256 versionPart) public pure returns(VersionPart) {
|
89
|
+
// return VersionPart.wrap(uint8(versionPart));
|
90
|
+
// }
|
81
91
|
|
82
92
|
function toVersion(
|
83
93
|
uint256 major,
|
@@ -193,7 +193,7 @@ contract ProxyManager is
|
|
193
193
|
}
|
194
194
|
|
195
195
|
address initialOwner = msg.sender;
|
196
|
-
|
196
|
+
__NftOwnable_init(registry, initialOwner);
|
197
197
|
|
198
198
|
currentProxyOwner = getOwner(); // used by implementation
|
199
199
|
initialProxyAdminOwner = address(this); // used by proxy
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@etherisc/gif-next",
|
3
|
-
"version": "0.0.2-
|
3
|
+
"version": "0.0.2-f677999-878",
|
4
4
|
"description": "This is the repository for the next version of the Generic Insurance Framework (GIF) smart contracts. ",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -36,7 +36,7 @@
|
|
36
36
|
"@typescript-eslint/parser": "^8.1.0",
|
37
37
|
"antlr4ng-cli": "^2.0.0",
|
38
38
|
"dotenv": "^16.3.1",
|
39
|
-
"eslint": "^
|
39
|
+
"eslint": "^9.9.1",
|
40
40
|
"hardhat": "^2.17.2",
|
41
41
|
"prettier": "^3.0.3",
|
42
42
|
"prettier-plugin-solidity": "^1.1.3",
|