Function: getReward(address _account, address _token)
Allows msg.sender to claim reward calculated using the user balance locked inside the auraLocker contract.
Inputs
_accountControl: Full control.
Constraints: Should have nonzero auraLocker balance.
Impact: The receiver of reward.
_tokenControl: Full control.
Constraints: If tokens are not added using the
addRewardfunction, the transaction will end without result.Impact: The address of reward token. It will be called to transfer reward amount.
Branches and code coverage (including function calls)
Intended branches
If
msg.sender != _account,_accountreceived the reward.If
msg.sender == _account,_accountreceived the reward.
Negative behavior
_accountis zero._tokenis zero.
Function call analysis
_getReward -> _allClaimableRewards(_account, _token, _startIndex)External/internal?: Internal.
Argument control?:
_account,_token, and_startIndex.Impact: Returns the amount of tokens available for claim and index of last rewarded epoch.
_getReward -> IERC20(_token).safeTransfer(_account, claimableTokens)External/internal?: External.
Argument control?:
_account.Impact: Transfer reward to the
_account.