diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 356c77087..92448edd1 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -27,7 +27,8 @@ RUN pipx install solc-select # Foundry at specific version RUN curl -L https://foundry.paradigm.xyz | zsh -RUN foundryup --version nightly-cafc2606a2187a42b236df4aa65f4e8cdfcea970 + +RUN foundryup --version nightly-2044faec64f99a21f0e5f0094458a973612d0712 # Clean up RUN sudo apt-get autoremove -y && sudo apt-get clean -y diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e8096892..46ae1d472 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## v4.0.1 + +- Updated README instructions to include `--isolate` mode (https://github.com/theredguild/damn-vulnerable-defi/pull/77) +- Fixed typo in typehash (https://github.com/theredguild/damn-vulnerable-defi/pull/75) +- Fixed typo in challenge prompt (https://github.com/theredguild/damn-vulnerable-defi/pull/79) +- Removed unused state variable in test (https://github.com/theredguild/damn-vulnerable-defi/issues/76) +- Updated Foundry version in devcontainer + ## v4.0.0 - Full migration from Hardhat to Foundry. diff --git a/README.md b/README.md index 22740cbc3..5ec75eede 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Use Damn Vulnerable DeFi to: ## Install 1. Clone the repository. -2. Checkout the latest release (for example, `git checkout v4.0.0`) +2. Checkout the latest release (for example, `git checkout v4.0.1`) 3. Rename the `.env.sample` file to `.env` and add a valid RPC URL. This is only needed for the challenges that fork mainnet state. 4. Either install [Foundry](https://book.getfoundry.sh/getting-started/installation), or use the [provided devcontainer](./.devcontainer/) (In VSCode, open the repository as a devcontainer with the command "Devcontainer: Open Folder in Container...") 5. Run `forge build` to initialize the project. @@ -33,6 +33,9 @@ To solve a challenge: 2. Uncover the flaw(s) in the challenge's smart contracts. 3. Code your solution in the corresponding test file. 4. Try your solution with `forge test --mp test//.t.sol`. + +> In challenges that restrict the number of transactions, you might need to run the test with the `--isolate` flag. + If the test passes, you've solved the challenge! Challenges may have more than one possible solution. diff --git a/src/naive-receiver/BasicForwarder.sol b/src/naive-receiver/BasicForwarder.sol index 708570ead..2166e1f5f 100644 --- a/src/naive-receiver/BasicForwarder.sol +++ b/src/naive-receiver/BasicForwarder.sol @@ -28,7 +28,7 @@ contract BasicForwarder is EIP712 { error InvalidValue(); bytes32 private constant _REQUEST_TYPEHASH = keccak256( - "Request(address from,address target,uint256 value,uint256 gas,uint256 nonce,bytes data,uint256 deadline" + "Request(address from,address target,uint256 value,uint256 gas,uint256 nonce,bytes data,uint256 deadline)" ); mapping(address => uint256) public nonces; diff --git a/src/side-entrance/README.md b/src/side-entrance/README.md index 9383347e4..c8273db08 100644 --- a/src/side-entrance/README.md +++ b/src/side-entrance/README.md @@ -4,4 +4,4 @@ A surprisingly simple pool allows anyone to deposit ETH, and withdraw it at any It has 1000 ETH in balance already, and is offering free flashloans using the deposited ETH to promote their system. -Yoy start with 1 ETH in balance. Pass the challenge by rescuing all ETH from the pool and depositing it in the designated recovery account. +You start with 1 ETH in balance. Pass the challenge by rescuing all ETH from the pool and depositing it in the designated recovery account. diff --git a/test/unstoppable/Unstoppable.t.sol b/test/unstoppable/Unstoppable.t.sol index ac469df8d..da060e7e0 100644 --- a/test/unstoppable/Unstoppable.t.sol +++ b/test/unstoppable/Unstoppable.t.sol @@ -10,7 +10,6 @@ import {UnstoppableMonitor} from "../../src/unstoppable/UnstoppableMonitor.sol"; contract UnstoppableChallenge is Test { address deployer = makeAddr("deployer"); address player = makeAddr("player"); - address monitor = makeAddr("monitor"); uint256 constant TOKENS_IN_VAULT = 1_000_000e18; uint256 constant INITIAL_PLAYER_TOKEN_BALANCE = 10e18;