Assessment reports>Aura Finance>Threat Models>Function: addPool(address _lptoken, address _gauge, uint256 _stashVersion)

Function: addPool(address _lptoken, address _gauge, uint256 _stashVersion)

Creates all the contracts required for a new pool and adds them to the poolInfo list. Can only be called by the pool manager. The pool ID is a sequential number that corresponds to the index in the list. Note that the list can never remove items, so care should be taken to limit the number of pools added for loops that require going through every pool.

Inputs

  • _lptoken

    • Control: Arbitrary.

    • Constraints: Cannot be 0.

    • Impact: Decides which token to use in the pool.

  • _gauge

    • Control: Arbitrary.

    • Constraints: Must be some gauge that passes the version test in CreateStash.

    • Impact: Decides which gauge contracts to use in, for example, the stash.

  • _stashVersion

    • Control: Arbitrary.

    • Constraints: Must be 1, 2 or 3.

    • Impact: Picks the expected stash version and does some checks to verify that the gauge matches that version later.

Branches and code coverage (including function calls)

Intended branches

  • Add single pool.

  • Add multiple pools.

Negative behavior

  • Called by someone who is not the pool manager.

  • Called during shutdown.

  • Called with gauge = address(0).

  • Called with lptoken = address(0).

  • Called with stash = address(0).

  • Called with bad or mismatching stash version.

Zellic © 2024Back to top ↑