Merge pull request #2247 from 0xProject/fix/3.0-audit/staking/shadowed-variable
fix `_computeUnfinalizedDelegatorReward()` shadowed variable and function mutability
This commit is contained in:
		@@ -314,18 +314,18 @@ contract MixinStakingPoolRewards is
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /// @dev Computes the unfinalized rewards earned by a delegator in the last epoch.
 | 
					    /// @dev Computes the unfinalized rewards earned by a delegator in the last epoch.
 | 
				
			||||||
    /// @param unsyncedStake Unsynced delegated stake to pool by staker
 | 
					    /// @param unsyncedStake Unsynced delegated stake to pool by staker
 | 
				
			||||||
    /// @param currentEpoch The epoch in which this call is executing
 | 
					    /// @param currentEpoch_ The epoch in which this call is executing
 | 
				
			||||||
    /// @param unfinalizedMembersReward Unfinalized total members reward (if any).
 | 
					    /// @param unfinalizedMembersReward Unfinalized total members reward (if any).
 | 
				
			||||||
    /// @param unfinalizedMembersStake Unfinalized total members stake (if any).
 | 
					    /// @param unfinalizedMembersStake Unfinalized total members stake (if any).
 | 
				
			||||||
    /// @return reward Balance in WETH.
 | 
					    /// @return reward Balance in WETH.
 | 
				
			||||||
    function _computeUnfinalizedDelegatorReward(
 | 
					    function _computeUnfinalizedDelegatorReward(
 | 
				
			||||||
        IStructs.StoredBalance memory unsyncedStake,
 | 
					        IStructs.StoredBalance memory unsyncedStake,
 | 
				
			||||||
        uint256 currentEpoch,
 | 
					        uint256 currentEpoch_,
 | 
				
			||||||
        uint256 unfinalizedMembersReward,
 | 
					        uint256 unfinalizedMembersReward,
 | 
				
			||||||
        uint256 unfinalizedMembersStake
 | 
					        uint256 unfinalizedMembersStake
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
        private
 | 
					        private
 | 
				
			||||||
        view
 | 
					        pure
 | 
				
			||||||
        returns (uint256)
 | 
					        returns (uint256)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        // If there are unfinalized rewards this epoch, compute the member's
 | 
					        // If there are unfinalized rewards this epoch, compute the member's
 | 
				
			||||||
@@ -335,8 +335,8 @@ contract MixinStakingPoolRewards is
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Unfinalized rewards are always earned from stake in
 | 
					        // Unfinalized rewards are always earned from stake in
 | 
				
			||||||
        // the prior epoch so we want the stake at `currentEpoch-1`.
 | 
					        // the prior epoch so we want the stake at `currentEpoch_-1`.
 | 
				
			||||||
        uint256 unfinalizedStakeBalance = unsyncedStake.currentEpoch >= currentEpoch.safeSub(1) ?
 | 
					        uint256 unfinalizedStakeBalance = unsyncedStake.currentEpoch >= currentEpoch_.safeSub(1) ?
 | 
				
			||||||
            unsyncedStake.currentEpochBalance :
 | 
					            unsyncedStake.currentEpochBalance :
 | 
				
			||||||
            unsyncedStake.nextEpochBalance;
 | 
					            unsyncedStake.nextEpochBalance;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user