|
3 | 3 | //!
|
4 | 4 | //! When this feature is used, the compiler will call one main method:
|
5 | 5 | //!
|
6 |
| -//! 1. `count_libfunc`: called before every libfunc execution. This method will handle the counting. Given a the index |
7 |
| -//! of a libfunc (relative the its declaration order), it accesses the array of counters and updates the counter. |
| 6 | +//! 1. `count_libfunc`: called before every libfunc execution. This method will handle the counting. Given the index |
| 7 | +//! of a libfunc (relative to its declaration order), it accesses the array of counters and updates the counter. |
8 | 8 | //!
|
9 |
| -//! In the context of Starknet contracts, we need to add support for building the arrays of counters for multiple executions. |
10 |
| -//! To do so, we need one important element, which must be set before every contract execution: |
| 9 | +//! In the context of Starknet contracts, we need to add support for building the array of counters for multiple executions. |
| 10 | +//! To do so, we need one important element which must be set before every contract execution: |
11 | 11 | //!
|
12 | 12 | //! * A counter to track the ID of the current array of counter, which gets updated every time we switch to another
|
13 | 13 | //! contract. Since a contract can call other contracts, we need a way of restoring the counter after every execution.
|
14 | 14 | //!
|
15 |
| -//! * An array-of-counter guard. Every time a new entrypoint is executed, a new array of counters needs to be created in order to isolate |
16 |
| -//! each of them. The guard keeps the last array that was used to restore it once the inner entrypoint execution has finished. |
| 15 | +//! * An array-of-counters guard. Every time a new entrypoint is executed, a new array of counters needs to be created. |
| 16 | +//! The guard keeps the last array that was used to restore it once the inner entrypoint execution has finished. |
17 | 17 | //!
|
18 | 18 | //! See `cairo-native-run` for an example on how to do it.
|
19 | 19 | use std::collections::HashSet;
|
|
0 commit comments