Skip to content

Commit

Permalink
fix(eip712): retrieve proper v value
Browse files Browse the repository at this point in the history
  • Loading branch information
Karrq committed Nov 26, 2024
1 parent faccfe9 commit f798c17
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/zksync/core/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,13 @@ impl ConvertSignature for ZkSignature {

impl ConvertSignature for AlloySignature {
fn to_ethers(self) -> ZkSignature {
ZkSignature { r: self.r().to_u256(), s: self.s().to_u256(), v: self.v() as u64 }
let parity = alloy_primitives::Parity::from(self.v());

ZkSignature {
r: self.r().to_u256(),
s: self.s().to_u256(),
v: parity.y_parity_byte_non_eip155().unwrap_or(parity.y_parity_byte()) as u64,
}
}

fn to_alloy(self) -> AlloySignature {
Expand Down

0 comments on commit f798c17

Please sign in to comment.