Skip to content

Commit

Permalink
Merge branch 'main' into protocol_release_tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey authored Jan 20, 2023
2 parents cb94fe3 + d696adf commit 6c80b5e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/protocol/contracts/L1/libs/LibVerifying.sol
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ library LibVerifying {
TkoToken tkoToken
) private {
uint refund = (target.deposit * (10000 - tRelBp)) / 10000;
if (refund > 0) {
if (refund > 0 && tkoToken.balanceOf(target.proposer) > 0) {
// Do not refund proposer with 0 TKO balance.
tkoToken.mint(target.proposer, refund);
}
}
Expand All @@ -160,8 +161,10 @@ library LibVerifying {
uint proverReward = (reward * weight) / sum;

if (tkoToken.balanceOf(fc.provers[i]) == 0) {
// reduce reward if the prover has 0 TKO balance.
proverReward /= 2;
// Reduce reward to 1 wei as a penalty if the prover
// has 0 TKO balance. This allows the next prover reward
// to be fully paid.
proverReward = uint256(1);
}
tkoToken.mint(fc.provers[i], proverReward);
}
Expand Down

0 comments on commit 6c80b5e

Please sign in to comment.