Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit 7834cc6

Browse files
authored
fix first byte (#802)
1 parent d3ffb46 commit 7834cc6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

zkevm-circuits/src/evm_circuit/execution/error_invalid_creation_code.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ impl<F: Field> ExecutionGadget<F> for ErrorInvalidCreationCodeGadget<F> {
129129
self.value_left
130130
.assign(region, offset, Some(word_left.to_le_bytes()))?;
131131

132-
let bytes = word_left.to_le_bytes();
132+
let mut bytes = word_left.to_le_bytes();
133+
bytes.reverse();
134+
133135
let first_byte: u8 = bytes[0];
134136

135137
self.first_byte
@@ -186,7 +188,7 @@ mod test {
186188
PUSH32(0)
187189
MSTORE
188190
PUSH2( 5 ) // length to copy
189-
PUSH2(32u64 - u64::try_from(memory_bytes.len()).unwrap()) // offset
191+
PUSH2(u64::try_from(memory_bytes.len()).unwrap()) // offset
190192
//PUSH2(0x00) // offset
191193

192194
};

0 commit comments

Comments
 (0)