Skip to content

Commit

Permalink
feat: versions instead of enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
alrxy committed Nov 26, 2024
1 parent dacbed3 commit 7818c55
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/middleware/extensions/SharedVaults.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ 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;
uint64 public constant SharedVaults_VERSION = 1;

/**
* @notice Registers a new shared vault
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/extensions/Subnetworks.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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;
uint64 public constant Subnetworks_VERSION = 1;

/**
* @notice Registers a new subnetwork
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {BaseMiddleware} from "../../BaseMiddleware.sol";
* @dev Implements BaseMiddleware and always reverts on access checks
*/
abstract contract NoAccessManager is BaseMiddleware {
bool public constant NoAccessManagerEnabled = true;
uint64 public constant NoAccessManager_VERSION = 1;

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

/**
* @notice Error thrown when a non-owner address attempts to call a restricted function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {BaseMiddleware} from "../../BaseMiddleware.sol";
* @dev Implements BaseMiddleware with OpenZeppelin's AccessManagedUpgradeable functionality
*/
abstract contract OzAccessManaged is BaseMiddleware, AccessManagedUpgradeable {
bool public constant OzAccessManagedEnabled = true;
uint64 public constant OzAccessManaged_VERSION = 1;
/**
* @notice Initializes the contract with an authority address
* @param authority The address to set as the access manager authority
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Time} from "@openzeppelin/contracts/utils/types/Time.sol";
import {BaseMiddleware} from "../../BaseMiddleware.sol";

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

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

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

/*
* @notice Returns the current timestamp minus 1 second.
Expand Down
5 changes: 3 additions & 2 deletions src/middleware/extensions/key-storages/KeyStorage256.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import {Time} from "@openzeppelin/contracts/utils/types/Time.sol";
* @dev Extends BaseMiddleware to provide key management functionality
*/
abstract contract KeyStorage256 is BaseMiddleware {
using PauseableEnumerableSet for PauseableEnumerableSet.Bytes32Set;
using PauseableEnumerableSet for PauseableEnumerableSet.Status;
uint64 public constant KeyStorage256_VERSION = 1;

using PauseableEnumerableSet for PauseableEnumerableSet.Bytes32Set;

error DuplicateKey();
error KeyAlreadyEnabled();
error MaxDisabledKeysReached();
Expand Down
3 changes: 2 additions & 1 deletion src/middleware/extensions/key-storages/KeyStorageBytes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import {Time} from "@openzeppelin/contracts/utils/types/Time.sol";
* @dev Extends BaseManager to provide key management functionality
*/
abstract contract KeyStorageBytes is BaseMiddleware {
uint64 public constant KeyStorageBytes_VERSION = 1;

using PauseableEnumerableSet for PauseableEnumerableSet.BytesSet;
using PauseableEnumerableSet for PauseableEnumerableSet.Status;

error DuplicateKey();
error MaxDisabledKeysReached();
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/extensions/key-storages/NoKeyStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {BaseMiddleware} from "../../BaseMiddleware.sol";
* @dev Implements BaseMiddleware and always reverts on key operations
*/
abstract contract NoKeyStorage is BaseMiddleware {
bool public constant NoKeyStorageEnabled = true;
uint64 public constant NoKeyStorage_VERSION = 1;

error KeyStorageDisabled();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ 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;
uint64 public constant ForcePauseSelfRegisterOperators_VERSION = 1;

struct ForcePauseSelfRegisterOperatorsStorage {
mapping(address => bool) forcePaused;
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/extensions/operators/Operators.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ 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;
uint64 public constant Operators_VERSION = 1;

/**
* @notice Registers a new operator with an optional vault association
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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;
uint64 public constant SelfRegisterOperators_VERSION = 1;

error InvalidSignature();

Expand Down
2 changes: 1 addition & 1 deletion src/middleware/extensions/sigs/ECDSASig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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;
uint64 public constant ECDSASig_VERSION = 1;

using ECDSA for bytes32;

Expand Down
2 changes: 1 addition & 1 deletion src/middleware/extensions/sigs/EdDSASig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {BaseSig} from "./BaseSig.sol";
* @dev Implements BaseSig interface using EdDSA signature verification
*/
abstract contract EdDSASig is BaseSig {
bool public constant EdDSASigEnabled = true;
uint64 public constant EdDSASig_VERSION = 1;

/**
* @notice Verifies that a signature was created by the owner of a key
Expand Down

0 comments on commit 7818c55

Please sign in to comment.