diff --git a/packages/starknet-snap/src/__tests__/fixture/contract-example.json b/packages/starknet-snap/src/__tests__/fixture/contract-example.json new file mode 100644 index 00000000..fb39acad --- /dev/null +++ b/packages/starknet-snap/src/__tests__/fixture/contract-example.json @@ -0,0 +1,4969 @@ +{ + "contract": { + "abi": [ + { + "inputs": [ + { + "name": "amount", + "type": "felt" + } + ], + "name": "increase_balance", + "outputs": [], + "type": "function" + }, + { + "inputs": [], + "name": "get_balance", + "outputs": [ + { + "name": "res", + "type": "felt" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "entry_points_by_type": { + "CONSTRUCTOR": [], + "EXTERNAL": [ + { + "offset": 58, + "selector": "0x362398bec32bc0ebb411203221a35a0301193a96f317ebe5e40be9f60d15320" + }, + { + "offset": 91, + "selector": "0x39e11d48192e4333233c7eb19d10ad67c362bb28580c604d67884c85da39695" + } + ], + "L1_HANDLER": [] + }, + "program": { + "attributes": [], + "builtins": ["pedersen", "range_check"], + "compiler_version": "0.13.2", + "data": [ + "0x480680017fff8000", + "0x53746f7261676552656164", + "0x400280007ffc7fff", + "0x400380017ffc7ffd", + "0x482680017ffc8000", + "0x3", + "0x480280027ffc8000", + "0x208b7fff7fff7ffe", + "0x480680017fff8000", + "0x53746f726167655772697465", + "0x400280007ffb7fff", + "0x400380017ffb7ffc", + "0x400380027ffb7ffd", + "0x482680017ffb8000", + "0x3", + "0x208b7fff7fff7ffe", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x480680017fff8000", + "0x206f38f7e4f15e87567361213c28f235cccdaa1d7fd34c9db1dfe9489c6a091", + "0x208b7fff7fff7ffe", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffffa", + "0x480a7ffb7fff8000", + "0x48127ffe7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe6", + "0x48127ffe7fff8000", + "0x48127ff57fff8000", + "0x48127ff57fff8000", + "0x48127ffc7fff8000", + "0x208b7fff7fff7ffe", + "0x480a7ffb7fff8000", + "0x480a7ffc7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", + "0x480a7ffa7fff8000", + "0x48127ffe7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe0", + "0x48127ff67fff8000", + "0x48127ff67fff8000", + "0x208b7fff7fff7ffe", + "0x480a7ffa7fff8000", + "0x480a7ffb7fff8000", + "0x480a7ffc7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe5", + "0x48127ffc7fff8000", + "0x48127ffc7fff8000", + "0x48127ffc7fff8000", + "0x48287ffd7ffc8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffec", + "0x208b7fff7fff7ffe", + "0x482680017ffd8000", + "0x1", + "0x402a7ffd7ffc7fff", + "0x480280007ffb8000", + "0x480280017ffb8000", + "0x480280027ffb8000", + "0x480280007ffd8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffee", + "0x40780017fff7fff", + "0x1", + "0x48127ffc7fff8000", + "0x48127ffc7fff8000", + "0x48127ffc7fff8000", + "0x480680017fff8000", + "0x0", + "0x48127ffb7fff8000", + "0x208b7fff7fff7ffe", + "0x480a7ffb7fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffc7", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x4003800080007ffc", + "0x4826800180008000", + "0x1", + "0x480a7ffd7fff8000", + "0x4828800080007ffe", + "0x480a80007fff8000", + "0x208b7fff7fff7ffe", + "0x402b7ffd7ffc7ffd", + "0x480280007ffb8000", + "0x480280017ffb8000", + "0x480280027ffb8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffee", + "0x48127ffe7fff8000", + "0x1104800180018000", + "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff1", + "0x48127ff47fff8000", + "0x48127ff47fff8000", + "0x48127ffb7fff8000", + "0x48127ffb7fff8000", + "0x48127ffb7fff8000", + "0x208b7fff7fff7ffe" + ], + "debug_info": { + "file_contents": { + "autogen/starknet/arg_processor/01cba52f8515996bb9d7070bde81ff39281d096d7024a558efcba6e1fd2402cf.cairo": "assert [cast(fp + (-4), felt*)] = __calldata_actual_size;\n", + "autogen/starknet/arg_processor/293368f3a0e12cfcf22314a31e13b9801e95a5b8b2b71822a2fbbdf5a01ea795.cairo": "assert [__return_value_ptr] = ret_value.res;\nlet __return_value_ptr = __return_value_ptr + 1;\n", + "autogen/starknet/arg_processor/73e68c490b7650388f650e9e1ff9b2b3ced88dabf86213d6a0831077eb1a0800.cairo": "let __calldata_arg_amount = [__calldata_ptr];\nlet __calldata_ptr = __calldata_ptr + 1;\n", + "autogen/starknet/arg_processor/c31620b02d4d706f0542c989b2aadc01b0981d1f6a5933a8fe4937ace3d70d92.cairo": "let __calldata_actual_size = __calldata_ptr - cast([cast(fp + (-3), felt**)], felt*);\n", + "autogen/starknet/external/get_balance/2c767dabe8478bfafd38f9fb907f9842d03e3c9d2b355e2af5c59b126fcc8f59.cairo": "let ret_value = __wrapped_func{syscall_ptr=syscall_ptr, pedersen_ptr=pedersen_ptr, range_check_ptr=range_check_ptr}();\nlet (range_check_ptr, retdata_size, retdata) = get_balance_encode_return(ret_value, range_check_ptr);\n", + "autogen/starknet/external/get_balance/741ea357d6336b0bed7bf0472425acd0311d543883b803388880e60a232040c7.cairo": "let range_check_ptr = [cast([cast(fp + (-5), felt**)] + 2, felt*)];\n", + "autogen/starknet/external/get_balance/9684a85e93c782014ca14293edea4eb2502039a5a7b6538ecd39c56faaf12529.cairo": "let pedersen_ptr = [cast([cast(fp + (-5), felt**)] + 1, starkware.cairo.common.cairo_builtins.HashBuiltin**)];\n", + "autogen/starknet/external/get_balance/b2c52ca2d2a8fc8791a983086d8716c5eacd0c3d62934914d2286f84b98ff4cb.cairo": "let syscall_ptr = [cast([cast(fp + (-5), felt**)] + 0, felt**)];\n", + "autogen/starknet/external/get_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo": "return (syscall_ptr,pedersen_ptr,range_check_ptr,retdata_size,retdata);\n", + "autogen/starknet/external/increase_balance/741ea357d6336b0bed7bf0472425acd0311d543883b803388880e60a232040c7.cairo": "let range_check_ptr = [cast([cast(fp + (-5), felt**)] + 2, felt*)];\n", + "autogen/starknet/external/increase_balance/9684a85e93c782014ca14293edea4eb2502039a5a7b6538ecd39c56faaf12529.cairo": "let pedersen_ptr = [cast([cast(fp + (-5), felt**)] + 1, starkware.cairo.common.cairo_builtins.HashBuiltin**)];\n", + "autogen/starknet/external/increase_balance/a41d25a92a3a14a71125d51d48dd7398e2839f055f01551b7b1950eafc1187c0.cairo": "let ret_value = __wrapped_func{syscall_ptr=syscall_ptr, pedersen_ptr=pedersen_ptr, range_check_ptr=range_check_ptr}(amount=__calldata_arg_amount,);\n%{ memory[ap] = segments.add() %} // Allocate memory for return value.\ntempvar retdata: felt*;\nlet retdata_size = 0;\n", + "autogen/starknet/external/increase_balance/b2c52ca2d2a8fc8791a983086d8716c5eacd0c3d62934914d2286f84b98ff4cb.cairo": "let syscall_ptr = [cast([cast(fp + (-5), felt**)] + 0, felt**)];\n", + "autogen/starknet/external/increase_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo": "return (syscall_ptr,pedersen_ptr,range_check_ptr,retdata_size,retdata);\n", + "autogen/starknet/external/return/get_balance/9ef0a2b9ad0a2e2b202322d7261fff6dada72892e286df2230a9eb8873880a98.cairo": "func get_balance_encode_return(ret_value: (res: felt), range_check_ptr) -> (\n range_check_ptr: felt, data_len: felt, data: felt*) {\n %{ memory[ap] = segments.add() %}\n alloc_locals;\n local __return_value_ptr_start: felt*;\n let __return_value_ptr = __return_value_ptr_start;\n with range_check_ptr {\n }\n return (\n range_check_ptr=range_check_ptr,\n data_len=__return_value_ptr - __return_value_ptr_start,\n data=__return_value_ptr_start);\n}\n", + "autogen/starknet/storage_var/balance/decl.cairo": "namespace balance {\n from starkware.starknet.common.storage import normalize_address\n from starkware.starknet.common.syscalls import storage_read, storage_write\n from starkware.cairo.common.cairo_builtins import HashBuiltin\n from starkware.cairo.common.hash import hash2\n\n func addr{pedersen_ptr: HashBuiltin*, range_check_ptr}() -> (res: felt) {\n let res = 0;\n call hash2;\n call normalize_address;\n }\n\n func read{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr}() -> (res: felt) {\n let storage_addr = 0;\n call addr;\n call storage_read;\n }\n\n func write{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr}(value: felt) {\n let storage_addr = 0;\n call addr;\n call storage_write;\n }\n}", + "autogen/starknet/storage_var/balance/impl.cairo": "namespace balance {\n from starkware.starknet.common.storage import normalize_address\n from starkware.starknet.common.syscalls import storage_read, storage_write\n from starkware.cairo.common.cairo_builtins import HashBuiltin\n from starkware.cairo.common.hash import hash2\n\n func addr{pedersen_ptr: HashBuiltin*, range_check_ptr}() -> (res: felt) {\n let res = 916907772491729262376534102982219947830828984996257231353398618781993312401;\n return (res=res);\n }\n\n func read{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr}() -> (res: felt) {\n let (storage_addr) = addr();\n let (__storage_var_temp0) = storage_read(address=storage_addr + 0);\n\n tempvar syscall_ptr = syscall_ptr;\n tempvar pedersen_ptr = pedersen_ptr;\n tempvar range_check_ptr = range_check_ptr;\n tempvar __storage_var_temp0: felt = __storage_var_temp0;\n return ([cast(&__storage_var_temp0, felt*)],);\n }\n\n func write{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr}(value: felt) {\n let (storage_addr) = addr();\n storage_write(address=storage_addr + 0, value=[cast(&value, felt) + 0]);\n return ();\n }\n}" + }, + "instruction_locations": { + "0": { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 79, + "end_line": 354, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 58, + "start_line": 354 + } + }, + "2": { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 98, + "end_line": 354, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 5, + "start_line": 354 + } + }, + "3": { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 98, + "end_line": 354, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 5, + "start_line": 354 + } + }, + "4": { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_read" + ], + "flow_tracking_data": null, + "hints": [ + { + "location": { + "end_col": 87, + "end_line": 355, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 5, + "start_line": 355 + }, + "n_prefix_newlines": 0 + } + ], + "inst": { + "end_col": 53, + "end_line": 357, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "parent_location": [ + { + "end_col": 37, + "end_line": 352, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "parent_location": [ + { + "end_col": 35, + "end_line": 358, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 5, + "start_line": 358 + }, + "While trying to retrieve the implicit argument 'syscall_ptr' in:" + ], + "start_col": 19, + "start_line": 352 + }, + "While expanding the reference 'syscall_ptr' in:" + ], + "start_col": 23, + "start_line": 357 + } + }, + "6": { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 33, + "end_line": 358, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 19, + "start_line": 358 + } + }, + "7": { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 35, + "end_line": 358, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 5, + "start_line": 358 + } + }, + "8": { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 40, + "end_line": 372, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 18, + "start_line": 372 + } + }, + "10": { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 7, + "end_line": 373, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 5, + "start_line": 371 + } + }, + "11": { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 7, + "end_line": 373, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 5, + "start_line": 371 + } + }, + "12": { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 7, + "end_line": 373, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 5, + "start_line": 371 + } + }, + "13": { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_write" + ], + "flow_tracking_data": null, + "hints": [ + { + "location": { + "end_col": 88, + "end_line": 374, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 5, + "start_line": 374 + }, + "n_prefix_newlines": 0 + } + ], + "inst": { + "end_col": 54, + "end_line": 375, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "parent_location": [ + { + "end_col": 38, + "end_line": 370, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "parent_location": [ + { + "end_col": 15, + "end_line": 376, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 5, + "start_line": 376 + }, + "While trying to retrieve the implicit argument 'syscall_ptr' in:" + ], + "start_col": 20, + "start_line": 370 + }, + "While expanding the reference 'syscall_ptr' in:" + ], + "start_col": 23, + "start_line": 375 + } + }, + "15": { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 15, + "end_line": 376, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "start_col": 5, + "start_line": 376 + } + }, + "16": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.addr" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 41, + "end_line": 7, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 41, + "end_line": 7, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 26, + "end_line": 9, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 9, + "start_line": 9 + }, + "While trying to retrieve the implicit argument 'pedersen_ptr' in:" + ], + "start_col": 15, + "start_line": 7 + }, + "While expanding the reference 'pedersen_ptr' in:" + ], + "start_col": 15, + "start_line": 7 + } + }, + "17": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.addr" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 58, + "end_line": 7, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 58, + "end_line": 7, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 26, + "end_line": 9, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 9, + "start_line": 9 + }, + "While trying to retrieve the implicit argument 'range_check_ptr' in:" + ], + "start_col": 43, + "start_line": 7 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 43, + "start_line": 7 + } + }, + "18": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.addr" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 94, + "end_line": 8, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 24, + "end_line": 9, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 21, + "start_line": 9 + }, + "While expanding the reference 'res' in:" + ], + "start_col": 19, + "start_line": 8 + } + }, + "20": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.addr" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 26, + "end_line": 9, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 9, + "start_line": 9 + } + }, + "21": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 61, + "end_line": 12, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 41, + "end_line": 7, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 36, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 30, + "start_line": 13 + }, + "While trying to retrieve the implicit argument 'pedersen_ptr' in:" + ], + "start_col": 15, + "start_line": 7 + }, + "While expanding the reference 'pedersen_ptr' in:" + ], + "start_col": 35, + "start_line": 12 + } + }, + "22": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 78, + "end_line": 12, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 58, + "end_line": 7, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 36, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 30, + "start_line": 13 + }, + "While trying to retrieve the implicit argument 'range_check_ptr' in:" + ], + "start_col": 43, + "start_line": 7 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 63, + "start_line": 12 + } + }, + "23": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 36, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 30, + "start_line": 13 + } + }, + "25": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 33, + "end_line": 12, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 37, + "end_line": 352, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "parent_location": [ + { + "end_col": 75, + "end_line": 14, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 37, + "start_line": 14 + }, + "While trying to retrieve the implicit argument 'syscall_ptr' in:" + ], + "start_col": 19, + "start_line": 352 + }, + "While expanding the reference 'syscall_ptr' in:" + ], + "start_col": 15, + "start_line": 12 + } + }, + "26": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 26, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 70, + "end_line": 14, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 58, + "start_line": 14 + }, + "While expanding the reference 'storage_addr' in:" + ], + "start_col": 14, + "start_line": 13 + } + }, + "27": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 75, + "end_line": 14, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 37, + "start_line": 14 + } + }, + "29": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 37, + "end_line": 352, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "parent_location": [ + { + "end_col": 75, + "end_line": 14, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 42, + "end_line": 16, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 31, + "start_line": 16 + }, + "While expanding the reference 'syscall_ptr' in:" + ], + "start_col": 37, + "start_line": 14 + }, + "While trying to update the implicit return value 'syscall_ptr' in:" + ], + "start_col": 19, + "start_line": 352 + } + }, + "30": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 41, + "end_line": 7, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 36, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 44, + "end_line": 17, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 32, + "start_line": 17 + }, + "While expanding the reference 'pedersen_ptr' in:" + ], + "start_col": 30, + "start_line": 13 + }, + "While trying to update the implicit return value 'pedersen_ptr' in:" + ], + "start_col": 15, + "start_line": 7 + } + }, + "31": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 58, + "end_line": 7, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 36, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 50, + "end_line": 18, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 35, + "start_line": 18 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 30, + "start_line": 13 + }, + "While trying to update the implicit return value 'range_check_ptr' in:" + ], + "start_col": 43, + "start_line": 7 + } + }, + "32": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 33, + "end_line": 14, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 64, + "end_line": 19, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 45, + "start_line": 19 + }, + "While expanding the reference '__storage_var_temp0' in:" + ], + "start_col": 14, + "start_line": 14 + } + }, + "33": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.read" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 55, + "end_line": 20, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 9, + "start_line": 20 + } + }, + "34": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 62, + "end_line": 23, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 41, + "end_line": 7, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 36, + "end_line": 24, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 30, + "start_line": 24 + }, + "While trying to retrieve the implicit argument 'pedersen_ptr' in:" + ], + "start_col": 15, + "start_line": 7 + }, + "While expanding the reference 'pedersen_ptr' in:" + ], + "start_col": 36, + "start_line": 23 + } + }, + "35": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 79, + "end_line": 23, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 58, + "end_line": 7, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 36, + "end_line": 24, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 30, + "start_line": 24 + }, + "While trying to retrieve the implicit argument 'range_check_ptr' in:" + ], + "start_col": 43, + "start_line": 7 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 64, + "start_line": 23 + } + }, + "36": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 36, + "end_line": 24, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 30, + "start_line": 24 + } + }, + "38": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 34, + "end_line": 23, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 38, + "end_line": 370, + "input_file": { + "filename": "/Users/stanleyyuen/miniconda3/lib/python3.10/site-packages/starkware/starknet/common/syscalls.cairo" + }, + "parent_location": [ + { + "end_col": 80, + "end_line": 25, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 9, + "start_line": 25 + }, + "While trying to retrieve the implicit argument 'syscall_ptr' in:" + ], + "start_col": 20, + "start_line": 370 + }, + "While expanding the reference 'syscall_ptr' in:" + ], + "start_col": 16, + "start_line": 23 + } + }, + "39": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 26, + "end_line": 24, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 43, + "end_line": 25, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 31, + "start_line": 25 + }, + "While expanding the reference 'storage_addr' in:" + ], + "start_col": 14, + "start_line": 24 + } + }, + "40": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 79, + "end_line": 25, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 55, + "start_line": 25 + } + }, + "41": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 80, + "end_line": 25, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 9, + "start_line": 25 + } + }, + "43": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 41, + "end_line": 7, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 36, + "end_line": 24, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 62, + "end_line": 19, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 19, + "end_line": 26, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 9, + "start_line": 26 + }, + "While trying to retrieve the implicit argument 'pedersen_ptr' in:" + ], + "start_col": 36, + "start_line": 19 + }, + "While expanding the reference 'pedersen_ptr' in:" + ], + "start_col": 30, + "start_line": 24 + }, + "While trying to update the implicit return value 'pedersen_ptr' in:" + ], + "start_col": 15, + "start_line": 7 + } + }, + "44": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 58, + "end_line": 7, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 36, + "end_line": 24, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "parent_location": [ + { + "end_col": 79, + "end_line": 19, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 19, + "end_line": 26, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 9, + "start_line": 26 + }, + "While trying to retrieve the implicit argument 'range_check_ptr' in:" + ], + "start_col": 64, + "start_line": 19 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 30, + "start_line": 24 + }, + "While trying to update the implicit return value 'range_check_ptr' in:" + ], + "start_col": 43, + "start_line": 7 + } + }, + "45": { + "accessible_scopes": [ + "__main__", + "__main__.balance", + "__main__.balance.write" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 19, + "end_line": 26, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/impl.cairo" + }, + "start_col": 9, + "start_line": 26 + } + }, + "46": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 23, + "end_line": 14, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 33, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 31, + "end_line": 18, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 17, + "start_line": 18 + }, + "While trying to retrieve the implicit argument 'syscall_ptr' in:" + ], + "start_col": 15, + "start_line": 13 + }, + "While expanding the reference 'syscall_ptr' in:" + ], + "start_col": 5, + "start_line": 14 + } + }, + "47": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 31, + "end_line": 15, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 61, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 31, + "end_line": 18, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 17, + "start_line": 18 + }, + "While trying to retrieve the implicit argument 'pedersen_ptr' in:" + ], + "start_col": 35, + "start_line": 13 + }, + "While expanding the reference 'pedersen_ptr' in:" + ], + "start_col": 5, + "start_line": 15 + } + }, + "48": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 20, + "end_line": 16, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 78, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 31, + "end_line": 18, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 17, + "start_line": 18 + }, + "While trying to retrieve the implicit argument 'range_check_ptr' in:" + ], + "start_col": 63, + "start_line": 13 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 5, + "start_line": 16 + } + }, + "49": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 31, + "end_line": 18, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 17, + "start_line": 18 + } + }, + "51": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 33, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 31, + "end_line": 18, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 34, + "end_line": 19, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 32, + "end_line": 19, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 5, + "start_line": 19 + }, + "While trying to retrieve the implicit argument 'syscall_ptr' in:" + ], + "start_col": 16, + "start_line": 19 + }, + "While expanding the reference 'syscall_ptr' in:" + ], + "start_col": 17, + "start_line": 18 + }, + "While trying to update the implicit return value 'syscall_ptr' in:" + ], + "start_col": 15, + "start_line": 13 + } + }, + "52": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 61, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 31, + "end_line": 18, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 62, + "end_line": 19, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 32, + "end_line": 19, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 5, + "start_line": 19 + }, + "While trying to retrieve the implicit argument 'pedersen_ptr' in:" + ], + "start_col": 36, + "start_line": 19 + }, + "While expanding the reference 'pedersen_ptr' in:" + ], + "start_col": 17, + "start_line": 18 + }, + "While trying to update the implicit return value 'pedersen_ptr' in:" + ], + "start_col": 35, + "start_line": 13 + } + }, + "53": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 78, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 31, + "end_line": 18, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 79, + "end_line": 19, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 32, + "end_line": 19, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 5, + "start_line": 19 + }, + "While trying to retrieve the implicit argument 'range_check_ptr' in:" + ], + "start_col": 64, + "start_line": 19 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 17, + "start_line": 18 + }, + "While trying to update the implicit return value 'range_check_ptr' in:" + ], + "start_col": 63, + "start_line": 13 + } + }, + "54": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 31, + "end_line": 19, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 19, + "start_line": 19 + } + }, + "55": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 32, + "end_line": 19, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 5, + "start_line": 19 + } + }, + "57": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 15, + "end_line": 20, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 5, + "start_line": 20 + } + }, + "58": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 40, + "end_line": 2, + "input_file": { + "filename": "autogen/starknet/arg_processor/73e68c490b7650388f650e9e1ff9b2b3ced88dabf86213d6a0831077eb1a0800.cairo" + }, + "parent_location": [ + { + "end_col": 15, + "end_line": 17, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 45, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/arg_processor/c31620b02d4d706f0542c989b2aadc01b0981d1f6a5933a8fe4937ace3d70d92.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 57, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/arg_processor/01cba52f8515996bb9d7070bde81ff39281d096d7024a558efcba6e1fd2402cf.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While handling calldata of" + ], + "start_col": 35, + "start_line": 1 + }, + "While expanding the reference '__calldata_actual_size' in:" + ], + "start_col": 6, + "start_line": 13 + }, + "While handling calldata of" + ], + "start_col": 31, + "start_line": 1 + }, + "While expanding the reference '__calldata_ptr' in:" + ], + "start_col": 3, + "start_line": 17 + }, + "While handling calldata argument 'amount'" + ], + "start_col": 22, + "start_line": 2 + } + }, + "60": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 58, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/arg_processor/01cba52f8515996bb9d7070bde81ff39281d096d7024a558efcba6e1fd2402cf.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While handling calldata of" + ], + "start_col": 1, + "start_line": 1 + } + }, + "61": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 64, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/b2c52ca2d2a8fc8791a983086d8716c5eacd0c3d62934914d2286f84b98ff4cb.cairo" + }, + "parent_location": [ + { + "end_col": 23, + "end_line": 14, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 55, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/a41d25a92a3a14a71125d51d48dd7398e2839f055f01551b7b1950eafc1187c0.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 44, + "start_line": 1 + }, + "While expanding the reference 'syscall_ptr' in:" + ], + "start_col": 5, + "start_line": 14 + }, + "While constructing the external wrapper for:" + ], + "start_col": 19, + "start_line": 1 + } + }, + "62": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 110, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/9684a85e93c782014ca14293edea4eb2502039a5a7b6538ecd39c56faaf12529.cairo" + }, + "parent_location": [ + { + "end_col": 31, + "end_line": 15, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 82, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/a41d25a92a3a14a71125d51d48dd7398e2839f055f01551b7b1950eafc1187c0.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 70, + "start_line": 1 + }, + "While expanding the reference 'pedersen_ptr' in:" + ], + "start_col": 5, + "start_line": 15 + }, + "While constructing the external wrapper for:" + ], + "start_col": 20, + "start_line": 1 + } + }, + "63": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 67, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/741ea357d6336b0bed7bf0472425acd0311d543883b803388880e60a232040c7.cairo" + }, + "parent_location": [ + { + "end_col": 20, + "end_line": 16, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 115, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/a41d25a92a3a14a71125d51d48dd7398e2839f055f01551b7b1950eafc1187c0.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 100, + "start_line": 1 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 5, + "start_line": 16 + }, + "While constructing the external wrapper for:" + ], + "start_col": 23, + "start_line": 1 + } + }, + "64": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 45, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/arg_processor/73e68c490b7650388f650e9e1ff9b2b3ced88dabf86213d6a0831077eb1a0800.cairo" + }, + "parent_location": [ + { + "end_col": 15, + "end_line": 17, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 145, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/a41d25a92a3a14a71125d51d48dd7398e2839f055f01551b7b1950eafc1187c0.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 124, + "start_line": 1 + }, + "While expanding the reference '__calldata_arg_amount' in:" + ], + "start_col": 3, + "start_line": 17 + }, + "While handling calldata argument 'amount'" + ], + "start_col": 29, + "start_line": 1 + } + }, + "65": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + } + }, + "67": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [ + { + "location": { + "end_col": 34, + "end_line": 2, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/a41d25a92a3a14a71125d51d48dd7398e2839f055f01551b7b1950eafc1187c0.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 1, + "start_line": 2 + }, + "n_prefix_newlines": 0 + } + ], + "inst": { + "end_col": 24, + "end_line": 3, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/a41d25a92a3a14a71125d51d48dd7398e2839f055f01551b7b1950eafc1187c0.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 1, + "start_line": 3 + } + }, + "69": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 55, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/a41d25a92a3a14a71125d51d48dd7398e2839f055f01551b7b1950eafc1187c0.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 20, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 9, + "start_line": 1 + }, + "While expanding the reference 'syscall_ptr' in:" + ], + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 44, + "start_line": 1 + } + }, + "70": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 82, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/a41d25a92a3a14a71125d51d48dd7398e2839f055f01551b7b1950eafc1187c0.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 33, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 21, + "start_line": 1 + }, + "While expanding the reference 'pedersen_ptr' in:" + ], + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 70, + "start_line": 1 + } + }, + "71": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 115, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/a41d25a92a3a14a71125d51d48dd7398e2839f055f01551b7b1950eafc1187c0.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 49, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 34, + "start_line": 1 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 100, + "start_line": 1 + } + }, + "72": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 21, + "end_line": 4, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/a41d25a92a3a14a71125d51d48dd7398e2839f055f01551b7b1950eafc1187c0.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 62, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 50, + "start_line": 1 + }, + "While expanding the reference 'retdata_size' in:" + ], + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 20, + "start_line": 4 + } + }, + "74": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 16, + "end_line": 3, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/a41d25a92a3a14a71125d51d48dd7398e2839f055f01551b7b1950eafc1187c0.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 70, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 63, + "start_line": 1 + }, + "While expanding the reference 'retdata' in:" + ], + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 9, + "start_line": 3 + } + }, + "75": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 72, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/increase_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 13, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 13 + }, + "While constructing the external wrapper for:" + ], + "start_col": 1, + "start_line": 1 + } + }, + "76": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 23, + "end_line": 26, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 33, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 31, + "end_line": 30, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 17, + "start_line": 30 + }, + "While trying to retrieve the implicit argument 'syscall_ptr' in:" + ], + "start_col": 15, + "start_line": 13 + }, + "While expanding the reference 'syscall_ptr' in:" + ], + "start_col": 5, + "start_line": 26 + } + }, + "77": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 31, + "end_line": 27, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 61, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 31, + "end_line": 30, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 17, + "start_line": 30 + }, + "While trying to retrieve the implicit argument 'pedersen_ptr' in:" + ], + "start_col": 35, + "start_line": 13 + }, + "While expanding the reference 'pedersen_ptr' in:" + ], + "start_col": 5, + "start_line": 27 + } + }, + "78": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 20, + "end_line": 28, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 78, + "end_line": 13, + "input_file": { + "filename": "autogen/starknet/storage_var/balance/decl.cairo" + }, + "parent_location": [ + { + "end_col": 31, + "end_line": 30, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 17, + "start_line": 30 + }, + "While trying to retrieve the implicit argument 'range_check_ptr' in:" + ], + "start_col": 63, + "start_line": 13 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 5, + "start_line": 28 + } + }, + "79": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 31, + "end_line": 30, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 17, + "start_line": 30 + } + }, + "81": { + "accessible_scopes": [ + "__main__", + "__main__", + "__main__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 22, + "end_line": 31, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 5, + "start_line": 31 + } + }, + "82": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance_encode_return" + ], + "flow_tracking_data": null, + "hints": [ + { + "location": { + "end_col": 38, + "end_line": 3, + "input_file": { + "filename": "autogen/starknet/external/return/get_balance/9ef0a2b9ad0a2e2b202322d7261fff6dada72892e286df2230a9eb8873880a98.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While handling return value of" + ], + "start_col": 5, + "start_line": 3 + }, + "n_prefix_newlines": 0 + } + ], + "inst": { + "end_col": 18, + "end_line": 4, + "input_file": { + "filename": "autogen/starknet/external/return/get_balance/9ef0a2b9ad0a2e2b202322d7261fff6dada72892e286df2230a9eb8873880a98.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While handling return value of" + ], + "start_col": 5, + "start_line": 4 + } + }, + "84": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance_encode_return" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 45, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/arg_processor/293368f3a0e12cfcf22314a31e13b9801e95a5b8b2b71822a2fbbdf5a01ea795.cairo" + }, + "parent_location": [ + { + "end_col": 18, + "end_line": 29, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 9, + "start_line": 29 + }, + "While handling return value 'res'" + ], + "start_col": 1, + "start_line": 1 + } + }, + "85": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance_encode_return" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 48, + "end_line": 2, + "input_file": { + "filename": "autogen/starknet/arg_processor/293368f3a0e12cfcf22314a31e13b9801e95a5b8b2b71822a2fbbdf5a01ea795.cairo" + }, + "parent_location": [ + { + "end_col": 18, + "end_line": 29, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 36, + "end_line": 11, + "input_file": { + "filename": "autogen/starknet/external/return/get_balance/9ef0a2b9ad0a2e2b202322d7261fff6dada72892e286df2230a9eb8873880a98.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While handling return value of" + ], + "start_col": 18, + "start_line": 11 + }, + "While expanding the reference '__return_value_ptr' in:" + ], + "start_col": 9, + "start_line": 29 + }, + "While handling return value 'res'" + ], + "start_col": 26, + "start_line": 2 + } + }, + "87": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance_encode_return" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 71, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/return/get_balance/9ef0a2b9ad0a2e2b202322d7261fff6dada72892e286df2230a9eb8873880a98.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 40, + "end_line": 10, + "input_file": { + "filename": "autogen/starknet/external/return/get_balance/9ef0a2b9ad0a2e2b202322d7261fff6dada72892e286df2230a9eb8873880a98.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While handling return value of" + ], + "start_col": 25, + "start_line": 10 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 6, + "start_line": 25 + }, + "While handling return value of" + ], + "start_col": 56, + "start_line": 1 + } + }, + "88": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance_encode_return" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 63, + "end_line": 11, + "input_file": { + "filename": "autogen/starknet/external/return/get_balance/9ef0a2b9ad0a2e2b202322d7261fff6dada72892e286df2230a9eb8873880a98.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While handling return value of" + ], + "start_col": 18, + "start_line": 11 + } + }, + "89": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance_encode_return" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 35, + "end_line": 5, + "input_file": { + "filename": "autogen/starknet/external/return/get_balance/9ef0a2b9ad0a2e2b202322d7261fff6dada72892e286df2230a9eb8873880a98.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 38, + "end_line": 12, + "input_file": { + "filename": "autogen/starknet/external/return/get_balance/9ef0a2b9ad0a2e2b202322d7261fff6dada72892e286df2230a9eb8873880a98.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While handling return value of" + ], + "start_col": 14, + "start_line": 12 + }, + "While expanding the reference '__return_value_ptr_start' in:" + ], + "start_col": 6, + "start_line": 25 + }, + "While handling return value of" + ], + "start_col": 11, + "start_line": 5 + } + }, + "90": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance_encode_return" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 40, + "end_line": 12, + "input_file": { + "filename": "autogen/starknet/external/return/get_balance/9ef0a2b9ad0a2e2b202322d7261fff6dada72892e286df2230a9eb8873880a98.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While handling return value of" + ], + "start_col": 5, + "start_line": 9 + } + }, + "91": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 58, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/arg_processor/01cba52f8515996bb9d7070bde81ff39281d096d7024a558efcba6e1fd2402cf.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While handling calldata of" + ], + "start_col": 1, + "start_line": 1 + } + }, + "92": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 64, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/b2c52ca2d2a8fc8791a983086d8716c5eacd0c3d62934914d2286f84b98ff4cb.cairo" + }, + "parent_location": [ + { + "end_col": 23, + "end_line": 26, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 55, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/2c767dabe8478bfafd38f9fb907f9842d03e3c9d2b355e2af5c59b126fcc8f59.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 44, + "start_line": 1 + }, + "While expanding the reference 'syscall_ptr' in:" + ], + "start_col": 5, + "start_line": 26 + }, + "While constructing the external wrapper for:" + ], + "start_col": 19, + "start_line": 1 + } + }, + "93": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 110, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/9684a85e93c782014ca14293edea4eb2502039a5a7b6538ecd39c56faaf12529.cairo" + }, + "parent_location": [ + { + "end_col": 31, + "end_line": 27, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 82, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/2c767dabe8478bfafd38f9fb907f9842d03e3c9d2b355e2af5c59b126fcc8f59.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 70, + "start_line": 1 + }, + "While expanding the reference 'pedersen_ptr' in:" + ], + "start_col": 5, + "start_line": 27 + }, + "While constructing the external wrapper for:" + ], + "start_col": 20, + "start_line": 1 + } + }, + "94": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 67, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/741ea357d6336b0bed7bf0472425acd0311d543883b803388880e60a232040c7.cairo" + }, + "parent_location": [ + { + "end_col": 20, + "end_line": 28, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 115, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/2c767dabe8478bfafd38f9fb907f9842d03e3c9d2b355e2af5c59b126fcc8f59.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 100, + "start_line": 1 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 5, + "start_line": 28 + }, + "While constructing the external wrapper for:" + ], + "start_col": 23, + "start_line": 1 + } + }, + "95": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + } + }, + "97": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 115, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/2c767dabe8478bfafd38f9fb907f9842d03e3c9d2b355e2af5c59b126fcc8f59.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 100, + "end_line": 2, + "input_file": { + "filename": "autogen/starknet/external/get_balance/2c767dabe8478bfafd38f9fb907f9842d03e3c9d2b355e2af5c59b126fcc8f59.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 85, + "start_line": 2 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 100, + "start_line": 1 + } + }, + "98": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 101, + "end_line": 2, + "input_file": { + "filename": "autogen/starknet/external/get_balance/2c767dabe8478bfafd38f9fb907f9842d03e3c9d2b355e2af5c59b126fcc8f59.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 48, + "start_line": 2 + } + }, + "100": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 55, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/2c767dabe8478bfafd38f9fb907f9842d03e3c9d2b355e2af5c59b126fcc8f59.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 20, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 9, + "start_line": 1 + }, + "While expanding the reference 'syscall_ptr' in:" + ], + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 44, + "start_line": 1 + } + }, + "101": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 82, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/2c767dabe8478bfafd38f9fb907f9842d03e3c9d2b355e2af5c59b126fcc8f59.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 33, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 21, + "start_line": 1 + }, + "While expanding the reference 'pedersen_ptr' in:" + ], + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 70, + "start_line": 1 + } + }, + "102": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 21, + "end_line": 2, + "input_file": { + "filename": "autogen/starknet/external/get_balance/2c767dabe8478bfafd38f9fb907f9842d03e3c9d2b355e2af5c59b126fcc8f59.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 49, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 34, + "start_line": 1 + }, + "While expanding the reference 'range_check_ptr' in:" + ], + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 6, + "start_line": 2 + } + }, + "103": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 35, + "end_line": 2, + "input_file": { + "filename": "autogen/starknet/external/get_balance/2c767dabe8478bfafd38f9fb907f9842d03e3c9d2b355e2af5c59b126fcc8f59.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 62, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 50, + "start_line": 1 + }, + "While expanding the reference 'retdata_size' in:" + ], + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 23, + "start_line": 2 + } + }, + "104": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 44, + "end_line": 2, + "input_file": { + "filename": "autogen/starknet/external/get_balance/2c767dabe8478bfafd38f9fb907f9842d03e3c9d2b355e2af5c59b126fcc8f59.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "parent_location": [ + { + "end_col": 70, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 63, + "start_line": 1 + }, + "While expanding the reference 'retdata' in:" + ], + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 37, + "start_line": 2 + } + }, + "105": { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance" + ], + "flow_tracking_data": null, + "hints": [], + "inst": { + "end_col": 72, + "end_line": 1, + "input_file": { + "filename": "autogen/starknet/external/get_balance/da17921a4e81c09e730800bbf23bfdbe5e9e6bfaedc59d80fbf62087fa43c27d.cairo" + }, + "parent_location": [ + { + "end_col": 17, + "end_line": 25, + "input_file": { + "filename": "test.cairo" + }, + "start_col": 6, + "start_line": 25 + }, + "While constructing the external wrapper for:" + ], + "start_col": 1, + "start_line": 1 + } + } + } + }, + "hints": { + "4": [ + { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_read" + ], + "code": "syscall_handler.storage_read(segments=segments, syscall_ptr=ids.syscall_ptr)", + "flow_tracking_data": { + "ap_tracking": { + "group": 0, + "offset": 1 + }, + "reference_ids": { + "starkware.starknet.common.syscalls.storage_read.syscall_ptr": 0 + } + } + } + ], + "13": [ + { + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_write" + ], + "code": "syscall_handler.storage_write(segments=segments, syscall_ptr=ids.syscall_ptr)", + "flow_tracking_data": { + "ap_tracking": { + "group": 1, + "offset": 1 + }, + "reference_ids": { + "starkware.starknet.common.syscalls.storage_write.syscall_ptr": 1 + } + } + } + ], + "67": [ + { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.increase_balance" + ], + "code": "memory[ap] = segments.add()", + "flow_tracking_data": { + "ap_tracking": { + "group": 6, + "offset": 52 + }, + "reference_ids": {} + } + } + ], + "82": [ + { + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.get_balance_encode_return" + ], + "code": "memory[ap] = segments.add()", + "flow_tracking_data": { + "ap_tracking": { + "group": 8, + "offset": 0 + }, + "reference_ids": {} + } + } + ] + }, + "identifiers": { + "__main__.HashBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "type": "alias" + }, + "__main__.balance": { + "type": "namespace" + }, + "__main__.balance.Args": { + "full_name": "__main__.balance.Args", + "members": {}, + "size": 0, + "type": "struct" + }, + "__main__.balance.HashBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "type": "alias" + }, + "__main__.balance.ImplicitArgs": { + "full_name": "__main__.balance.ImplicitArgs", + "members": {}, + "size": 0, + "type": "struct" + }, + "__main__.balance.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "__main__.balance.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "__main__.balance.addr": { + "decorators": [], + "pc": 16, + "type": "function" + }, + "__main__.balance.addr.Args": { + "full_name": "__main__.balance.addr.Args", + "members": {}, + "size": 0, + "type": "struct" + }, + "__main__.balance.addr.ImplicitArgs": { + "full_name": "__main__.balance.addr.ImplicitArgs", + "members": { + "pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "offset": 0 + }, + "range_check_ptr": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "__main__.balance.addr.Return": { + "cairo_type": "(res: felt)", + "type": "type_definition" + }, + "__main__.balance.addr.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "__main__.balance.hash2": { + "destination": "starkware.cairo.common.hash.hash2", + "type": "alias" + }, + "__main__.balance.normalize_address": { + "destination": "starkware.starknet.common.storage.normalize_address", + "type": "alias" + }, + "__main__.balance.read": { + "decorators": [], + "pc": 21, + "type": "function" + }, + "__main__.balance.read.Args": { + "full_name": "__main__.balance.read.Args", + "members": {}, + "size": 0, + "type": "struct" + }, + "__main__.balance.read.ImplicitArgs": { + "full_name": "__main__.balance.read.ImplicitArgs", + "members": { + "pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "offset": 1 + }, + "range_check_ptr": { + "cairo_type": "felt", + "offset": 2 + }, + "syscall_ptr": { + "cairo_type": "felt*", + "offset": 0 + } + }, + "size": 3, + "type": "struct" + }, + "__main__.balance.read.Return": { + "cairo_type": "(res: felt)", + "type": "type_definition" + }, + "__main__.balance.read.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "__main__.balance.storage_read": { + "destination": "starkware.starknet.common.syscalls.storage_read", + "type": "alias" + }, + "__main__.balance.storage_write": { + "destination": "starkware.starknet.common.syscalls.storage_write", + "type": "alias" + }, + "__main__.balance.write": { + "decorators": [], + "pc": 34, + "type": "function" + }, + "__main__.balance.write.Args": { + "full_name": "__main__.balance.write.Args", + "members": { + "value": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "__main__.balance.write.ImplicitArgs": { + "full_name": "__main__.balance.write.ImplicitArgs", + "members": { + "pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "offset": 1 + }, + "range_check_ptr": { + "cairo_type": "felt", + "offset": 2 + }, + "syscall_ptr": { + "cairo_type": "felt*", + "offset": 0 + } + }, + "size": 3, + "type": "struct" + }, + "__main__.balance.write.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "__main__.balance.write.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "__main__.get_balance": { + "decorators": ["view"], + "pc": 76, + "type": "function" + }, + "__main__.get_balance.Args": { + "full_name": "__main__.get_balance.Args", + "members": {}, + "size": 0, + "type": "struct" + }, + "__main__.get_balance.ImplicitArgs": { + "full_name": "__main__.get_balance.ImplicitArgs", + "members": { + "pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "offset": 1 + }, + "range_check_ptr": { + "cairo_type": "felt", + "offset": 2 + }, + "syscall_ptr": { + "cairo_type": "felt*", + "offset": 0 + } + }, + "size": 3, + "type": "struct" + }, + "__main__.get_balance.Return": { + "cairo_type": "(res: felt)", + "type": "type_definition" + }, + "__main__.get_balance.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "__main__.increase_balance": { + "decorators": ["external"], + "pc": 46, + "type": "function" + }, + "__main__.increase_balance.Args": { + "full_name": "__main__.increase_balance.Args", + "members": { + "amount": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "__main__.increase_balance.ImplicitArgs": { + "full_name": "__main__.increase_balance.ImplicitArgs", + "members": { + "pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "offset": 1 + }, + "range_check_ptr": { + "cairo_type": "felt", + "offset": 2 + }, + "syscall_ptr": { + "cairo_type": "felt*", + "offset": 0 + } + }, + "size": 3, + "type": "struct" + }, + "__main__.increase_balance.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "__main__.increase_balance.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "__wrappers__.get_balance": { + "decorators": ["view"], + "pc": 91, + "type": "function" + }, + "__wrappers__.get_balance.Args": { + "full_name": "__wrappers__.get_balance.Args", + "members": {}, + "size": 0, + "type": "struct" + }, + "__wrappers__.get_balance.ImplicitArgs": { + "full_name": "__wrappers__.get_balance.ImplicitArgs", + "members": {}, + "size": 0, + "type": "struct" + }, + "__wrappers__.get_balance.Return": { + "cairo_type": "(syscall_ptr: felt*, pedersen_ptr: starkware.cairo.common.cairo_builtins.HashBuiltin*, range_check_ptr: felt, size: felt, retdata: felt*)", + "type": "type_definition" + }, + "__wrappers__.get_balance.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "__wrappers__.get_balance.__wrapped_func": { + "destination": "__main__.get_balance", + "type": "alias" + }, + "__wrappers__.get_balance_encode_return": { + "decorators": [], + "pc": 82, + "type": "function" + }, + "__wrappers__.get_balance_encode_return.Args": { + "full_name": "__wrappers__.get_balance_encode_return.Args", + "members": { + "range_check_ptr": { + "cairo_type": "felt", + "offset": 1 + }, + "ret_value": { + "cairo_type": "(res: felt)", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "__wrappers__.get_balance_encode_return.ImplicitArgs": { + "full_name": "__wrappers__.get_balance_encode_return.ImplicitArgs", + "members": {}, + "size": 0, + "type": "struct" + }, + "__wrappers__.get_balance_encode_return.Return": { + "cairo_type": "(range_check_ptr: felt, data_len: felt, data: felt*)", + "type": "type_definition" + }, + "__wrappers__.get_balance_encode_return.SIZEOF_LOCALS": { + "type": "const", + "value": 1 + }, + "__wrappers__.get_balance_encode_return.memcpy": { + "destination": "starkware.cairo.common.memcpy.memcpy", + "type": "alias" + }, + "__wrappers__.increase_balance": { + "decorators": ["external"], + "pc": 58, + "type": "function" + }, + "__wrappers__.increase_balance.Args": { + "full_name": "__wrappers__.increase_balance.Args", + "members": {}, + "size": 0, + "type": "struct" + }, + "__wrappers__.increase_balance.ImplicitArgs": { + "full_name": "__wrappers__.increase_balance.ImplicitArgs", + "members": {}, + "size": 0, + "type": "struct" + }, + "__wrappers__.increase_balance.Return": { + "cairo_type": "(syscall_ptr: felt*, pedersen_ptr: starkware.cairo.common.cairo_builtins.HashBuiltin*, range_check_ptr: felt, size: felt, retdata: felt*)", + "type": "type_definition" + }, + "__wrappers__.increase_balance.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "__wrappers__.increase_balance.__wrapped_func": { + "destination": "__main__.increase_balance", + "type": "alias" + }, + "__wrappers__.increase_balance_encode_return.memcpy": { + "destination": "starkware.cairo.common.memcpy.memcpy", + "type": "alias" + }, + "starkware.cairo.common.bool.FALSE": { + "type": "const", + "value": 0 + }, + "starkware.cairo.common.bool.TRUE": { + "type": "const", + "value": 1 + }, + "starkware.cairo.common.cairo_builtins.BitwiseBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "members": { + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "x_and_y": { + "cairo_type": "felt", + "offset": 2 + }, + "x_or_y": { + "cairo_type": "felt", + "offset": 4 + }, + "x_xor_y": { + "cairo_type": "felt", + "offset": 3 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 5, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.EcOpBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.EcOpBuiltin", + "members": { + "m": { + "cairo_type": "felt", + "offset": 4 + }, + "p": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 0 + }, + "q": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 2 + }, + "r": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 5 + } + }, + "size": 7, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.EcPoint": { + "destination": "starkware.cairo.common.ec_point.EcPoint", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.HashBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "members": { + "result": { + "cairo_type": "felt", + "offset": 2 + }, + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.KeccakBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.KeccakBuiltin", + "members": { + "input": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "offset": 0 + }, + "output": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "offset": 8 + } + }, + "size": 16, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.KeccakBuiltinState": { + "destination": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.ModBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.ModBuiltin", + "members": { + "n": { + "cairo_type": "felt", + "offset": 6 + }, + "offsets_ptr": { + "cairo_type": "felt*", + "offset": 5 + }, + "p": { + "cairo_type": "starkware.cairo.common.cairo_builtins.UInt384", + "offset": 0 + }, + "values_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.UInt384*", + "offset": 4 + } + }, + "size": 7, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.PoseidonBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.PoseidonBuiltin", + "members": { + "input": { + "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "offset": 0 + }, + "output": { + "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "offset": 3 + } + }, + "size": 6, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.PoseidonBuiltinState": { + "destination": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.SignatureBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.SignatureBuiltin", + "members": { + "message": { + "cairo_type": "felt", + "offset": 1 + }, + "pub_key": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.UInt384": { + "full_name": "starkware.cairo.common.cairo_builtins.UInt384", + "members": { + "d0": { + "cairo_type": "felt", + "offset": 0 + }, + "d1": { + "cairo_type": "felt", + "offset": 1 + }, + "d2": { + "cairo_type": "felt", + "offset": 2 + }, + "d3": { + "cairo_type": "felt", + "offset": 3 + } + }, + "size": 4, + "type": "struct" + }, + "starkware.cairo.common.dict_access.DictAccess": { + "full_name": "starkware.cairo.common.dict_access.DictAccess", + "members": { + "key": { + "cairo_type": "felt", + "offset": 0 + }, + "new_value": { + "cairo_type": "felt", + "offset": 2 + }, + "prev_value": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.cairo.common.ec_point.EcPoint": { + "full_name": "starkware.cairo.common.ec_point.EcPoint", + "members": { + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.hash.HashBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "type": "alias" + }, + "starkware.cairo.common.keccak_state.KeccakBuiltinState": { + "full_name": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "members": { + "s0": { + "cairo_type": "felt", + "offset": 0 + }, + "s1": { + "cairo_type": "felt", + "offset": 1 + }, + "s2": { + "cairo_type": "felt", + "offset": 2 + }, + "s3": { + "cairo_type": "felt", + "offset": 3 + }, + "s4": { + "cairo_type": "felt", + "offset": 4 + }, + "s5": { + "cairo_type": "felt", + "offset": 5 + }, + "s6": { + "cairo_type": "felt", + "offset": 6 + }, + "s7": { + "cairo_type": "felt", + "offset": 7 + } + }, + "size": 8, + "type": "struct" + }, + "starkware.cairo.common.math.FALSE": { + "destination": "starkware.cairo.common.bool.FALSE", + "type": "alias" + }, + "starkware.cairo.common.math.TRUE": { + "destination": "starkware.cairo.common.bool.TRUE", + "type": "alias" + }, + "starkware.cairo.common.poseidon_state.PoseidonBuiltinState": { + "full_name": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "members": { + "s0": { + "cairo_type": "felt", + "offset": 0 + }, + "s1": { + "cairo_type": "felt", + "offset": 1 + }, + "s2": { + "cairo_type": "felt", + "offset": 2 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.starknet.common.storage.ADDR_BOUND": { + "type": "const", + "value": -106710729501573572985208420194530329073740042555888586719489 + }, + "starkware.starknet.common.storage.MAX_STORAGE_ITEM_SIZE": { + "type": "const", + "value": 256 + }, + "starkware.starknet.common.storage.assert_250_bit": { + "destination": "starkware.cairo.common.math.assert_250_bit", + "type": "alias" + }, + "starkware.starknet.common.syscalls.CALL_CONTRACT_SELECTOR": { + "type": "const", + "value": 20853273475220472486191784820 + }, + "starkware.starknet.common.syscalls.CallContract": { + "full_name": "starkware.starknet.common.syscalls.CallContract", + "members": { + "request": { + "cairo_type": "starkware.starknet.common.syscalls.CallContractRequest", + "offset": 0 + }, + "response": { + "cairo_type": "starkware.starknet.common.syscalls.CallContractResponse", + "offset": 5 + } + }, + "size": 7, + "type": "struct" + }, + "starkware.starknet.common.syscalls.CallContractRequest": { + "full_name": "starkware.starknet.common.syscalls.CallContractRequest", + "members": { + "calldata": { + "cairo_type": "felt*", + "offset": 4 + }, + "calldata_size": { + "cairo_type": "felt", + "offset": 3 + }, + "contract_address": { + "cairo_type": "felt", + "offset": 1 + }, + "function_selector": { + "cairo_type": "felt", + "offset": 2 + }, + "selector": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 5, + "type": "struct" + }, + "starkware.starknet.common.syscalls.CallContractResponse": { + "full_name": "starkware.starknet.common.syscalls.CallContractResponse", + "members": { + "retdata": { + "cairo_type": "felt*", + "offset": 1 + }, + "retdata_size": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.starknet.common.syscalls.DELEGATE_CALL_SELECTOR": { + "type": "const", + "value": 21167594061783206823196716140 + }, + "starkware.starknet.common.syscalls.DELEGATE_L1_HANDLER_SELECTOR": { + "type": "const", + "value": 23274015802972845247556842986379118667122 + }, + "starkware.starknet.common.syscalls.DEPLOY_SELECTOR": { + "type": "const", + "value": 75202468540281 + }, + "starkware.starknet.common.syscalls.Deploy": { + "full_name": "starkware.starknet.common.syscalls.Deploy", + "members": { + "request": { + "cairo_type": "starkware.starknet.common.syscalls.DeployRequest", + "offset": 0 + }, + "response": { + "cairo_type": "starkware.starknet.common.syscalls.DeployResponse", + "offset": 6 + } + }, + "size": 9, + "type": "struct" + }, + "starkware.starknet.common.syscalls.DeployRequest": { + "full_name": "starkware.starknet.common.syscalls.DeployRequest", + "members": { + "class_hash": { + "cairo_type": "felt", + "offset": 1 + }, + "constructor_calldata": { + "cairo_type": "felt*", + "offset": 4 + }, + "constructor_calldata_size": { + "cairo_type": "felt", + "offset": 3 + }, + "contract_address_salt": { + "cairo_type": "felt", + "offset": 2 + }, + "deploy_from_zero": { + "cairo_type": "felt", + "offset": 5 + }, + "selector": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 6, + "type": "struct" + }, + "starkware.starknet.common.syscalls.DeployResponse": { + "full_name": "starkware.starknet.common.syscalls.DeployResponse", + "members": { + "constructor_retdata": { + "cairo_type": "felt*", + "offset": 2 + }, + "constructor_retdata_size": { + "cairo_type": "felt", + "offset": 1 + }, + "contract_address": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.starknet.common.syscalls.DictAccess": { + "destination": "starkware.cairo.common.dict_access.DictAccess", + "type": "alias" + }, + "starkware.starknet.common.syscalls.EMIT_EVENT_SELECTOR": { + "type": "const", + "value": 1280709301550335749748 + }, + "starkware.starknet.common.syscalls.EmitEvent": { + "full_name": "starkware.starknet.common.syscalls.EmitEvent", + "members": { + "data": { + "cairo_type": "felt*", + "offset": 4 + }, + "data_len": { + "cairo_type": "felt", + "offset": 3 + }, + "keys": { + "cairo_type": "felt*", + "offset": 2 + }, + "keys_len": { + "cairo_type": "felt", + "offset": 1 + }, + "selector": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 5, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GET_BLOCK_NUMBER_SELECTOR": { + "type": "const", + "value": 1448089106835523001438702345020786 + }, + "starkware.starknet.common.syscalls.GET_BLOCK_TIMESTAMP_SELECTOR": { + "type": "const", + "value": 24294903732626645868215235778792757751152 + }, + "starkware.starknet.common.syscalls.GET_CALLER_ADDRESS_SELECTOR": { + "type": "const", + "value": 94901967781393078444254803017658102643 + }, + "starkware.starknet.common.syscalls.GET_CONTRACT_ADDRESS_SELECTOR": { + "type": "const", + "value": 6219495360805491471215297013070624192820083 + }, + "starkware.starknet.common.syscalls.GET_SEQUENCER_ADDRESS_SELECTOR": { + "type": "const", + "value": 1592190833581991703053805829594610833820054387 + }, + "starkware.starknet.common.syscalls.GET_TX_INFO_SELECTOR": { + "type": "const", + "value": 1317029390204112103023 + }, + "starkware.starknet.common.syscalls.GET_TX_SIGNATURE_SELECTOR": { + "type": "const", + "value": 1448089128652340074717162277007973 + }, + "starkware.starknet.common.syscalls.GetBlockNumber": { + "full_name": "starkware.starknet.common.syscalls.GetBlockNumber", + "members": { + "request": { + "cairo_type": "starkware.starknet.common.syscalls.GetBlockNumberRequest", + "offset": 0 + }, + "response": { + "cairo_type": "starkware.starknet.common.syscalls.GetBlockNumberResponse", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetBlockNumberRequest": { + "full_name": "starkware.starknet.common.syscalls.GetBlockNumberRequest", + "members": { + "selector": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetBlockNumberResponse": { + "full_name": "starkware.starknet.common.syscalls.GetBlockNumberResponse", + "members": { + "block_number": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetBlockTimestamp": { + "full_name": "starkware.starknet.common.syscalls.GetBlockTimestamp", + "members": { + "request": { + "cairo_type": "starkware.starknet.common.syscalls.GetBlockTimestampRequest", + "offset": 0 + }, + "response": { + "cairo_type": "starkware.starknet.common.syscalls.GetBlockTimestampResponse", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetBlockTimestampRequest": { + "full_name": "starkware.starknet.common.syscalls.GetBlockTimestampRequest", + "members": { + "selector": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetBlockTimestampResponse": { + "full_name": "starkware.starknet.common.syscalls.GetBlockTimestampResponse", + "members": { + "block_timestamp": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetCallerAddress": { + "full_name": "starkware.starknet.common.syscalls.GetCallerAddress", + "members": { + "request": { + "cairo_type": "starkware.starknet.common.syscalls.GetCallerAddressRequest", + "offset": 0 + }, + "response": { + "cairo_type": "starkware.starknet.common.syscalls.GetCallerAddressResponse", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetCallerAddressRequest": { + "full_name": "starkware.starknet.common.syscalls.GetCallerAddressRequest", + "members": { + "selector": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetCallerAddressResponse": { + "full_name": "starkware.starknet.common.syscalls.GetCallerAddressResponse", + "members": { + "caller_address": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetContractAddress": { + "full_name": "starkware.starknet.common.syscalls.GetContractAddress", + "members": { + "request": { + "cairo_type": "starkware.starknet.common.syscalls.GetContractAddressRequest", + "offset": 0 + }, + "response": { + "cairo_type": "starkware.starknet.common.syscalls.GetContractAddressResponse", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetContractAddressRequest": { + "full_name": "starkware.starknet.common.syscalls.GetContractAddressRequest", + "members": { + "selector": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetContractAddressResponse": { + "full_name": "starkware.starknet.common.syscalls.GetContractAddressResponse", + "members": { + "contract_address": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetSequencerAddress": { + "full_name": "starkware.starknet.common.syscalls.GetSequencerAddress", + "members": { + "request": { + "cairo_type": "starkware.starknet.common.syscalls.GetSequencerAddressRequest", + "offset": 0 + }, + "response": { + "cairo_type": "starkware.starknet.common.syscalls.GetSequencerAddressResponse", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetSequencerAddressRequest": { + "full_name": "starkware.starknet.common.syscalls.GetSequencerAddressRequest", + "members": { + "selector": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetSequencerAddressResponse": { + "full_name": "starkware.starknet.common.syscalls.GetSequencerAddressResponse", + "members": { + "sequencer_address": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetTxInfo": { + "full_name": "starkware.starknet.common.syscalls.GetTxInfo", + "members": { + "request": { + "cairo_type": "starkware.starknet.common.syscalls.GetTxInfoRequest", + "offset": 0 + }, + "response": { + "cairo_type": "starkware.starknet.common.syscalls.GetTxInfoResponse", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetTxInfoRequest": { + "full_name": "starkware.starknet.common.syscalls.GetTxInfoRequest", + "members": { + "selector": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetTxInfoResponse": { + "full_name": "starkware.starknet.common.syscalls.GetTxInfoResponse", + "members": { + "tx_info": { + "cairo_type": "starkware.starknet.common.syscalls.TxInfo*", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetTxSignature": { + "full_name": "starkware.starknet.common.syscalls.GetTxSignature", + "members": { + "request": { + "cairo_type": "starkware.starknet.common.syscalls.GetTxSignatureRequest", + "offset": 0 + }, + "response": { + "cairo_type": "starkware.starknet.common.syscalls.GetTxSignatureResponse", + "offset": 1 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetTxSignatureRequest": { + "full_name": "starkware.starknet.common.syscalls.GetTxSignatureRequest", + "members": { + "selector": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetTxSignatureResponse": { + "full_name": "starkware.starknet.common.syscalls.GetTxSignatureResponse", + "members": { + "signature": { + "cairo_type": "felt*", + "offset": 1 + }, + "signature_len": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.starknet.common.syscalls.LIBRARY_CALL_L1_HANDLER_SELECTOR": { + "type": "const", + "value": 436233452754198157705746250789557519228244616562 + }, + "starkware.starknet.common.syscalls.LIBRARY_CALL_SELECTOR": { + "type": "const", + "value": 92376026794327011772951660 + }, + "starkware.starknet.common.syscalls.LibraryCall": { + "full_name": "starkware.starknet.common.syscalls.LibraryCall", + "members": { + "request": { + "cairo_type": "starkware.starknet.common.syscalls.LibraryCallRequest", + "offset": 0 + }, + "response": { + "cairo_type": "starkware.starknet.common.syscalls.CallContractResponse", + "offset": 5 + } + }, + "size": 7, + "type": "struct" + }, + "starkware.starknet.common.syscalls.LibraryCallRequest": { + "full_name": "starkware.starknet.common.syscalls.LibraryCallRequest", + "members": { + "calldata": { + "cairo_type": "felt*", + "offset": 4 + }, + "calldata_size": { + "cairo_type": "felt", + "offset": 3 + }, + "class_hash": { + "cairo_type": "felt", + "offset": 1 + }, + "function_selector": { + "cairo_type": "felt", + "offset": 2 + }, + "selector": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 5, + "type": "struct" + }, + "starkware.starknet.common.syscalls.REPLACE_CLASS_SELECTOR": { + "type": "const", + "value": 25500403217443378527601783667 + }, + "starkware.starknet.common.syscalls.ReplaceClass": { + "full_name": "starkware.starknet.common.syscalls.ReplaceClass", + "members": { + "class_hash": { + "cairo_type": "felt", + "offset": 1 + }, + "selector": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.starknet.common.syscalls.SEND_MESSAGE_TO_L1_SELECTOR": { + "type": "const", + "value": 433017908768303439907196859243777073 + }, + "starkware.starknet.common.syscalls.STORAGE_READ_SELECTOR": { + "type": "const", + "value": 100890693370601760042082660 + }, + "starkware.starknet.common.syscalls.STORAGE_WRITE_SELECTOR": { + "type": "const", + "value": 25828017502874050592466629733 + }, + "starkware.starknet.common.syscalls.SendMessageToL1SysCall": { + "full_name": "starkware.starknet.common.syscalls.SendMessageToL1SysCall", + "members": { + "payload_ptr": { + "cairo_type": "felt*", + "offset": 3 + }, + "payload_size": { + "cairo_type": "felt", + "offset": 2 + }, + "selector": { + "cairo_type": "felt", + "offset": 0 + }, + "to_address": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 4, + "type": "struct" + }, + "starkware.starknet.common.syscalls.StorageRead": { + "full_name": "starkware.starknet.common.syscalls.StorageRead", + "members": { + "request": { + "cairo_type": "starkware.starknet.common.syscalls.StorageReadRequest", + "offset": 0 + }, + "response": { + "cairo_type": "starkware.starknet.common.syscalls.StorageReadResponse", + "offset": 2 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.starknet.common.syscalls.StorageReadRequest": { + "full_name": "starkware.starknet.common.syscalls.StorageReadRequest", + "members": { + "address": { + "cairo_type": "felt", + "offset": 1 + }, + "selector": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.starknet.common.syscalls.StorageReadResponse": { + "full_name": "starkware.starknet.common.syscalls.StorageReadResponse", + "members": { + "value": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.StorageWrite": { + "full_name": "starkware.starknet.common.syscalls.StorageWrite", + "members": { + "address": { + "cairo_type": "felt", + "offset": 1 + }, + "selector": { + "cairo_type": "felt", + "offset": 0 + }, + "value": { + "cairo_type": "felt", + "offset": 2 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.starknet.common.syscalls.TxInfo": { + "full_name": "starkware.starknet.common.syscalls.TxInfo", + "members": { + "account_contract_address": { + "cairo_type": "felt", + "offset": 1 + }, + "chain_id": { + "cairo_type": "felt", + "offset": 6 + }, + "max_fee": { + "cairo_type": "felt", + "offset": 2 + }, + "nonce": { + "cairo_type": "felt", + "offset": 7 + }, + "signature": { + "cairo_type": "felt*", + "offset": 4 + }, + "signature_len": { + "cairo_type": "felt", + "offset": 3 + }, + "transaction_hash": { + "cairo_type": "felt", + "offset": 5 + }, + "version": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 8, + "type": "struct" + }, + "starkware.starknet.common.syscalls.storage_read": { + "decorators": [], + "pc": 0, + "type": "function" + }, + "starkware.starknet.common.syscalls.storage_read.Args": { + "full_name": "starkware.starknet.common.syscalls.storage_read.Args", + "members": { + "address": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.storage_read.ImplicitArgs": { + "full_name": "starkware.starknet.common.syscalls.storage_read.ImplicitArgs", + "members": { + "syscall_ptr": { + "cairo_type": "felt*", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.storage_read.Return": { + "cairo_type": "(value: felt)", + "type": "type_definition" + }, + "starkware.starknet.common.syscalls.storage_read.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "starkware.starknet.common.syscalls.storage_read.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "starkware.starknet.common.syscalls.storage_read.syscall_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 0, + "offset": 0 + }, + "pc": 0, + "value": "[cast(fp + (-4), felt**)]" + }, + { + "ap_tracking_data": { + "group": 0, + "offset": 1 + }, + "pc": 4, + "value": "cast([fp + (-4)] + 3, felt*)" + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.storage_write": { + "decorators": [], + "pc": 8, + "type": "function" + }, + "starkware.starknet.common.syscalls.storage_write.Args": { + "full_name": "starkware.starknet.common.syscalls.storage_write.Args", + "members": { + "address": { + "cairo_type": "felt", + "offset": 0 + }, + "value": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.starknet.common.syscalls.storage_write.ImplicitArgs": { + "full_name": "starkware.starknet.common.syscalls.storage_write.ImplicitArgs", + "members": { + "syscall_ptr": { + "cairo_type": "felt*", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.starknet.common.syscalls.storage_write.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "starkware.starknet.common.syscalls.storage_write.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "starkware.starknet.common.syscalls.storage_write.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "starkware.starknet.common.syscalls.storage_write.syscall_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 1, + "offset": 0 + }, + "pc": 8, + "value": "[cast(fp + (-5), felt**)]" + }, + { + "ap_tracking_data": { + "group": 1, + "offset": 1 + }, + "pc": 13, + "value": "cast([fp + (-5)] + 3, felt*)" + } + ], + "type": "reference" + } + }, + "main_scope": "__main__", + "prime": "0x800000000000011000000000000000000000000000000000000000000000001", + "reference_manager": { + "references": [ + { + "ap_tracking_data": { + "group": 0, + "offset": 0 + }, + "pc": 0, + "value": "[cast(fp + (-4), felt**)]" + }, + { + "ap_tracking_data": { + "group": 1, + "offset": 0 + }, + "pc": 8, + "value": "[cast(fp + (-5), felt**)]" + } + ] + } + } + } +} diff --git a/packages/starknet-snap/src/estimateFee.ts b/packages/starknet-snap/src/estimateFee.ts index 5775cb34..8cc4805d 100644 --- a/packages/starknet-snap/src/estimateFee.ts +++ b/packages/starknet-snap/src/estimateFee.ts @@ -1,9 +1,10 @@ import type { Invocations } from 'starknet'; import { TransactionType } from 'starknet'; -import type { - ApiParamsWithKeyDeriver, - EstimateFeeRequestParams, +import { + FeeTokenUnit, + type ApiParamsWithKeyDeriver, + type EstimateFeeRequestParams, } from './types/snapApi'; import { ACCOUNT_CLASS_HASH } from './utils/constants'; import { logger } from './utils/logger'; @@ -130,7 +131,7 @@ export async function estimateFee(params: ApiParamsWithKeyDeriver) { const resp = { suggestedMaxFee: estimateFeeResp.suggestedMaxFee.toString(10), overallFee: estimateFeeResp.overall_fee.toString(10), - unit: 'wei', + unit: FeeTokenUnit.ETH, includeDeploy: !accountDeployed, }; logger.log(`estimateFee:\nresp: ${toJson(resp)}`); diff --git a/packages/starknet-snap/src/index.ts b/packages/starknet-snap/src/index.ts index e9482055..18b8126e 100644 --- a/packages/starknet-snap/src/index.ts +++ b/packages/starknet-snap/src/index.ts @@ -20,7 +20,6 @@ import { addNetwork } from './addNetwork'; import { createAccount } from './createAccount'; import { declareContract } from './declareContract'; import { estimateAccDeployFee } from './estimateAccountDeployFee'; -import { estimateFee } from './estimateFee'; import { estimateFees } from './estimateFees'; import { executeTxn } from './executeTxn'; import { extractPublicKey } from './extractPublicKey'; @@ -37,6 +36,7 @@ import { getValue } from './getValue'; import { recoverAccounts } from './recoverAccounts'; import type { DisplayPrivateKeyParams, + EstimateFeeParams, SignMessageParams, SignTransactionParams, SignDeclareTransactionParams, @@ -44,6 +44,7 @@ import type { } from './rpcs'; import { displayPrivateKey, + estimateFee, signMessage, signTransaction, signDeclareTransaction, @@ -224,9 +225,8 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ request }) => { return await getValue(apiParams); case 'starkNet_estimateFee': - apiParams.keyDeriver = await getAddressKeyDeriver(snap); - return await estimateFee( - apiParams as unknown as ApiParamsWithKeyDeriver, + return await estimateFee.execute( + apiParams.requestParams as unknown as EstimateFeeParams, ); case 'starkNet_estimateAccountDeployFee': diff --git a/packages/starknet-snap/src/rpcs/estimateFee.test.ts b/packages/starknet-snap/src/rpcs/estimateFee.test.ts new file mode 100644 index 00000000..6561b7fc --- /dev/null +++ b/packages/starknet-snap/src/rpcs/estimateFee.test.ts @@ -0,0 +1,100 @@ +import { InvalidParamsError } from '@metamask/snaps-sdk'; +import type { Invocations } from 'starknet'; +import { constants, TransactionType } from 'starknet'; +import type { Infer } from 'superstruct'; + +import { FeeTokenUnit } from '../types/snapApi'; +import { STARKNET_SEPOLIA_TESTNET_NETWORK } from '../utils/constants'; +import * as starknetUtils from '../utils/starknetUtils'; +import type { TxVersionStruct } from '../utils/superstruct'; +import { mockAccount, prepareMockAccount } from './__tests__/helper'; +import { estimateFee } from './estimateFee'; +import type { EstimateFeeParams } from './estimateFee'; + +jest.mock('../utils/snap'); +jest.mock('../utils/logger'); + +const prepareMockEstimateFee = ({ + chainId, + address, + version, + includeDeploy = false, +}: { + chainId: constants.StarknetChainId; + address: string; + version: Infer; + includeDeploy?: boolean; +}) => { + const invocations: Invocations = [ + { + type: TransactionType.INVOKE, + payload: { + contractAddress: + '0x00b28a089e7fb83debee4607b6334d687918644796b47d9e9e38ea8213833137', + entrypoint: 'functionName', + calldata: ['1', '1'], + }, + }, + ]; + + const request = { + chainId, + address, + invocations, + details: { version }, + } as unknown as EstimateFeeParams; + + const estimateBulkFeeRespMock = { + suggestedMaxFee: BigInt(1000000000000000).toString(10), + overallFee: BigInt(1500000000000000).toString(10), + unit: FeeTokenUnit.ETH, + includeDeploy, + }; + + const getEstimatedFeesSpy = jest.spyOn(starknetUtils, 'getEstimatedFees'); + getEstimatedFeesSpy.mockResolvedValue(estimateBulkFeeRespMock); + + return { estimateBulkFeeRespMock, invocations, request, getEstimatedFeesSpy }; +}; + +describe('estimateFee', () => { + const state = { + accContracts: [], + erc20Tokens: [], + networks: [STARKNET_SEPOLIA_TESTNET_NETWORK], + transactions: [], + }; + + it('estimates fee correctly', async () => { + const chainId = constants.StarknetChainId.SN_SEPOLIA; + const account = await mockAccount(chainId); + prepareMockAccount(account, state); + const { request, getEstimatedFeesSpy, estimateBulkFeeRespMock } = + prepareMockEstimateFee({ + includeDeploy: false, + chainId, + address: account.address, + version: constants.TRANSACTION_VERSION.V2, + }); + + const result = await estimateFee.execute(request); + + expect(getEstimatedFeesSpy).toHaveBeenCalledWith( + STARKNET_SEPOLIA_TESTNET_NETWORK, + account.address, + account.privateKey, + account.publicKey, + request.invocations, + { + version: constants.TRANSACTION_VERSION.V2, + }, + ); + expect(result).toStrictEqual(estimateBulkFeeRespMock); + }); + + it('throws `InvalidParamsError` when request parameter is not correct', async () => { + await expect( + estimateFee.execute({} as unknown as EstimateFeeParams), + ).rejects.toThrow(InvalidParamsError); + }); +}); diff --git a/packages/starknet-snap/src/rpcs/estimateFee.ts b/packages/starknet-snap/src/rpcs/estimateFee.ts new file mode 100644 index 00000000..3a89d83b --- /dev/null +++ b/packages/starknet-snap/src/rpcs/estimateFee.ts @@ -0,0 +1,81 @@ +import type { Json } from '@metamask/snaps-sdk'; +import type { UniversalDetails } from 'starknet'; +import type { Infer } from 'superstruct'; +import { object, string, assign, boolean, optional, enums } from 'superstruct'; + +import { FeeTokenUnit } from '../types/snapApi'; +import { + AddressStruct, + BaseRequestStruct, + AccountRpcController, + UniversalDetailsStruct, + InvocationsStruct, +} from '../utils'; +import { getEstimatedFees } from '../utils/starknetUtils'; + +export const EstimateFeeRequestStruct = assign( + object({ + address: AddressStruct, + invocations: InvocationsStruct, + details: optional(UniversalDetailsStruct), + }), + BaseRequestStruct, +); + +export const EstimateFeeResponseStruct = object({ + suggestedMaxFee: string(), + overallFee: string(), + unit: enums(Object.values(FeeTokenUnit)), + includeDeploy: boolean(), +}); + +export type EstimateFeeParams = Infer & Json; + +export type EstimateFeeResponse = Infer; + +/** + * The RPC handler to estimate fee of a transaction. + */ +export class EstimateFeeRpc extends AccountRpcController< + EstimateFeeParams, + EstimateFeeResponse +> { + protected requestStruct = EstimateFeeRequestStruct; + + protected responseStruct = EstimateFeeResponseStruct; + + /** + * Execute the bulk estimate transaction fee request handler. + * + * @param params - The parameters of the request. + * @param params.address - The account address. + * @param params.invocations - The invocations to estimate fee. Reference: https://starknetjs.com/docs/API/namespaces/types#invocations + * @param params.details - The universal details associated to the invocations. Reference: https://starknetjs.com/docs/API/interfaces/types.EstimateFeeDetails + * @param params.chainId - The chain id of the network. + * @returns A promise that resolves to a EstimateFeeResponse object. + */ + async execute(params: EstimateFeeParams): Promise { + return super.execute(params); + } + + protected async handleRequest( + params: EstimateFeeParams, + ): Promise { + const { address, invocations, details } = params; + + const estimateFeeResp = await getEstimatedFees( + this.network, + address, + this.account.privateKey, + this.account.publicKey, + invocations, + details as UniversalDetails, + ); + + return estimateFeeResp; + } +} + +export const estimateFee = new EstimateFeeRpc({ + showInvalidAccountAlert: false, +}); diff --git a/packages/starknet-snap/src/rpcs/index.ts b/packages/starknet-snap/src/rpcs/index.ts index 3733777a..2e595419 100644 --- a/packages/starknet-snap/src/rpcs/index.ts +++ b/packages/starknet-snap/src/rpcs/index.ts @@ -1,5 +1,6 @@ -export * from './signMessage'; export * from './displayPrivateKey'; +export * from './estimateFee'; +export * from './signMessage'; export * from './signTransaction'; export * from './sign-declare-transaction'; export * from './verify-signature'; diff --git a/packages/starknet-snap/src/types/snapApi.ts b/packages/starknet-snap/src/types/snapApi.ts index efd375c2..f3a69a65 100644 --- a/packages/starknet-snap/src/types/snapApi.ts +++ b/packages/starknet-snap/src/types/snapApi.ts @@ -234,4 +234,14 @@ export type GetStarkNameRequestParam = { userAddress: string; } & BaseRequestParams; +export enum FeeToken { + ETH = 'ETH', + STRK = 'STRK', +} + +export enum FeeTokenUnit { + ETH = 'wei', + STRK = 'fri', +} + /* eslint-disable */ diff --git a/packages/starknet-snap/src/types/starknet.ts b/packages/starknet-snap/src/types/starknet.ts index 718c6095..cc0be9e8 100644 --- a/packages/starknet-snap/src/types/starknet.ts +++ b/packages/starknet-snap/src/types/starknet.ts @@ -1,4 +1,7 @@ import type { GetTransactionResponse } from 'starknet'; +import type { Infer } from 'superstruct'; + +import type { TxVersionStruct } from '../utils'; export type TransactionStatuses = { executionStatus: string | undefined; @@ -13,3 +16,12 @@ export type TransactionResponse = GetTransactionResponse & { contract_address?: string; calldata?: string[]; }; + +export type TransactionVersion = Infer; + +export type DeployAccountPayload = { + classHash: string; + contractAddress: string; + constructorCalldata: string[]; + addressSalt: string; +}; diff --git a/packages/starknet-snap/src/utils/rpc.test.ts b/packages/starknet-snap/src/utils/rpc.test.ts index 4594e296..0b92373b 100644 --- a/packages/starknet-snap/src/utils/rpc.test.ts +++ b/packages/starknet-snap/src/utils/rpc.test.ts @@ -45,6 +45,11 @@ describe('validateRequest', () => { expect(() => validateRequest(requestParams, validateStruct as unknown as Struct), ).toThrow(InvalidParamsError); + expect(() => + validateRequest(requestParams, validateStruct as unknown as Struct), + ).toThrow( + 'At path: signerAddress -- Expected a string, but received: 1234', + ); }); }); diff --git a/packages/starknet-snap/src/utils/rpc.ts b/packages/starknet-snap/src/utils/rpc.ts index 75997ed1..3b3cc925 100644 --- a/packages/starknet-snap/src/utils/rpc.ts +++ b/packages/starknet-snap/src/utils/rpc.ts @@ -110,7 +110,7 @@ export type Account = { derivationPath: ReturnType; }; -export type AccountRpcControllerOptions = Json & { +export type AccountRpcControllerOptions = { showInvalidAccountAlert: boolean; }; diff --git a/packages/starknet-snap/src/utils/snapUtils.ts b/packages/starknet-snap/src/utils/snapUtils.ts index 4aa38a44..90165a2f 100644 --- a/packages/starknet-snap/src/utils/snapUtils.ts +++ b/packages/starknet-snap/src/utils/snapUtils.ts @@ -12,9 +12,10 @@ import type { DeployAccountSignerDetails, } from 'starknet'; -import type { - AddErc20TokenRequestParams, - AddNetworkRequestParams, +import { + FeeToken, + type AddErc20TokenRequestParams, + type AddNetworkRequestParams, } from '../types/snapApi'; import { TransactionStatus } from '../types/snapState'; import type { @@ -391,7 +392,7 @@ export function getTxnSnapTxt( if (invocationsDetails?.maxFee) { addDialogTxt( components, - 'Max Fee(ETH)', + `Max Fee(${FeeToken.ETH})`, convert(invocationsDetails.maxFee, 'wei', 'ether'), ); } diff --git a/packages/starknet-snap/src/utils/starknetUtils.test.ts b/packages/starknet-snap/src/utils/starknetUtils.test.ts new file mode 100644 index 00000000..aafa3b6f --- /dev/null +++ b/packages/starknet-snap/src/utils/starknetUtils.test.ts @@ -0,0 +1,167 @@ +import type { EstimateFee, Invocations } from 'starknet'; +import { constants, TransactionType } from 'starknet'; + +import { mockAccount, prepareMockAccount } from '../rpcs/__tests__/helper'; +import { FeeTokenUnit } from '../types/snapApi'; +import type { SnapState } from '../types/snapState'; +import { + ACCOUNT_CLASS_HASH, + STARKNET_SEPOLIA_TESTNET_NETWORK, + TRANSACTION_VERSION, +} from './constants'; +import * as starknetUtils from './starknetUtils'; + +describe('getEstimatedFees', () => { + const state: SnapState = { + accContracts: [], + erc20Tokens: [], + networks: [STARKNET_SEPOLIA_TESTNET_NETWORK], + transactions: [], + }; + + const suggestedMaxFee = BigInt('0xc'); + const overallFee = BigInt('0xa'); + + const prepareSpy = async (deployed: boolean) => { + const chainId = constants.StarknetChainId.SN_SEPOLIA; + const account = await mockAccount(chainId); + + const invocations: Invocations = [ + { + type: TransactionType.INVOKE, + payload: { + contractAddress: + '0x00b28a089e7fb83debee4607b6334d687918644796b47d9e9e38ea8213833137', + entrypoint: 'functionName', + calldata: ['1', '1'], + }, + }, + ]; + + prepareMockAccount(account, state); + const accountDeployedSpy = jest.spyOn(starknetUtils, 'isAccountDeployed'); + accountDeployedSpy.mockResolvedValue(deployed); + + const estimateFeeResp = { + // eslint-disable-next-line @typescript-eslint/naming-convention + overall_fee: overallFee, + // eslint-disable-next-line @typescript-eslint/naming-convention + gas_consumed: BigInt('0x0'), + suggestedMaxFee, + // eslint-disable-next-line @typescript-eslint/naming-convention + gas_price: BigInt('0x0'), + } as EstimateFee; + const estimateBulkFeeSpy = jest.spyOn(starknetUtils, 'estimateFeeBulk'); + estimateBulkFeeSpy.mockResolvedValue([estimateFeeResp]); + + return { + account, + invocations, + accountDeployedSpy, + estimateBulkFeeSpy, + }; + }; + + it.each([constants.TRANSACTION_VERSION.V2, constants.TRANSACTION_VERSION.V3])( + 'estimate fees for transaction version %s', + async (transactionVersion) => { + const deployed = true; + const { account, invocations } = await prepareSpy(deployed); + + const resp = await starknetUtils.getEstimatedFees( + STARKNET_SEPOLIA_TESTNET_NETWORK, + account.address, + account.privateKey, + account.publicKey, + invocations, + { + version: transactionVersion, + }, + ); + + expect(resp).toStrictEqual({ + suggestedMaxFee: suggestedMaxFee.toString(10), + overallFee: overallFee.toString(10), + unit: + transactionVersion === constants.TRANSACTION_VERSION.V2 + ? FeeTokenUnit.ETH + : FeeTokenUnit.STRK, + includeDeploy: !deployed, + }); + }, + ); + + it('estimate fees including deployment if the account is not deployed', async () => { + const deployed = false; + const { account, estimateBulkFeeSpy, invocations } = await prepareSpy( + deployed, + ); + const deployAccountpayload = starknetUtils.createAccountDeployPayload( + account.address, + account.publicKey, + ); + const call = invocations[0]; + + const resp = await starknetUtils.getEstimatedFees( + STARKNET_SEPOLIA_TESTNET_NETWORK, + account.address, + account.privateKey, + account.publicKey, + [call], + { + version: TRANSACTION_VERSION, + }, + ); + + expect(estimateBulkFeeSpy).toHaveBeenCalledWith( + STARKNET_SEPOLIA_TESTNET_NETWORK, + account.address, + account.privateKey, + [ + { + payload: { + addressSalt: account.addressSalt, + classHash: ACCOUNT_CLASS_HASH, + constructorCalldata: deployAccountpayload.constructorCalldata, + contractAddress: deployAccountpayload.contractAddress, + }, + type: TransactionType.DEPLOY_ACCOUNT, + }, + { + payload: (invocations[0] as any).payload, + type: TransactionType.INVOKE, + }, + ], + TRANSACTION_VERSION, + { + version: TRANSACTION_VERSION, + }, + ); + expect(resp).toStrictEqual({ + suggestedMaxFee: suggestedMaxFee.toString(10), + overallFee: overallFee.toString(10), + unit: FeeTokenUnit.ETH, + includeDeploy: !deployed, + }); + }); + + it('estimate fees without transaction version', async () => { + const deployed = true; + const { account, invocations } = await prepareSpy(true); + + const resp = await starknetUtils.getEstimatedFees( + STARKNET_SEPOLIA_TESTNET_NETWORK, + account.address, + account.privateKey, + account.publicKey, + invocations, + ); + + expect(resp).toStrictEqual({ + suggestedMaxFee: suggestedMaxFee.toString(10), + overallFee: overallFee.toString(10), + unit: FeeTokenUnit.ETH, + includeDeploy: !deployed, + }); + }); +}); diff --git a/packages/starknet-snap/src/utils/starknetUtils.ts b/packages/starknet-snap/src/utils/starknetUtils.ts index 7f50d3df..7998435b 100644 --- a/packages/starknet-snap/src/utils/starknetUtils.ts +++ b/packages/starknet-snap/src/utils/starknetUtils.ts @@ -37,14 +37,21 @@ import { validateAndParseAddress as _validateAndParseAddress, Signer, stark, + TransactionType as StarknetTransactionType, } from 'starknet'; -import type { RpcV4GetTransactionReceiptResponse } from '../types/snapApi'; +import type { EstimateFeeResponse } from '../rpcs/estimateFee'; +import { + FeeTokenUnit, + type RpcV4GetTransactionReceiptResponse, +} from '../types/snapApi'; import type { Network, SnapState, Transaction } from '../types/snapState'; import { TransactionType } from '../types/snapState'; import type { + DeployAccountPayload, TransactionResponse, TransactionStatuses, + TransactionVersion, } from '../types/starknet'; import type { VoyagerTransactions, @@ -133,9 +140,7 @@ export const getAccountInstance = ( userAddress: string, privateKey: string | Uint8Array, cairoVersion?: CairoVersion, - transactionVersion?: - | typeof constants.TRANSACTION_VERSION.V2 - | typeof constants.TRANSACTION_VERSION.V3, + transactionVersion?: TransactionVersion, blockIdentifier?: BlockIdentifierEnum, ): Account => { const provider = getProvider(network, blockIdentifier); @@ -233,9 +238,7 @@ export const estimateFeeBulk = async ( senderAddress: string, privateKey: string | Uint8Array, txnInvocation: Invocations, - transactionVersion: - | typeof constants.TRANSACTION_VERSION.V2 - | typeof constants.TRANSACTION_VERSION.V3 = TRANSACTION_VERSION, + transactionVersion: TransactionVersion = TRANSACTION_VERSION, invocationsDetails?: UniversalDetails, cairoVersion?: CairoVersion, ): Promise => { @@ -908,6 +911,89 @@ export const validateAndParseAddress = ( return _validateAndParseAddressFn(address); }; +/** + * Creates the payload required to deploy a new account on StarkNet. + * + * This function generates the necessary parameters for deploying an account, including the + * class hash, contract address, constructor calldata, and address salt. The payload returned + * by this function can be used in the deployment transaction to initialize the account. + * + * @param {string} address - The address of the account to be deployed. + * @param {string} publicKey - The public key associated with the account. + * @returns {DeployAccountPayload} - The payload object containing the class hash, contract address, + * constructor calldata, and address salt required for deployment. + */ +export function createAccountDeployPayload( + address: string, + publicKey: string, +): DeployAccountPayload { + const { callData } = getAccContractAddressAndCallData(publicKey); + return { + classHash: ACCOUNT_CLASS_HASH, + contractAddress: address, + constructorCalldata: callData, + addressSalt: publicKey, + }; +} + +/** + * Estimate the fees required for a set of transactions, including optional account deployment costs. + * + * This function is specifically designed for use with Cairo 1 and does not support Cairo 0. + * It calculates the fees for a batch of transaction invocations and includes the additional cost + * of deploying an account if the account has not yet been deployed. + * + * @param {Network} network - The StarkNet network to interact with. + * @param {string} address - The account address involved in the transactions. + * @param {string} privateKey - The private key for signing the transactions. + * @param {string} publicKey - The public key of the account. + * @param {Invocations} transactionInvocations - The set of transactions to be executed. + * @param {constants.TRANSACTION_VERSION} transactionVersion - The version of the transaction, valid values are '0x2' or '0x3'. + * @returns {Promise} - A promise that resolves to the estimated fee response, + * including suggested maximum fee and overall fee in wei. + */ +export async function getEstimatedFees( + network: Network, + address: string, + privateKey: string, + publicKey: string, + transactionInvocations: Invocations, + invocationsDetails: UniversalDetails = {}, +): Promise { + const transactionVersion = (invocationsDetails?.version ?? + TRANSACTION_VERSION) as TransactionVersion; + const accountDeployed = await isAccountDeployed(network, address); + if (!accountDeployed) { + const deployAccountpayload = createAccountDeployPayload(address, publicKey); + + transactionInvocations.unshift({ + type: StarknetTransactionType.DEPLOY_ACCOUNT, + payload: deployAccountpayload, + }); + } + + const estimateBulkFeeResp = await estimateFeeBulk( + network, + address, + privateKey, + transactionInvocations, + transactionVersion, + invocationsDetails, + ); + + const estimateFeeResp = addFeesFromAllTransactions(estimateBulkFeeResp); + + return { + suggestedMaxFee: estimateFeeResp.suggestedMaxFee.toString(10), + overallFee: estimateFeeResp.overall_fee.toString(10), + unit: + transactionVersion === constants.TRANSACTION_VERSION.V2 + ? FeeTokenUnit.ETH + : FeeTokenUnit.STRK, + includeDeploy: !accountDeployed, + }; +} + /** * Check address needed deploy by using getVersion and check if eth balance is non empty. * diff --git a/packages/starknet-snap/src/utils/superstruct.test.ts b/packages/starknet-snap/src/utils/superstruct.test.ts index ea2c4027..e9198798 100644 --- a/packages/starknet-snap/src/utils/superstruct.test.ts +++ b/packages/starknet-snap/src/utils/superstruct.test.ts @@ -1,24 +1,31 @@ -import { constants } from 'starknet'; +import { constants, TransactionType } from 'starknet'; import { StructError, assert, object, number, string } from 'superstruct'; +import contractExample from '../__tests__/fixture/contract-example.json'; import transactionExample from '../__tests__/fixture/transactionExample.json'; import typedDataExample from '../__tests__/fixture/typedDataExample.json'; -import { CAIRO_VERSION, CAIRO_VERSION_LEGACY } from './constants'; +import { + ACCOUNT_CLASS_HASH, + CAIRO_VERSION, + CAIRO_VERSION_LEGACY, + ETHER_SEPOLIA_TESTNET, +} from './constants'; import { AddressStruct, AuthorizableStruct, BaseRequestStruct, CairoVersionStruct, CallDataStruct, - ChainIdStruct, + createStructWithAdditionalProperties, DeclareSignDetailsStruct, EDataModeStruct, NumberStringStruct, ResourceBoundMappingStruct, - createStructWithAdditionalProperties, TxVersionStruct, TypeDataStruct, V3TransactionDetailStruct, + InvocationsStruct, + ChainIdStruct, } from './superstruct'; describe('AddressStruct', () => { @@ -413,3 +420,149 @@ describe('createStructWithAdditionalProperties', () => { expect(error?.message).toContain('Expected a string, but received'); }); }); + +describe('InvocationsStruct', () => { + it.each([ + { + type: TransactionType.INVOKE, + payload: { + contractAddress: ETHER_SEPOLIA_TESTNET.address, + entrypoint: 'transfer', + }, + }, + { + type: TransactionType.DECLARE, + payload: { + contract: contractExample.contract, + }, + }, + { + type: TransactionType.DEPLOY, + payload: { + classHash: ACCOUNT_CLASS_HASH, + }, + }, + { + type: TransactionType.DEPLOY_ACCOUNT, + payload: { + classHash: ACCOUNT_CLASS_HASH, + }, + }, + ])( + 'does not throw error if the invocation type is $type and payload is valid', + (request: unknown) => { + expect(() => assert([request], InvocationsStruct)).not.toThrow(); + }, + ); + + it.each([ + { + type: TransactionType.INVOKE, + payload: { + entrypoint: 'transfer', + }, + }, + { + type: TransactionType.DECLARE, + payload: { + contract: { + ...contractExample.contract, + // eslint-disable-next-line @typescript-eslint/naming-convention + entry_points_by_type: { + invalid: 1, + }, + }, + }, + }, + { + type: TransactionType.DEPLOY, + payload: { + classHash: '', + }, + }, + { + type: TransactionType.DEPLOY_ACCOUNT, + payload: { + classHash: '', + }, + }, + ])( + 'throws error if the invocation type is $type and payload is invalid', + (request: unknown) => { + expect(() => assert([request], InvocationsStruct)).toThrow(StructError); + }, + ); + + it.each([ + { + request: { + type: TransactionType.DECLARE, + payload: [ + { + contract: contractExample.contract, + }, + ], + }, + expectedError: 'Declare payload does not accept mutiple items', + }, + { + request: { + type: TransactionType.DEPLOY_ACCOUNT, + payload: [ + { + classHash: ACCOUNT_CLASS_HASH, + }, + ], + }, + expectedError: 'Deploy account payload does not accept mutiple items', + }, + ])( + 'throws error if the invocation type is $request.type and payload is multiple', + ({ + request, + expectedError, + }: { + request: unknown; + expectedError: string; + }) => { + expect(() => assert([request], InvocationsStruct)).toThrow(expectedError); + }, + ); + + it.each([ + { + type: TransactionType.INVOKE, + payload: [ + { + contractAddress: ETHER_SEPOLIA_TESTNET.address, + entrypoint: 'transfer', + }, + ], + }, + { + type: TransactionType.DEPLOY, + payload: [ + { + classHash: ACCOUNT_CLASS_HASH, + }, + ], + }, + ])( + 'does not throw error if the invocation type is $type and payload is multiple', + (request: unknown) => { + expect(() => assert([request], InvocationsStruct)).not.toThrow(); + }, + ); + + it('throws meaningful error message if a nested StructError thrown', () => { + const request = { + type: TransactionType.INVOKE, + payload: { + contractAddress: ETHER_SEPOLIA_TESTNET.address, + }, + }; + expect(() => assert([request], InvocationsStruct)).toThrow( + 'At path: entrypoint -- At path: entrypoint -- Expected a string, but received: undefined', + ); + }); +}); diff --git a/packages/starknet-snap/src/utils/superstruct.ts b/packages/starknet-snap/src/utils/superstruct.ts index 2afc0301..ed1ce4ab 100644 --- a/packages/starknet-snap/src/utils/superstruct.ts +++ b/packages/starknet-snap/src/utils/superstruct.ts @@ -1,6 +1,7 @@ import { union } from '@metamask/snaps-sdk'; import { HexStruct } from '@metamask/utils'; -import { constants, validateAndParseAddress } from 'starknet'; +import type { CompiledContract, Invocations } from 'starknet'; +import { constants, TransactionType, validateAndParseAddress } from 'starknet'; import type { Struct } from 'superstruct'; import { boolean, @@ -13,9 +14,13 @@ import { any, number, array, - nonempty, - dynamic, assign, + dynamic, + define, + mask, + validate, + nonempty, + unknown, } from 'superstruct'; import { CAIRO_VERSION_LEGACY, CAIRO_VERSION } from './constants'; @@ -85,10 +90,13 @@ export const BaseRequestStruct = object({ debugLevel: optional(enums(Object.keys(LogLevel))), }); +// TODO: refine this to calldata +export const RawArgsStruct = union([array(string()), record(string(), any())]); + export const CallDataStruct = object({ - entrypoint: string(), - contractAddress: string(), - calldata: union([array(string()), record(string(), any())]), // TODO: refine this to calldata + entrypoint: nonempty(string()), + contractAddress: nonempty(string()), + calldata: optional(RawArgsStruct), }); export const NumberStringStruct = union([number(), HexStruct]); @@ -184,3 +192,165 @@ export const createStructWithAdditionalProperties = ( return assign(predefinedProperties, object(additionalProperties)); }); }; + +// Define the types you expect for additional properties +export const additionalPropertyTypes = union([string(), number(), any()]); + +/* ------------------------------ Contract Struct ------------------------------ */ +/* eslint-disable */ +export const SierraContractEntryPointFieldsStruct = object({ + selector: string(), + function_idx: string(), +}); + +export const ContractEntryPointFieldsStruct = object({ + selector: string(), + offset: union([string(), number()]), + builtins: optional(array(string())), +}); + +export const EntryPointByTypeStruct = object({ + CONSTRUCTOR: array(ContractEntryPointFieldsStruct), + EXTERNAL: array(ContractEntryPointFieldsStruct), + L1_HANDLER: array(ContractEntryPointFieldsStruct), +}); + +export const SierraEntryPointByTypeStruct = object({ + CONSTRUCTOR: array(SierraContractEntryPointFieldsStruct), + EXTERNAL: array(SierraContractEntryPointFieldsStruct), + L1_HANDLER: array(SierraContractEntryPointFieldsStruct), +}); + +export const CompiledSierraStruct = object({ + sierra_program: array(string()), + contract_class_version: nonempty(string()), + entry_points_by_type: SierraEntryPointByTypeStruct, + sierra_program_debug_info: optional(any()), + abi: any(), +}); + +export const CompiledSierraCasmStruct = object({ + prime: string(), + compiler_version: string(), + bytecode: array(string()), + hints: array(any()), + pythonic_hints: optional(array(any())), + bytecode_segment_lengths: optional(array(number())), + entry_points_by_type: EntryPointByTypeStruct, +}); + +export const LegacyCompiledContractStruct = object({ + program: record(string(), any()), + entry_points_by_type: EntryPointByTypeStruct, + abi: any(), +}); +/* eslint-disable */ +/* ------------------------------ Contract Struct ------------------------------ */ + +// TODO: add unit test +export const CompiledContractStruct = define( + 'CompiledContractStruct', + (value: CompiledContract) => { + if (Object.prototype.hasOwnProperty.call(value, 'sierra_program')) { + return validate(value, CompiledSierraStruct)[0] ?? true; + } + return validate(value, LegacyCompiledContractStruct)[0] ?? true; + }, +); + +export const DeclareContractPayloadStruct = object({ + contract: CompiledContractStruct, + classHash: optional(string()), + casm: optional(CompiledSierraCasmStruct), + compiledClassHash: optional(string()), +}); + +export const DeployAccountContractStruct = object({ + classHash: nonempty(string()), + constructorCalldata: optional(RawArgsStruct), + addressSalt: optional(NumberStringStruct), + contractAddress: optional(string()), +}); + +export const UniversalDeployerContractPayloadStruct = object({ + classHash: NumberStringStruct, + salt: optional(string()), + unique: optional(boolean()), + constructorCalldata: optional(RawArgsStruct), +}); + +export const BaseInvocationStruct = object({ + // lets not accept optaional payload to reduce the complexity of the struct + // as the snap control the input + payload: unknown(), + type: enums([ + TransactionType.DECLARE, + TransactionType.DEPLOY, + TransactionType.DEPLOY_ACCOUNT, + TransactionType.INVOKE, + ]), +}); + +export const InvocationsStruct = define( + // We do use a custom `define` for this type to avoid having to use a `union` since error + // messages are a bit confusing. + // + // Doing manual validation allows us to use the "concrete" type of each supported acounts giving + // use a much nicer message from `superstruct`. + 'InvocationsStruct', + (value: unknown[]) => { + for (const invocation of value as Invocations) { + // This will also raise if `value` does not match any of the supported TransactionType! + const maskedInvocation = mask(invocation, BaseInvocationStruct); + + const isArray = Array.isArray(maskedInvocation.payload); + + let struct: Struct; + + switch (invocation.type) { + case TransactionType.DECLARE: + struct = DeclareContractPayloadStruct; + if (isArray) { + throw new Error('Declare payload does not accept mutiple items'); + } + break; + case TransactionType.DEPLOY: + struct = UniversalDeployerContractPayloadStruct; + break; + case TransactionType.DEPLOY_ACCOUNT: + struct = DeployAccountContractStruct; + if (isArray) { + throw new Error( + 'Deploy account payload does not accept mutiple items', + ); + } + break; + case TransactionType.INVOKE: + struct = CallDataStruct; + break; + default: + throw new Error('Invalid transaction type'); + } + + const [error] = validate( + maskedInvocation.payload, + isArray ? array(struct) : struct, + ); + + if (error !== undefined) { + return error; + } + } + return true; + }, +); + +export const UniversalDetailsStruct = assign( + V3TransactionDetailStruct, + object({ + blockIdentifier: optional(string()), + maxFee: optional(NumberStringStruct), + skipValidate: optional(boolean()), + version: optional(TxVersionStruct), + }), +); diff --git a/packages/starknet-snap/test/src/sendTransaction.test.ts b/packages/starknet-snap/test/src/sendTransaction.test.ts index 764e45d6..5cb42d48 100644 --- a/packages/starknet-snap/test/src/sendTransaction.test.ts +++ b/packages/starknet-snap/test/src/sendTransaction.test.ts @@ -27,6 +27,7 @@ import { getAddressKeyDeriver } from '../../src/utils/keyPair'; import { Mutex } from 'async-mutex'; import { ApiParamsWithKeyDeriver, + FeeTokenUnit, SendTransactionRequestParams, } from '../../src/types/snapApi'; import { GetTransactionReceiptResponse } from 'starknet'; @@ -242,7 +243,7 @@ describe('Test function: sendTransaction', function () { sandbox.stub(estimateFeeSnap, 'estimateFee').resolves({ suggestedMaxFee: estimateFeeResp.suggestedMaxFee.toString(10), overallFee: estimateFeeResp.overall_fee.toString(10), - unit: 'wei', + unit: FeeTokenUnit.ETH, includeDeploy: true, }); executeTxnResp = sendTransactionResp; diff --git a/packages/wallet-ui/src/components/ui/organism/Header/SendSummaryModal/SendSummaryModal.view.tsx b/packages/wallet-ui/src/components/ui/organism/Header/SendSummaryModal/SendSummaryModal.view.tsx index 983a46d9..6ee3755e 100644 --- a/packages/wallet-ui/src/components/ui/organism/Header/SendSummaryModal/SendSummaryModal.view.tsx +++ b/packages/wallet-ui/src/components/ui/organism/Header/SendSummaryModal/SendSummaryModal.view.tsx @@ -32,7 +32,7 @@ import { useStarkNetSnap } from 'services'; import { ethers } from 'ethers'; import Toastr from 'toastr2'; import { constants } from 'starknet'; -import { FeeToken } from 'types'; +import { FeeToken, FeeTokenUnit } from 'types'; interface Props { address: string; @@ -53,7 +53,8 @@ export const SendSummaryModalView = ({ const [estimatingGas, setEstimatingGas] = useState(true); const [gasFees, setGasFees] = useState({ suggestedMaxFee: '0', - unit: 'wei', + unit: + selectedFeeToken === FeeToken.ETH ? FeeTokenUnit.ETH : FeeTokenUnit.STRK, includeDeploy: false, }); const [gasFeesError, setGasFeesError] = useState(false); @@ -118,7 +119,7 @@ export const SendSummaryModalView = ({ if (gasFees?.suggestedMaxFee) { const gasFeesBN = ethers.utils.parseUnits( gasFees.suggestedMaxFee, - gasFees.unit, + FeeTokenUnit.ETH, ); let totalToCheck = gasFeesBN; diff --git a/packages/wallet-ui/src/services/useStarkNetSnap.ts b/packages/wallet-ui/src/services/useStarkNetSnap.ts index 3ebbf2a6..1599bbc7 100644 --- a/packages/wallet-ui/src/services/useStarkNetSnap.ts +++ b/packages/wallet-ui/src/services/useStarkNetSnap.ts @@ -32,7 +32,7 @@ import { ethers } from 'ethers'; import { getAssetPriceUSD } from './coinGecko'; import semver from 'semver/preload'; import { setActiveNetwork } from 'slices/networkSlice'; -import { constants } from 'starknet'; +import { constants, Invocations, TransactionType } from 'starknet'; export const useStarkNetSnap = () => { const dispatch = useAppDispatch(); @@ -331,13 +331,23 @@ export const useStarkNetSnap = () => { contractAddress: string, contractFuncName: string, contractCallData: string, - senderAddress: string, + address: string, chainId: string, transactionVersion?: | typeof constants.TRANSACTION_VERSION.V2 | typeof constants.TRANSACTION_VERSION.V3, ) { try { + const invocations: Invocations = [ + { + type: TransactionType.INVOKE, + payload: { + contractAddress, + entrypoint: contractFuncName, + calldata: contractCallData.split(',').map((ele) => ele.trim()), + }, + }, + ]; const response = await provider.request({ method: 'wallet_invokeSnap', params: { @@ -346,12 +356,10 @@ export const useStarkNetSnap = () => { method: 'starkNet_estimateFee', params: { ...defaultParam, - contractAddress, - contractFuncName, - contractCallData, - senderAddress, + address, + invocations, + details: { version: transactionVersion }, chainId, - transactionVersion, }, }, }, diff --git a/packages/wallet-ui/src/types/index.ts b/packages/wallet-ui/src/types/index.ts index e1dc4156..cc3dd1f4 100644 --- a/packages/wallet-ui/src/types/index.ts +++ b/packages/wallet-ui/src/types/index.ts @@ -54,7 +54,12 @@ export interface TokenBalance { balanceLatest: BigNumber; } -export enum FeeToken { // for retrieving txns from Voyager +export enum FeeToken { ETH = 'ETH', STRK = 'STRK', } + +export enum FeeTokenUnit { + ETH = 'wei', + STRK = 'fri', +}