Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
6boris committed Oct 16, 2023
1 parent 2d07ff3 commit 05af20e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
4 changes: 0 additions & 4 deletions contracts/CTF/Damn-Vulnerable-DeFi/02.Naive-Receiver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ contract NaiveReceiverLenderPool is ReentrancyGuard, IERC3156FlashLender {
receive() external payable { }
}

interface IPool {
function flashLoan(address receiver, address token, uint256 amount, bytes calldata data) external returns (bool);
}

contract NaiveReceiverHack {
address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
NaiveReceiverLenderPool pool;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import { DamnValuableToken } from "@contracts/CTF/Damn-Vulnerable-DeFi/00.Base/DamnVulnerableDeFi.sol";
import { Address } from "@openzeppelin/contracts-v4.7.1/utils/Address.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts-v4.7.1/security/ReentrancyGuard.sol";
import { DamnValuableToken } from "@contracts/CTF/Damn-Vulnerable-DeFi/00.Base/DamnValuableToken.sol";

/**
* @title TrusterLenderPool
Expand Down
5 changes: 2 additions & 3 deletions foundry/test/CTF/Damn-Vulnerable-DeFi/03.Truster.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ pragma solidity ^0.8.0;

import { Test } from "forge-std/Test.sol";
import { Vm } from "forge-std/Vm.sol";

Check warning on line 5 in foundry/test/CTF/Damn-Vulnerable-DeFi/03.Truster.t.sol

View workflow job for this annotation

GitHub Actions / lint

imported name Vm is not used
import { DamnValuableToken } from "@contracts/CTF/Damn-Vulnerable-DeFi/00.Base/DamnVulnerableDeFi.sol";
import { TrusterLenderPool } from "@contracts/CTF/Damn-Vulnerable-DeFi/03.Truster/TrusterLenderPool.sol";
import { DamnValuableToken } from "@contracts/CTF/Damn-Vulnerable-DeFi/00.Base/DamnValuableToken.sol";
import { TrusterLenderPool } from "@contracts/CTF/Damn-Vulnerable-DeFi/03.Truster.sol";

/*
https://www.damnvulnerabledefi.xyz/challenges/naive-receiver/
forge test --match-path foundry/test/CTF/Damn-Vulnerable-DeFi/03.Truster.t.sol -vvvvv
*/

Expand Down

0 comments on commit 05af20e

Please sign in to comment.