@@ -26,6 +26,9 @@ contract IexecHub
2626 address public tokenAddress;
2727
2828 uint256 public constant STAKE_BONUS_RATIO = 10 ;
29+ uint256 public constant STAKE_BONUS_MIN_THRESHOLD = 1000 ;
30+
31+ uint256 public constant SCORE_UNITARY_SLASH = 50 ;
2932
3033 /**
3134 * Slaves contracts
@@ -367,14 +370,8 @@ contract IexecHub
367370 uint256 locked;
368371 (,locked) = checkBalance (this );
369372 if (locked > 0 ){
370- if (locked <= 10 ){
371- require (seize (this , locked));
372- require (reward (workerpoolOwner, locked));
373- }
374- else {
375- require (seize (this , locked.percentage (STAKE_BONUS_RATIO)));
376- require (reward (workerpoolOwner, locked.percentage (STAKE_BONUS_RATIO)));
377- }
373+ require (seize (this , locked.min (locked.percentage (STAKE_BONUS_RATIO).max (STAKE_BONUS_MIN_THRESHOLD))));
374+ require (reward (workerpoolOwner,locked.min (locked.percentage (STAKE_BONUS_RATIO).max (STAKE_BONUS_MIN_THRESHOLD))));
378375 }
379376
380377 emit WorkOrderCompleted (_woid, workorder.m_workerpool ());
@@ -519,7 +516,7 @@ contract IexecHub
519516 if (_reputation)
520517 {
521518 m_contributionHistory.failled = m_contributionHistory.failled.add (1 );
522- m_scores[_worker] = m_scores[_worker].sub (m_scores[_worker].min (50 ));
519+ m_scores[_worker] = m_scores[_worker].sub (m_scores[_worker].min (SCORE_UNITARY_SLASH ));
523520 emit FaultyContribution (_woid, _worker);
524521 }
525522 return true ;
0 commit comments