Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions contracts/utils/cryptography/SignatureChecker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {ECDSA} from "./ECDSA.sol";
import {IERC1271} from "../../interfaces/IERC1271.sol";
import {IERC7913SignatureVerifier} from "../../interfaces/IERC7913.sol";
import {Bytes} from "../Bytes.sol";
import {Memory} from "../Memory.sol";

/**
* @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support:
Expand Down Expand Up @@ -138,13 +139,15 @@ library SignatureChecker {
) internal view returns (bool) {
if (signers.length != signatures.length) return false;

Memory.Pointer ptr = Memory.getFreeMemoryPointer();
bytes32 lastId = bytes32(0);

for (uint256 i = 0; i < signers.length; ++i) {
bytes memory signer = signers[i];

// If one of the signatures is invalid, reject the batch
if (!isValidSignatureNow(signer, hash, signatures[i])) return false;
Memory.setFreeMemoryPointer(ptr);

bytes32 id = keccak256(signer);
// If the current signer ID is greater than all previous IDs, then this is a new signer.
Expand Down
Loading