Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Minor grammar improvements #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions src/tutorial/the-basics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Once complete - come back here!!

## What you are going to learn?

Unlike other programming languages, creating a Huff contract that returns "Hello, world!" is quite advanced! To keep things simple we are going to learn how to create a Huff contract that adds two numbers (then we will dive into "Hello, world!").
Open up your editor and create a file called `addTwo.huff`. Lets jump in.
Unlike other programming languages, creating a Huff contract that returns "Hello, world!" is quite advanced! To keep things simple, we are going to learn how to create a Huff contract that adds two numbers (then we will dive into "Hello, world!").
Open up your editor and create a file called `addTwo.huff`. Let's jump in.

## Add Two

Expand Down Expand Up @@ -121,7 +121,7 @@ As mentioned before, EVM contracts use an ABI to determine which function should

The contract ABI specification dictates that contract calls will select which function they want to call by prepending a 4 byte (function selector) to their calls. The 4 bytes are sliced from the start of the keccak of the function's abi definition. For example, `addTwo(uint256,uint256)`'s function selector will become `0x0f52d66e` (You can confirm this by using a command line tool such as [`cast`](https://book.getfoundry.sh/cast/)'s `sig` command, or online sites such as [keccak256 online](https://emn178.github.io/online-tools/keccak_256.html)). If you are curious as to what these look like you can find a registry of common 4byte function selectors in the [4 byte directory](https://www.4byte.directory/).

Calculating the function selector each time can be tedious. To make life easy, huff has an included builtin `__FUNC_SIG()`. If a function interface is declared within the file's current scope, it's function selector will be calculated and inlined for you. You can view more information about huff's builtin functions [here](/get-started/huff-by-example/#func-sig-func-def-string).
Calculating the function selector each time can be tedious. To make life easy, Huff has an included built-in `__FUNC_SIG()`. If a function interface is declared within the file's current scope, its function selector will be calculated and inlined for you. You can view more information about Huff's builtin functions [here](/get-started/huff-by-example/#func-sig-func-def-string).

#### Modifying our contract to accept external function calls

Expand Down