@etherisc/gif-next 0.0.2-858f0b8-208 → 0.0.2-85e7957-019
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- 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/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +52 -22
- 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 +38 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +2 -2
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +2 -2
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- 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/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +2 -2
- 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 +2 -2
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +77 -58
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +2 -2
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +2 -2
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2 -2
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +46 -16
- 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/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +38 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +2 -2
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +2 -2
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +38 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +2 -2
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +74 -98
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +38 -50
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +38 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +2 -2
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +2 -2
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +2 -2
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +2 -2
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +38 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +2 -2
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +2 -2
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +2 -2
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +2 -2
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +2 -2
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +2 -2
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +2 -2
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +38 -0
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +2 -2
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +2 -2
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +2 -2
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +2 -2
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.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 +2 -2
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +2 -2
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +38 -0
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +58 -58
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +30 -30
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
- 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 +38 -0
- 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/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +2 -2
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +62 -32
- 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 +13 -17
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +22 -22
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +12 -12
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/distribution/DistributionService.sol +2 -1
- package/contracts/instance/InstanceReader.sol +8 -0
- package/contracts/pool/BundleService.sol +17 -12
- package/contracts/pool/IBundleService.sol +1 -1
- package/contracts/pool/PoolService.sol +6 -3
- package/contracts/shared/Component.sol +4 -4
- package/contracts/shared/ComponentService.sol +2 -1
- package/contracts/shared/IComponent.sol +3 -4
- package/contracts/staking/StakingService.sol +12 -8
- package/package.json +1 -1
@@ -298,9 +298,10 @@ contract DistributionService is
|
|
298
298
|
// transfer amount to distributor
|
299
299
|
{
|
300
300
|
address distributor = getRegistry().ownerOf(distributorNftId);
|
301
|
-
emit LogDistributionServiceCommissionWithdrawn(distributorNftId, distributor, address(token), withdrawnAmount);
|
302
301
|
// TODO: centralize token handling (issue #471)
|
303
302
|
distributionInfo.tokenHandler.transfer(distributionWallet, distributor, withdrawnAmount);
|
303
|
+
|
304
|
+
emit LogDistributionServiceCommissionWithdrawn(distributorNftId, distributor, address(token), withdrawnAmount);
|
304
305
|
}
|
305
306
|
}
|
306
307
|
|
@@ -85,6 +85,14 @@ contract InstanceReader {
|
|
85
85
|
return _store.getState(toPolicyKey(policyNftId));
|
86
86
|
}
|
87
87
|
|
88
|
+
function getBundleState(NftId bundleNftId)
|
89
|
+
public
|
90
|
+
view
|
91
|
+
returns (StateId state)
|
92
|
+
{
|
93
|
+
return _store.getState(toBundleKey(bundleNftId));
|
94
|
+
}
|
95
|
+
|
88
96
|
/// @dev returns true iff policy may be closed
|
89
97
|
/// a policy can be closed all conditions below are met
|
90
98
|
/// - policy exists
|
@@ -113,13 +113,15 @@ contract BundleService is
|
|
113
113
|
InstanceStore instanceStore = instance.getInstanceStore();
|
114
114
|
instanceStore.createBundle(
|
115
115
|
bundleNftId,
|
116
|
-
IBundle.BundleInfo(
|
117
|
-
poolNftId,
|
118
|
-
bundleFee,
|
119
|
-
filter,
|
120
|
-
TimestampLib.blockTimestamp(),
|
121
|
-
TimestampLib.blockTimestamp().addSeconds(lifetime),
|
122
|
-
zeroTimestamp()
|
116
|
+
IBundle.BundleInfo({
|
117
|
+
poolNftId: poolNftId,
|
118
|
+
fee: bundleFee,
|
119
|
+
filter: filter,
|
120
|
+
activatedAt: TimestampLib.blockTimestamp(),
|
121
|
+
expiredAt: TimestampLib.blockTimestamp().addSeconds(lifetime),
|
122
|
+
closedAt: zeroTimestamp()
|
123
|
+
})
|
124
|
+
);
|
123
125
|
|
124
126
|
// bundle book keeping
|
125
127
|
_componentService.increaseBundleBalance(
|
@@ -148,7 +150,7 @@ contract BundleService is
|
|
148
150
|
restricted()
|
149
151
|
{
|
150
152
|
InstanceReader instanceReader = instance.getInstanceReader();
|
151
|
-
StateId bundleState =
|
153
|
+
StateId bundleState = instance.getInstanceReader().getBundleState(bundleNftId);
|
152
154
|
IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
|
153
155
|
|
154
156
|
// ensure bundle is active and not yet expired
|
@@ -244,9 +246,11 @@ contract BundleService is
|
|
244
246
|
// TODO: restricted() (once #462 is done)
|
245
247
|
{
|
246
248
|
IBundle.BundleInfo memory bundleInfo = instance.getInstanceReader().getBundleInfo(bundleNftId);
|
247
|
-
StateId bundleState = instance.getInstanceReader().
|
249
|
+
StateId bundleState = instance.getInstanceReader().getBundleState(bundleNftId);
|
248
250
|
|
249
|
-
if(bundleState != ACTIVE()
|
251
|
+
if( (bundleState != ACTIVE() && bundleState != PAUSED()) // locked bundles can be staked
|
252
|
+
|| bundleInfo.expiredAt < TimestampLib.blockTimestamp()
|
253
|
+
|| bundleInfo.closedAt.gtz()) {
|
250
254
|
revert ErrorBundleServiceBundleNotOpen(bundleNftId, bundleState, bundleInfo.expiredAt);
|
251
255
|
}
|
252
256
|
|
@@ -306,7 +310,7 @@ contract BundleService is
|
|
306
310
|
{
|
307
311
|
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
308
312
|
IBundle.BundleInfo memory bundleInfo = instance.getInstanceReader().getBundleInfo(bundleNftId);
|
309
|
-
StateId bundleState = instance.getInstanceReader().
|
313
|
+
StateId bundleState = instance.getInstanceReader().getBundleState(bundleNftId);
|
310
314
|
|
311
315
|
// ensure bundle belongs to the pool
|
312
316
|
if (bundleInfo.poolNftId != poolNftId) {
|
@@ -409,9 +413,10 @@ contract BundleService is
|
|
409
413
|
// transfer amount to bundle owner
|
410
414
|
{
|
411
415
|
address owner = getRegistry().ownerOf(bundleNftId);
|
412
|
-
emit LogBundleServiceFeesWithdrawn(bundleNftId, owner, address(token), withdrawnAmount);
|
413
416
|
// TODO: centralize token handling (issue #471)
|
414
417
|
poolInfo.tokenHandler.transfer(poolWallet, owner, withdrawnAmount);
|
418
|
+
|
419
|
+
emit LogBundleServiceFeesWithdrawn(bundleNftId, owner, address(token), withdrawnAmount);
|
415
420
|
}
|
416
421
|
}
|
417
422
|
|
@@ -52,7 +52,7 @@ interface IBundleService is IService {
|
|
52
52
|
returns(NftId bundleNftId); // the nft id of the newly created bundle
|
53
53
|
|
54
54
|
|
55
|
-
/// @dev increase bundle stakes by the specified amount
|
55
|
+
/// @dev increase bundle stakes by the specified amount. bundle must not be expired or closed
|
56
56
|
/// may only be called by the pool service
|
57
57
|
function stake(IInstance instance, NftId bundleNftId, Amount amount) external;
|
58
58
|
|
@@ -128,7 +128,7 @@ contract PoolService is
|
|
128
128
|
_getStakingFee(instance.getInstanceReader(), poolNftId),
|
129
129
|
stakingAmount);
|
130
130
|
|
131
|
-
// TODO: staking amount must be be > maxCapitalAmount
|
131
|
+
// TODO: (staking amount + existing pool balance) must be be > maxCapitalAmount
|
132
132
|
|
133
133
|
bundleNftId = _bundleService.create(
|
134
134
|
instance,
|
@@ -222,12 +222,13 @@ contract PoolService is
|
|
222
222
|
|
223
223
|
// collect tokens from bundle owner
|
224
224
|
address bundleOwner = getRegistry().ownerOf(bundleNftId);
|
225
|
-
emit LogPoolServiceBundleStaked(instance.getNftId(), poolNftId, bundleNftId, amount, netAmount);
|
226
225
|
_collectStakingAmount(
|
227
226
|
instanceReader,
|
228
227
|
poolNftId,
|
229
228
|
bundleOwner,
|
230
229
|
amount);
|
230
|
+
|
231
|
+
emit LogPoolServiceBundleStaked(instance.getNftId(), poolNftId, bundleNftId, amount, netAmount);
|
231
232
|
}
|
232
233
|
|
233
234
|
/// @inheritdoc IPoolService
|
@@ -279,9 +280,11 @@ contract PoolService is
|
|
279
280
|
|
280
281
|
// transfer amount to bundle owner
|
281
282
|
address owner = getRegistry().ownerOf(bundleNftId);
|
282
|
-
emit LogPoolServiceBundleUnstaked(instance.getNftId(), poolNftId, bundleNftId, unstakedAmount);
|
283
283
|
// TODO: centralize token handling (issue #471)
|
284
284
|
poolComponentInfo.tokenHandler.transfer(poolWallet, owner, unstakedAmount);
|
285
|
+
|
286
|
+
emit LogPoolServiceBundleUnstaked(instance.getNftId(), poolNftId, bundleNftId, unstakedAmount);
|
287
|
+
|
285
288
|
return unstakedAmount;
|
286
289
|
}
|
287
290
|
|
@@ -6,7 +6,7 @@ import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessMana
|
|
6
6
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
7
7
|
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
8
8
|
|
9
|
-
import {Amount
|
9
|
+
import {Amount} from "../type/Amount.sol";
|
10
10
|
import {IComponent} from "./IComponent.sol";
|
11
11
|
import {IComponents} from "../instance/module/IComponents.sol";
|
12
12
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
@@ -132,7 +132,7 @@ abstract contract Component is
|
|
132
132
|
// move tokens from component smart contract to external wallet
|
133
133
|
} else {
|
134
134
|
// move tokens from external wallet to component smart contract or another external wallet
|
135
|
-
uint256 allowance = token.allowance(currentWallet, address(
|
135
|
+
uint256 allowance = token.allowance(currentWallet, address(this));
|
136
136
|
if (allowance < currentBalance) {
|
137
137
|
revert ErrorComponentWalletAllowanceTooSmall(currentWallet, newWallet, allowance, currentBalance);
|
138
138
|
}
|
@@ -147,11 +147,11 @@ abstract contract Component is
|
|
147
147
|
// transfer tokens from current wallet to new wallet
|
148
148
|
if (currentWallet == address(this)) {
|
149
149
|
// transferFrom requires self allowance too
|
150
|
-
token.approve(address(
|
150
|
+
token.approve(address(this), currentBalance);
|
151
151
|
}
|
152
152
|
|
153
|
+
SafeERC20.safeTransferFrom(token, currentWallet, newWallet, currentBalance);
|
153
154
|
emit LogComponentWalletTokensTransferred(currentWallet, newWallet, currentBalance);
|
154
|
-
getTokenHandler().transfer(currentWallet, newWallet, AmountLib.toAmount(currentBalance));
|
155
155
|
}
|
156
156
|
}
|
157
157
|
|
@@ -128,9 +128,10 @@ contract ComponentService is
|
|
128
128
|
|
129
129
|
// transfer amount to component owner
|
130
130
|
address componentOwner = getRegistry().ownerOf(componentNftId);
|
131
|
-
emit LogComponentServiceComponentFeesWithdrawn(componentNftId, componentOwner, address(token), withdrawnAmount);
|
132
131
|
// TODO: centralize token handling (issue #471)
|
133
132
|
tokenHandler.transfer(componentWallet, componentOwner, withdrawnAmount);
|
133
|
+
|
134
|
+
emit LogComponentServiceComponentFeesWithdrawn(componentNftId, componentOwner, address(token), withdrawnAmount);
|
134
135
|
}
|
135
136
|
|
136
137
|
|
@@ -35,11 +35,10 @@ interface IComponent is
|
|
35
35
|
/// only component owner (nft holder) is authorizes to call this function
|
36
36
|
function approveTokenHandler(Amount spendingLimitAmount) external;
|
37
37
|
|
38
|
-
/// @dev sets the wallet address for the component
|
39
|
-
/// if the current wallet has tokens, these will be transferred
|
38
|
+
/// @dev sets the wallet address for the component
|
39
|
+
/// if the current wallet has tokens, these will be transferred
|
40
40
|
/// if the new wallet address is externally owned, an approval from the
|
41
|
-
/// owner of the external wallet
|
42
|
-
/// covers the current component balance must exist
|
41
|
+
/// owner of the external wallet for the component to move all tokens must exist
|
43
42
|
function setWallet(address walletAddress) external;
|
44
43
|
|
45
44
|
/// @dev returns the name of this component
|
@@ -122,10 +122,11 @@ contract StakingService is
|
|
122
122
|
|
123
123
|
// transfer withdrawal amount to target owner
|
124
124
|
address instanceOwner = getRegistry().ownerOf(instanceNftId);
|
125
|
-
emit LogStakingServiceRewardReservesDecreased(instanceNftId, instanceOwner, dipAmount, newBalance);
|
126
125
|
$._staking.transferDipAmount(
|
127
126
|
instanceOwner,
|
128
127
|
dipAmount);
|
128
|
+
|
129
|
+
emit LogStakingServiceRewardReservesDecreased(instanceNftId, instanceOwner, dipAmount, newBalance);
|
129
130
|
}
|
130
131
|
|
131
132
|
|
@@ -168,12 +169,12 @@ contract StakingService is
|
|
168
169
|
targetNftId,
|
169
170
|
dipAmount);
|
170
171
|
|
171
|
-
emit LogStakingServiceStakeCreated(stakeNftId, targetNftId, stakeOwner, dipAmount);
|
172
|
-
|
173
172
|
// collect staked dip by staking
|
174
173
|
$._staking.collectDipAmount(
|
175
174
|
stakeOwner,
|
176
175
|
dipAmount);
|
176
|
+
|
177
|
+
emit LogStakingServiceStakeCreated(stakeNftId, targetNftId, stakeOwner, dipAmount);
|
177
178
|
}
|
178
179
|
|
179
180
|
|
@@ -196,11 +197,12 @@ contract StakingService is
|
|
196
197
|
|
197
198
|
// collect staked dip by staking
|
198
199
|
if (dipAmount.gtz()) {
|
199
|
-
emit LogStakingServiceStakeIncreased(stakeNftId, stakeOwner, dipAmount, stakeBalance);
|
200
200
|
$._staking.collectDipAmount(
|
201
201
|
stakeOwner,
|
202
202
|
dipAmount);
|
203
203
|
}
|
204
|
+
|
205
|
+
emit LogStakingServiceStakeIncreased(stakeNftId, stakeOwner, dipAmount, stakeBalance);
|
204
206
|
}
|
205
207
|
|
206
208
|
|
@@ -245,10 +247,11 @@ contract StakingService is
|
|
245
247
|
address stakeOwner = msg.sender;
|
246
248
|
|
247
249
|
Amount rewardsClaimedAmount = $._staking.claimRewards(stakeNftId);
|
248
|
-
emit LogStakingServiceRewardsClaimed(stakeNftId, stakeOwner, rewardsClaimedAmount);
|
249
250
|
$._staking.transferDipAmount(
|
250
251
|
stakeOwner,
|
251
252
|
rewardsClaimedAmount);
|
253
|
+
|
254
|
+
emit LogStakingServiceRewardsClaimed(stakeNftId, stakeOwner, rewardsClaimedAmount);
|
252
255
|
}
|
253
256
|
|
254
257
|
|
@@ -267,10 +270,11 @@ contract StakingService is
|
|
267
270
|
) = $._staking.unstake(stakeNftId);
|
268
271
|
|
269
272
|
Amount totalAmount = unstakedAmount + rewardsClaimedAmount;
|
270
|
-
emit LogStakingServiceUnstaked(stakeNftId, stakeOwner, totalAmount);
|
271
273
|
$._staking.transferDipAmount(
|
272
274
|
stakeOwner,
|
273
275
|
totalAmount);
|
276
|
+
|
277
|
+
emit LogStakingServiceUnstaked(stakeNftId, stakeOwner, totalAmount);
|
274
278
|
}
|
275
279
|
|
276
280
|
|
@@ -385,12 +389,12 @@ contract StakingService is
|
|
385
389
|
StakingServiceStorage storage $ = _getStakingServiceStorage();
|
386
390
|
newBalance = $._staking.refillRewardReserves(targetNftId, dipAmount);
|
387
391
|
|
388
|
-
emit LogStakingServiceRewardReservesIncreased(targetNftId, rewardProvider, dipAmount, newBalance);
|
389
|
-
|
390
392
|
// collect reward dip from provider
|
391
393
|
$._staking.collectDipAmount(
|
392
394
|
rewardProvider,
|
393
395
|
dipAmount);
|
396
|
+
|
397
|
+
emit LogStakingServiceRewardReservesIncreased(targetNftId, rewardProvider, dipAmount, newBalance);
|
394
398
|
}
|
395
399
|
|
396
400
|
|
package/package.json
CHANGED