Mellow Protocol
  • 💡Overview
  • 🎛️MELLOW LRT (LST) PRIMITIVE
    • Overview
    • Simple-LRT
    • LRT Contracts
      • 🏦Vault
      • 🔧VaultConfigurator
      • ⚖️Validators
        • ManagedValidator
        • ERC20SwapValidator
        • DefaultBondValidator
        • AllowAllValidator
      • 🧬Strategies
        • DefaultBondStrategy
        • SimpleDVTStakingStrategy
      • 🔎Oracles
        • ChainlinkOracle
        • ManagedRatiosOracle
      • 🧱Modules
        • DelegateModules
          • ERC20SwapModule
          • DefaultBondModule
          • StakingModule
        • ExternalModules
        • TvlModules
          • DefaultBondTvlModule
          • ERC20TvlModule
          • ManagedTvlModule
      • 🪛Utils
        • DepositWrapper
        • DefaultAccessControl
      • 🔐Security
        • AdminProxy
    • DVstETH vault overview
    • Interoperable vaults
    • Contract deployments
    • Security
    • Loyalty Points
      • Points in Symbiotic pre-deposit contracts
      • DeFi points integration instructions
    • User Tutorials
      • Deposit guide
      • Withdrawal guide
      • Emergency withdrawal guide (advanced)
    • API
  • 🤖MELLOW ALM
    • Mellow ALM Toolkit
      • Overview
      • 📘Domain objects
      • 🧩Components
      • 🍜Processes
      • 💎Core
      • 🔮Oracles
        • VeloOracle
      • 🎯Strategy
        • PulseStrategyModule
      • 🔌AMM Adapters
        • VeloAmmModule
      • 🚙Utility contracts
        • AmmDepositWithdrawModule
        • Counter
        • LpWrapper
        • VeloDeployFactory
    • Mellow permissionless vaults
      • Overview
      • Core
      • Contracts API
      • Strategies
        • Fearless Gearbox strategy
        • LStrategy
        • Uni V3 Boosted strategy
        • Pulse strategy
        • Pulse strategy V2
        • Tamper strategy
      • Governance parameters
      • Contracts specs
      • Tutorials
        • Contracts deployments
        • Deploy your own strategy
        • wstETH strategies deposit guide
      • Mellow contracts addresses
        • Mellow Protocol Addresses (Polygon)
        • Mellow Protocol Addresses (Mainnet)
        • Gearbox Fearless Strategy
        • Tamper Strategy
        • UniV3 Pulse wstETH-USDC
        • UniV3 Pulse V2 wstETH-USDC
        • Velodrome CL strategies
        • Aerodrome CL strategies
      • Glossary
      • FAQ
    • Mellow Backtesting SDK
  • 🗄️Resources
    • Media kit
    • Twitter
    • Discord
Powered by GitBook
On this page
  • Overview
  • Key Features
  • Core Methods
  1. MELLOW LRT (LST) PRIMITIVE
  2. LRT Contracts
  3. Utils

DepositWrapper

Overview

DepositWrapper contract is a utility that wraps deposits of various tokens into a specific vault asset. It allows for deposits in ETH, WETH, stETH and wstETH.

Key Features

  • Token Conversion: Converts between ETH, WETH, stETH, and wstETH for deposits.

  • Direct Deposit: Supports direct deposits into the vault with security checks.

  • Allowance Management: Adjusts ERC20 allowances securely before deposit.

Core Methods

  1. Deposit Function

    • deposit(address, address, uint256, uint256, uint256): Facilitates deposits into the vault after converting tokens.

      • to: The address receiving LP tokens after the deposit.

      • token: The address of the input token (WETH, stETH, wstETH, or native ETH).

      • amount: The amount of the input token.

      • minLpAmount: Minimum acceptable amount of LP tokens to be minted.

      • deadline: Time before which the deposit must be completed.

      • Returns: The amount of LP tokens minted.

      • Errors:

        • InvalidTokenList: If the vault does not exclusively accept wstETH.

        • InvalidAmount: If the input amount is zero or doesn't match msg.value for ETH.

        • InvalidToken: If the input token is not recognized.

      • Event:

        • DepositWrapperDeposit(address, address, uint256, uint256, uint256): Emitted after a successful deposit.

          • sender: Address of the sender.

          • token: Address of the input token.

          • amount: Amount deposited.

          • lpAmount: Amount of LP tokens minted.

          • deadline: Deadline of the deposit operation.

  2. Conversion Helpers

    • _wethToWsteth(uint256): Converts WETH to wstETH through stETH.

    • _ethToSteth(uint256): Converts native ETH to stETH.

    • _stethToWsteth(uint256): Converts stETH to wstETH.

  3. Fallback Method

    • receive(): Allows receiving ETH only from the WETH contract.

      • Error:

        • InvalidSender: Raised if ETH is received from an address other than WETH.

PreviousUtilsNextDefaultAccessControl
🎛️
🪛