-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54965f8
commit fe43b16
Showing
31 changed files
with
21,241 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/openzeppelin-contracts"] | ||
path = lib/openzeppelin-contracts | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts | ||
[submodule "lib/openzeppelin-contracts-upgradeable"] | ||
path = lib/openzeppelin-contracts-upgradeable | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[profile.default] | ||
src = 'src/main/solidity' | ||
test = 'src/test/solidity' | ||
out = 'artifacts' | ||
libs = ['lib'] | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/tree/master/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import fs from "fs"; | ||
import "@typechain/hardhat"; | ||
import "hardhat-preprocessor"; | ||
import { HardhatUserConfig, task } from "hardhat/config"; | ||
|
||
import example from "./src/deploy/typescript/example"; | ||
|
||
function getRemappings() { | ||
return fs | ||
.readFileSync("remappings.txt", "utf8") | ||
.split("\n") | ||
.filter(Boolean) | ||
.map((line) => line.trim().split("=")); | ||
} | ||
|
||
task("example", "Example task").setAction(example); | ||
|
||
const config: HardhatUserConfig = { | ||
solidity: { | ||
version: "0.8.20", | ||
settings: { | ||
optimizer: { | ||
enabled: true, | ||
runs: 200, | ||
}, | ||
}, | ||
}, | ||
paths: { | ||
sources: "./src/main/solidity", // Use ./src rather than ./contracts as Hardhat expects | ||
cache: "./cache_hardhat", // Use a different cache for Hardhat than Foundry | ||
}, | ||
// This fully resolves paths for imports in the ./lib directory for Hardhat | ||
//@ts-ignore | ||
preprocess: { | ||
//@ts-ignore | ||
eachLine: (hre) => ({ | ||
transform: (line: string) => { | ||
if (line.match(/^\s*import /i)) { | ||
getRemappings().forEach(([find, replace]) => { | ||
if (line.match(find)) { | ||
line = line.replace(find, replace); | ||
} | ||
}); | ||
} | ||
return line; | ||
}, | ||
}), | ||
}, | ||
}; | ||
|
||
export default config; |
Submodule openzeppelin-contracts
added at
69c8de
Submodule openzeppelin-contracts-upgradeable
added at
fa5253
Oops, something went wrong.