diff --git a/src/fe.rs b/src/fe.rs index 8fbd6e1..8f5899a 100644 --- a/src/fe.rs +++ b/src/fe.rs @@ -159,7 +159,7 @@ impl FromStr for fe256 { let s = s .strip_suffix(".fe") .ok_or_else(|| ParseFeError::NoSuffix(s.to_owned()))?; - let bytes = Bytes32::from_str(s)?; + let bytes = if s.len() % 2 == 1 { Bytes32::from_str(&format!("0{s}"))? } else { Bytes32::from_str(s)? }; let val = u256::from_le_bytes(bytes.into_inner()); if !Self::test_value(val) { return Err(ParseFeError::Overflow(val));