Skip to content

Commit a2548c3

Browse files
Quan Nguyenclaude
authored andcommitted
Format Exercise 7 to match other exercises
Update Exercise 7 to follow the same format as Exercise 6 and 8: - Fix capitalization in "Table of Contents:" - Add Context section with link to challenge description - Add Hints section with links to hints branch - Add relevant contract list - Update solution link to solutions branch Closes #159 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent a8dbda0 commit a2548c3

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

program-analysis/echidna/exercises/Exercise-7.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,50 @@
11
# Exercise 7
22

3-
**Table of contents:**
3+
**Table of Contents:**
44

55
- [Exercise 7](#exercise-7)
66
- [Setup](#setup)
7+
- [Context](#context)
78
- [Goals](#goals)
9+
- [Hints](#hints)
810
- [Solution](#solution)
911

1012
Join the team on Slack at: https://slack.empirehacking.nyc/ #ethereum
1113

1214
## Setup
1315

1416
1. Clone the repository: `git clone https://github.com/crytic/damn-vulnerable-defi-echidna`
15-
2. Install dependencies using `yarn install`.
16-
3. Analyze the `before` function in `test/side-entrance/side-entrance.challenge.js` to determine the initial setup requirements.
17-
4. Create a contract to be used for property testing with Echidna.
17+
2. Install the dependencies via `yarn install`.
1818

19-
No skeleton will be provided for this exercise.
19+
## Context
20+
21+
The challenge is described here: https://www.damnvulnerabledefi.xyz/challenges/4.html. We assume that the reader is familiar with it.
2022

2123
## Goals
2224

2325
- Set up the testing environment with appropriate contracts and necessary balances.
26+
- Analyze the `before` function in `test/side-entrance/side-entrance.challenge.js` to determine the initial setup requirements.
2427
- Add a property to check if the balance of the `SideEntranceLenderPool` contract has changed.
2528
- Create a `config.yaml` with the required configuration option(s).
2629
- After Echidna discovers the bug, fix the issue and test your property with Echidna again.
2730

28-
Hint: To become familiar with the workings of the target contract, try manually executing a flash loan.
31+
Only the following contracts are relevant:
32+
33+
- `contracts/side-entrance/SideEntranceLenderPool.sol`
34+
35+
## Hints
36+
37+
We recommend trying without reading the following hints first. The hints are in the [`hints` branch](https://github.com/crytic/damn-vulnerable-defi-echidna/tree/hints).
38+
39+
- The invariant you are looking for is "the balance of the pool contract cannot change."
40+
- To become familiar with the workings of the target contract, try manually executing a flash loan.
41+
- Read about the [allContracts option](../basic/common-testing-approaches.md#external-testing).
42+
- A template is provided in [contracts/side-entrance/SideEntranceEchidna.sol](https://github.com/crytic/damn-vulnerable-defi-echidna/blob/hints/contracts/side-entrance/SideEntranceEchidna.sol).
43+
- A config file is provided in [side-entrance.yaml](https://github.com/crytic/damn-vulnerable-defi-echidna/blob/hints/side-entrance.yaml).
2944

3045
## Solution
3146

32-
The solution can be found in [solution.sol](https://github.com/crytic/building-secure-contracts/tree/master/program-analysis/echidna/exercises/exercise7/solution.sol).
47+
This solution can be found in the [`solutions` branch](https://github.com/crytic/damn-vulnerable-defi-echidna/blob/solutions/contracts/side-entrance/SideEntranceEchidna.sol).
3348

3449
[ctf]: https://www.damnvulnerabledefi.xyz/
3550

0 commit comments

Comments
 (0)