A library to verify multiple signatures
In a contract, you can use the CheckNSignatures
library to verify multiple signatures:
import { CheckSignatures } from "checknsignatures/CheckNSignatures.sol";
contract Example {
using CheckSignatures for bytes32;
function verify(bytes32 hash, bytes memory signatures) external view returns (bool) {
// Determine the number of required signatures
uint256 requiredSignatures = 2;
// Recover the signers
address[] memory recoveredSigners = hash.recoverNSignatures(signatures, requiredSignatures);
// Check if the signers are the expected ones
// ...
}
}
To install the dependencies, run:
forge install
To build the project, run:
forge build
To run the tests, run:
forge test
For feature or change requests, feel free to open a PR, start a discussion or get in touch with us.