Skip to content

Commit 043d074

Browse files
committed
update
1 parent c5dd503 commit 043d074

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

contracts/utils/cryptography/ERC7913SignatureVerifierZKEmail.sol

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,13 @@ contract ERC7913SignatureVerifierZKEmail is IERC7913SignatureVerifier {
2626
function verify(bytes calldata key, bytes32 hash, bytes calldata signature) public view virtual returns (bytes4) {
2727
(IDKIMRegistry registry, bytes32 accountSalt) = abi.decode(key, (IDKIMRegistry, bytes32));
2828
EmailAuthMsg memory emailAuthMsg = abi.decode(signature, (EmailAuthMsg));
29-
if (
30-
bytes32(emailAuthMsg.commandParams[0]) == hash &&
31-
emailAuthMsg.templateId == commandTemplate &&
32-
emailAuthMsg.proof.accountSalt == accountSalt
33-
) {
34-
(bool verified, ) = emailAuthMsg.isValidZKEmail(registry, verifier);
35-
if (verified) {
36-
return IERC7913SignatureVerifier.verify.selector;
37-
}
38-
}
39-
return 0xffffffff;
29+
30+
return
31+
(abi.decode(emailAuthMsg.commandParams[0], (bytes32)) == hash &&
32+
emailAuthMsg.templateId == commandTemplate &&
33+
emailAuthMsg.proof.accountSalt == accountSalt &&
34+
emailAuthMsg.isValidZKEmail(registry, verifier) == ZKEmailUtils.EmailProofError.NoError)
35+
? IERC7913SignatureVerifier.verify.selector
36+
: 0xffffffff;
4037
}
4138
}

0 commit comments

Comments
 (0)