Closed odednaor closed 6 months ago
The issue here is that the JSON-RPC representation of a class is slightly different from what you actually get off the compiler. To solve this exact issue, a new option --parse
has been added for the class-by-hash
command (https://github.com/xJonathanLEI/starkli/commit/08b9571029a8860975e1fef6aad17593f18ff1b1). Simply add this option and you'll get the recovered class artifact instead, which looks exactly like the ones you'd get from compiling.
Will close this issue once it's released.
Released in v0.2.0.
starkli declare --account ~/.starkli-wallets/deployer/account.json target/dev/hellow_world.sierra.json
is declare contract command, but error is Error: failed to parse contract artifact
, what solution is it ?
@learnfortime Please open a new issue unless you're in the exact same scenario as OP: trying to declare the result from class-by-hash
.
After getting a class using
starkli class-by-hash
, when trying to calculate the class hash on that class usingstarkli class-hash
or when trying to declare the same class on a different chain usingstarkli declare
results in anError: failed to parse contract artifact
.This error is shown for both Cairo 0 and Cairo contracts.