Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: typos #36

Merged
merged 4 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ All the Markdown files **MUST** be edited in english. To work locally in english

The current book has script that verifies the compilation of all Cairo programs in the book.
Instead of directly writing Cairo programs in the markdown files, we use code blocks that import the Cairo programs from the `listing` directory.
These programs are bundled into scarb packages, which makes it easier to test and build entier packages.
These programs are bundled into scarb packages, which makes it easier to test and build entire packages.

To run the script locally, ensure that you are at the root of the repository (same directoy of this `README.md` file),
To run the script locally, ensure that you are at the root of the repository (same directory as this `README.md` file),
and run:

`bash scripts/cairo_programs_verifier.sh`
2 changes: 1 addition & 1 deletion src/ch00-03-calling_other_contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ There are two different ways to call other contracts in Cairo.
The easiest way to call other contracts is by using the dispatcher of the contract you want to call.
You can read more about Dispatchers in the [Cairo Book](https://cairo-book.github.io/ch99-02-02-contract-dispatcher-library-dispatcher-and-system-calls.html#contract-dispatcher)

The other way is to use the `starknet::call_contract_syscall` syscall yourself. However, this method is not recommanded.
The other way is to use the `starknet::call_contract_syscall` syscall yourself. However, this method is not recommended.

In order to call other contracts using dispatchers, you will need to define the called contract's interface as a trait annotated with the `#[abi]` attribute, and then import the `IContractDispatcher` and `IContractDispatcherTrait` items in your contract.

Expand Down
2 changes: 1 addition & 1 deletion src/ch00-06-mappings.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Here we demonstrate how to use the `LegacyMap` type within a Cairo contract, to

Some additional notes:

- More complex key-value mapppings are possible, for example we could use `LegacyMap::<(ContractAddress, ContractAddress), felt252>` to create an allowance on an ERC20 token contract.
- More complex key-value mappings are possible, for example we could use `LegacyMap::<(ContractAddress, ContractAddress), felt252>` to create an allowance on an ERC20 token contract.

- In mappings, the address of the value at key `k_1,...,k_n` is `h(...h(h(sn_keccak(variable_name),k_1),k_2),...,k_n)` where `ℎ` is the Pedersen hash and the final value is taken `mod2251−256`. You can learn more about the contract storage layout in the [Starknet Documentation](https://docs.starknet.io/documentation/architecture_and_concepts/Contracts/contract-storage/#storage_variables)

Expand Down
2 changes: 1 addition & 1 deletion src/ch01-01-upgradeable_contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ instances. This division follows a similar concept used in object-oriented
programming languages, where we distinguish between the definition and implementation
of objects.

A contract class is the definition of a contract: it specify how the contract
A contract class is the definition of a contract: it specifies how the contract
behaves. It contains essential information like the Cairo byte code, hint
information, entry point names, and everything that defines its semantics
unambiguously.
Expand Down