From dcae3cea7577fae2ac4e15e7fcdd43ac656965b9 Mon Sep 17 00:00:00 2001 From: Agusx1211 Date: Mon, 15 Jan 2024 18:12:35 +0000 Subject: [PATCH] Fix save address and bytes32 --- src/L2Compressor.huff | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/L2Compressor.huff b/src/L2Compressor.huff index 46474f4..d23a7e9 100644 --- a/src/L2Compressor.huff +++ b/src/L2Compressor.huff @@ -177,16 +177,14 @@ 0x60 shr // [addr, windex, rindex] PULL_ADDRESS() ADDRESS_STORAGE_POINTER() sstore // [windex, rindex] - // Add 20 bytes to both indexes - - 0x14 dup1 // [0x14, 0x14, windex, rindex] - swap3 // [rindex, 0x14, windex, 0x14] - add // [windex + 0x14, 0x14, rindex] + // Add 32 bytes to both indexes - swap2 // [rindex, 0x14, windex + 0x14] - add // [rindex + 0x14, windex + 0x14] + 0x20 dup1 // [0x20, 0x20, windex, rindex] + swap3 // [rindex, 0x20, windex, 0x20] + add // [rindex + 0x20, 0x20, windex] - swap1 // [windex + 0x14, rindex + 0x14] + swap2 // [windex, 0x20, rindex + 0x20] + add // [windex + 0x20, rindex + 0x20] // output stack: [windex + 20, rindex + 20] } @@ -201,8 +199,8 @@ FLAG_SAVE_ADDRESS() // [windex, rindex] - 0x15 eq ASSERT() // [rindex] - 0x34 eq ASSERT() // [] + 0x40 eq ASSERT() // [rindex] + 0x21 eq ASSERT() // [] // Validate that memory was written correctly @@ -238,12 +236,10 @@ 0x20 dup1 // [0x20, 0x20, windex, rindex] swap3 // [rindex, 0x20, windex, 0x20] - add // [windex + 0x20, 0x20, rindex] + add // [rindex + 0x20, 0x20, windex] - swap2 // [rindex, 0x20, windex + 0x20] - add // [rindex + 0x20, windex + 0x20] - - swap1 // [windex + 0x20, rindex + 0x20] + swap2 // [windex, 0x20, rindex + 0x20] + add // [windex + 0x20, rindex + 0x20] // output stack: [windex + 32, rindex + 32] } @@ -257,8 +253,8 @@ FLAG_SAVE_BYTES32() // [windex, rindex] - 0x21 eq ASSERT() // [rindex] 0x40 eq ASSERT() // [] + 0x21 eq ASSERT() // [rindex] // Validate that memory was written correctly