LogoLogo
General DocsTechnical DocsSource CodeMarketing SiteGet Early Access
  • Protocol
    • Overview
    • Treasury & Departments
      • Signers & Access Control
      • Spending Funds & Allowance
      • Departments
    • Capital Stack
      • Share Classes
      • Debt
    • Shareholder Governance
    • Modules
      • Equity Financing Module
        • Priced Rounds
        • SAFEs
      • Billing
      • Payroll
      • Documents
      • Vesting & Unlocks
    • Lifecycle Events
      • Recapitalization
      • Liquidation
      • Acquisition
    • KYC Procceses
  • Smart Contracts
    • Overview
    • Smart Contract Security
    • Deployment of Core Contracts
    • Contract Upgrades
    • Mezz Guards
    • Documents
    • Glossary
    • Source Code
      • Core
        • Base
          • Team
          • TeamControlled
          • AdminControlled
          • Credentialed
          • MezzUUPSUpgradeable
        • MezzShares
          • CommonShares
          • PreferredShares
        • Treasury
        • Department
          • GeneralDepartment
        • Module
          • EquityFinancingModule
        • CapitalStack
        • DelegateRegistry
        • TokenTimelock
        • PayrollManager
        • PricedRound
        • MezzGovernor
          • ProposalGovernor
          • StartupGovernor
          • ShareClassGovernor
          • LateStageGovernor
        • MezzGuard
          • BlacklistGuard
          • WhitelistGuard
          • ShareholderGuard
      • MezzHub
      • MezzDeployer
      • MezzMigrator
      • BillingRouter
      • DocumentRegistry
      • FeeController
      • Events
      • Errors
  • Technical Documentation
    • Creating a Custom Module
Powered by GitBook
On this page
  • Functions
  • constructor
  • init
  • __Module_init
  • supportsInterface
  • getParent
  1. Smart Contracts
  2. Source Code
  3. Core

Module

PreviousGeneralDepartmentNextEquityFinancingModule

Last updated 1 year ago

Inherits: Initializable, ERC165Upgradeable, TeamControlled, IModule

Author: Daniel Yamagata & Naveen Ailawadi

A base contract for modules, which are 'children' of departments and treasuries with bespoke logic and spending capabilities

*Modules should be deployed as proxies. If ERC1967 proxies, their storage layout should use EIP7201 storage slots Reference:

Functions

constructor

constructor();

init

Initializes the state of the module. This initialization is bespoke to each module

function init(address initTeam, bytes memory params) external virtual;

Parameters

Name
Type
Description

initTeam

address

The team that controls the module

params

bytes

The abi-encoded params to be decoded and passed to the module's initializer

__Module_init

function __Module_init(address initTeam) internal virtual onlyInitializing;

supportsInterface

ERC165 support

function supportsInterface(bytes4 interfaceId)
    public
    view
    virtual
    override(ERC165Upgradeable, IERC165)
    returns (bool);

getParent

Returns the parent of 'this'. If 'this' is a department or module, returns the team that directly controls 'this'. If 'this' is the Treasury, returns the sentinel parent, which is address(0x1)

function getParent() public view virtual returns (address);

Returns

Name
Type
Description

<none>

address

The parent, which is either the treasury, a department, a module, or the sentinel parent

Git Source
EIP7201
ERC1967 Proxies