Skip to content

fix(init): use Universal Sierra Compiler for contract declaration#406

Open
kariy wants to merge 2 commits intomainfrom
fix/use-usc-for-contract-declaration
Open

fix(init): use Universal Sierra Compiler for contract declaration#406
kariy wants to merge 2 commits intomainfrom
fix/use-usc-for-contract-declaration

Conversation

@kariy
Copy link
Member

@kariy kariy commented Jan 29, 2026

When declaring contracts on Starknet during katana init, the compiled class hash computed by Katana's built-in Sierra-to-CASM compiler can differ from what Starknet validators compute. This happens when the contract was compiled with a different Cairo version than what Katana uses, causing declaration to fail with "Mismatch compiled class hash" errors.

This PR integrates the Universal Sierra Compiler (USC) from Software Mansion for contract declaration. USC bundles all previously released Sierra compilers and automatically selects the appropriate one based on the Sierra version embedded in the contract, ensuring the CASM output matches what Starknet validators produce.

See https://github.com/software-mansion/universal-sierra-compiler for more details on how USC works.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@kariy kariy force-pushed the fix/use-usc-for-contract-declaration branch from d519236 to b2fac6c Compare January 29, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant