This is FYI, not a real issue as you have expressed your interest in minor improvement suggestions (not security or gas related):
This code has too much duplication:
if (maintenanceStakePerBlock > currentStake) {
// skip
staker = nextMaintenanceStaker[staker];
currentStake = getMaintenanceStakerStake(staker);
} else {
startBlock += currentStake / maintenanceStakePerBlock;
staker = nextMaintenanceStaker[staker];
currentStake = getMaintenanceStakerStake(staker);
}
and can be refactored to:
Email address
pauliax6@gmail.com
Handle
paulius.eth
Eth address
0x523B5b2Cc58A818667C22c862930B141f85d49DD
Vulnerability details
This is FYI, not a real issue as you have expressed your interest in minor improvement suggestions (not security or gas related):
This code has too much duplication: if (maintenanceStakePerBlock > currentStake) { // skip staker = nextMaintenanceStaker[staker]; currentStake = getMaintenanceStakerStake(staker); } else { startBlock += currentStake / maintenanceStakePerBlock; staker = nextMaintenanceStaker[staker]; currentStake = getMaintenanceStakerStake(staker); } and can be refactored to:
if (maintenanceStakePerBlock <= currentStake) { startBlock += currentStake / maintenanceStakePerBlock; } staker = nextMaintenanceStaker[staker]; currentStake = getMaintenanceStakerStake(staker);