From 4dbb5c697b482e08238b15c0ac3052ba82ec2412 Mon Sep 17 00:00:00 2001 From: huyhuynh3103 Date: Mon, 1 Jul 2024 13:14:39 +0700 Subject: [PATCH 1/4] chore: apply soldeer --- .gitignore | 4 +++- .gitmodules | 7 ------- foundry.toml | 4 ++++ lib/forge-std | 1 - lib/openzeppelin-contracts | 1 - remappings.txt | 2 ++ soldeer.lock | 12 ++++++++++++ src/legacy/transfers/RONTransferHelper.sol | 2 +- src/legacy/transfers/TransferFromHelper.sol | 2 +- src/legacy/transfers/TransferHelper.sol | 2 +- test/transfers/LibNativeTransfer.t.sol | 2 +- 11 files changed, 25 insertions(+), 14 deletions(-) delete mode 160000 lib/forge-std delete mode 160000 lib/openzeppelin-contracts create mode 100644 remappings.txt create mode 100644 soldeer.lock diff --git a/.gitignore b/.gitignore index 5168248..29328c4 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,6 @@ docs/ # Dotenv file .env node_modules -.yarn \ No newline at end of file +.yarn + +dependencies/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index b618289..3847b07 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,2 @@ -[submodule "lib/forge-std"] - path = lib/forge-std - url = https://github.com/foundry-rs/forge-std - shallow = true -[submodule "lib/openzeppelin-contracts"] - path = lib/openzeppelin-contracts - url = https://github.com/OpenZeppelin/openzeppelin-contracts [submodule "lib/lib/openzeppelin-contracts"] shallow = true diff --git a/foundry.toml b/foundry.toml index 9082196..9143dd0 100644 --- a/foundry.toml +++ b/foundry.toml @@ -29,3 +29,7 @@ runs = 256 [invariant] runs = 256 + +[dependencies] +forge-std = { version = "1.8.2" } +"@openzeppelin-contracts" = { version = "4.9.6" } diff --git a/lib/forge-std b/lib/forge-std deleted file mode 160000 index b6a506d..0000000 --- a/lib/forge-std +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b6a506db2262cad5ff982a87789ee6d1558ec861 diff --git a/lib/openzeppelin-contracts b/lib/openzeppelin-contracts deleted file mode 160000 index 6b4ec6c..0000000 --- a/lib/openzeppelin-contracts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6b4ec6c6c6b67d7350f5b449c0a2fd2dab1af3c7 diff --git a/remappings.txt b/remappings.txt new file mode 100644 index 0000000..bb310d9 --- /dev/null +++ b/remappings.txt @@ -0,0 +1,2 @@ +@forge-std-1.8.2=dependencies/forge-std-1.8.2/src +@openzeppelin-contracts-4.9.6=dependencies/@openzeppelin-contracts-4.9.6 \ No newline at end of file diff --git a/soldeer.lock b/soldeer.lock new file mode 100644 index 0000000..45fd5b1 --- /dev/null +++ b/soldeer.lock @@ -0,0 +1,12 @@ + +[[dependencies]] +name = "forge-std" +version = "1.8.2" +source = "https://soldeer-revisions.s3.amazonaws.com/forge-std/1_8_2_19-05-2024_18:52:07_forge-std-1.8.2.zip" +checksum = "88a37e1d79f60b8aad08c7bd50a7a5ef973fc172b1495028d0725a17f5a4976c" + +[[dependencies]] +name = "@openzeppelin-contracts" +version = "4.9.6" +source = "https://soldeer-revisions.s3.amazonaws.com/@openzeppelin-contracts/4_9_6_14-03-2024_06:11:55_contracts.zip" +checksum = "57f2cae4b45b91b0847e58c36ea70aee0fb3212cc09b47279627f0764f87e5ee" diff --git a/src/legacy/transfers/RONTransferHelper.sol b/src/legacy/transfers/RONTransferHelper.sol index 93f16b0..88a5db4 100644 --- a/src/legacy/transfers/RONTransferHelper.sol +++ b/src/legacy/transfers/RONTransferHelper.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import { Strings } from "../../../lib/openzeppelin-contracts/contracts/utils/Strings.sol"; +import { Strings } from "@openzeppelin-contracts-4.9.6/utils/Strings.sol"; /** * @title RONTransferHelper diff --git a/src/legacy/transfers/TransferFromHelper.sol b/src/legacy/transfers/TransferFromHelper.sol index 19a98d6..ccda466 100644 --- a/src/legacy/transfers/TransferFromHelper.sol +++ b/src/legacy/transfers/TransferFromHelper.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import { Strings } from "../../../lib/openzeppelin-contracts/contracts/utils/Strings.sol"; +import { Strings } from "@openzeppelin-contracts-4.9.6/utils/Strings.sol"; /** * @title TransferFromHelper diff --git a/src/legacy/transfers/TransferHelper.sol b/src/legacy/transfers/TransferHelper.sol index 9f9a4ec..c5a962d 100644 --- a/src/legacy/transfers/TransferHelper.sol +++ b/src/legacy/transfers/TransferHelper.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import { Strings } from "../../../lib/openzeppelin-contracts/contracts/utils/Strings.sol"; +import { Strings } from "@openzeppelin-contracts-4.9.6/utils/Strings.sol"; /** * @title TransferHelper diff --git a/test/transfers/LibNativeTransfer.t.sol b/test/transfers/LibNativeTransfer.t.sol index 5eddad0..70d81ae 100644 --- a/test/transfers/LibNativeTransfer.t.sol +++ b/test/transfers/LibNativeTransfer.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; -import { Test } from "forge-std/Test.sol"; +import { Test } from "@forge-std-1.8.2/Test.sol"; import { LibNativeTransfer } from "src/transfers/LibNativeTransfer.sol"; contract LibNativeTransferTest is Test { From 4dc4a1ba4ba38d1d6f625b9f6bdb4f9140f52451 Mon Sep 17 00:00:00 2001 From: huyhuynh3103 Date: Mon, 1 Jul 2024 13:17:22 +0700 Subject: [PATCH 2/4] chore: fix unit test on ci --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e8d435..0f18cde 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,9 @@ jobs: with: version: nightly + - name: Update package + run: forge soldeer update + - name: Run Forge build run: | forge --version From d0019c04f65be24d884294b9bd440a63354c77d3 Mon Sep 17 00:00:00 2001 From: huyhuynh3103 Date: Mon, 1 Jul 2024 13:56:30 +0700 Subject: [PATCH 3/4] chore: using relative path instead of remapping --- remappings.txt | 2 +- src/legacy/transfers/RONTransferHelper.sol | 2 +- src/legacy/transfers/TransferFromHelper.sol | 2 +- src/legacy/transfers/TransferHelper.sol | 2 +- test/transfers/LibNativeTransfer.t.sol | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/remappings.txt b/remappings.txt index bb310d9..4902534 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,2 +1,2 @@ -@forge-std-1.8.2=dependencies/forge-std-1.8.2/src +@forge-std-1.8.2=dependencies/forge-std-1.8.2 @openzeppelin-contracts-4.9.6=dependencies/@openzeppelin-contracts-4.9.6 \ No newline at end of file diff --git a/src/legacy/transfers/RONTransferHelper.sol b/src/legacy/transfers/RONTransferHelper.sol index 88a5db4..15ee670 100644 --- a/src/legacy/transfers/RONTransferHelper.sol +++ b/src/legacy/transfers/RONTransferHelper.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import { Strings } from "@openzeppelin-contracts-4.9.6/utils/Strings.sol"; +import { Strings } from "../../../dependencies/@openzeppelin-contracts-4.9.6/utils/Strings.sol"; /** * @title RONTransferHelper diff --git a/src/legacy/transfers/TransferFromHelper.sol b/src/legacy/transfers/TransferFromHelper.sol index ccda466..c3139b5 100644 --- a/src/legacy/transfers/TransferFromHelper.sol +++ b/src/legacy/transfers/TransferFromHelper.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import { Strings } from "@openzeppelin-contracts-4.9.6/utils/Strings.sol"; +import { Strings } from "../../../dependencies/@openzeppelin-contracts-4.9.6/utils/Strings.sol"; /** * @title TransferFromHelper diff --git a/src/legacy/transfers/TransferHelper.sol b/src/legacy/transfers/TransferHelper.sol index c5a962d..29c920b 100644 --- a/src/legacy/transfers/TransferHelper.sol +++ b/src/legacy/transfers/TransferHelper.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import { Strings } from "@openzeppelin-contracts-4.9.6/utils/Strings.sol"; +import { Strings } from "../../../dependencies/@openzeppelin-contracts-4.9.6/utils/Strings.sol"; /** * @title TransferHelper diff --git a/test/transfers/LibNativeTransfer.t.sol b/test/transfers/LibNativeTransfer.t.sol index 70d81ae..b4ccc26 100644 --- a/test/transfers/LibNativeTransfer.t.sol +++ b/test/transfers/LibNativeTransfer.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; -import { Test } from "@forge-std-1.8.2/Test.sol"; +import { Test } from "../../dependencies/forge-std-1.8.2/src/Test.sol"; import { LibNativeTransfer } from "src/transfers/LibNativeTransfer.sol"; contract LibNativeTransferTest is Test { From a3bf2144c1c30dccd549febbeace07cf6b5dd949 Mon Sep 17 00:00:00 2001 From: huyhuynh3103 Date: Mon, 1 Jul 2024 13:59:03 +0700 Subject: [PATCH 4/4] chore: remove git submodule --- .gitmodules | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 3847b07..0000000 --- a/.gitmodules +++ /dev/null @@ -1,2 +0,0 @@ -[submodule "lib/lib/openzeppelin-contracts"] - shallow = true