Assessment reports>Ostium>Threat Model>depositWithDiscountAndLock

Function: depositWithDiscountAndLock(uint256 assets, uint32 lockDuration, address receiver)

Deposits assets into the vault in order to mint shares corresponding to the value plus a premium and then locks the shares into a minted NFT.

Inputs

  • assets

    • Control: Arbitrary.

    • Constraints: Must be less than max deposit after premium. Asset transfer must succeed.

    • Impact: Amount of assets to deposit.

  • lockDuration

    • Control: Arbitrary.

    • Constraints: Must cause nonzero discount.

    • Impact: Duration before NFT can be redeemed.

  • receiver

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: Receiver of the NFT.

Branches and code coverage

Intended branches

  • Deposit and lock succeeds.

Negative behavior

  • Deposit fails due to whitelist.

  • Deposit fails due to being over max deposit.

  • Deposit fails due to asset-transfer failure.

  • Deposit fails due to zero or negative discount.

Function call analysis

  • this._executeDiscountAndLock(simulatedAssets, assets, this.previewDeposit(simulatedAssets), lockDuration, receiver)

    • See _executeDiscountAndLock (ref).

Zellic © 2024Back to top ↑