NEWTON
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);
} }
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
Has anyone had `get_caller_address` problems in devnet ?
How do you check if a number is even in Cairo?
How can I pass an array of felt to call with Nile in StarkNet?
Can anyone explain Pathfinder JSON-RPC InvokeTXNV1?
when to use tail call optimization in a cairo smartcontract
Cairo Lang / StarkNet: What are Revoked references? What is alloc_locals?
AssertionError with range_check_ptr_ptr
Does Account Abstraction (StarkNet) support bundling multiple operations at once?
Cairo Testing Error
StarkNet Faucet: How can I get a Goerli-2 eth faucet tokens (StarkNet)?
How to generate a proof for a Cairo program and verify it?[StackOverflow]
How long does starkgate bridge process?
Cairo error: Unknown identifier 'bitwise_ptr' when using keccak
Is Kakarot zkEVM a blockchain?