Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
6boris committed Oct 14, 2023
1 parent ae19d8b commit 67f0c93
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 183 deletions.
10 changes: 5 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"[toml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"npm.exclude": "**/lib/**",
"solidity.formatter": "prettier",
// "solidity.formatter": "forge",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
"npm.exclude": "/foundry/**/lib/**",
// "solidity.formatter": "prettier",
"solidity.formatter": "forge"
// "editor.defaultFormatter": "esbenp.prettier-vscode",
// "editor.formatOnSave": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { FlashLoanReceiver } from "./FlashLoanReceiver.sol";
*/
contract NaiveReceiverLenderPool is ReentrancyGuard, IERC3156FlashLender {
address public constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
uint256 private constant FIXED_FEE = 1 ether; // not the cheapest flash loan
bytes32 private constant CALLBACK_SUCCESS = keccak256("ERC3156FlashBorrower.onFlashLoan");
uint256 public constant FIXED_FEE = 1 ether; // not the cheapest flash loan
bytes32 public constant CALLBACK_SUCCESS = keccak256("ERC3156FlashBorrower.onFlashLoan");

error RepayFailed();
error UnsupportedCurrency();
Expand Down
6 changes: 3 additions & 3 deletions foundry/test/CTF/Damn-Vulnerable-DeFi/02.Naive-Receiver.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { NaiveReceiverHack } from "@contracts/CTF/Damn-Vulnerable-DeFi/02.Naive-

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

Expand All @@ -23,8 +23,8 @@ contract Naive_Receiver_02_Test is Test {
NaiveReceiverLenderPool private pool;
FlashLoanReceiver private receiver;

uint256 ETHER_IN_POOL = 1000 ether;
uint256 ETHER_IN_RECEIVER = 10 ether;
uint256 private ETHER_IN_POOL = 1000 ether;
uint256 private ETHER_IN_RECEIVER = 10 ether;

function setUp() public {
vm.startPrank(deployer);
Expand Down
3 changes: 1 addition & 2 deletions foundry/test/CTF/Damn-Vulnerable-DeFi/03.Truster.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { TrusterLenderPool } from "@contracts/CTF/Damn-Vulnerable-DeFi/03.Truste

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

Expand All @@ -20,7 +19,7 @@ contract Truster_03_Test is Test {

TrusterLenderPool private pool;
DamnValuableToken private token;
uint256 TOKENS_IN_POOL = 1_000_000 ether;
uint256 private TOKENS_IN_POOL = 1_000_000 ether;

function setUp() public {
vm.startPrank(deployer);
Expand Down
136 changes: 0 additions & 136 deletions hardhat.config.ts

This file was deleted.

36 changes: 1 addition & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,6 @@
},
"devDependencies": {
"prettier": "^3.0.3",
"solhint": "^3.6.2",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-network-helpers": "^1.0.6",
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.0",
"@nomicfoundation/hardhat-verify": "^1.0.0",
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
"@typechain/ethers-v6": "^0.4.0",
"@typechain/hardhat": "^8.0.0",
"@types/chai": "^4.3.4",
"@types/fs-extra": "^9.0.13",
"@types/mocha": "^10.0.0",
"@types/node": "^18.11.9",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"chai": "^4.3.7",
"cross-env": "^7.0.3",
"dotenv": "^16.0.3",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"ethers": "^6.4.0",
"fs-extra": "^10.1.0",
"hardhat": "^2.12.2",
"hardhat-deploy": "^0.11.29",
"hardhat-gas-reporter": "^1.0.9",
"lodash": "^4.17.21",
"mocha": "^10.1.0",
"prettier-plugin-solidity": "^1.1.2",
"rimraf": "^4.1.2",
"solhint-plugin-prettier": "^0.0.5",
"solidity-coverage": "^0.8.2",
"ts-generator": "^0.1.1",
"ts-node": "^10.9.1",
"typechain": "^8.2.0",
"typescript": "^4.9.3"
"solhint": "^3.6.2"
}
}

0 comments on commit 67f0c93

Please sign in to comment.