From 8977264a6dcd2fd5106c09bc42bf3ae8be5e8258 Mon Sep 17 00:00:00 2001 From: Boris Date: Mon, 16 Oct 2023 15:20:44 +0800 Subject: [PATCH] update lib --- .gitmodules | 6 ++ README.md | 77 +------------------ .../11.DIVERSION/token/MintableERC20.sol | 2 +- foundry/lib/@dev/forge-std | 1 + foundry/lib/@dev/prb-test | 1 + foundry/lib/@gnosis.pm/safe-contracts | 1 + foundry/lib/@gnosis.pm/safe-contracts-v1.3.0 | 1 + foundry/lib/@openzeppelin/contracts | 1 + .../lib/@openzeppelin/contracts-upgradeable | 1 + .../contracts-upgradeable-v4.7.1 | 1 + foundry/lib/@openzeppelin/contracts-v4.7.1 | 1 + foundry/lib/@openzeppelin/contracts-v4.7.3 | 1 + foundry/lib/@uniswap/v2-core | 1 + foundry/lib/@uniswap/v2-periphery | 1 + foundry/lib/@uniswap/v3-core | 1 + foundry/lib/@uniswap/v3-periphery | 1 + foundry/lib/@uniswap/v4-core | 1 + foundry/lib/@uniswap/v4-periphery | 1 + foundry/lib/solady | 1 + foundry/lib/solmate | 1 + .../Damn-Vulnerable-DeFi/10.Free-Rider.t.sol | 2 +- remappings.txt | 2 +- 22 files changed, 27 insertions(+), 79 deletions(-) create mode 160000 foundry/lib/@dev/forge-std create mode 160000 foundry/lib/@dev/prb-test create mode 160000 foundry/lib/@gnosis.pm/safe-contracts create mode 160000 foundry/lib/@gnosis.pm/safe-contracts-v1.3.0 create mode 160000 foundry/lib/@openzeppelin/contracts create mode 160000 foundry/lib/@openzeppelin/contracts-upgradeable create mode 160000 foundry/lib/@openzeppelin/contracts-upgradeable-v4.7.1 create mode 160000 foundry/lib/@openzeppelin/contracts-v4.7.1 create mode 160000 foundry/lib/@openzeppelin/contracts-v4.7.3 create mode 160000 foundry/lib/@uniswap/v2-core create mode 160000 foundry/lib/@uniswap/v2-periphery create mode 160000 foundry/lib/@uniswap/v3-core create mode 160000 foundry/lib/@uniswap/v3-periphery create mode 160000 foundry/lib/@uniswap/v4-core create mode 160000 foundry/lib/@uniswap/v4-periphery create mode 160000 foundry/lib/solady create mode 160000 foundry/lib/solmate diff --git a/.gitmodules b/.gitmodules index d0b2caf..7261504 100644 --- a/.gitmodules +++ b/.gitmodules @@ -100,3 +100,9 @@ [submodule "foundry/lib/@openzeppelin/contracts-v4.7.3"] path = foundry/lib/@openzeppelin/contracts-v4.7.3 url = https://github.com/OpenZeppelin/openzeppelin-contracts +[submodule "foundry/lib/@solady"] + path = foundry/lib/@solady + url = https://github.com/Vectorized/solady +[submodule "foundry/lib/@solmate"] + path = foundry/lib/@solmate + url = https://github.com/transmissions11/solmate diff --git a/README.md b/README.md index 9ee0380..6978550 100644 --- a/README.md +++ b/README.md @@ -17,84 +17,9 @@ yarn 安装指定版本 ```bash - git submodule update --init --recursive -# OR -forge install foundry-rs/forge-std@v1.7.1 --no-commit -forge install transmissions11/solmate@0384dbaaa4fcb5715738a9254a7c0a4cb62cf458 --no-commit -forge install vectorized/solady@v0.0.124 --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 - -forge install OpenZeppelin/openzeppelin-contracts@v5.0.0 --no-commit -forge install OpenZeppelin/openzeppelin-contracts-upgradeable@v5.0.0 --no-commit - -# OpenZeppelin v4 -v4.7.1 - -git clone https://github.com/OpenZeppelin/openzeppelin-contracts foundry/lib/openzeppelin-contracts-v4.7.1 && cd foundry/lib/openzeppelin-contracts-v4.7.1 && git checkout tags/v4.7.1 - -git clone https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable foundry/lib/openzeppelin-contracts-upgradeable-v4.7.1 && cd foundry/lib/openzeppelin-contracts-upgradeable-v4.7.1 && git checkout tags/v4.7.1 - -git rm --cached foundry/lib/openzeppelin-contracts-v4.7.1 - -git submodule add https://github.com/OpenZeppelin/openzeppelin-contracts foundry/lib/openzeppelin-contracts-v4.7.1 - -git submodule add https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable foundry/lib/openzeppelin-contracts-upgradeable-v4.7.1 - -git submodule add https://github.com/safe-global/safe-contracts foundry/lib/safe-contracts-v1.3.0 - - - -git submodule add https://github.com/foundry-rs/forge-std foundry/lib/@dev/forge-std -git submodule add https://github.com/PaulRBerg/prb-test foundry/lib/@dev/prb-test -git submodule add https://github.com/dapphub/ds-test foundry/lib/@dev/ds-test - - -git submodule add https://github.com/Uniswap/v2-core foundry/lib/@uniswap/v2-core -git submodule add https://github.com/Uniswap/v2-periphery foundry/lib/@uniswap/v2-periphery - -git submodule add https://github.com/Uniswap/v3-core foundry/lib/@uniswap/v3-core -git submodule add https://github.com/Uniswap/v3-periphery foundry/lib/@uniswap/v3-periphery - -git submodule add https://github.com/Uniswap/v4-core foundry/lib/@uniswap/v4-core -git submodule add https://github.com/Uniswap/v4-periphery foundry/lib/@uniswap/v4-periphery - -git submodule add https://github.com/safe-global/safe-contracts foundry/lib/@gnosis.pm/safe-contracts -git submodule add https://github.com/safe-global/safe-contracts foundry/lib/@gnosis.pm/safe-contracts-v1.3.0 -# cd foundry/lib/@gnosis.pm/safe-contracts-v1.3.0 && git checkout tags/v1.3.0 - -git submodule add https://github.com/OpenZeppelin/openzeppelin-contracts foundry/lib/@openzeppelin/contracts -git submodule add https://github.com/OpenZeppelin/openzeppelin-contracts foundry/lib/@openzeppelin/contracts-v4.7.1 -# cd foundry/lib/@openzeppelin/contracts-v4.7.1 && git checkout tags/v4.7.1 -git submodule add https://github.com/OpenZeppelin/openzeppelin-contracts foundry/lib/@openzeppelin/contracts-v4.7.3 -# cd foundry/lib/@openzeppelin/contracts-v4.7.3 && git checkout tags/v4.7.3 - - -git submodule add https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable foundry/lib/@openzeppelin/contracts-upgradeable -git submodule add https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable foundry/lib/@openzeppelin/contracts-upgradeable-v4.7.1 -# cd foundry/lib/@openzeppelin/contracts-upgradeable-v4.7.1 && git checkout tags/v4.7.1 - -git submodule add https://github.com/transmissions11/solmate - - - -rm -rf .git/modules/foundry/lib/@dev/ds-test -git submodule deinit -f foundry/lib/@dev/ds-test -git rm --cached -r foundry/lib/@dev/ds-test -rm -rf foundry/lib/@dev/ds-test - - -forge install safe-global/safe-contracts --no-commit - +forge install ``` ```bash diff --git a/contracts/CTF/ONLYPWNER/11.DIVERSION/token/MintableERC20.sol b/contracts/CTF/ONLYPWNER/11.DIVERSION/token/MintableERC20.sol index e9d2055..074f883 100644 --- a/contracts/CTF/ONLYPWNER/11.DIVERSION/token/MintableERC20.sol +++ b/contracts/CTF/ONLYPWNER/11.DIVERSION/token/MintableERC20.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import { ERC20 } from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; +import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract MintableERC20 is ERC20 { address public owner; diff --git a/foundry/lib/@dev/forge-std b/foundry/lib/@dev/forge-std new file mode 160000 index 0000000..f73c73d --- /dev/null +++ b/foundry/lib/@dev/forge-std @@ -0,0 +1 @@ +Subproject commit f73c73d2018eb6a111f35e4dae7b4f27401e9421 diff --git a/foundry/lib/@dev/prb-test b/foundry/lib/@dev/prb-test new file mode 160000 index 0000000..2ece875 --- /dev/null +++ b/foundry/lib/@dev/prb-test @@ -0,0 +1 @@ +Subproject commit 2ece8755d9afe7d66440ef9ca19b8a9dab40164b diff --git a/foundry/lib/@gnosis.pm/safe-contracts b/foundry/lib/@gnosis.pm/safe-contracts new file mode 160000 index 0000000..810fad9 --- /dev/null +++ b/foundry/lib/@gnosis.pm/safe-contracts @@ -0,0 +1 @@ +Subproject commit 810fad9a074837e1247ca24ac9e7f77a5dffce19 diff --git a/foundry/lib/@gnosis.pm/safe-contracts-v1.3.0 b/foundry/lib/@gnosis.pm/safe-contracts-v1.3.0 new file mode 160000 index 0000000..186a21a --- /dev/null +++ b/foundry/lib/@gnosis.pm/safe-contracts-v1.3.0 @@ -0,0 +1 @@ +Subproject commit 186a21a74b327f17fc41217a927dea7064f74604 diff --git a/foundry/lib/@openzeppelin/contracts b/foundry/lib/@openzeppelin/contracts new file mode 160000 index 0000000..6383299 --- /dev/null +++ b/foundry/lib/@openzeppelin/contracts @@ -0,0 +1 @@ +Subproject commit 6383299d715d7cd3d697ab655b42f8e61e52e197 diff --git a/foundry/lib/@openzeppelin/contracts-upgradeable b/foundry/lib/@openzeppelin/contracts-upgradeable new file mode 160000 index 0000000..9610f7d --- /dev/null +++ b/foundry/lib/@openzeppelin/contracts-upgradeable @@ -0,0 +1 @@ +Subproject commit 9610f7de978f623ecf4ae5e4b917e53e17ceaff2 diff --git a/foundry/lib/@openzeppelin/contracts-upgradeable-v4.7.1 b/foundry/lib/@openzeppelin/contracts-upgradeable-v4.7.1 new file mode 160000 index 0000000..5e9bccb --- /dev/null +++ b/foundry/lib/@openzeppelin/contracts-upgradeable-v4.7.1 @@ -0,0 +1 @@ +Subproject commit 5e9bccb282ee8f3c9c4abaccc74b40b9d34ccffa diff --git a/foundry/lib/@openzeppelin/contracts-v4.7.1 b/foundry/lib/@openzeppelin/contracts-v4.7.1 new file mode 160000 index 0000000..3b8b4ba --- /dev/null +++ b/foundry/lib/@openzeppelin/contracts-v4.7.1 @@ -0,0 +1 @@ +Subproject commit 3b8b4ba82c880c31cd3b96dd5e15741d7e26658e diff --git a/foundry/lib/@openzeppelin/contracts-v4.7.3 b/foundry/lib/@openzeppelin/contracts-v4.7.3 new file mode 160000 index 0000000..ecd2ca2 --- /dev/null +++ b/foundry/lib/@openzeppelin/contracts-v4.7.3 @@ -0,0 +1 @@ +Subproject commit ecd2ca2cd7cac116f7a37d0e474bbb3d7d5e1c4d diff --git a/foundry/lib/@uniswap/v2-core b/foundry/lib/@uniswap/v2-core new file mode 160000 index 0000000..ee547b1 --- /dev/null +++ b/foundry/lib/@uniswap/v2-core @@ -0,0 +1 @@ +Subproject commit ee547b17853e71ed4e0101ccfd52e70d5acded58 diff --git a/foundry/lib/@uniswap/v2-periphery b/foundry/lib/@uniswap/v2-periphery new file mode 160000 index 0000000..0335e8f --- /dev/null +++ b/foundry/lib/@uniswap/v2-periphery @@ -0,0 +1 @@ +Subproject commit 0335e8f7e1bd1e8d8329fd300aea2ef2f36dd19f diff --git a/foundry/lib/@uniswap/v3-core b/foundry/lib/@uniswap/v3-core new file mode 160000 index 0000000..d8b1c63 --- /dev/null +++ b/foundry/lib/@uniswap/v3-core @@ -0,0 +1 @@ +Subproject commit d8b1c635c275d2a9450bd6a78f3fa2484fef73eb diff --git a/foundry/lib/@uniswap/v3-periphery b/foundry/lib/@uniswap/v3-periphery new file mode 160000 index 0000000..697c247 --- /dev/null +++ b/foundry/lib/@uniswap/v3-periphery @@ -0,0 +1 @@ +Subproject commit 697c2474757ea89fec12a4e6db16a574fe259610 diff --git a/foundry/lib/@uniswap/v4-core b/foundry/lib/@uniswap/v4-core new file mode 160000 index 0000000..60de80a --- /dev/null +++ b/foundry/lib/@uniswap/v4-core @@ -0,0 +1 @@ +Subproject commit 60de80a37b26e4d36bd573430b5b4bf53d0a3d36 diff --git a/foundry/lib/@uniswap/v4-periphery b/foundry/lib/@uniswap/v4-periphery new file mode 160000 index 0000000..581d96d --- /dev/null +++ b/foundry/lib/@uniswap/v4-periphery @@ -0,0 +1 @@ +Subproject commit 581d96dfd8b281cafe351205bf6d2d65efb4df90 diff --git a/foundry/lib/solady b/foundry/lib/solady new file mode 160000 index 0000000..a44f583 --- /dev/null +++ b/foundry/lib/solady @@ -0,0 +1 @@ +Subproject commit a44f583e2f64b89d7dfcf94562d48ff54f0882d8 diff --git a/foundry/lib/solmate b/foundry/lib/solmate new file mode 160000 index 0000000..0384dba --- /dev/null +++ b/foundry/lib/solmate @@ -0,0 +1 @@ +Subproject commit 0384dbaaa4fcb5715738a9254a7c0a4cb62cf458 diff --git a/foundry/test/CTF/Damn-Vulnerable-DeFi/10.Free-Rider.t.sol b/foundry/test/CTF/Damn-Vulnerable-DeFi/10.Free-Rider.t.sol index 81e70f1..032cdd8 100644 --- a/foundry/test/CTF/Damn-Vulnerable-DeFi/10.Free-Rider.t.sol +++ b/foundry/test/CTF/Damn-Vulnerable-DeFi/10.Free-Rider.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import { PRBTest } from "@dev/prb-test/src/PRBTest.sol"; +import { PRBTest } from "@prb/test/PRBTest.sol"; import { DamnValuableNFT } from "@contracts/CTF/Damn-Vulnerable-DeFi/00.Base/DamnValuableNFT.sol"; import { DamnValuableToken } from "@contracts/CTF/Damn-Vulnerable-DeFi/00.Base/DamnValuableToken.sol"; import { diff --git a/remappings.txt b/remappings.txt index 01f6c68..0b84ddc 100644 --- a/remappings.txt +++ b/remappings.txt @@ -2,7 +2,7 @@ @solmate=foundry/lib/solmate/src @solady=foundry/lib/solady/src -@prb/test=foundry/lib/prb-test/src +@prb/test=foundry/lib/@dev/prb-test/src @gnosis.pm/safe-contracts=foundry/lib/@gnosis.pm/safe-contracts/contracts @gnosis.pm/safe-contracts-v1.3.0=foundry/lib/@gnosis.pm/safe-contracts-v1.3.0/contracts