cairo-native 0.9.0-rc.5

A compiler to convert Cairo's IR Sierra code to MLIR and execute it.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[starknet::contract]
mod Echo {
    #[storage]
    struct Storage {
        balance: felt252,
    }

    #[constructor]
    fn constructor(ref self: ContractState, initial_balance: felt252) {
        //panic_with_felt252('panic');
        self.balance.write(initial_balance);
    }

    #[external(v0)]
    fn echo(ref self: ContractState, value: felt252) -> felt252 {
        value
    }
}