MezzGovernor

Git Source

Inherits: StateAware, Patchable, IMezzGovernor

Author: Daniel Yamagata

A base contract for governor that defines upgradeability logic and modifiers for access control

All governors are able to execute arbitrary transactions. Therefore, they are able to call the Mezz Migrator to upgrade themselves to a newer version. Specifically, the governor should call the Mezz Migrator's upgradeToNewerVersion() However, resetting to a patched version may not be possible depending on the protocol state. Therefore, a function to execute this callback is provided via 'Patchable'

State Variables

MezzGovernorStorageLocation

bytes32 private constant MezzGovernorStorageLocation =
    0x0b1a6379e7855c565527499b30056eabdaf3a2b55abb1e5da911b250c18bf800;

Functions

_getMezzGovernorStorage

function _getMezzGovernorStorage() internal pure returns (MezzGovernorStorage storage $);

constructor

constructor(address _mezzHub, address _mezzMigrator) StateAware(_mezzHub) Patchable(_mezzMigrator);

onlyMezzGovernance

Reverts if the caller is not 'this'

modifier onlyMezzGovernance();

init

Intializes the Governor's state

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

Parameters

NameTypeDescription

initTreasury

address

The address of the Treasury that the Governor is in charge of

params

bytes

Bespoke abi.encoded parameters

__MezzGovernor_init

function __MezzGovernor_init(address initTreasury) internal virtual onlyInitializing;

treasury

Returns the address of the treasury associated with the governor

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

name

Returns the name of the governor

function name() public view virtual returns (string memory);

_validateCallerIsGovernance

Reverts if the caller is not 'this'

function _validateCallerIsGovernance() internal view;

_authorizePatch

Access control for 'resetToPatchedLatestVersion()'

function _authorizePatch(bytes memory) internal view override;

Structs

MezzGovernorStorage

struct MezzGovernorStorage {
    address _treasury;
}

Last updated