Assessment reports>Aura Finance>Threat Models>Function: addReward(address _token, uint256 _amount)

Function: addReward(address _token, uint256 _amount)

Added reward tokens from the caller to the last epoch. The caller should be whitelisted by owner.

Inputs

  • _token

    • Control: Full control.

    • Constraints: No.

    • Impact: The reward token address.

  • _amount

    • Control: Full control.

    • Constraints: Caller should have enough amount of tokens to transfer.

    • Impact: The amount of reward tokens will be transferred.

Branches and code coverage (including function calls)

Intended branches

  • The balance of msg.sender was decreased by _amount.

  • The rewardData was updated properly.

Negative behavior

  • msg.sender is not whitelisted.

  • _token is zero.

  • _amount is zero.

Function call analysis

  • auraLocker.checkpointEpoch()

    • External/internal?: External.

    • Argument control?: N/A.

    • Impact: Added new checkpoint.

  • _addReward(_token, _amount, latestEpoch)

    • External/internal?: External.

    • Argument control?: _token and _amount.

    • Impact: Add reward to the last epoch.

Zellic © 2024Back to top ↑