File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/horizon/contracts/staking Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -268,11 +268,11 @@ abstract contract HorizonStakingBase is
268
268
* TODO: update the calculation after the transition period.
269
269
*/
270
270
function _getIdleStake (address _serviceProvider ) internal view returns (uint256 ) {
271
- return
272
- _serviceProviders[_serviceProvider].tokensStaked -
273
- _serviceProviders[_serviceProvider].tokensProvisioned -
274
- _serviceProviders[_serviceProvider].__DEPRECATED_tokensAllocated -
271
+ uint256 tokensUsed = _serviceProviders[_serviceProvider].tokensProvisioned +
272
+ _serviceProviders[_serviceProvider].__DEPRECATED_tokensAllocated +
275
273
_serviceProviders[_serviceProvider].__DEPRECATED_tokensLocked;
274
+ uint256 tokensStaked = _serviceProviders[_serviceProvider].tokensStaked;
275
+ return tokensStaked > tokensUsed ? tokensStaked - tokensUsed : 0 ;
276
276
}
277
277
278
278
/**
You can’t perform that action at this time.
0 commit comments