Skip to content

Commit

Permalink
feat: update sierra explanation file
Browse files Browse the repository at this point in the history
  • Loading branch information
NueloSE committed Dec 1, 2024
1 parent 689fbc3 commit 8ca9cfa
Show file tree
Hide file tree
Showing 5 changed files with 641 additions and 367 deletions.
7 changes: 7 additions & 0 deletions listings/advanced-concepts/sierra_ir/simple_program.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// [!region contract]
#[starknet::contract]
fn add_numbers(a: felt252, b: felt252) -> felt252 {
let sum = a + b;
sum
}
// [!endregion contract]
10 changes: 10 additions & 0 deletions listings/advanced-concepts/sierra_ir/simple_program.sierra
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type felt252 = felt252 [storable: true, drop: true, dup: true, zero_sized: false];

libfunc felt252_add = felt252_add;
libfunc store_temp<felt252> = store_temp<felt252>;

felt252_add([0], [1]) -> ([2]); // 0
store_temp<felt252>([2]) -> ([2]); // 1
return([2]); // 2

simple::simple::add_numbers@0([0]: felt252, [1]: felt252) -> (felt252);
Loading

0 comments on commit 8ca9cfa

Please sign in to comment.