NEWTON

NEWTON


Popular tags

    Getting the CLASS_HASH of a contract in Cairo

    Asked

    6 months ago

    9

    views


    0

    When deploying contract2 from contract1 in Cairo, I need to get the CLASS_HASH. How do I achieve this?

    This question was originally posted on Triality

      cairocairo-lang

    1 answers

    0

    You can do the same thing as deploy just change one keyword to declare. This w

    First compile you code.

    starknet-compile contract2.cairo \

    --output contract2_compiled.json \

    --abi contract2_abi.json

    Then declare it to get the contract class hash

    starknet declare --contract contract2_compiled.json

    This answer was originally posted on Triality

    answered

    7 months ago

    Your answer

    NEWTON

    NEWTON