Assessment reports>Aura Finance>Threat Models>Function: earmarkRewards(uint256 _pid)

Function: earmarkRewards(uint256 _pid)

Responsible for collecting the CRV from gauge and then redistributing to the correct place. Pays the caller a fee to process this.

The function is a thin wrapper for _earmarkRewards(_pid), which claims CRV from the staker, transfers idle CRV in the Booster to the treasury, and finally transfers it to the LP provider reward contract. Incentives (fees) are paid to the caller and the lockers reward contract.

Inputs

  • _pid

    • Control: Arbitrary.

    • Constraints: Must be a valid pool ID in poolInfo.

    • Impact: Decides which gauge to pull and redistribute CRV from.

Branches and code coverage (including function calls)

Intended branches

  • Earmark rewards.

  • Caller earns CRV.

  • Call when there are idle rewards to transfer to treasury.

Negative behavior

  • Call when pool is closed.

  • Call when stash is not set.

  • Call when there is nothing to earmark.

Zellic © 2024Back to top ↑