Skip to content

getClassHashAt / getNonce return 0x0 for system addresses (0x1, 0x2) instead of CONTRACT_NOT_FOUND #3777

Description

@brbrr

For the system-contract addresses 0x1 and 0x2 (which have no Cairo class), Juno returns success 0x0 where the spec - return CONTRACT_NOT_FOUND. getClassAt errors too, but with the inconsistent code CLASS_HASH_NOT_FOUND.

Repro:

curl -s http://localhost:6060/rpc/v0_10 -H 'content-type: application/json' -d \
'{"jsonrpc":"2.0","id":1,"method":"starknet_getClassHashAt","params":[{"block_number":8314364},"0x2"]}'
method (addr 0x2) Juno expected
getClassHashAt "0x0" CONTRACT_NOT_FOUND
getNonce "0x0" CONTRACT_NOT_FOUND
getClassAt CLASS_HASH_NOT_FOUND CONTRACT_NOT_FOUND

0x1/0x2 are protocol system contracts, not deployed classes — see Starknet docs: system contracts 0x1 & 0x2.
Juno should return CONTRACT_NOT_FOUND for class/nonce reads on them, consistently across the three methods.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions