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
  • Roles
  • Constructor
  • Core Methods
  1. MELLOW LRT (LST) PRIMITIVE
  2. LRT Contracts
  3. Utils

DefaultAccessControl

Overview

DefaultAccessControl contract provides a flexible role-based access control mechanism. It leverages the OpenZeppelin AccessControlEnumerable. The contract defines three roles —OPERATOR, ADMIN_ROLE, and ADMIN_DELEGATE_ROLE — each with specific permissions to control various aspects of the system.

Key Features

  • Role Hierarchy: Establishes a clear hierarchy of permissions through three primary roles:

    • Admin Role: Has the highest privileges.

    • Admin Delegate Role: Can manage operators.

    • Operator Role: Executes regular tasks but with limited authority.

  • Access Verification: Provides methods to verify if a user meets certain permission requirements.

Roles

  • OPERATOR: A hashed identifier for the operator role.

  • ADMIN_ROLE: A hashed identifier for the admin role.

  • ADMIN_DELEGATE_ROLE: A hashed identifier for the admin delegate role.

Constructor

  • constructor(address): Initializes the contract with an admin address.

    • admin: Address of the initial admin.

    • Errors:

      • AddressZero: Raised if the admin address is zero.

Core Methods

  1. Role Verification

    • isAdmin(address): Checks if the sender has an admin or admin delegate role.

      • sender: Address to verify.

      • Returns: true if the sender is an admin or delegate, false otherwise.

    • isOperator(address): Checks if the sender has an operator role.

      • sender: Address to verify.

      • Returns: true if the sender is an operator, false otherwise.

  2. Access Enforcement

    • requireAdmin(address): Requires the sender to be an admin or delegate.

      • sender: Address of the user.

      • Errors:

        • Forbidden: Raised if the sender does not have the required role.

    • requireAtLeastOperator(address): Requires the sender to be at least an operator or higher.

      • sender: Address of the user.

      • Errors:

        • Forbidden: Raised if the sender does not have the required role.

  3. Internal Methods

    • _requireAdmin(address): Internal method for admin verification.

    • _requireAtLeastOperator(address): Internal method for operator or higher verification.

PreviousDepositWrapperNextSecurity
🎛️
🪛