@@ -9,6 +9,8 @@ import {IPartner} from "./interfaces/IPartner.sol";
99import {MessageLib} from "./libraries/MessageLib.sol " ;
1010import {VerificationLib} from "./libraries/VerificationLib.sol " ;
1111
12+ import {Bridge} from "./Bridge.sol " ;
13+
1214/// @title BridgeValidator
1315///
1416/// @notice A validator contract to be used during the Stage 0 phase of Base Bridge. This will likely later be replaced
@@ -90,6 +92,9 @@ contract BridgeValidator is Initializable {
9092 /// @notice Thrown when attempting to register an empty batch of messages
9193 error NoMessages ();
9294
95+ /// @notice Thrown when the Bridge is paused
96+ error Paused ();
97+
9398 //////////////////////////////////////////////////////////////
9499 /// Modifiers ///
95100 //////////////////////////////////////////////////////////////
@@ -100,6 +105,12 @@ contract BridgeValidator is Initializable {
100105 _;
101106 }
102107
108+ /// @dev Restricts function to when the Bridge is not paused
109+ modifier whenNotPaused () {
110+ require (! Bridge (BRIDGE).paused (), Paused ());
111+ _;
112+ }
113+
103114 //////////////////////////////////////////////////////////////
104115 /// Public Functions ///
105116 //////////////////////////////////////////////////////////////
@@ -142,7 +153,10 @@ contract BridgeValidator is Initializable {
142153 /// `abi.encode(messageHashes)`, provided in strictly ascending order by signer address.
143154 /// Must include at least `getBaseThreshold()` Base validator signatures. The external
144155 /// signature threshold is controlled by `PARTNER_VALIDATOR_THRESHOLD`.
145- function registerMessages (bytes32 [] calldata innerMessageHashes , bytes calldata validatorSigs ) external {
156+ function registerMessages (bytes32 [] calldata innerMessageHashes , bytes calldata validatorSigs )
157+ external
158+ whenNotPaused
159+ {
146160 uint256 len = innerMessageHashes.length ;
147161 if (len == 0 ) revert NoMessages ();
148162
0 commit comments