Skip to content

Commit

Permalink
fix(contracts): use named error messages instead of require
Browse files Browse the repository at this point in the history
  • Loading branch information
mempirate committed Oct 14, 2024
1 parent 61ea21c commit 37e6c43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bolt-contracts/src/contracts/BoltManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ contract BoltManager is IBoltManager, OwnableUpgradeable, UUPSUpgradeable {
uint48 public START_TIMESTAMP;

modifier onlyMiddleware() {
require(restakingProtocols.contains(msg.sender), "BoltManager: caller is not a middleware");
if (!restakingProtocols.contains(msg.sender)) {
revert UnauthorizedMiddleware();
}
_;
}

Expand Down
1 change: 1 addition & 0 deletions bolt-contracts/src/interfaces/IBoltManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface IBoltManager {
error InvalidQuery();
error OperatorAlreadyRegistered();
error OperatorNotRegistered();
error UnauthorizedMiddleware();

struct Operator {
string rpc;
Expand Down

0 comments on commit 37e6c43

Please sign in to comment.