Skip to content

Commit 64fddf9

Browse files
authored
Work for v4.1.0 (#96)
1 parent 98028bb commit 64fddf9

File tree

16 files changed

+103
-25
lines changed

16 files changed

+103
-25
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ RUN curl -o- https://raw.githubusercontent.com/devcontainers/features/main/src/n
2525
# Install solc-select
2626
RUN pipx install solc-select
2727

28-
# Foundry at specific version
28+
# Foundry
2929
RUN curl -L https://foundry.paradigm.xyz | zsh
3030

31-
RUN foundryup --version nightly-2044faec64f99a21f0e5f0094458a973612d0712
31+
RUN foundryup
3232

3333
# Clean up
3434
RUN sudo apt-get autoremove -y && sudo apt-get clean -y

.gitmodules

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@
4141
[submodule "lib/v3-periphery"]
4242
path = lib/v3-periphery
4343
url = https://github.com/Uniswap/v3-periphery
44+
ignore = dirty
4445
[submodule "lib/v3-core"]
4546
path = lib/v3-core
4647
url = https://github.com/Uniswap/v3-core
4748
ignore = dirty
4849
[submodule "lib/permit2"]
4950
path = lib/permit2
5051
url = https://github.com/Uniswap/permit2
51-
ignore = dirty
52+
ignore = dirty

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## v4.1.0
4+
5+
- Updated Wallet Mining challenge to:
6+
- Use a new `USER_DEPOSIT_ADDRESS`
7+
- Use [CREATEX](https://github.com/pcaversaccio/createx) for deployment of `AuthorizerFactory` and `WalletDeployer`
8+
- Set `chief` of `WalletDeployer` in constructor instead of `msg.sender`
9+
- Use [Safe Singleton Factory](https://github.com/safe-global/safe-singleton-factory)'s signed transaction for this chain (instead of using `etch` to set the code)
10+
- Updated devcontainer to use Foundry stable
11+
- Updated libraries (OZ Contracts, forge-std)
12+
- Explicitly enabled optimizer in `foundry.toml`
13+
- Updated instances of `vm.expectRevert`
14+
- Fixed some comments
15+
316
## v4.0.1
417

518
- Updated README instructions to include `--isolate` mode (https://github.com/theredguild/damn-vulnerable-defi/pull/77)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Use Damn Vulnerable DeFi to:
1414
## Install
1515

1616
1. Clone the repository.
17-
2. Checkout the latest release (for example, `git checkout v4.0.1`)
17+
2. Checkout the latest release (for example, `git checkout v4.1.0`)
1818
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.
1919
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...")
2020
5. Run `forge build` to initialize the project.

foundry.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ ignored_warnings_from = [
1414
"src/curvy-puppet/ICryptoSwapPool.sol"
1515
]
1616
bytecode_hash = "none"
17+
optimizer = true
18+
optimizer_runs = 200
19+

lib/openzeppelin-contracts

src/wallet-mining/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ There’s a contract that incentivizes users to deploy Safe wallets, rewarding t
44

55
The deployer contract only works with a Safe factory and copy set during deployment. It looks like the [Safe singleton factory](https://github.com/safe-global/safe-singleton-factory) is already deployed.
66

7-
The team transferred 20 million DVT tokens to a user at `0x8be6a88D3871f793aD5D5e24eF39e1bf5be31d2b`, where her plain 1-of-1 Safe was supposed to land. But they lost the nonce they should use for deployment.
7+
The team transferred 20 million DVT tokens to a user at `0xCe07CF30B540Bb84ceC5dA5547e1cb4722F9E496`, where her plain 1-of-1 Safe was supposed to land. But they lost the nonce they should use for deployment.
88

99
To make matters worse, there's been rumours of a vulnerability in the system. The team's freaked out. Nobody knows what to do, let alone the user. She granted you access to her private key.
1010

src/wallet-mining/WalletDeployer.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@ contract WalletDeployer {
1616
address public immutable cpy;
1717

1818
uint256 public constant pay = 1 ether;
19-
address public immutable chief = msg.sender;
19+
address public immutable chief;
2020
address public immutable gem;
2121

2222
address public mom;
2323
address public hat;
2424

2525
error Boom();
2626

27-
constructor(address _gem, address _cook, address _cpy) {
27+
constructor(address _gem, address _cook, address _cpy, address _chief) {
2828
gem = _gem;
2929
cook = SafeProxyFactory(_cook);
3030
cpy = _cpy;
31+
chief = _chief;
3132
}
3233

3334
/**

0 commit comments

Comments
 (0)