NEWTON
Asked
4 months ago
126
views
0
Hey guys, has anyone had get_caller_address
problems in devnet ? I feel like it's returning address 0 when it shouldn't so I made this small contract to test it
from starkware.cairo.common.cairo_builtins import HashBuiltin
from starkware.starknet.common.syscalls import (get_caller_address)
func caller_addr() -> (res: felt) {
}
func fn_to_be_called{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr: felt}() {
let (caller) = get_caller_address();
caller_addr.write(caller);
return ();
}
func get_caller_addr{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr: felt}() -> (caller_addr: felt) {
let (caller) = caller_addr.read();
return (caller_addr=caller);
}```
and indeed `get_caller_addr` return address 0 after I called `fn_to_be_called` in the devnet. This is causing some problems in more complex contracts of course. Is it just me ?
_This question was originally posted on [StarkNet Discord](https://www.newton.so/view?tags=discord)_
Newton
asked
4 months ago
0
Accepted answer
get_caller_address returning 0 on Devnet
This answer was originally posted on StarkNet Discord
Newton
answered
4 months ago
Issue with generating _abi.json file
How can I use start_prank with deploy_contract?
How can I use start_prank with deploy_contract?
when to use tail call optimization in a cairo smartcontract
storage for array
How can I pass an array of felt to call with Nile in StarkNet?
Does anybody have an idea what is `get_caller_address` returning on an L1 handler call?
Cairo: Unknown value for memory cell at address
Cairo: Cannot unpack error
Does Account Abstraction (StarkNet) support bundling multiple operations at once?
AssertionError with range_check_ptr_ptr
How many time does it take for stark to eth starkgate bridge process?
how to return struct
Cairo: Cannot unpack multiplication error