NEWTON

NEWTON


Popular tags

    Cairo: are builtins always needed to be expressed in function signature?

    Asked

    4 months ago

    4

    views


    0

    Say I am calling the following function test. Why can I call with either of these function signatures and get the same result?

    func test{syscall_ptr : felt*}():

    or

    func test{syscall_ptr : felt*, range_check_ptr}():

    This question was originally posted on Triality

      cairocairo-lang

    1 answers

    0

    From the docs:

    "Builtins are predefined optimized low-level execution units which are added to the Cairo CPU board to perform predefined computations which are expensive to perform in vanilla Cairo (e.g., range-checks, Pedersen hash, ECDSA, …)."

    https://www.cairo-lang.org/docs/how_cairo_works/builtins.html?highlight=range_check_ptr

    So if you have access to a builtin and do not need to redefine it, you do not need to explicitly pass it in to a function

    This answer was originally posted on Triality

    answered

    4 months ago

    Your answer

    NEWTON

    NEWTON