Skip to content

Commit

Permalink
storage slot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Jul 24, 2024
1 parent 64edbe5 commit 4f2d4ca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
3 changes: 2 additions & 1 deletion packages/contract_bootloader/execute_syscalls.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ func execute_call_contract{
block_number=call_contract_request.calldata_start[3],
address=call_contract_request.calldata_start[4],
storage_slot=Uint256(
call_contract_request.calldata_start[5], call_contract_request.calldata_start[6]
low=call_contract_request.calldata_start[6],
high=call_contract_request.calldata_start[5],
),
);
if (functionId == StorageMemorizerFunctionId.GET_SLOT) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from starkware.cairo.lang.vm.memory_segments import MemorySegmentManager
from tools.py.rlp import get_rlp_len
from tools.py.utils import little_8_bytes_chunks_to_bytes
from rlp.sedes import Binary
from rlp.sedes import big_endian_int


class StorageMemorizerHandler(AbstractStorageMemorizerBase):
Expand All @@ -28,10 +28,7 @@ def get_slot(self, key: MemorizerKey) -> Tuple[int, int]:
)

value = int(
decode(
little_8_bytes_chunks_to_bytes(rlp, rlp_len), Binary.fixed_length(32)
).hex(),
16,
decode(little_8_bytes_chunks_to_bytes(rlp, rlp_len), big_endian_int)
)

return (
Expand Down
16 changes: 8 additions & 8 deletions src/hdp_input.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cairo_run_output_path": "cairo_run_output.json",
"task_root": "0xaa30bf945c71955baeb7348ed98a37497a0cdbf0a01b2121004fd9f804a4a42a",
"result_root": "0xb5acdc1a6d2f10725b08b2c832572effa3715d85f00055f97a0c7fbffd9a43d8",
"task_root": "0xcc392fc5c447c5b129739adb810c745e43a6a3bbb98b5d26ae00c7c0b08491e0",
"result_root": "0x63cbd4ce7dcddf233f3c39d4ee6fcb836d0a82b97df9ef7f4212622c7ef8ddea",
"proofs": {
"mmr_metas": [
{
Expand Down Expand Up @@ -657,10 +657,10 @@
"type": "module",
"context": {
"encoded_task": [
"0xb3424e2f215f3e02",
"0xfb8dd84559b80524",
"0xbcbe5767b92e9c31",
"0x3450de4f93196035",
"0xe5895a6640af0302",
"0xa9053321f48e0a06",
"0x2f8a0734f300be37",
"0x25797242ad41dd5",
"0x0",
"0x0",
"0x0",
Expand Down Expand Up @@ -1395,8 +1395,8 @@
"0x400180027fff7ff9",
"0x400180037fff7ffa",
"0x400180047fff7ffb",
"0x400180057fff7ffc",
"0x400180067fff7ffd",
"0x400180057fff7ffd",
"0x400180067fff7ffc",
"0x480680017fff8000",
"0x0",
"0x48127ffe7fff8000",
Expand Down

0 comments on commit 4f2d4ca

Please sign in to comment.