Skip to content

Commit

Permalink
Remove unused signature decoding logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincheng96 committed Sep 27, 2024
1 parent 74a31f4 commit a823cca
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/quark-core/src/QuarkWallet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -410,24 +410,6 @@ contract QuarkWallet is IERC1271 {
}
} else {
// For EOA signers, this implementation of the QuarkWallet only supports ECDSA signatures
/*
* Code taken directly from OpenZeppelin ECDSA.tryRecover; see:
* https://github.com/OpenZeppelin/openzeppelin-contracts/blob/HEAD/contracts/utils/cryptography/ECDSA.sol#L64-L68
*
* This is effectively an optimized variant of the Reference Implementation; see:
* https://eips.ethereum.org/EIPS/eip-1271#reference-implementation
*/
if (signature.length != 65) {
revert InvalidSignature();
}
bytes32 r;
bytes32 s;
uint8 v;
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
(address recoveredSigner, ECDSA.RecoverError recoverError) = ECDSA.tryRecover(digest, signature);
if (recoverError != ECDSA.RecoverError.NoError) {
revert InvalidSignature();
Expand Down

0 comments on commit a823cca

Please sign in to comment.