github starkware-libs/cairo v1.0.0-alpha.3
Release v1.0.0-alpha.3

latest releases: v2.12.4-dev.1, v2.12.4-dev.0, v2.12.3...
2 years ago

Release notes

Cairo Language

  • Snapshot type - A type that creates a reference to an object at a point in time, which can not be further changed, of a possibly non-copyable object.
    Added Snapshot operator @ and De-snapping operator *.
    For example - Snapshot:
trait ArrayTrait<T> {
	...
    fn at(self: @Array::<T>, index: usize) -> @T;
    ...
}

Desnapping:

let mut arr = ArrayTrait::new();
arr.append(10);
let x = *arr.at(0_usize);
  • Improved inlining - more functions are supported.
    New #[inline(never)] attribute.

  • EC library extended:
    ec_point_zero, ec_point_is_zero, ec_state_finalize.

  • New operators: +=, -=, *=, /=, %=.

  • Traits for Neg and Not operators.

  • Into and TryInto traits.

  • Support for new integer types: u8, u16, u32, u64.

  • Improved diagnostics.

StarkNet contract features

  • Contract address. For example:
#[contract]
mod contract {
	...
    #[event]
    fn Transfer(from: ContractAddress, to: ContractAddress, value: u256) {}

    #[event]
    fn Approval(owner: ContractAddress, spender: ContractAddress, value: u256) {}
    ...
}

Sierra

The Sierra language was stabilized as a preparation for integration with Starknet.

Bug fixes

Fixed Dups and Drops behavior.
Fixed types inference bug.
Support recursive types.

Don't miss a new cairo release

NewReleases is sending notifications on new releases.