Skip to content

Commit 3d65320

Browse files
author
francois branciard
committed
issue #34 the variable names workerReward and workersReward are confusingly similar
1 parent fe6cbec commit 3d65320

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

contracts/WorkerPool.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ contract WorkerPool is OwnableOZ, IexecHubAccessor, MarketplaceAccessor
420420
uint256 workerBonus;
421421
uint256 workerWeight;
422422
uint256 totalWeight;
423-
uint256 workerReward;
423+
uint256 individualWorkerReward;
424424
uint256 totalReward = _consensus.poolReward;
425425
address[] memory contributors = _consensus.contributors;
426426
for (i = 0; i<contributors.length; ++i)
@@ -442,17 +442,17 @@ contract WorkerPool is OwnableOZ, IexecHubAccessor, MarketplaceAccessor
442442
require(totalWeight > 0);
443443

444444
// compute how much is going to the workers
445-
uint256 workersReward = totalReward.percentage(uint256(100).sub(_consensus.schedulerRewardRatioPolicy));
445+
uint256 totalWorkersReward = totalReward.percentage(uint256(100).sub(_consensus.schedulerRewardRatioPolicy));
446446

447447
for (i = 0; i<contributors.length; ++i)
448448
{
449449
w = contributors[i];
450450
if (m_contributions[_woid][w].status == IexecLib.ContributionStatusEnum.PROVED)
451451
{
452-
workerReward = workersReward.mulByFraction(m_contributions[_woid][w].weight, totalWeight);
453-
totalReward = totalReward.sub(workerReward);
452+
individualWorkerReward = totalWorkersReward.mulByFraction(m_contributions[_woid][w].weight, totalWeight);
453+
totalReward = totalReward.sub(individualWorkerReward);
454454
require(iexecHubInterface.unlockForWork(_woid, w, _consensus.stakeAmount));
455-
require(iexecHubInterface.rewardForWork(_woid, w, workerReward, true));
455+
require(iexecHubInterface.rewardForWork(_woid, w, individualWorkerReward, true));
456456
}
457457
else // WorkStatusEnum.POCO_REJECT or ContributionStatusEnum.CONTRIBUTED (not revealed)
458458
{

0 commit comments

Comments
 (0)