Skip to content

Commit

Permalink
age Bug fixed (#517)
Browse files Browse the repository at this point in the history
* age Bug fixed

* proper datatype defined
  • Loading branch information
SamAg19 authored Oct 20, 2021
1 parent e034385 commit c24709f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contracts/Core/RewardManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ contract RewardManager is Initializable, ACL, Constants, IRewardManager {
stakeManager.setStakerAge(epoch, thisStaker.id, 0);
return;
}
uint32 age = thisStaker.age + 10000;
uint64 age = thisStaker.age + 10000;
// cap age to maxAge
uint32 maxAge = parameters.maxAge();
age = age > maxAge ? maxAge : age;
Expand All @@ -135,7 +135,7 @@ contract RewardManager is Initializable, ACL, Constants, IRewardManager {
uint64 penalty = 0;
for (uint8 i = 0; i < mediansLastEpoch.length; i++) {
// slither-disable-next-line calls-loop
uint48 voteValueLastEpoch = voteManager.getVoteValue(i, stakerId);
uint64 voteValueLastEpoch = voteManager.getVoteValue(i, stakerId);
// uint32 voteWeightLastEpoch = voteManager.getVoteWeight(thisStaker.id, i);
uint32 medianLastEpoch = mediansLastEpoch[i];
if (medianLastEpoch == 0) continue;
Expand All @@ -150,6 +150,6 @@ contract RewardManager is Initializable, ACL, Constants, IRewardManager {

age = penalty > age ? 0 : age - uint32(penalty);

stakeManager.setStakerAge(epoch, thisStaker.id, age);
stakeManager.setStakerAge(epoch, thisStaker.id, uint32(age));
}
}

0 comments on commit c24709f

Please sign in to comment.