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

Mention functions and test compatibility #85

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
8 changes: 8 additions & 0 deletions src/get-started/huff-by-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,12 @@ Available decorators include:
* `calldata` - Set the calldata for the transaction environment. Accepts a single string of calldata bytes.
* `value` - Set the callvalue for the transaction environment. Accepts a single literal.

#### Testing with functions

Huff functions are appended at the end of the contract bytecode, which may conflict with the execution of the tests, as function code may be executed after them.

Always include a return statement at the end of each of your tests to ensure compatibility with functions.

#### Example
```plaintext
#include "huffmate/utils/Errors.huff"
Expand All @@ -536,5 +542,7 @@ Available decorators include:
0x00 calldataload // [0x01]
callvalue // [0x01, 0x01]
eq ASSERT()

0x00 0x00 return
}
```