From e0cc06c273f6e20cc764aee99890d20d4cbad1ec Mon Sep 17 00:00:00 2001 From: Gustavo Grieco <31542053+ggrieco-tob@users.noreply.github.com> Date: Tue, 28 May 2024 15:12:14 +0200 Subject: [PATCH 1/2] Update on-using-cheat-codes.md --- program-analysis/echidna/advanced/on-using-cheat-codes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/program-analysis/echidna/advanced/on-using-cheat-codes.md b/program-analysis/echidna/advanced/on-using-cheat-codes.md index dcd89771..373dd964 100644 --- a/program-analysis/echidna/advanced/on-using-cheat-codes.md +++ b/program-analysis/echidna/advanced/on-using-cheat-codes.md @@ -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 @@ -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: From f14d548132d95edd14245fc429850f9e548e7b9d Mon Sep 17 00:00:00 2001 From: Gustavo Grieco <31542053+ggrieco-tob@users.noreply.github.com> Date: Tue, 28 May 2024 15:13:53 +0200 Subject: [PATCH 2/2] Update hevm-cheats-to-test-permit.md --- program-analysis/echidna/advanced/hevm-cheats-to-test-permit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program-analysis/echidna/advanced/hevm-cheats-to-test-permit.md b/program-analysis/echidna/advanced/hevm-cheats-to-test-permit.md index 5f6fade4..10c7a3da 100644 --- a/program-analysis/echidna/advanced/hevm-cheats-to-test-permit.md +++ b/program-analysis/echidna/advanced/hevm-cheats-to-test-permit.md @@ -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