Cairo-lang

Latest version: v0.13.3

Safety actively analyzes 688775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 8 of 11

0.8.1

Not secure
**StarkNet**:
* API changes (breaking changes):
* Convert the transaction's `signature` field to hex in the *response* objects
* Add `class_hash` to DeploySpecificInfo
* Fees:
* Change the way transaction fee is computed to include L1 operations and system call costs
* Use L1 data to obtain gas prices in ETH

**Cairo**:
* Change the auto-formatting of function arguments to an argument-per-line mode (unless all arguments fit into a single line). Use `--no_one_item_per_line` for the old formatting.
* Bug fixes:
* A bug that prevented declaring local variables inside a `with_attr` statement
* A bug that prevented using `cairo-lang` with `python3.9`

0.8.0

Not secure
**StarkNet**
* Support paying fees for transactions
* System calls:
* Add transaction hash and chain id to the `TxInfo` struct. See [here](https://starknet.io/docs/hello_starknet/more_features.html#retrieving-the-transaction-information)
* API:
* `estimate_fee`
* `get_transaction_trace` - shows the internal calls executed by the transactions in a tree structure. See [here](https://starknet.io/docs/hello_starknet/cli.html#get-transaction-trace)
* `get_transaction` returns a new field `max_fee` and the `calldata` field was changed from decimal to hex
* Add an option to cancel an L1->L2 message. See [here](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/eth/StarknetMessaging.sol)
* Testing framework:
* Add `replace_abi()` function (useful for the proxy pattern)
* Technical changes:
* Add `version` and `max_fee` fields to the transaction hash
* Account contracts should have an `__execute__` function. To compile a contract with such an external function, you should pass the `--account_contract` flag to the compiler.

**Cairo**:
* Syntax:
* Add `new` operator. See [here](https://cairo-lang.org/docs/how_cairo_works/object_allocation.html#the-new-operator)
* Add named tuple types. See [here](https://cairo-lang.org/docs/how_cairo_works/types.html#tuples)
* Add type aliases. See [here](https://cairo-lang.org/docs/how_cairo_works/types.html#used-defined-type-aliases)
* Support escape sequences in short strings (currently, only `\x**`)
* Add `codeoffset` type for labels
* Support negative values in `dw` statements
* Forbid using `nondet` in references (since it may lead to unexpected behavior)
* Standard library:
* Add `blake2s` to the common library. See [here](https://github.com/starkware-libs/cairo-lang/tree/master/src/starkware/cairo/common/cairo_blake2s)
* New functions: `horner_eval` and `usort`
* Rename `small_merkle_tree` to `small_merkle_tree_update`
* Other:
* Support including local variables and arguments in error messages. See [here](https://cairo-lang.org/docs/how_cairo_works/scope_attributes.html)

0.7.1

Not secure
**StarkNet**:

* Some performance improvements
* System calls:
* ``get_tx_info()`` - Return a struct with information about the transactions. See https://www.starknet.io/docs/hello_starknet/more_features.html#retrieving-the-transaction-information
* ``get_tx_signature()`` is deprecated - use ``get_tx_info()`` instead.
* API:
* ``get_state_update`` - Returns the state diff of a given block
* ``get_full_contract`` - Returns the full contract definition (including the hints). See https://www.starknet.io/docs/hello_starknet/cli.html#get-full-contract.
* Client libraries:
* Return structured classes in ``FeederGatewayClient``.

**Cairo**:

* Support ``felt*`` in ``nondet`` expressions.

0.7.0

Not secure
**StarkNet**:

* Improvements in transaction cost estimations. Note that this may cause transactions that would have been accepted in the past to be rejected, and it may affect how many transactions are included in each block
* Add nonce to L1->L2 messages (note that this affects the hash of the corresponding transactions)
* Small optimizations in on-chain data

* Contracts:
* ``%builtins`` directive is no longer required in StarkNet contracts
* Support passing and returning arrays of structs in external functions
* Support events (https://starknet.io/docs/hello_starknet/events.html)
* Support delegate calls (https://starknet.io/docs/hello_starknet/calling_contracts.html#delegate-calls)
* Support default entry point (https://starknet.io/docs/hello_starknet/default_entrypoint.html)
* New system calls:
* `delegate_l1_handler`
* `get_block_number` - Returns the sequential block number of the block containing the transaction (https://starknet.io/docs/hello_starknet/more_features.html#block-number-and-timestamp)
* `get_block_timestamp` - Returns the timestamp at the beginning of the block's creation. Note that currently this value is *not* validated by the StarkNet OS (https://starknet.io/docs/hello_starknet/more_features.html#block-number-and-timestamp)
* `emit_event`
* Support `raw_input` and `raw_output` that disables the automatic calldata/return-value processing (https://starknet.io/docs/hello_starknet/default_entrypoint.html#default-entry-point)

* StarkNet CLI:
* Support account contracts (https://starknet.io/docs/hello_starknet/account_setup.html)
* Deploy Open Zeppelin's account contract
* Automatically sign transactions
* Support passing negative inputs to contracts
* Support querying the pending block
* Support reconstructing trace when a contract calls another contract (https://starknet.io/docs/hello_starknet/user_auth.html#retrieving-the-revert-reason)

* Testing framework:
* Support negative inputs (up to -PRIME/2)
* Add events to the execution info
* `postman` - Testing framework for L1<->L2 interaction

**Cairo**:

* Added `sqrt` (square root) functions for `felt` and `uint256` to the math common library
* Support attaching indicative error message to failures (https://cairo-lang.org/docs/how_cairo_works/scope_attributes.html)
* Named arguments in struct constructors are now verified by the compiler (they were ignored before)

0.6.2

Not secure
**StarkNet**:

* Split `PENDING` status into `PENDING` and `ACCEPTED_ON_L2`.
* StarkNet CLI: Renamed "alpha" network to "alpha-goerli".
* Storage variables support felts-only types (structs and tuples that don't contain pointers).

**Cairo**:
* `Uint256` bitwise functions are now using the bitwise builtin (making them much more efficient).

0.6.1

Not secure
**StarkNet**:
* Support the alpha-mainnet network in the `starknet` CLI (use `--network=alpha-mainnet` or `STARKNET_NETWORK=alpha-mainnet`)

Page 8 of 11

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.