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
  • checkTransaction
  • coreId
  • version
  1. Smart Contracts
  2. Source Code
  3. Core
  4. MezzGuard

WhitelistGuard

PreviousBlacklistGuardNextShareholderGuard

Last updated 1 year ago

Inherits: MezzGuard

Author: Daniel Yamagata & Jerry Qi & Naveen Ailawadi

A Mezzanine guard that is capable of whitelisting operations that a team can execute. All non-whitelisted operations will revert. Whitelisted operations are determined by a 'controller', which is typically the parent of the 'controlled'

*Operations are whitelisted based on two sets:

  • A set of whitelisted contracts

  • A set of whitelisted selectors, which are each associated with a contract For example, if ERC20 contract 'Foo' is part of the contract set, all functions associated with it will be enabled. Similarly, if the function selector of 'bar()' is part of the whitelisted selectors for 'Foo', all calls to 'bar()' by the team will be enabled

Functions

checkTransaction

Reverts if 'to' or the function selector of 'data' for 'to' is not whitelisted. Will also revert if the operation is a delegate call or relates to the management of the owners, modules, or guard of the 'controlled' Reference: https://github.com/safe-global/safe-smart-account/blob/f03dfae65fd1d085224b00a10755c509a4eaacfe/contracts/Safe.sol#L173-L190

function checkTransaction(
    address to,
    uint256,
    bytes memory data,
    Enum.Operation operation,
    uint256,
    uint256,
    uint256,
    address,
    address payable,
    bytes memory,
    address
) external view virtual;

coreId

function coreId() public pure virtual override returns (bytes32);

version

function version() public pure virtual override returns (uint256);
Git Source