Closed 2klonghua closed 4 months ago
Hey can you check what spec version your RPC endpoint is serving? starkli spec-version
.
0.6.0
Would you mind posting the content of target/dev/contracts_Simple_storage.contract_class.json
so I can reproduce the issue?
Here is the original lib.cairo:
Code: `
mod Simple_storage {
#[storage]
struct Storage {
value: felt252,
}
fn set_value(ref self: ContractState, value: felt252) {
self.value.write(value);
}
fn get_value(self: @ContractState) -> felt252 {
self.value.read()
}
} `
I compile it using scarb build, and generate the following json:
Result:
{"sierra_program":["0x1","0x4","0x0","0x2","0x5","0x4","0x1","0xff","0x0","0x4","0x0"],"sierra_program_debug_info":{"type_names":[],"libfunc_names":[],"user_func_names":[]},"contract_class_version":"0.1.0","entry_points_by_type":{"EXTERNAL":[],"L1_HANDLER":[],"CONSTRUCTOR":[]},"abi":[{"type":"event","name":"contracts::Simple_storage::Event","kind":"enum","variants":[]}]}%
Sorry for the formatting
I just tried declaring this exact class on Sepolia using Starkli and it works. Transaction hash: 0x06bf7c26f81dafa1d9ab4b36fabd75bb05806f967dad268d5d0e729dfc520020
.
Are you using the latest Starkli version? If so can you post the complete --log-traffic
logs?
(You might need to do some renaming on the contract to be able to declare it again, as the network doesn't allow declaring the same class twice)
Resolved
If it helps, my Scarb.toml configuration are as follows:
` [package] name = "contracts" version = "0.1.0"
[dependencies] starknet = ">=2.2.0"
[[target.starknet-contract]] sierra = true `
From your own log:
WARNING: the JSON-RPC endpoint you're using serves specs 0.5.1, which might be incompatible with the version 0.6.0 supported by this Starkli release for the starknet_estimateFee method. You might encounter errors.
Why did you claim that your RPC is 0.6.0 then? Starkli already tells you why it fails with a warning. You need a JSON-RPC 0.6.0 endpoint. Check which RPC version to use with starkli -vv
.
Closing this now.
I run starkli spec-version
earlier which generate 0.6.0
I missed that warning message, my bad. Switched to 0.6.0 and it works now. Thank you
I run
starkli spec-version
earlier which generate 0.6.0
This is quite weird tbh. Maybe this means that whichever API provider you're using load balances traffic across different RPC versions, which sounds like a terrible idea if true. In any case pinning the version is always better. You can also consider using the free RPC vendor feature.
Calling
starkli declare target/dev/contracts_Simple_storage.contract_class.json --rpc .... --account .. --keystore
Investigate it further using the --log-traffic and it looks like these params are expected when calling
"starknet_estimateFee"
: