Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
6boris committed Oct 9, 2023
1 parent 24cf5f2 commit b032296
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 11 deletions.
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,15 @@
[submodule "foundry/lib/v2-core"]
path = foundry/lib/v2-core
url = https://github.com/Uniswap/v2-core
[submodule "foundry/lib/v3-periphery"]
path = foundry/lib/v3-periphery
url = https://github.com/Uniswap/v3-periphery
[submodule "foundry/lib/v3-core"]
path = foundry/lib/v3-core
url = https://github.com/Uniswap/v3-core
[submodule "foundry/lib/v4-periphery"]
path = foundry/lib/v4-periphery
url = https://github.com/Uniswap/v4-periphery
[submodule "foundry/lib/v4-core"]
path = foundry/lib/v4-core
url = https://github.com/Uniswap/v4-core
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ forge install foundry-rs/forge-std@v1.7.1 --no-commit
forge install Uniswap/v2-periphery --no-commit
forge install Uniswap/v2-core --no-commit

forge install Uniswap/v3-periphery --no-commit
forge install Uniswap/v3-core --no-commit

forge install Uniswap/v4-periphery --no-commit
forge install Uniswap/v4-core --no-commit

```

```bash
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions contracts/CTF/ONLYPWNER/01.FREEBIE.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@ contract VaultExploit {
victimInstance.withdraw(victimInstance.totalDeposited());
}

fallback() external payable { }

receive() external payable { }
}
2 changes: 0 additions & 2 deletions contracts/CTF/ONLYPWNER/02.TUTORIAL.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@ contract TutorialExploit {
victimInstance.callMe();
}

fallback() external payable { }

receive() external payable { }
}
4 changes: 2 additions & 2 deletions contracts/CTF/ONLYPWNER/03.REVERSE-RUGPULL.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity ^0.8.0;

import { console2 } from "forge-std/console2.sol";
import { ERC20 } from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";
import { IERC20 } from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract MintableERC20 is ERC20 {
constructor(string memory name, string memory symbol, uint256 mintAmount) ERC20(name, symbol) {
Expand Down
1 change: 1 addition & 0 deletions foundry/lib/v3-core
Submodule v3-core added at e3589b
1 change: 1 addition & 0 deletions foundry/lib/v3-periphery
Submodule v3-periphery added at 80f26c
1 change: 1 addition & 0 deletions foundry/lib/v4-core
Submodule v4-core added at 0095e0
1 change: 1 addition & 0 deletions foundry/lib/v4-periphery
Submodule v4-periphery added at 581d96
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity ^0.8.0;

import { Test } from "forge-std/Test.sol";
import { Fallback, FallbackFactory } from "@contracts/Ethernaut/01_Fallback.sol";
import { Ethernaut } from "@contracts/Ethernaut/00_Ethernaut.sol";
import { Fallback, FallbackFactory } from "@contracts/CTF/Ethernaut/01_Fallback.sol";
import { Ethernaut } from "@contracts/CTF/Ethernaut/00_Ethernaut.sol";
import { console } from "forge-std/console.sol";

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity ^0.8.0;

import { Test } from "forge-std/Test.sol";
import { console } from "forge-std/console.sol";
import { Ethernaut } from "@contracts/Ethernaut/00_Ethernaut.sol";
import { Fallout, FalloutFactory } from "@contracts/Ethernaut/02_Fallout.sol";
import { Ethernaut } from "@contracts/CTF/Ethernaut/00_Ethernaut.sol";
import { Fallout, FalloutFactory } from "@contracts/CTF/Ethernaut/02_Fallout.sol";

/*
forge test --match-path foundry/test/Ethernaut/02_Fallout.t.sol -vvvv
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"private": true,
"scripts": {
"clean": "rm -rf cache out broadcast",
"clean": "rm -rf foundry/cache foundry/out foundry/broadcast",
"lint": "yarn lint:sol && yarn lint:prettier",
"lint:sol": "forge fmt && yarn solhint foundry/test/**/*.sol contracts/**/*.sol --fix",
"lint:prettier": "prettier --write **/*.{json,md,yml} --ignore-path=.prettierignore",
Expand Down
2 changes: 2 additions & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ forge-std=foundry/lib/forge-std/src
@openzeppelin=foundry/lib/openzeppelin-contracts
@uniswap/v2-core=foundry/lib/v2-core
@uniswap/v2-periphery=foundry/lib/v2-periphery
@uniswap/v3-core=foundry/lib/v3-core
@uniswap/v3-periphery=foundry/lib/v3-periphery

0 comments on commit b032296

Please sign in to comment.