From 3d4c0bd04b9dacdc13650de943a3cd00e44e0765 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Mon, 27 May 2024 17:35:41 +0300 Subject: [PATCH 1/5] feat: add foundry support --- .gitignore | 5 +++++ foundry.toml | 7 +++++++ hardhat.config.ts | 1 + package.json | 4 +++- yarn.lock | 7 +++++++ 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 foundry.toml diff --git a/.gitignore b/.gitignore index e180212..67b96e3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,9 @@ typechain-types cache artifacts +# Foundry files +out/ +cache_forge/ +lib/ + access_token \ No newline at end of file diff --git a/foundry.toml b/foundry.toml new file mode 100644 index 0000000..be64e8e --- /dev/null +++ b/foundry.toml @@ -0,0 +1,7 @@ +[profile.default] +src = 'contracts' +out = 'out' +viaIR = true +libs = ['node_modules', 'lib'] +test = 'test' +cache_path = 'cache_forge' \ No newline at end of file diff --git a/hardhat.config.ts b/hardhat.config.ts index 430dd4d..fdc90e0 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,4 +1,5 @@ import "@nomicfoundation/hardhat-toolbox"; +import "@nomicfoundation/hardhat-foundry"; import "@zetachain/toolkit/tasks"; import { getHardhatConfigNetworks } from "@zetachain/networks"; diff --git a/package.json b/package.json index da774ba..87521d7 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "@ethersproject/abi": "^5.4.7", "@ethersproject/providers": "^5.4.7", "@nomicfoundation/hardhat-chai-matchers": "^1.0.0", + "@nomicfoundation/hardhat-foundry": "^1.1.2", "@nomicfoundation/hardhat-network-helpers": "^1.0.0", "@nomicfoundation/hardhat-toolbox": "^2.0.0", "@nomiclabs/hardhat-ethers": "^2.0.0", @@ -47,5 +48,6 @@ "ts-node": ">=8.0.0", "typechain": "^8.1.0", "typescript": ">=4.5.0" - } + }, + "packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72" } diff --git a/yarn.lock b/yarn.lock index 2c4c005..72c65c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1184,6 +1184,13 @@ deep-eql "^4.0.1" ordinal "^1.0.3" +"@nomicfoundation/hardhat-foundry@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-foundry/-/hardhat-foundry-1.1.2.tgz#4f5aaa1803b8f5d974dcbc361beb72d49c815562" + integrity sha512-f5Vhj3m2qvKGpr6NAINYwNgILDsai8dVCsFb1rAVLkJxOmD2pAtfCmOH5SBVr9yUI5B1z9rbTwPBJVrqnb+PXQ== + dependencies: + chalk "^2.4.2" + "@nomicfoundation/hardhat-network-helpers@^1.0.0": version "1.0.8" resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.8.tgz#e4fe1be93e8a65508c46d73c41fa26c7e9f84931" From 9629ed12607ee1640a55a54af0a371977a81a4f7 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Mon, 27 May 2024 17:50:11 +0300 Subject: [PATCH 2/5] remove lib from gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 67b96e3..4b7773a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,5 @@ artifacts # Foundry files out/ cache_forge/ -lib/ access_token \ No newline at end of file From 93aba3eb18de0f30008542a0b97c9e3d18995c1c Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Mon, 27 May 2024 17:50:37 +0300 Subject: [PATCH 3/5] forge install: solmate --- .gitmodules | 3 +++ lib/solmate | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 lib/solmate diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8640357 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/solmate"] + path = lib/solmate + url = https://github.com/transmissions11/solmate diff --git a/lib/solmate b/lib/solmate new file mode 160000 index 0000000..c892309 --- /dev/null +++ b/lib/solmate @@ -0,0 +1 @@ +Subproject commit c892309933b25c03d32b1b0d674df7ae292ba925 From a96a7786596eec543892209b455ea394361b7027 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Mon, 27 May 2024 17:51:26 +0300 Subject: [PATCH 4/5] forge install: openzeppelin-contracts v5.0.2 --- .gitmodules | 3 +++ lib/openzeppelin-contracts | 1 + 2 files changed, 4 insertions(+) create mode 160000 lib/openzeppelin-contracts diff --git a/.gitmodules b/.gitmodules index 8640357..feef93b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "lib/solmate"] path = lib/solmate url = https://github.com/transmissions11/solmate +[submodule "lib/openzeppelin-contracts"] + path = lib/openzeppelin-contracts + url = https://github.com/Openzeppelin/openzeppelin-contracts diff --git a/lib/openzeppelin-contracts b/lib/openzeppelin-contracts new file mode 160000 index 0000000..dbb6104 --- /dev/null +++ b/lib/openzeppelin-contracts @@ -0,0 +1 @@ +Subproject commit dbb6104ce834628e473d2173bbc9d47f81a9eec3 From 5f09056262ba29038c09193e3fe5d97f123747f5 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Mon, 27 May 2024 18:26:20 +0300 Subject: [PATCH 5/5] remove lib --- lib/openzeppelin-contracts | 1 - lib/solmate | 1 - 2 files changed, 2 deletions(-) delete mode 160000 lib/openzeppelin-contracts delete mode 160000 lib/solmate diff --git a/lib/openzeppelin-contracts b/lib/openzeppelin-contracts deleted file mode 160000 index dbb6104..0000000 --- a/lib/openzeppelin-contracts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dbb6104ce834628e473d2173bbc9d47f81a9eec3 diff --git a/lib/solmate b/lib/solmate deleted file mode 160000 index c892309..0000000 --- a/lib/solmate +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c892309933b25c03d32b1b0d674df7ae292ba925