-
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 29cdbda
Showing
16 changed files
with
16,168 additions
and
2 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/solmate"] | ||
path = lib/solmate | ||
url = https://github.com/transmissions11/solmate | ||
[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 |
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,52 @@ | ||
import fs from "fs"; | ||
import "@nomiclabs/hardhat-waffle"; | ||
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.13", | ||
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
Oops, something went wrong.