Skip to content

Commit

Permalink
feat: add enabled constant var getter for extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
alrxy committed Nov 21, 2024
1 parent 9787a88 commit 22add8a
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/middleware/extensions/SharedVaults.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {BaseMiddleware} from "../BaseMiddleware.sol";
* @dev Extends BaseMiddleware to provide access control for vault management functions
*/
abstract contract SharedVaults is BaseMiddleware {
bool public constant SharedVaultsEnabled = true;

/**
* @notice Registers a new shared vault
* @param sharedVault The address of the vault to register
Expand Down
2 changes: 2 additions & 0 deletions src/middleware/extensions/Subnetworks.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {BaseMiddleware} from "../BaseMiddleware.sol";
* @dev Extends BaseMiddleware to provide access control for subnetwork management functions
*/
abstract contract Subnetworks is BaseMiddleware {
bool public constant SubnetworksEnabled = true;

/**
* @notice Registers a new subnetwork
* @param subnetwork The ID of the subnetwork to register
Expand Down
2 changes: 2 additions & 0 deletions src/middleware/extensions/access-managers/NoAccessManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {BaseMiddleware} from "../../BaseMiddleware.sol";
* @dev Implements BaseMiddleware and always reverts on access checks
*/
abstract contract NoAccessManager is BaseMiddleware {
bool public constant NoAccessManagerEnabled = true;

/**
* @notice Error thrown when access is denied
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {BaseMiddleware} from "../../BaseMiddleware.sol";
* @dev Implements BaseMiddleware with owner-based access control
*/
abstract contract OwnableAccessManager is BaseMiddleware {
bool public constant OwnableAccessManagerEnabled = true;

/**
* @notice Error thrown when a non-owner address attempts to call a restricted function
* @param sender The address that attempted the call
Expand Down
2 changes: 2 additions & 0 deletions src/middleware/extensions/access-managers/OzAccessManaged.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import {BaseMiddleware} from "../../BaseMiddleware.sol";
* @dev Implements BaseMiddleware with OpenZeppelin's AccessManagedUpgradeable functionality
*/
abstract contract OzAccessManaged is BaseMiddleware, AccessManagedUpgradeable {
bool public constant OzAccessManagedEnabled = true;
/**
* @notice Initializes the contract with an authority address
* @param authority The address to set as the access manager authority
* @dev Can only be called during initialization
*/

function __OzAccessManaged_init(
address authority
) internal onlyInitializing {
Expand Down
2 changes: 2 additions & 0 deletions src/middleware/extensions/capture-timestamps/EpochCapture.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {Time} from "@openzeppelin/contracts/utils/types/Time.sol";
import {BaseMiddleware} from "../../BaseMiddleware.sol";

abstract contract EpochCapture is BaseMiddleware {
bool public constant EpochCaptureEnabled = true;

struct EpochCaptureStorage {
uint48 startTimestamp;
uint48 epochDuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {Time} from "@openzeppelin/contracts/utils/types/Time.sol";
import {BaseMiddleware} from "../../BaseMiddleware.sol";

abstract contract TimestampCapture is BaseMiddleware {
bool public constant TimestampCaptureEnabled = true;

/*
* @notice Returns the current timestamp minus 1 second.
* @return timestamp The current timestamp minus 1 second.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {SelfRegisterOperators} from "./SelfRegisterOperators.sol";
* @dev Implements force pause functionality and prevents unpausing of force-paused operators
*/
abstract contract ForcePauseSelfRegisterOperators is SelfRegisterOperators {
bool public constant ForcePauseSelfRegisterOperatorsEnabled = true;

struct ForcePauseSelfRegisterOperatorsStorage {
mapping(address => bool) forcePaused;
mapping(address => mapping(address => bool)) forcePausedVault;
Expand Down
2 changes: 2 additions & 0 deletions src/middleware/extensions/operators/Operators.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {BaseMiddleware} from "../../BaseMiddleware.sol";
* @dev Provides core operator management functionality with hooks for customization
*/
abstract contract Operators is BaseMiddleware {
bool public constant OperatorsEnabled = true;

/**
* @notice Registers a new operator with an optional vault association
* @param operator The address of the operator to register
Expand Down
2 changes: 2 additions & 0 deletions src/middleware/extensions/operators/SelfRegisterOperators.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/Signa
* @dev Extends BaseMiddleware, BaseSig, and EIP712Upgradeable to provide signature-based operator management
*/
abstract contract SelfRegisterOperators is BaseMiddleware, BaseSig, EIP712Upgradeable {
bool public constant SelfRegisterOperatorsEnabled = true;

error InvalidSignature();

// EIP-712 TypeHash constants
Expand Down
2 changes: 2 additions & 0 deletions src/middleware/extensions/sigs/ECDSASig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
* @dev Implements BaseSig interface using OpenZeppelin's ECDSA library
*/
abstract contract ECDSASig is BaseSig {
bool public constant ECDSASigEnabled = true;

using ECDSA for bytes32;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/middleware/extensions/sigs/Ed25519Sig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {BaseSig} from "./BaseSig.sol";
* @dev Implements BaseSig interface using Ed25519 signature verification
*/
abstract contract Ed25519Sig is BaseSig {
bool public constant Ed25519SigEnabled = true;

/**
* @notice Verifies that a signature was created by the owner of a key
* @param operator The address of the operator that owns the key
Expand Down

0 comments on commit 22add8a

Please sign in to comment.