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.
- Due to added support for
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
- Added
extended_gcd
function. #3138 - Added
inv_mod
function. #3172 - Added
u256_div_mod_n
. #3190 return;
andbreak;
are now supported. By @gaetbout in #3134- Derive StorageAccess for struct. By @maciejka in #3062
// 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 #3048let d: Felt252Dict<Felt252> = Default::default();
- Added
U256IntoEthAddress
. #3244 - Added
verify_eth_signature
to secp256k1. #2929 - Derive
StorageAccess
forEthAddress
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
- @karol-bisztyga made their first contribution in #3126
- @ArniStarkware made their first contribution in #3228
- @ftupas made their first contribution in #3241
- @tdelabro made their first contribution in #3276
- @chirag-bgh made their first contribution in #3296
- @yair-starkware made their first contribution in #3289
- @lambda-0x made their first contribution in #3293
- @alonh5 made their first contribution in #3334
Full Changelog: v1.1.0...v2.0.0-rc0