@etherisc/gif-next 0.0.2-9e6b423-414 → 0.0.2-9f1b659-471
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +86 -34
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +73 -35
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +52 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +2 -2
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +2 -2
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +2 -2
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +2 -2
- 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/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- 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 +37 -18
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +2 -2
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +19 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +311 -151
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +112 -86
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +19 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +199 -15
- 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 +65 -42
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +16 -16
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +79 -44
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +16 -16
- 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 +57 -22
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +27 -8
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +69 -50
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +16 -16
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +248 -68
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +16 -16
- 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 +26 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +96 -4
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +37 -12
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +2 -2
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +16 -16
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +56 -56
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +118 -26
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +69 -31
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +106 -98
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +101 -88
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +8 -8
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +2 -2
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +23 -4
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +2 -2
- 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 +19 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +29 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +19 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +49 -20
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +78 -40
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +37 -26
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +19 -19
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +280 -119
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +106 -48
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +180 -27
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +19 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +220 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +19 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +36 -52
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +292 -65
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +94 -52
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +202 -61
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +75 -33
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +19 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +19 -19
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +128 -104
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +95 -65
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +166 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +50 -10
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +55 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +29 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +19 -0
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +203 -18
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +109 -46
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +2 -2
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +91 -49
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +79 -74
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +82 -40
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +19 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +231 -46
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +70 -32
- 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 +18 -7
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +29 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +56 -45
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +2 -2
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +29 -21
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +41 -12
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +65 -27
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +2 -2
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +81 -81
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +17 -17
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +119 -59
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +19 -0
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +120 -56
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +96 -50
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +9 -9
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +2 -2
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +19 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +48 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +19 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +6 -6
- 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/INftOwnable.sol/INftOwnable.json +19 -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 +19 -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 +19 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +6 -6
- 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 +21 -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 +19 -0
- 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 +29 -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/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1146 -53
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +91 -111
- package/artifacts/contracts/staking/ITargetManager.sol/ITargetManager.dbg.json +4 -0
- package/artifacts/contracts/staking/ITargetManager.sol/ITargetManager.json +69 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +1392 -181
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +73 -72
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +138 -56
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +174 -180
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +115 -167
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +68 -46
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +1290 -599
- package/artifacts/contracts/staking/TargetManager.sol/TargetManager.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetManager.sol/TargetManager.json +134 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +72 -32
- 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 +2 -2
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +45 -19
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.json +193 -0
- 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/Fee.sol/FeeLib.json +2 -2
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- 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/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/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +2 -2
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +45 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +3 -3
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.json +10 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +55 -17
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.json +10 -0
- package/contracts/accounting/AccountingService.sol +13 -0
- package/contracts/accounting/IAccountingService.sol +2 -0
- package/contracts/authorization/AccessAdmin.sol +5 -5
- package/contracts/authorization/AccessAdminLib.sol +2 -2
- package/contracts/authorization/Authorization.sol +2 -7
- package/contracts/authorization/IAuthorization.sol +0 -1
- package/contracts/authorization/ServiceAuthorization.sol +2 -2
- package/contracts/distribution/BasicDistribution.sol +2 -2
- package/contracts/distribution/Distribution.sol +5 -3
- package/contracts/distribution/DistributionService.sol +27 -21
- package/contracts/distribution/IDistributionService.sol +10 -4
- package/contracts/examples/fire/FireProduct.sol +6 -6
- package/contracts/examples/unpermissioned/SimpleProduct.sol +83 -19
- package/contracts/instance/IInstance.sol +1 -1
- package/contracts/instance/IInstanceService.sol +7 -3
- package/contracts/instance/Instance.sol +6 -4
- package/contracts/instance/InstanceAuthorizationV3.sol +2 -1
- package/contracts/instance/InstanceService.sol +21 -32
- package/contracts/instance/RiskSet.sol +10 -2
- package/contracts/instance/base/BalanceStore.sol +1 -1
- package/contracts/instance/base/ObjectLifecycle.sol +2 -6
- package/contracts/oracle/BasicOracle.sol +1 -1
- package/contracts/oracle/Oracle.sol +2 -2
- package/contracts/oracle/OracleService.sol +4 -4
- package/contracts/pool/BasicPool.sol +3 -14
- package/contracts/pool/BasicPoolAuthorization.sol +1 -2
- package/contracts/pool/BundleService.sol +34 -43
- package/contracts/pool/IBundleService.sol +14 -13
- package/contracts/pool/IPoolService.sol +7 -2
- package/contracts/pool/Pool.sol +4 -14
- package/contracts/pool/PoolLib.sol +10 -22
- package/contracts/pool/PoolService.sol +35 -8
- package/contracts/product/ApplicationService.sol +58 -9
- package/contracts/product/BasicProduct.sol +1 -1
- package/contracts/product/BasicProductAuthorization.sol +2 -0
- package/contracts/product/ClaimService.sol +39 -40
- package/contracts/product/IApplicationService.sol +21 -2
- package/contracts/product/IClaimService.sol +5 -4
- package/contracts/product/IPolicyService.sol +9 -2
- package/contracts/product/IRiskService.sol +18 -3
- package/contracts/product/PolicyService.sol +13 -8
- package/contracts/product/PolicyServiceLib.sol +7 -7
- package/contracts/product/PricingService.sol +22 -25
- package/contracts/product/Product.sol +38 -12
- package/contracts/product/RiskService.sol +48 -12
- package/contracts/registry/IRegistry.sol +11 -9
- package/contracts/registry/Registry.sol +15 -9
- package/contracts/registry/RegistryAuthorization.sol +55 -20
- package/contracts/registry/RegistryService.sol +1 -1
- package/contracts/registry/ReleaseRegistry.sol +8 -3
- package/contracts/registry/ServiceAuthorizationV3.sol +10 -12
- package/contracts/registry/TokenRegistry.sol +52 -49
- package/contracts/shared/Component.sol +6 -2
- package/contracts/shared/ComponentService.sol +15 -6
- package/contracts/shared/ContractLib.sol +3 -2
- package/contracts/shared/IComponent.sol +1 -1
- package/contracts/shared/IComponentService.sol +1 -0
- package/contracts/shared/IKeyValueStore.sol +1 -1
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/InstanceLinkedComponent.sol +4 -4
- package/contracts/shared/KeyValueStore.sol +3 -3
- package/contracts/shared/NftOwnable.sol +2 -0
- package/contracts/shared/PolicyHolder.sol +3 -2
- package/contracts/staking/IStaking.sol +187 -65
- package/contracts/staking/IStakingService.sol +36 -84
- package/contracts/staking/ITargetManager.sol +28 -0
- package/contracts/staking/Staking.sol +458 -210
- package/contracts/staking/StakingLib.sol +38 -124
- package/contracts/staking/StakingManager.sol +1 -2
- package/contracts/staking/StakingReader.sol +45 -74
- package/contracts/staking/StakingService.sol +39 -185
- package/contracts/staking/StakingServiceManager.sol +1 -0
- package/contracts/staking/StakingStore.sol +866 -327
- package/contracts/staking/TargetManager.sol +103 -0
- package/contracts/type/Amount.sol +4 -0
- package/contracts/type/Blocknumber.sol +15 -15
- package/contracts/type/ChainId.sol +101 -0
- package/contracts/type/NftId.sol +3 -3
- package/contracts/type/Seconds.sol +14 -0
- package/contracts/type/Timestamp.sol +4 -2
- package/contracts/type/UFixed.sol +1 -0
- package/contracts/upgradeability/IVersionable.sol +3 -0
- package/contracts/upgradeability/ProxyManager.sol +13 -1
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +6 -2
- package/contracts/upgradeability/Versionable.sol +2 -2
- package/package.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +0 -4
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +0 -485
- package/contracts/shared/ComponentVerifyingService.sol +0 -128
@@ -3,9 +3,13 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
5
|
|
6
|
-
import {Amount} from "../type/Amount.sol";
|
7
6
|
import {IComponent} from "../shared/IComponent.sol";
|
7
|
+
import {ITargetManager} from "./ITargetManager.sol";
|
8
8
|
import {IVersionable} from "../upgradeability/IVersionable.sol";
|
9
|
+
|
10
|
+
import {Amount} from "../type/Amount.sol";
|
11
|
+
import {Blocknumber} from "../type/Blocknumber.sol";
|
12
|
+
import {ChainId} from "../type/ChainId.sol";
|
9
13
|
import {NftId} from "../type/NftId.sol";
|
10
14
|
import {ObjectType} from "../type/ObjectType.sol";
|
11
15
|
import {Seconds} from "../type/Seconds.sol";
|
@@ -13,37 +17,88 @@ import {StakingReader} from "./StakingReader.sol";
|
|
13
17
|
import {StakingStore} from "./StakingStore.sol";
|
14
18
|
import {Timestamp} from "../type/Timestamp.sol";
|
15
19
|
import {UFixed} from "../type/UFixed.sol";
|
20
|
+
import {VersionPart} from "../type/Version.sol";
|
21
|
+
|
16
22
|
|
17
23
|
interface IStaking is
|
18
24
|
IComponent,
|
19
|
-
IVersionable
|
25
|
+
IVersionable,
|
26
|
+
ITargetManager
|
20
27
|
{
|
21
|
-
|
22
|
-
|
28
|
+
|
29
|
+
// owner functions
|
30
|
+
event LogStakingProtocolLockingPeriodSet(NftId targetNftId, Seconds newLockingPeriod, Seconds oldLockingPeriod, Blocknumber lastUpdatedIn);
|
31
|
+
event LogStakingProtocolRewardRateSet(NftId targetNftId, UFixed newRewardRate, UFixed oldRewardRate, Blocknumber lastUpdatedIn);
|
32
|
+
event LogStakingStakingRateSet(ChainId chainId, address token, UFixed newStakingRate, UFixed oldStakingRate, Blocknumber lastUpdatedIn);
|
33
|
+
event LogStakingStakingServiceSet(address stakingService, VersionPart release, address oldStakingService);
|
34
|
+
event LogStakingStakingReaderSet(address stakingReader, address oldStakingReader);
|
35
|
+
event LogStakingTargetManagerSet(address targetManager, address oldTargetManager);
|
36
|
+
event LogStakingTokenHandlerApproved(address token, Amount approvalAmount, Amount oldApprovalAmount);
|
37
|
+
|
38
|
+
// token
|
39
|
+
event LogStakingTokenAdded(ChainId chainId, address token);
|
40
|
+
event LogStakingTargetTokenAdded(NftId targetNftId, ChainId chainId, address token);
|
41
|
+
|
42
|
+
// total value locked
|
43
|
+
event LogStakingTotalValueLockedIncreased(NftId targetNftId, address token, Amount amount, Amount newBalance);
|
44
|
+
event LogStakingTotalValueLockedDecreased(NftId targetNftId, address token, Amount amount, Amount newBalance);
|
45
|
+
|
46
|
+
// targets
|
47
|
+
event LogStakingTargetCreated(NftId targetNftId, ObjectType objectType, Seconds lockingPeriod, UFixed rewardRate, Amount stakeLimitAmount);
|
48
|
+
event LogStakingTargetLimitsUpdated(NftId targetNftId, Amount marginAmount, Amount hardLimitAmount, Blocknumber lastUpdateIn);
|
49
|
+
event LogStakingTargetLimitUpdated(NftId targetNftId, Amount limitAmount, Amount hardLimitAmount, Amount requiredStakeAmount, Amount actualStakeAmount, Blocknumber lastUpdateIn);
|
23
50
|
|
24
51
|
// target parameters
|
25
|
-
event
|
26
|
-
event
|
27
|
-
|
52
|
+
event LogStakingTargetLockingPeriodSet(NftId targetNftId, Seconds oldLockingPeriod, Seconds lockingPeriod);
|
53
|
+
event LogStakingTargetRewardRateSet(NftId targetNftId, UFixed rewardRate, UFixed oldRewardRate);
|
54
|
+
// TODO cleanup LogStakingTargetMaxStakedAmountSet
|
55
|
+
event LogStakingTargetMaxStakedAmountSet(NftId targetNftId, Amount stakeLimitAmount, Blocknumber lastUpdateIn);
|
56
|
+
event LogStakingTargetLimitsSet(NftId targetNftId, Amount stakeLimitAmount, Amount marginAmount, Amount limitAmount);
|
57
|
+
|
58
|
+
// reward reserves
|
59
|
+
event LogStakingRewardReservesRefilled(NftId targetNftId, Amount dipAmount, address targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn);
|
60
|
+
event LogStakingRewardReservesWithdrawn(NftId targetNftId, Amount dipAmount, address targetOwner, Amount reserveBalance, Blocknumber lastUpdateIn);
|
61
|
+
event LogStakingRewardReservesSpent(NftId targetNftId, Amount dipAmount, Amount reserveBalance, Blocknumber lastUpdateIn);
|
62
|
+
|
63
|
+
// stakes
|
64
|
+
event LogStakingStakeCreated(NftId stakeNftId, NftId targetNftId, Amount stakeAmount, Timestamp lockedUntil, address stakeOwner);
|
65
|
+
event LogStakingStakeRewardsUpdated(NftId stakeNftId, Amount rewardIncrementAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil);
|
66
|
+
event LogStakingRewardsRestaked(NftId stakeNftId, Amount restakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil);
|
67
|
+
event LogStakingStaked(NftId stakeNftId, Amount stakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil);
|
68
|
+
event LogStakingUnstaked(NftId stakeNftId, Amount unstakedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil);
|
69
|
+
event LogStakingRewardsClaimed(NftId stakeNftId, Amount claimedAmount, Amount stakeBalance, Amount rewardBalance, Timestamp lockedUntil);
|
70
|
+
|
71
|
+
event LogStakingStakeRestaked(NftId stakeNftId, NftId targetNftId, Amount stakeAmount, address owner, NftId oldStakeNftId);
|
28
72
|
|
29
73
|
// modifiers
|
30
74
|
error ErrorStakingNotStake(NftId stakeNftId);
|
31
75
|
error ErrorStakingNotTarget(NftId targetNftId);
|
76
|
+
error ErrorStakingNotOwner(NftId stakeNftId, address expectedOwner, address actualOwner);
|
32
77
|
|
33
78
|
error ErrorStakingNotStakingOwner();
|
34
79
|
error ErrorStakingNotNftOwner(NftId nftId);
|
35
80
|
|
81
|
+
// owner functions
|
82
|
+
error ErrorStakingReleaseNotActive(VersionPart release);
|
83
|
+
error ErrorStakingServiceNotFound(VersionPart release);
|
84
|
+
|
36
85
|
// initializeTokenHandler
|
37
86
|
error ErrorStakingNotRegistry(address registry);
|
38
87
|
|
39
88
|
// staking rate
|
40
|
-
error ErrorStakingTokenNotRegistered(
|
89
|
+
error ErrorStakingTokenNotRegistered(ChainId chainId, address token);
|
41
90
|
|
42
91
|
// check dip balance and allowance
|
43
92
|
error ErrorStakingDipBalanceInsufficient(address owner, uint256 amount, uint256 dipBalance);
|
44
93
|
error ErrorStakingDipAllowanceInsufficient(address owner, address tokenHandler, uint256 amount, uint256 dipAllowance);
|
45
94
|
|
46
95
|
error ErrorStakingStakingReaderStakingMismatch(address stakingByStakingReader);
|
96
|
+
|
97
|
+
// target management
|
98
|
+
error ErrorStakingTargetNotFound(NftId targetNftId);
|
99
|
+
error ErrorStakingTargetTokenNotFound(NftId targetNftId, ChainId chainId, address token);
|
100
|
+
error ErrorStakingTargetMaxStakedAmountExceeded(NftId targetNftId, Amount stakeLimitAmount, Amount stakedAmount);
|
101
|
+
|
47
102
|
error ErrorStakingTargetAlreadyRegistered(NftId targetNftId);
|
48
103
|
error ErrorStakingTargetNftIdZero();
|
49
104
|
error ErrorStakingTargetTypeNotSupported(NftId targetNftId, ObjectType objectType);
|
@@ -52,79 +107,140 @@ interface IStaking is
|
|
52
107
|
error ErrorStakingLockingPeriodTooLong(NftId targetNftId, Seconds maxLockingPeriod, Seconds lockingPeriod);
|
53
108
|
error ErrorStakingStakeLocked(NftId stakeNftId, Timestamp lockedUntil);
|
54
109
|
error ErrorStakingRewardRateTooHigh(NftId targetNftId, UFixed maxRewardRate, UFixed rewardRate);
|
55
|
-
error ErrorStakingTargetNotFound(NftId targetNftId);
|
56
|
-
error ErrorStakingTargetTokenNotFound(NftId targetNftId, uint256 chainId, address token);
|
57
|
-
error ErrorStakingTargetMaxStakedAmountExceeded(NftId targetNftId, Amount maxStakedAmount, Amount stakedAmount);
|
58
110
|
|
59
111
|
error ErrorStakingStakeAmountZero(NftId targetNftId);
|
60
112
|
|
61
113
|
// info for individual stake
|
62
114
|
struct StakeInfo {
|
63
115
|
// slot 0
|
64
|
-
|
116
|
+
Amount stakedAmount; // 96
|
117
|
+
Amount rewardAmount; // 96
|
118
|
+
Timestamp lockedUntil; // 40
|
119
|
+
// slot 1
|
120
|
+
NftId targetNftId; // 96, redundant to parent nft in registry object info
|
121
|
+
Timestamp lastUpdateAt; // 40, needed to update rewards
|
122
|
+
Blocknumber lastUpdateIn; // 40, needed for traceability
|
65
123
|
}
|
66
124
|
|
67
125
|
struct TargetInfo {
|
68
126
|
// Slot 0
|
69
|
-
|
70
|
-
Amount
|
127
|
+
Amount stakedAmount; // 96
|
128
|
+
Amount rewardAmount; // 96
|
129
|
+
Blocknumber lastUpdateIn; // 40, needed for traceability
|
71
130
|
// Slot 1
|
72
|
-
|
73
|
-
|
131
|
+
Amount reserveAmount; // 96
|
132
|
+
Amount limitAmount; // 96
|
133
|
+
Seconds lockingPeriod; // 40
|
134
|
+
ObjectType objectType; // 8
|
74
135
|
// Slot 2
|
75
|
-
|
136
|
+
UFixed rewardRate; // 160
|
137
|
+
ChainId chainId; // 96 redundant to target nft id
|
138
|
+
}
|
139
|
+
|
140
|
+
struct LimitInfo {
|
141
|
+
// Slot 0
|
142
|
+
Amount marginAmount; // 96
|
143
|
+
Amount hardLimitAmount; // 96
|
144
|
+
Blocknumber lastUpdateIn; // 40, needed for traceability
|
145
|
+
}
|
146
|
+
|
147
|
+
struct TvlInfo {
|
148
|
+
// Slot 0
|
149
|
+
Amount tvlAmount; // 96
|
150
|
+
Amount tvlBaselineAmount; // 96
|
151
|
+
uint16 updatesCounter; // 8
|
152
|
+
Blocknumber lastUpdateIn; // 40, needed for traceability
|
153
|
+
}
|
154
|
+
|
155
|
+
struct TokenInfo {
|
156
|
+
// Slot 0
|
157
|
+
UFixed stakingRate; // 160
|
158
|
+
Blocknumber lastUpdateIn; // 40, needed for traceability
|
76
159
|
}
|
77
160
|
|
78
161
|
function initializeTokenHandler() external;
|
79
162
|
|
163
|
+
//--- only owner functions ----------------------------------------------//
|
164
|
+
|
165
|
+
/// @dev Set the stake locking period for protocol stakes to the specified duration.
|
166
|
+
function setProtocolLockingPeriod(Seconds lockingPeriod) external;
|
167
|
+
|
168
|
+
/// @dev Set the protocol reward rate.
|
169
|
+
function setProtocolRewardRate(UFixed rewardRate) external;
|
170
|
+
|
171
|
+
/// @dev Set the staking rate for the specified chain and token.
|
172
|
+
/// The staking rate defines the amount of staked dips required to back up 1 token of total value locked.
|
173
|
+
function setStakingRate(ChainId chainId, address token, UFixed stakingRate) external;
|
174
|
+
|
175
|
+
/// @dev Sets/updates the staking service contract to the staking service of the specified release.
|
176
|
+
function setStakingService(VersionPart release) external;
|
177
|
+
|
178
|
+
/// @dev Sets/updates the staking reader contract.
|
179
|
+
function setStakingReader(address stakingReader) external;
|
180
|
+
|
181
|
+
// TODO rename TargetManager to something without manager (manager reserved for upgradeable stuff)
|
182
|
+
/// @dev Sets/updates the target manager contract.
|
183
|
+
function setTargetManager(address targetManager) external;
|
184
|
+
|
185
|
+
/// @dev Registers a token for recording staking rate and total value locked.
|
186
|
+
function addToken(ChainId chainId, address token) external;
|
187
|
+
|
188
|
+
/// @dev Set the approval to the token handler.
|
189
|
+
/// Defines the max allowance from the staking wallet to the token handler.
|
80
190
|
function approveTokenHandler(IERC20Metadata token, Amount amount) external;
|
81
191
|
|
82
|
-
|
192
|
+
//--- only target owner functions ---------------------------------------//
|
83
193
|
|
84
|
-
/// @dev
|
85
|
-
///
|
86
|
-
function
|
194
|
+
/// @dev (Re)fills the staking reward reserves for the specified target
|
195
|
+
/// Unpermissioned: anybody may fill up staking reward reserves
|
196
|
+
function refillRewardReserves(NftId targetNftId, Amount dipAmount) external returns (Amount newBalance);
|
87
197
|
|
198
|
+
/// @dev Defunds the staking reward reserves for the specified target
|
199
|
+
/// Permissioned: only the owner may call this function
|
200
|
+
function withdrawRewardReserves(NftId targetNftId, Amount dipAmount) external returns (Amount newBalance);
|
88
201
|
|
89
|
-
|
202
|
+
//--- target management -------------------------------------------------//
|
90
203
|
|
204
|
+
/// @dev Register a new target for staking.
|
205
|
+
/// Permissioned: only the staking service may call this function
|
91
206
|
function registerTarget(
|
92
207
|
NftId targetNftId,
|
93
208
|
ObjectType expectedObjectType,
|
94
|
-
uint256 chainId,
|
95
209
|
Seconds initialLockingPeriod,
|
96
210
|
UFixed initialRewardRate
|
97
211
|
) external;
|
98
212
|
|
99
213
|
|
100
|
-
/// @dev
|
101
|
-
///
|
214
|
+
/// @dev Set the stake locking period to the specified duration.
|
215
|
+
/// Permissioned: only the staking service may call this function
|
102
216
|
function setLockingPeriod(NftId targetNftId, Seconds lockingPeriod) external;
|
103
217
|
|
104
|
-
/// @dev
|
105
|
-
///
|
218
|
+
/// @dev Update the target specific reward rate.
|
219
|
+
/// Permissioned: only the staking service may call this function
|
106
220
|
function setRewardRate(NftId targetNftId, UFixed rewardRate) external;
|
107
221
|
|
108
|
-
/// @dev
|
109
|
-
///
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
/// unpermissioned: anybody may fill up staking reward reserves
|
114
|
-
function refillRewardReserves(NftId targetNftId, Amount dipAmount) external returns (Amount newBalance);
|
222
|
+
/// @dev Set the staking limits for the specified target.
|
223
|
+
/// The margin amount allows staker to stake over the current required stakes by this amount.
|
224
|
+
/// The limit amount restricts stakers to ever stake more than this amount.
|
225
|
+
/// Permissioned: only the target owner may call this function
|
226
|
+
function setTargetLimits(NftId targetNftId, Amount marginAmount, Amount limitAmount) external;
|
115
227
|
|
116
|
-
|
117
|
-
///
|
118
|
-
|
228
|
+
// TODO refactor this into new setStakingLimits
|
229
|
+
/// @dev Set the maximum staked amount for the specified target.
|
230
|
+
/// Permissioned: only the staking service may call this function
|
231
|
+
function setMaxStakedAmount(NftId targetNftId, Amount stakeLimitAmount) external;
|
119
232
|
|
233
|
+
/// @dev Register a token for the specified target.
|
234
|
+
/// Used for instance targets. Each product may introduce its own token.
|
235
|
+
/// Permissioned: only the staking service may call this function
|
236
|
+
function addTargetToken(NftId targetNftId, address token) external;
|
120
237
|
|
121
|
-
/// @dev
|
238
|
+
/// @dev Increases the total value locked amount for the specified target by the provided token amount.
|
122
239
|
/// function is called when a new policy is collateralized.
|
123
240
|
/// function restricted to the pool service.
|
124
241
|
function increaseTotalValueLocked(NftId targetNftId, address token, Amount amount) external returns (Amount newBalance);
|
125
242
|
|
126
|
-
|
127
|
-
/// @dev decreases the total value locked amount for the specified target by the provided token amount.
|
243
|
+
/// @dev Decreases the total value locked amount for the specified target by the provided token amount.
|
128
244
|
/// function is called when a new policy is closed or payouts are executed.
|
129
245
|
/// function restricted to the pool service.
|
130
246
|
function decreaseTotalValueLocked(NftId targetNftId, address token, Amount amount) external returns (Amount newBalance);
|
@@ -132,45 +248,51 @@ interface IStaking is
|
|
132
248
|
|
133
249
|
function updateRemoteTvl(NftId targetNftId, address token, Amount amount) external;
|
134
250
|
|
135
|
-
|
251
|
+
//--- service interaction functions -------------------------------------//
|
136
252
|
|
137
|
-
/// @dev
|
138
|
-
///
|
139
|
-
|
253
|
+
/// @dev Set the staking limits for the specified target.
|
254
|
+
/// Permissioned: only the staking service may call this function
|
255
|
+
// TODO implement
|
256
|
+
// function setStakingLimitsByService(NftId targetNftId, Amount marginAmount, Amount limitAmount) external;
|
140
257
|
|
141
|
-
/// @dev
|
142
|
-
///
|
143
|
-
|
144
|
-
function stake(NftId stakeNftId, Amount dipAmount) external returns (Amount stakeBalance);
|
258
|
+
/// @dev (Re)fills the staking reward reserves for the specified target
|
259
|
+
/// Unpermissioned: anybody may fill up staking reward reserves
|
260
|
+
function refillRewardReservesByService(NftId targetNftId, Amount dipAmount, address transferFrom) external returns (Amount newBalance);
|
145
261
|
|
146
|
-
/// @dev
|
147
|
-
///
|
262
|
+
/// @dev Defunds the staking reward reserves for the specified target
|
263
|
+
/// Permissioned: only the owner may call this function
|
264
|
+
function withdrawRewardReservesByService(NftId targetNftId, Amount dipAmount, address transferTo) external returns (Amount newBalance);
|
265
|
+
|
266
|
+
//--- staking functions -------------------------------------------------//
|
267
|
+
|
268
|
+
/// @dev Creates a new stake to the specified target over the given DIP amount.
|
269
|
+
/// The stake owner is provided as an argument and becomes the stake NFT holder.
|
270
|
+
/// This function is permissionless and may be called by any user.
|
271
|
+
function createStake(NftId targetNftId, Amount dipAmount, address stakeOwner) external returns (NftId stakeNftId);
|
272
|
+
|
273
|
+
/// @dev Increase the staked DIP by dipAmount for the specified stake.
|
274
|
+
/// Staking rewards are updated and added to the staked DIP amount as well.
|
275
|
+
/// The function returns the new total amount of staked dips.
|
276
|
+
function stake(NftId stakeNftId, Amount dipAmount) external returns (Amount newStakeBalance);
|
277
|
+
|
278
|
+
/// @dev Pays the specified DIP amount to the holder of the stake NFT ID.
|
148
279
|
/// permissioned: only staking service may call this function.
|
149
|
-
function
|
280
|
+
function unstake(NftId stakeNftId) external returns (Amount unstakedAmount);
|
150
281
|
|
151
|
-
/// @dev
|
152
|
-
///
|
282
|
+
/// @dev restakes the dips to a new target.
|
283
|
+
/// the sum of the staked dips and the accumulated rewards will be restaked.
|
153
284
|
/// permissioned: only staking service may call this function.
|
154
|
-
function
|
155
|
-
external
|
156
|
-
returns (
|
157
|
-
Amount unstakedAmount,
|
158
|
-
Amount rewardsClaimedAmount
|
159
|
-
);
|
285
|
+
function restake(NftId stakeNftId, NftId newTargetNftId) external returns (NftId newStakeNftId, Amount newStakeBalance);
|
160
286
|
|
161
287
|
/// @dev update stake rewards for current time.
|
162
288
|
/// may be called before an announement of a decrease of a reward rate reduction.
|
163
289
|
/// calling this functions ensures that reward balance is updated using the current (higher) reward rate.
|
164
290
|
/// unpermissioned.
|
165
|
-
function updateRewards(NftId stakeNftId) external;
|
291
|
+
function updateRewards(NftId stakeNftId) external returns (Amount newRewardAmount);
|
166
292
|
|
167
293
|
/// @dev transfers all rewards accumulated so far to the holder of the specified stake nft.
|
168
294
|
/// permissioned: only staking service may call this function.
|
169
|
-
function claimRewards(NftId stakeNftId)
|
170
|
-
external
|
171
|
-
returns (
|
172
|
-
Amount rewardsClaimedAmount
|
173
|
-
);
|
295
|
+
function claimRewards(NftId stakeNftId) external returns (Amount rewardsClaimedAmount);
|
174
296
|
|
175
297
|
//--- view and pure functions -------------------------------------------//
|
176
298
|
|
@@ -3,9 +3,10 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
5
|
|
6
|
-
import {Amount} from "../type/Amount.sol";
|
7
6
|
import {IService} from "../shared/IService.sol";
|
8
7
|
import {IStaking} from "./IStaking.sol";
|
8
|
+
|
9
|
+
import {Amount} from "../type/Amount.sol";
|
9
10
|
import {NftId} from "../type/NftId.sol";
|
10
11
|
import {Seconds} from "../type/Seconds.sol";
|
11
12
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
@@ -23,6 +24,7 @@ interface IStakingService is IService
|
|
23
24
|
event LogStakingServiceRewardReservesIncreased(NftId targetNftId, address rewardProvider, Amount dipAmount, Amount newBalance);
|
24
25
|
event LogStakingServiceRewardReservesDecreased(NftId targetNftId, address targetOwner, Amount dipAmount, Amount newBalance);
|
25
26
|
|
27
|
+
event LogStakingServiceStakeObjectCreated(NftId stakeNftId, NftId targetNftId, address stakeOwner);
|
26
28
|
event LogStakingServiceStakeCreated(NftId stakeNftId, NftId targetNftId, address owner, Amount stakedAmount);
|
27
29
|
event LogStakingServiceStakeIncreased(NftId stakeNftId, address owner, Amount stakedAmount, Amount stakeBalance);
|
28
30
|
event LogStakingServiceUnstaked(NftId stakeNftId, address stakeOwner, Amount totalAmount);
|
@@ -44,22 +46,10 @@ interface IStakingService is IService
|
|
44
46
|
error ErrorStakingServiceDipBalanceInsufficient(NftId targetNftId, uint256 amount, uint256 balance);
|
45
47
|
error ErrorStakingServiceDipAllowanceInsufficient(NftId targetNftId, address tokenHandler, uint256 amount, uint256 allowance);
|
46
48
|
|
47
|
-
|
48
|
-
/// Permissioned: only staking owner
|
49
|
-
// TODO implement
|
50
|
-
// function setProtocolRewardRate(UFixed rewardRate) external;
|
51
|
-
// function setProtocolLockingPeriod(Seconds lockingPeriod) external;
|
52
|
-
// TODO also make sure that protocol rewards can be refilled and withdrawn
|
53
|
-
|
54
|
-
/// @dev Approves the staking token handler.
|
55
|
-
/// Reverts if the staking token handler wallet is not the token handler itself.
|
56
|
-
function approveTokenHandler(
|
57
|
-
IERC20Metadata token,
|
58
|
-
Amount amount
|
59
|
-
) external;
|
49
|
+
//--- functions for instance service -----------------------------------------------//
|
60
50
|
|
61
|
-
/// @dev
|
62
|
-
///
|
51
|
+
/// @dev Creates/registers an on-chain instance staking target.
|
52
|
+
/// Permissioned: Only instance service
|
63
53
|
function createInstanceTarget(
|
64
54
|
NftId targetNftId,
|
65
55
|
Seconds initialLockingPeriod,
|
@@ -67,96 +57,58 @@ interface IStakingService is IService
|
|
67
57
|
) external;
|
68
58
|
|
69
59
|
/// @dev Set the instance stake locking period to the specified duration.
|
70
|
-
/// Permissioned: Only
|
60
|
+
/// Permissioned: Only instance service
|
71
61
|
function setInstanceLockingPeriod(NftId instanceNftId, Seconds lockingPeriod) external;
|
72
62
|
|
73
63
|
/// @dev Set the instance reward rate to the specified value.
|
74
|
-
/// Permissioned: Only
|
64
|
+
/// Permissioned: Only instance service
|
75
65
|
function setInstanceRewardRate(NftId instanceNftId, UFixed rewardRate) external;
|
76
66
|
|
77
67
|
/// @dev Set the instance max staked amount to the specified value.
|
78
|
-
/// Permissioned: Only
|
68
|
+
/// Permissioned: Only instance service
|
79
69
|
function setInstanceMaxStakedAmount(NftId instanceNftId, Amount maxStakingAmount) external;
|
80
70
|
|
81
71
|
/// @dev (Re)fills the staking reward reserves for the specified target using the dips provided by the reward provider.
|
82
|
-
///
|
72
|
+
/// Permissioned: Only instance service
|
83
73
|
function refillInstanceRewardReserves(NftId instanceNftId, address rewardProvider, Amount dipAmount) external returns (Amount newBalance);
|
84
74
|
|
85
|
-
/// @dev (Re)fills the staking reward reserves for the specified target using the dips provided by the sender
|
86
|
-
/// unpermissioned: anybody may fill up staking reward reserves
|
87
|
-
function refillRewardReservesBySender(NftId targetNftId, Amount dipAmount) external returns (Amount newBalance);
|
88
|
-
|
89
75
|
/// @dev Defunds the staking reward reserves for the specified target
|
90
|
-
/// Permissioned:
|
76
|
+
/// Permissioned: Only instance service
|
91
77
|
function withdrawInstanceRewardReserves(NftId instanceNftId, Amount dipAmount) external returns (Amount newBalance);
|
92
78
|
|
93
|
-
/// @dev
|
94
|
-
///
|
95
|
-
|
96
|
-
function create(
|
79
|
+
/// @dev Sets total value locked data for a target contract on a different chain.
|
80
|
+
/// this is done via CCIP (cross chain communication)
|
81
|
+
function setTotalValueLocked(
|
97
82
|
NftId targetNftId,
|
83
|
+
address token,
|
98
84
|
Amount amount
|
99
|
-
)
|
100
|
-
external
|
101
|
-
returns (
|
102
|
-
NftId stakeNftId
|
103
|
-
);
|
104
|
-
|
105
|
-
|
106
|
-
/// @dev increase an existing stake by amount DIP
|
107
|
-
/// updates and restakes the staking reward amount
|
108
|
-
/// function restricted to the current stake owner
|
109
|
-
function stake(
|
110
|
-
NftId stakeNftId,
|
111
|
-
Amount amount
|
112
|
-
)
|
113
|
-
external;
|
114
|
-
|
115
|
-
|
116
|
-
/// @dev re-stakes the current staked DIP as well as all accumulated rewards to the new stake target.
|
117
|
-
/// all related stakes and all accumulated reward DIP are transferred to the current stake holder
|
118
|
-
/// function restricted to the current stake owner
|
119
|
-
function restakeToNewTarget(
|
120
|
-
NftId stakeNftId,
|
121
|
-
NftId newTargetNftId
|
122
|
-
)
|
123
|
-
external
|
124
|
-
returns (
|
125
|
-
NftId newStakeNftId,
|
126
|
-
Amount newStakeBalance
|
127
|
-
);
|
128
|
-
|
129
|
-
|
130
|
-
/// @dev updates the reward balance of the stake using the current reward rate.
|
131
|
-
function updateRewards(
|
132
|
-
NftId stakeNftId
|
133
|
-
)
|
134
|
-
external;
|
135
|
-
|
85
|
+
) external;
|
136
86
|
|
137
|
-
|
138
|
-
function claimRewards(
|
139
|
-
NftId stakeNftId
|
140
|
-
)
|
141
|
-
external;
|
87
|
+
//--- functions for staking component ---------------------------------------------//
|
142
88
|
|
89
|
+
/// @dev Creates a new stake object for the specified target via the registry service.
|
90
|
+
/// Permissioned: only the staking component may call this function
|
91
|
+
function createStakeObject(
|
92
|
+
NftId targetNftId,
|
93
|
+
address initialOwner
|
94
|
+
) external returns (NftId stakeNftId);
|
143
95
|
|
144
|
-
/// @dev
|
145
|
-
///
|
146
|
-
function
|
147
|
-
NftId stakeNftId
|
148
|
-
)
|
149
|
-
external;
|
96
|
+
/// @dev Collect DIP token from stake owner.
|
97
|
+
/// Permissioned: only the staking component may call this function
|
98
|
+
function pullDipToken(Amount dipAmount, address stakeOwner) external;
|
150
99
|
|
100
|
+
/// @dev Transfer DIP token to stake owner.
|
101
|
+
/// Permissioned: only the staking component may call this function
|
102
|
+
function pushDipToken(Amount dipAmount, address stakeOwner) external;
|
151
103
|
|
152
|
-
/// @dev
|
153
|
-
///
|
154
|
-
function
|
155
|
-
|
156
|
-
address token,
|
104
|
+
/// @dev Approves the staking token handler.
|
105
|
+
/// Permissioned: only the staking component may call this function
|
106
|
+
function approveTokenHandler(
|
107
|
+
IERC20Metadata token,
|
157
108
|
Amount amount
|
158
|
-
)
|
159
|
-
|
109
|
+
) external;
|
110
|
+
|
111
|
+
//--- view functions --------------------------------------------------------------//
|
160
112
|
|
161
113
|
function getDipToken()
|
162
114
|
external
|
@@ -0,0 +1,28 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {Amount} from "../type/Amount.sol";
|
5
|
+
import {NftId} from "../type/NftId.sol";
|
6
|
+
|
7
|
+
interface ITargetManager {
|
8
|
+
|
9
|
+
//--- functions ---------------------------------------------------------//
|
10
|
+
|
11
|
+
/// @dev Updates the target limit.
|
12
|
+
/// The target limit defines the maximum stake amount for the target NFT ID.
|
13
|
+
function updateLimit(
|
14
|
+
NftId targetNftId
|
15
|
+
) external returns (Amount stakeLimitAmount);
|
16
|
+
|
17
|
+
|
18
|
+
//--- view functions ----------------------------------------------------//
|
19
|
+
|
20
|
+
/// @dev Returns true iff the target limit update is required.
|
21
|
+
function isLimitUpdateRequired(
|
22
|
+
NftId targetNftId,
|
23
|
+
address token,
|
24
|
+
uint16 tvlUpdatesCount,
|
25
|
+
Amount baselineTvlAmount,
|
26
|
+
Amount currentTvlAmount
|
27
|
+
) external view returns (bool updateIsRequired);
|
28
|
+
}
|