-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update sierra explanation file
- Loading branch information
Showing
5 changed files
with
641 additions
and
367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
10
listings/advanced-concepts/sierra_ir/simple_program.sierra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Oops, something went wrong.