Skip to content

Commit

Permalink
fix: chapter-related folder names (#216)
Browse files Browse the repository at this point in the history
* fix: chapter-related folder names

* updated all references
  • Loading branch information
raizo07 committed Jun 9, 2024
1 parent 19c67c2 commit 3fbfb60
Show file tree
Hide file tree
Showing 56 changed files with 1,125 additions and 1,126 deletions.
772 changes: 386 additions & 386 deletions po/es.po

Large diffs are not rendered by default.

750 changes: 375 additions & 375 deletions po/messages.pot

Large diffs are not rendered by default.

618 changes: 309 additions & 309 deletions po/zh-cn.po

Large diffs are not rendered by default.

107 changes: 53 additions & 54 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,44 @@ Summary

[Introduction](./starknet-by-example.md)

<!-- ch00 -->
<!-- getting-started -->

# Getting Started

<!-- - [Local environment setup](./ch00/env_setup.md) -->
<!-- - [Local environment setup](./getting-started/env_setup.md) -->

- [Basics of a Starknet contract](./ch00/basics/introduction.md)
- [Storage](./ch00/basics/storage.md)
- [Constructor](./ch00/basics/constructor.md)
- [Variables](./ch00/basics/variables.md)
- [Visibility and Mutability](./ch00/basics/visibility-mutability.md)
- [Counter Example](./ch00/basics/counter.md)
- [Mappings](./ch00/basics/mappings.md)
- [Errors](./ch00/basics/errors.md)
- [Events](./ch00/basics/events.md)
- [Syscalls](./ch00/basics/syscalls.md)
- [Strings and ByteArrays](./ch00/basics/bytearrays-strings.md)
- [Storing Custom Types](./ch00/basics/storing-custom-types.md)
- [Custom types in entrypoints](./ch00/basics/custom-types-in-entrypoints.md)
- [Documentation](./ch00/basics/documentation.md)
- [Deploy and interact with contracts](./ch00/interacting/interacting.md)
- [Contract interfaces and Traits generation](./ch00/interacting/interfaces-traits.md)
- [Calling other contracts](./ch00/interacting/calling_other_contracts.md)
- [Factory pattern](./ch00/interacting/factory.md)
- [Testing contracts](./ch00/testing/contract-testing.md)
- [Cairo cheatsheet](./ch00/cairo_cheatsheet/cairo_cheatsheet.md)
- [Felt](./ch00/cairo_cheatsheet/felt.md)
- [LegacyMap](./ch00/cairo_cheatsheet/mapping.md)
- [Arrays](./ch00/cairo_cheatsheet/arrays.md)
- [loop](./ch00/cairo_cheatsheet/loop.md)
- [while](./ch00/cairo_cheatsheet/while.md)
- [if let](./ch00/cairo_cheatsheet/if_let.md)
- [while let](./ch00/cairo_cheatsheet/while_let.md)
- [Enums](./ch00/cairo_cheatsheet/enums.md)
- [Match](./ch00/cairo_cheatsheet/match.md)
- [Tuples](./ch00/cairo_cheatsheet/tuples.md)
- [Struct](./ch00/cairo_cheatsheet/struct.md)
- [Type casting](./ch00/cairo_cheatsheet/type_casting.md)
- [Basics of a Starknet contract](./getting-started/basics/introduction.md)
- [Storage](./getting-started/basics/storage.md)
- [Constructor](./getting-started/basics/constructor.md)
- [Variables](./getting-started/basics/variables.md)
- [Visibility and Mutability](./getting-started/basics/visibility-mutability.md)
- [Counter Example](./getting-started/basics/counter.md)
- [Mappings](./getting-started/basics/mappings.md)
- [Errors](./getting-started/basics/errors.md)
- [Events](./getting-started/basics/events.md)
- [Syscalls](./getting-started/basics/syscalls.md)
- [Strings and ByteArrays](./getting-started/basics/bytearrays-strings.md)
- [Storing Custom Types](./getting-started/basics/storing-custom-types.md)
- [Custom types in entrypoints](./getting-started/basics/custom-types-in-entrypoints.md)
- [Documentation](./getting-started/basics/documentation.md)
- [Deploy and interact with contracts](./getting-started/interacting/interacting.md)
- [Contract interfaces and Traits generation](./getting-started/interacting/interfaces-traits.md)
- [Calling other contracts](./getting-started/interacting/calling_other_contracts.md)
- [Factory pattern](./getting-started/interacting/factory.md)
- [Testing contracts](./getting-started/testing/contract-testing.md)
- [Cairo cheatsheet](./getting-started/cairo_cheatsheet/cairo_cheatsheet.md)
- [Felt](./getting-started/cairo_cheatsheet/felt.md)
- [LegacyMap](./getting-started/cairo_cheatsheet/mapping.md)
- [Arrays](./getting-started/cairo_cheatsheet/arrays.md)
- [loop](./getting-started/cairo_cheatsheet/loop.md)
- [while](./getting-started/cairo_cheatsheet/while.md)
- [if let](./getting-started/cairo_cheatsheet/if_let.md)
- [while let](./getting-started/cairo_cheatsheet/while_let.md)
- [Enums](./getting-started/cairo_cheatsheet/enums.md)
- [Match](./getting-started/cairo_cheatsheet/match.md)
- [Tuples](./getting-started/cairo_cheatsheet/tuples.md)
- [Struct](./getting-started/cairo_cheatsheet/struct.md)
- [Type casting](./getting-started/cairo_cheatsheet/type_casting.md)

# Components

Expand All @@ -48,31 +48,30 @@ Summary
- [Storage Collisions](./components/collisions.md)
- [Ownable](./components/ownable.md)

<!-- ch01 -->
<!-- applications -->

# Applications

- [Upgradeable Contract](./ch01/upgradeable_contract.md)
- [Defi Vault](./ch01/simple_vault.md)
- [ERC20 Token](./ch01/erc20.md)
- [NFT Dutch Auction](./ch01/nft_dutch_auction.md)
- [Constant Product AMM](./ch01/constant-product-amm.md)
- [TimeLock](./ch01/timelock.md)
- [Staking](./ch01/staking.md)
- [Upgradeable Contract](./applications/upgradeable_contract.md)
- [Defi Vault](./applications/simple_vault.md)
- [ERC20 Token](./applications/erc20.md)
- [Constant Product AMM](./applications/constant-product-amm.md)
- [TimeLock](./applications/timelock.md)
- [Staking](./applications/staking.md)

<!-- ch02 -->
<!-- advanced-concepts -->

# Advanced concepts

- [Writing to any storage slot](./ch02/write_to_any_slot.md)
- [Storing Arrays](./ch02/storing_arrays.md)
- [Struct as mapping key](./ch02/struct-mapping-key.md)
- [Hashing](./ch02/hashing.md)
- [Writing to any storage slot](./advanced-concepts/write_to_any_slot.md)
- [Storing Arrays](./advanced-concepts/storing_arrays.md)
- [Struct as mapping key](./advanced-concepts/struct-mapping-key.md)
- [Hashing](./advanced-concepts/hashing.md)
<!-- Hidden until #123 is solved -->
<!-- - [Hash Solidity Compatible](./ch02/hash-solidity-compatible.md) -->
- [Optimisations](./ch02/optimisations/optimisations.md)
- [Storage Optimisations](./ch02/optimisations/store_using_packing.md)
- [List](./ch02/list.md)
- [Plugins](./ch02/plugins.md)
- [Signature Verification](./ch02/signature_verification.md)
- [Library Calls](./ch02/library_calls.md)
<!-- - [Hash Solidity Compatible](./advanced-concepts/hash-solidity-compatible.md) -->
- [Optimisations](./advanced-concepts/optimisations/optimisations.md)
- [Storage Optimisations](./advanced-concepts/optimisations/store_using_packing.md)
- [List](./advanced-concepts/list.md)
- [Plugins](./advanced-concepts/plugins.md)
- [Signature Verification](./advanced-concepts/signature_verification.md)
- [Library Calls](./advanced-concepts/library_calls.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

On Starknet, complex values (e.g. tuples or structs) are stored in a continuous segment starting from the address of the storage variable. There is a limitation in Cairo that restricts complex storage values to a maximum of 256 field elements. This means that to store arrays with more than 255 elements, you would have to split them into segments of size `n <= 255` and store these segments at multiple storage addresses. There is currently no native support for storing arrays in Cairo, so you would need to write your own implementation of the `Store` trait for the array type you wish to store.

However, the `ByteArray` struct can be used to store `Array<bytes31>` in storage without additional implementation. Before implementing your own `Store` trait, consider whether the `ByteArray` struct can be used to store the data you need! See the [ByteArray](../ch00/basics/bytearrays-strings.md#bytearray-long-strings) section for more information.
However, the `ByteArray` struct can be used to store `Array<bytes31>` in storage without additional implementation. Before implementing your own `Store` trait, consider wether the `ByteArray` struct can be used to store the data you need! See the [ByteArray](../getting-started/basics/bytearrays-strings.md#bytearray-long-strings) section for more information.

> Note: While storing arrays in storage is possible, it is not always recommended, as the read and write operations can get very costly. For example, reading an array of size `n` requires `n` storage reads, and writing to an array of size `n` requires `n` storage writes. If you only need to access a single element of the array at a time, it is recommended to use a `LegacyMap` and store the length in another variable instead.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ fn replace_class_syscall(

Replace the class of the calling contract with the class `class_hash`.

This is used for contract upgrades. Here's an example from the [Upgradeable Contract](../../ch01/upgradeable_contract.md):
This is used for contract upgrades. Here's an example from the [Upgradeable Contract](../../applications/upgradeable_contract.md):

```rust
{{#rustdoc_include ../../../listings/applications/upgradeable_contract/src/upgradeable_contract_v0.cairo:upgrade}}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3fbfb60

Please sign in to comment.