clarify code related to VP author rewards
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 33s Details

This commit is contained in:
Ladd Hoffman 2024-04-16 19:13:03 -05:00
parent 999ce51208
commit aedb6d3008
1 changed files with 6 additions and 5 deletions

View File

@ -230,9 +230,6 @@ contract ValidationPools is Reputation, Forum {
// Here we assume a stakeForAuthor ratio of 0.5
// TODO: Make stakeForAuthor an adjustable parameter
totalRewards += pool.minted / 2;
if (pool.minted % 2 != 0) {
totalRewards += 1;
}
// Include the losign portion of the VP initial stake
// Issue rewards to the winners
for (uint i = 0; i < pool.stakeCount; i++) {
@ -250,9 +247,13 @@ contract ValidationPools is Reputation, Forum {
}
// Due to rounding, there may be some excess REP. Award it to the author.
uint remainder = totalRewards - totalAllocated;
uint reward = pool.minted / 2 + remainder;
if (pool.minted % 2 != 0) {
// We staked the odd remainder in favor of the post, on behalf of the author.
reward += 1;
}
// Transfer REP to the forum instead of to the author directly
_onValidatePost(pool.postIndex, pool.minted / 2 + remainder);
_onValidatePost(pool.postIndex, reward);
} else {
// If vote does not pass, divide the losing stake among the winners
totalRewards += pool.minted;