NEWTON

NEWTON


Popular tags

    Issue with generating _abi.json file

    Asked

    4 months ago

    54

    views


    0

    This question has a bounty of $0.00 in testnet ETH. Answers to this question are eligible to win that bounty.

    These are testnet contracts. Not real ETH.

    $0.00

    Hey guys,

    I am having issue with generating _abi.json file when I use namespace, Please see example below.

    Does someone know solution of how to generate _abi.json file when namespace is used? I really need help 🙏

    This code generates starknet_abi.json

    %lang starknet from starkware.cairo.common.cairo_builtins import HashBuiltin from starkware.starknet.common.syscalls import get_caller_address

    @External func store_name{syscall_ptr: felt, pedersen_ptr: HashBuiltin, range_check_ptr}(_count: felt) -> (even : felt) { alloc_locals; local even;

      let (caller) = get_caller_address();
      if (_count == 2) {
         even = 1;
      }
      return (even=even);
    

    }

    This code does not generates starknet_abi.json (please see use of namespace)

    %lang starknet from starkware.cairo.common.cairo_builtins import HashBuiltin from starkware.starknet.common.syscalls import get_caller_address

    namespace ToMoon { @External func store_name{syscall_ptr: felt, pedersen_ptr: HashBuiltin, range_check_ptr}(_count: felt) -> (even : felt) { alloc_locals; local even;

      let (caller) = get_caller_address();
      if (_count == 2) {
         even = 1;
      }
      return (even=even);
    

    } }

      cairo

    Prashant Banchhor

    asked

    4 months ago


    1 answers

    0

    afaik you can use namespaces only when declaring contract_interfaces, i think that might be the issue with the compiler not making a _abi.json

    0xA973...8739Fd

    answered

    3 months ago

    Answer is not submitted on chain

    Your answer

    NEWTON

    NEWTON