From 013b90b46388c97ed8c3171fe31c153ed2035add Mon Sep 17 00:00:00 2001 From: PacificYield <173040337+PacificYield@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:59:20 +0100 Subject: [PATCH] chore: add KMSZeroSignature --- contracts/contracts/KMSVerifier.sol | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/contracts/contracts/KMSVerifier.sol b/contracts/contracts/KMSVerifier.sol index bed089b..df1ec17 100644 --- a/contracts/contracts/KMSVerifier.sol +++ b/contracts/contracts/KMSVerifier.sol @@ -30,6 +30,9 @@ contract KMSVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradea /// @param numSignatures Number of signatures. error KMSSignatureThresholdNotReached(uint256 numSignatures); + /// @notice Returned if the number of signatures is equal to 0. + error KMSZeroSignature(); + struct DecryptionResult { address aclAddress; uint256[] handlesList; @@ -250,6 +253,11 @@ contract KMSVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradea /// @return true if enough provided signatures are valid, false otherwise function verifySignaturesDigest(bytes32 digest, bytes[] memory signatures) internal virtual returns (bool) { uint256 numSignatures = signatures.length; + + if (numSignatures == 0) { + revert KMSZeroSignature(); + } + uint256 threshold = getThreshold(); if (numSignatures < threshold) {