diff --git a/ethers-core/src/types/transaction/eip712.rs b/ethers-core/src/types/transaction/eip712.rs index 61a6b9a1..c1875707 100644 --- a/ethers-core/src/types/transaction/eip712.rs +++ b/ethers-core/src/types/transaction/eip712.rs @@ -267,16 +267,17 @@ impl TryFrom<&syn::DeriveInput> for EIP712Domain { .to_compile_error()) } - domain.chain_id = lit_int - .base10_digits() - .parse() - .map_err(|_| { - Error::new( - meta.path.span(), - "failed to parse chain id", - ) - .to_compile_error() - })?; + domain.chain_id = U256::from( + lit_int.base10_parse::().map_err( + |_| { + Error::new( + meta.path.span(), + "failed to parse chain id", + ) + .to_compile_error() + }, + )?, + ); } _ => { return Err(Error::new(