NEWTON

NEWTON


Popular tags

    Cairo: How do I find the current contract's address?

    Asked

    6 months ago

    3

    views


    0

    How can I find the current contract's address in Cairo? Is there an equivalent to address(this) from Solidity?

    This question was originally posted on Triality

      cairocairo-langstarknet

    1 answers

    0

    You can find the contract address by using the library function get_contract_address() . For example:

    from starkware.starknet.common.syscalls import (get_contract_address,)

    # ...

    let (contract_address) = get_contract_address()

    This answer was originally posted on Triality

    answered

    6 months ago

    Your answer

    NEWTON

    NEWTON