Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove 0 check in recovered address in BatcherPaymentService #1064

Merged
Merged
Changes from 1 commit
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
18 changes: 8 additions & 10 deletions contracts/src/core/BatcherPaymentService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -282,21 +282,19 @@ contract BatcherPaymentService is
revert InvalidMaxFee(signatureData.maxFee, feePerProof);
}

bytes32 structHash = keccak256(abi.encode(
noncedVerificationDataTypeHash,
leaf,
signatureData.nonce,
signatureData.maxFee
));
bytes32 structHash = keccak256(
abi.encode(
noncedVerificationDataTypeHash,
leaf,
signatureData.nonce,
signatureData.maxFee
)
);

bytes32 hash = _hashTypedDataV4(structHash);

address signer = ECDSA.recover(hash, signatureData.signature);

if (signer == address(0)) {
revert InvalidSignature();
}

UserInfo storage signerData = userData[signer];

if (signerData.nonce != signatureData.nonce) {
Expand Down
Loading