👩‍💻
Unlockd Developers Docs
Unlockd for Devs V2
Unlockd for Devs V2
  • Introduction
  • ⚙️Core
    • Unlockd
    • BaseCore
    • BaseCoreModule
  • ⚙️Modules
    • Installer
    • Manager
    • Action
    • SellNow
    • BuyNow
    • Market
    • Auction
  • 🆕Vault and Tokens
    • UTokenVault
    • BaseToken
    • ScaledToken
    • WethGateway
  • 🆕Adapters and Strategies
    • ReservoirAdapter
    • MaxApyStrategy
  • 🆕Storage
    • CoreStorage
    • UVaultStorage
  • 📔Deployed Contracts
    • Ethereum Sepolia
    • Ethereum Mainnet
  • 📫Unlockd Account (Wallet)
    • Introduction
    • Architecture
    • DelegationWalletFactory
    • DelegationWalletRegistry
    • DelegationOwner
    • GuardOwner
    • ProtocolOwner
    • TransactionGuard
    • DelegationRecipes
    • AllowedControllers
    • Deployed Contracts
      • Ethereum Sepolia (Testnet)
  • 🧰SDK
    • Typescript Package
    • SDK Docs
  • 🤝DEVELOPERS HELP
    • Best Practices
    • Security and Risk Management
    • Github
    • Bug Bounty - ACTIVE
Powered by GitBook
On this page
  • Key variables:
  • Key functions:
  • Parameters:
  • Returns:
  • Parameters:
  • Returns:
  1. Core

BaseCore

BaseCore.sol contains the base logic for the proxy contracts used in the Unlockd Protocol. It provides functions for creating and managing module proxies and handling module-specific logic.

Key variables:

_moduleLookup: A mapping that stores the implementation address for each module ID.

_proxyLookup: A mapping that stores the proxy address for each module ID (only for single-proxy modules).

_trustedSenders: A mapping that stores the trusted sender information for each proxy address, including the module ID and implementation address (only for external single-proxy modules).

Key functions:

function _createProxy(
    uint256 proxyModuleId
) internal returns (address)

Creates a new proxy contract for the specified module ID. It deploys a new instance of the UnlockdMinimalProxy contract and stores the proxy address in the _proxyLookup mapping if the module ID is within the range of external single-proxy modules. It also updates the _trustedSenders mapping with the module ID and implementation address for the proxy.

Parameters:

proxyModuleId: The ID of the module for which to create a proxy.

Returns:

The address of the created proxy contract.


function callInternalModule(
    uint256 moduleId,
    bytes memory input
  ) internal returns (bytes memory)

Performs a delegatecall to the specified module contract with the provided input data. It retrieves the module implementation address from the _moduleLookup mapping and delegates the call using assembly. If the call fails, it reverts with the returned error data.

Parameters:

moduleId: The ID of the module to call.

input: The input data for the module call.

Returns:

The return data from the module call.

PreviousUnlockdNextBaseCoreModule

Last updated 1 year ago

⚙️