Skip to content

Commit

Permalink
Fix save address and bytes32
Browse files Browse the repository at this point in the history
  • Loading branch information
Agusx1211 committed Jan 15, 2024
1 parent 8d18380 commit dcae3ce
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions src/L2Compressor.huff
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand All @@ -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

Expand Down Expand Up @@ -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]
}
Expand All @@ -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

Expand Down

0 comments on commit dcae3ce

Please sign in to comment.