Use safeMath where possible

This commit is contained in:
Amir Bandeali 2019-10-19 18:13:59 -07:00
parent 1885957bd3
commit a362e9d2d8
3 changed files with 3 additions and 3 deletions

View File

@ -97,7 +97,7 @@ contract MixinExchangeFees is
totalWeightedStakeThisEpoch = totalWeightedStakeThisEpoch.safeAdd(pool.weightedStake); totalWeightedStakeThisEpoch = totalWeightedStakeThisEpoch.safeAdd(pool.weightedStake);
// Increase the number of active pools. // Increase the number of active pools.
numActivePoolsThisEpoch += 1; numActivePoolsThisEpoch = numActivePoolsThisEpoch.safeAdd(1);
// Emit an event so keepers know what pools to pass into // Emit an event so keepers know what pools to pass into
// `finalize()`. // `finalize()`.

View File

@ -211,7 +211,7 @@ contract MixinStakingPoolRewards is
PPM_DENOMINATOR, PPM_DENOMINATOR,
totalReward totalReward
); );
membersReward = totalReward - operatorReward; membersReward = totalReward.safeSub(operatorReward);
} }
return (operatorReward, membersReward); return (operatorReward, membersReward);
} }

View File

@ -50,7 +50,7 @@ contract MixinFinalizer is
if (state.poolsRemaining != 0) { if (state.poolsRemaining != 0) {
LibRichErrors.rrevert( LibRichErrors.rrevert(
LibStakingRichErrors.PreviousEpochNotFinalizedError( LibStakingRichErrors.PreviousEpochNotFinalizedError(
closingEpoch - 1, closingEpoch.safeSub(1),
state.poolsRemaining state.poolsRemaining
) )
); );