Assessment reports>Ethena>Threat Models>stake

Function: stake(uint256 eUSDIn, uint256 minStakedeUSDOut, address beneficiary)

Allows users to stake their eUSD tokens.

Inputs

  • eUSDIn

    • Constraints: Not zero --- should be at least MIN_INITIAL_STAKE during the first stake.

    • Impact: The amount of eUSD tokens to stake.

  • minStakedeUSDOut

    • Constraints: N/A.

    • Impact: The minimum amount of stakedeUSD tokens to receive.

  • beneficiary

    • Constraints: N/A.

    • Impact: The beneficiary of the stakedeUSD tokens.

Branches and code coverage (including function calls)

Intended branches

  • Stake tokens successfully (first stake).

  • Stake tokens successfully (non-first stake).

Negative behavior

  • The contract call is reverted when eUSDIn is less than MIN_INITIAL_STAKE during the first stake.

  • The contract call is reverted when allowance is insufficient.

  • The contract call is reverted when stakedeUSDOut is less than minStakedeUSDOut.

Function call analysis

  • stake -> _stake(eUSDIn, minStakedeUSDOut, beneficiary)

    • External/Internal? Internal.

    • Argument control? eUSDIn, minStakedeUSDOut, and beneficiary.

    • Impact: N/A.

Zellic © 2024Back to top ↑