Assessment reports>Aura Finance>Threat Models>Function: deposit(uint256 _pid, uint256 _amount, bool _stake)

Function: deposit(uint256 _pid, uint256 _amount, bool _stake)

Deposits _amount to a gauge specified by _pid, then mints a DepositToken and optionally stakes it if _stake is true.

Inputs

  • _pid

    • Control: Arbitrary.

    • Constraints: Cannot specify a shut down pool. If _pid is not in the poolInfo array, the resulting empty struct will appear to be shut down.

    • Impact: Decides the pool to deposit to.

  • _amount

    • Control: Arbitrary.

    • Constraints: Cannot be more tokens than the user owns.

    • Impact: Decides the amount of tokens to deposit/stake.

  • _stake

    • Control: Arbitrary.

    • Constraints: Boolean.

    • Impact: Chooses if the amount should be sent to the rewards contract on behalf of the user.

Branches and code coverage (including function calls)

Intended branches

  • Deposit with stake.

  • Deposit without stake.

Negative behavior

  • Deposit while pool is shut down.

  • Deposit while full shutdown is in effect.

  • Deposit to a gauge with incorrect settings (addr=0).

  • Deposit to a pool without a configured stash.

Zellic © 2024Back to top ↑