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
268268 * TODO: update the calculation after the transition period.
269269 */
270270 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 +
275273 _serviceProviders[_serviceProvider].__DEPRECATED_tokensLocked;
274+ uint256 tokensStaked = _serviceProviders[_serviceProvider].tokensStaked;
275+ return tokensStaked > tokensUsed ? tokensStaked - tokensUsed : 0 ;
276276 }
277277
278278 /**
You can’t perform that action at this time.
0 commit comments