Cairo by Example
/
GitHubGitHub
/
  • Welcome
  • Cairo
    • Allocating Memory
    • Arrays
    • Assert
    • Error Messages
    • Functions
    • Hints
    • If / Else
    • Implicit Arguments
    • Imports
    • Inputs
    • Jumps
    • Memory
    • Namespaces
    • Outputs
    • Pointers
    • Recursion
    • Registers
    • Signature Verification
    • Strings
    • Structs
    • Tuples
    • Variables
  • StarkNet
    • Authentication
    • Block Information
    • Caller Address
      • #Example
    • Constructor
    • Contract Address
    • Contract Calls
    • Events
    • Hello World
    • L1 -> L2
    • L2 -> L1
    • Library Calls
    • Mappings
    • Storage
    • Transaction Information
    • Visibility
  • SHARP
    • Generating Proofs
    • Verifying Proofs
  • Welcome
  • Cairo
    • Allocating Memory
    • Arrays
    • Assert
    • Error Messages
    • Functions
    • Hints
    • If / Else
    • Implicit Arguments
    • Imports
    • Inputs
    • Jumps
    • Memory
    • Namespaces
    • Outputs
    • Pointers
    • Recursion
    • Registers
    • Signature Verification
    • Strings
    • Structs
    • Tuples
    • Variables
  • StarkNet
    • Authentication
    • Block Information
    • Caller Address
      • #Example
    • Constructor
    • Contract Address
    • Contract Calls
    • Events
    • Hello World
    • L1 -> L2
    • L2 -> L1
    • Library Calls
    • Mappings
    • Storage
    • Transaction Information
    • Visibility
  • SHARP
    • Generating Proofs
    • Verifying Proofs
Edit this page on GitHub
StarkNet
Caller Address

Caller Address

The address that calls the contract function can be obtained via the get_caller_address utility function.

Example

%lang starknet

# Import the `get_caller_address` utility function.
from starkware.starknet.common.syscalls import get_caller_address

@view
func get_current_caller_address{syscall_ptr : felt*}() -> (address : felt):
    # `get_caller_address` returns the address that's calling the contract's function.
    let (address) = get_caller_address()
    return (address)
end
Block Information
Constructor
MIT 2022 © Philipp Muens.