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
  • Key Features
  • Constructor
  • Core Methods
  • Modifiers
  • Error Handling
  1. MELLOW LRT (LST) PRIMITIVE
  2. LRT Contracts
  3. Modules
  4. DelegateModules

StakingModule

The StakingModule contract facilitates the conversion and staking of Ethereum-based tokens, specifically WETH, stETH, and wstETH. It leverages the DefaultModule structure whilintegrating closely with security and withdrawal management systems of Lido protocol.

Key Features

  • Token Conversion: Supports the conversion of WETH to stETH and subsequently to wstETH.

  • Secure Staking: Interfaces with a DepositSecurityModule for secure staking operations.

  • Withdrawal Management: Coordinates with a WithdrawalQueue to manage staking withdrawals.

Constructor

  • Initializes the contract with the relevant Ethereum-based token addresses and modules.

    • Parameters:

      • weth_: Address of the WETH token.

      • steth_: Address of the stETH token.

      • wsteth_: Address of the wstETH token.

      • depositSecurityModule_: The deposit security module for additional security during deposits.

      • withdrawalQueue_: The withdrawal queue module to manage withdrawals.

      • stakingModuleId_: A unique identifier for the staking module.

Core Methods

  1. Token Conversion

    • convert(uint256): Converts a specified amount of WETH to wstETH.

      • amount: The amount of WETH to convert.

    • convertAndDeposit(uint256, uint256, bytes32, bytes32, uint256, bytes, IDepositSecurityModule.Signature[]): Converts WETH to wstETH and deposits it using the provided security parameters.

      • amount: The amount of WETH to convert and deposit.

      • blockNumber: The block number to reference for the deposit.

      • blockHash: The hash of the block.

      • depositRoot: The root of the deposit.

      • nonce: A nonce to ensure the uniqueness of the deposit.

      • depositCalldata: Additional calldata required for the deposit.

      • sortedGuardianSignatures: Signatures from guardians to validate the deposit.

  2. Private Helper Functions

    • _wethToWSteth(uint256): Internal function to convert WETH directly to wstETH, handling intermediate steps.

      • amount: The amount of WETH to convert.

Modifiers

  • onlyDelegateCall: Ensures that certain functions are only callable through delegate calls to prevent direct interaction that might bypass security checks.

Error Handling

  • NotEnoughWeth: Triggered if there is insufficient WETH for the requested operation.

  • InvalidWithdrawalQueueState: Indicates a mismatch in the expected state of withdrawals, potentially blocking operations if the conditions are unsafe.

PreviousDefaultBondModuleNextExternalModules
🎛️
🧱