github starkware-libs/cairo v2.0.0-rc0

latest releases: v2.12.2, v2.12.1, v2.12.0...
2 years ago

Cairo compiler.

Major updates

  • New contract syntax, see more details.
  • Fixed language server issues.
  • Updated docs.

Breaking Changes

  • Contract syntax changes.
  • Fix of operator precedence - note that & and | have lower precedence now than == and !=.
    • Due to added support for && and || operators.

Bug Fixes

  • Prevent formatting of files with syntax errors. #3168
  • Fixed bug when attempting to compile large amounts of code, where Sierra to CASM compilation failed. #3230
  • Added diagnostics for illegal match statement inputs. #3238
  • Fix handling of underscores in numeric literals semantic. #3314

New Features

// Foo will now be a valid type for a storage variable.
#[derive(starknet::StorageAccess)]
struct Foo {
   a: felt252,
   b: u256,
}
  • Added recover_public_key to secp256k1. #2928
  • Added Default trait for Array/Dict. By @wraitii in #3048
    • let d: Felt252Dict<Felt252> = Default::default();
  • Added U256IntoEthAddress. #3244
  • Added verify_eth_signature to secp256k1. #2929
  • Derive StorageAccess for EthAddress and abi Dispatcher builtin types. By @maciejka in #3247
  • Derive Serde for dispatchers. By @ftupas in #3241
  • Added support for secp256r1 in Cairo. #3269
  • Added SpanSerde implementation. By @milancermak in #3145
  • Add support for logical operators with short circuiting. #3323
if cond1 && (cond2 || cond3) {
    ...
}
  • Major type and Inference runtime improvements. #3347
  • #[generate_trait] attribute - to write just an impl for creating methods for a type.
  #[generate_trait]
  impl AddMethods for AddMethodsTrait {
      fn method(self: TypeWithNewMethods) -> u32 { ... }
  }

New Contributors

Full Changelog: v1.1.0...v2.0.0-rc0

Don't miss a new cairo release

NewReleases is sending notifications on new releases.