forked from lambdaclass/cairo-vm
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…lambdaclass#1073) * Add starknet_in_rust IS_250_BITS hint * Add starknet_in_rust IS_ADDR_BOUNDED hint * Update changelog * Remove unnecessary `mod_floor`
- Loading branch information
1 parent
a57695e
commit 0bf8ff8
Showing
6 changed files
with
261 additions
and
2 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
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,32 @@ | ||
%builtins range_check | ||
|
||
from starkware.starknet.common.storage import normalize_address | ||
from starkware.cairo.common.math import assert_250_bit | ||
from starkware.cairo.common.alloc import alloc | ||
|
||
func normalize_address_element_array{range_check_ptr: felt}( | ||
array: felt*, array_length: felt, iterator: felt | ||
) { | ||
if (iterator == array_length) { | ||
return (); | ||
} | ||
normalize_address(array[iterator]); | ||
return normalize_address_element_array(array, array_length, iterator + 1); | ||
} | ||
|
||
func fill_array(array: felt*, base: felt, step: felt, array_length: felt, iterator: felt) { | ||
if (iterator == array_length) { | ||
return (); | ||
} | ||
assert array[iterator] = base + step * iterator; | ||
return fill_array(array, base, step, array_length, iterator + 1); | ||
} | ||
|
||
func main{range_check_ptr: felt}() { | ||
alloc_locals; | ||
tempvar array_length = 10; | ||
let (array: felt*) = alloc(); | ||
fill_array(array, 70000000000000000000, 300000000000000000, array_length, 0); | ||
normalize_address_element_array(array, array_length, 0); | ||
return (); | ||
} |
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
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
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
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