2024-07-19 22:15:24 +03:00

35 lines
1.0 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "../Storage.sol";
import "../../common/ReentrancyGuard.sol";
import "../../common/AllowListed.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/// @title Base contract containing functions accessible to the other facets.
/// @author Matter Labs
/// @custom:security-contact security@matterlabs.dev
contract Base is ReentrancyGuard, AllowListed {
AppStorage internal s;
/// @notice Checks that the message sender is an active governor
modifier onlyGovernor() {
require(msg.sender == s.governor, "1g"); // only by governor
_;
}
/// @notice Checks that the message sender is an active governor or admin
modifier onlyGovernorOrAdmin() {
require(msg.sender == s.governor || msg.sender == s.admin, "Only by governor or admin");
_;
}
/// @notice Checks if validator is active
modifier onlyValidator() {
require(s.validators[msg.sender], "1h"); // validator is not active
_;
}
}