Function: getReward(address _account, address _token)
Allows msg.sender
to claim reward calculated using the user balance locked inside the auraLocker contract.
Inputs
_account
Control: Full control.
Constraints: Should have nonzero auraLocker balance.
Impact: The receiver of reward.
_token
Control: Full control.
Constraints: If tokens are not added using the
addReward
function, 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
,_account
received the reward.If
msg.sender == _account
,_account
received the reward.
Negative behavior
_account
is zero._token
is 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
.