Skip to content

Commit

Permalink
Merge pull request #359 from crytic/fix-hevm-links
Browse files Browse the repository at this point in the history
Fixes for hevm-related broken urls
  • Loading branch information
montyly authored May 28, 2024
2 parents 40216de + f14d548 commit f88d490
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

This method presents a new way of allocating allowances, as signatures can be computed off-chain and passed to a contract. It allows a relayer to pay the entire gas fee of the permit transaction in exchange for a fee, enabling completely gasless transactions for a user. Furthermore, this removes the typical `approve() -> transferFrom()` pattern that forces users to send two transactions instead of just one through this new method.

Note that for the permit function to work, a valid signature is needed. This example will demonstrate how we can use [`hevm`'s `sign` cheatcode](https://github.com/dapphub/dapptools/blob/master/src/hevm/README.md#cheat-codes) to sign data with a private key. More generally, you can use this cheatcode to test anything that requires valid signatures.
Note that for the permit function to work, a valid signature is needed. This example will demonstrate how we can use [`hevm`'s `sign` cheatcode](https://hevm.dev/ds-test-tutorial.html#supported-cheat-codes) to sign data with a private key. More generally, you can use this cheatcode to test anything that requires valid signatures.

## Example

Expand Down
4 changes: 2 additions & 2 deletions program-analysis/echidna/advanced/on-using-cheat-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- [How and when to use cheat codes](#how-and-when-to-use-cheat-codes)
- [Introduction](#introduction)
- [Cheat codes available in Echidna](#cheat-codes-available-in-echidna)
- [Advice on the use of cheat codes](#advice-on-the-use-of-cheat-codes)
- [Risks of cheat codes](#risks-of-cheat-codes)

## Introduction

Expand All @@ -14,7 +14,7 @@ Cheat codes are special functions that allow to change the state of the EVM in w

## Cheat codes available in Echidna

Echidna supports all cheat codes that are available in [hevm](https://github.com/ethereum/hevm). These are documented here: https://hevm.dev/controlling-the-unit-testing-environment.html#cheat-codes.
Echidna supports all cheat codes that are available in [hevm](https://github.com/ethereum/hevm). These are documented here: [https://hevm.dev/controlling-the-unit-testing-environment.html#cheat-codes](https://hevm.dev/ds-test-tutorial.html#supported-cheat-codes).
If a new cheat code is added in the future, Echidna only needs to update the hevm version and everything should work out of the box.

As an example, the `prank` cheat code is able to set the `msg.sender` address in the context of the next external call:
Expand Down

0 comments on commit f88d490

Please sign in to comment.