@@ -429,21 +429,47 @@ contract GatewayConfig is IGatewayConfig, Ownable2StepUpgradeable, UUPSUpgradeab
429429 /**
430430 * @notice See {IGatewayConfig-pauseAllGatewayContracts}.
431431 * Contracts that are technically pausable but do not provide any pausable functions are not
432- * paused. If at least one of the contracts is already paused, the function will revert.
432+ * paused. If all of the contracts are already paused, the function will revert.
433433 */
434434 function pauseAllGatewayContracts () external virtual onlyPauser {
435- DECRYPTION.pause ();
436- INPUT_VERIFICATION.pause ();
435+ bool isDecryptionPaused = DECRYPTION.paused ();
436+ bool isInputVerificationPaused = INPUT_VERIFICATION.paused ();
437+
438+ if (isDecryptionPaused && isInputVerificationPaused) {
439+ revert AllGatewayContractsAlreadyPaused ();
440+ }
441+
442+ if (! isDecryptionPaused) {
443+ DECRYPTION.pause ();
444+ }
445+
446+ if (! isInputVerificationPaused) {
447+ INPUT_VERIFICATION.pause ();
448+ }
449+
437450 emit PauseAllGatewayContracts ();
438451 }
439452
440453 /**
441454 * @notice See {IGatewayConfig-unpauseAllGatewayContracts}.
442- * If at least one of the contracts is not paused, the function will revert.
455+ * If none of the contracts are paused, the function will revert.
443456 */
444457 function unpauseAllGatewayContracts () external virtual onlyOwner {
445- DECRYPTION.unpause ();
446- INPUT_VERIFICATION.unpause ();
458+ bool isDecryptionPaused = DECRYPTION.paused ();
459+ bool isInputVerificationPaused = INPUT_VERIFICATION.paused ();
460+
461+ if (! isDecryptionPaused && ! isInputVerificationPaused) {
462+ revert AllGatewayContractsAlreadyUnpaused ();
463+ }
464+
465+ if (isDecryptionPaused) {
466+ DECRYPTION.unpause ();
467+ }
468+
469+ if (isInputVerificationPaused) {
470+ INPUT_VERIFICATION.unpause ();
471+ }
472+
447473 emit UnpauseAllGatewayContracts ();
448474 }
449475
0 commit comments