Release v1.0.0-alpha.3
github-actions
released this
21 Feb 13:21
·
3942 commits
to main
since this release
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
andNot
operators. -
Into
andTryInto
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.