starknet-rs
starknet-rs copied to clipboard
Legacy contract class corrupted when deserialized through `ContractArtifact`
Due to a scientific notation issue, certain legacy (Cairo 0) contract artifacts can be different when deserializing directly and through the ConrtractArtifact enum. This leads to class hash errors, and hence failures on contract declaration.
Details to be updated later. Creating this issue first so that it can be referenced from starkli.
Looks like the switch to raw_value in https://github.com/xJonathanLEI/starknet-rs/commit/c5cf1967d44dd61fb68b36cefed710cc8518b1ab has made this worse. Previously only artifacts with values that can be converted to the scientific notation without precision loss are affected; now it looks like most artifacts are affected.
Added a test case (that's disabled by default to avoid breaking CI) in #644, test_legacy_artifact_deser_from_contract_artifact, specifically to test this issue. A patch to this issue should be able to also remove the ignore attribute on that test case.