File tree 9 files changed +63
-0
lines changed
9 files changed +63
-0
lines changed Original file line number Diff line number Diff line change
1
+ [submodule "contracts/lib/forge-std "]
2
+ path = contracts/lib/forge-std
3
+ url = https://github.com/foundry-rs/forge-std
4
+ [submodule "contracts/lib/solmate "]
5
+ path = contracts/lib/solmate
6
+ url = https://github.com/rari-capital/solmate
Original file line number Diff line number Diff line change
1
+
2
+ [profile .default ]
3
+ src = ' src'
4
+ out = ' out'
5
+ libs = [' ../node_modules' , ' lib' ]
6
+
7
+ # See more config options https://book.getfoundry.sh/reference/config.html
Original file line number Diff line number Diff line change 1
1
import * as dotenv from "dotenv" ;
2
+ import fs from "fs" ;
2
3
3
4
import { HardhatUserConfig , task } from "hardhat/config" ;
4
5
import "@nomiclabs/hardhat-waffle" ;
@@ -12,9 +13,18 @@ import "hardhat-watcher";
12
13
import "hardhat-docgen" ;
13
14
import "hardhat-contract-sizer" ;
14
15
import "hardhat-tracer" ;
16
+ import "hardhat-preprocessor" ;
15
17
16
18
dotenv . config ( ) ;
17
19
20
+ function getRemappings ( ) {
21
+ return fs
22
+ . readFileSync ( "remappings.txt" , "utf8" )
23
+ . split ( "\n" )
24
+ . filter ( Boolean )
25
+ . map ( ( line ) => line . trim ( ) . split ( "=" ) ) ;
26
+ }
27
+
18
28
const config : HardhatUserConfig = {
19
29
solidity : {
20
30
version : "0.8.9" ,
@@ -27,6 +37,7 @@ const config: HardhatUserConfig = {
27
37
} ,
28
38
paths : {
29
39
sources : "./src" ,
40
+ cache : "./cache_hardhat" ,
30
41
} ,
31
42
networks : {
32
43
hardhat : {
@@ -185,6 +196,21 @@ const config: HardhatUserConfig = {
185
196
} ,
186
197
] ,
187
198
} ,
199
+ // This fully resolves paths for imports in the ./lib directory for Hardhat
200
+ preprocess : {
201
+ eachLine : ( hre ) => ( {
202
+ transform : ( line : string ) => {
203
+ if ( line . match ( / ^ \s * i m p o r t / i) ) {
204
+ getRemappings ( ) . forEach ( ( [ find , replace ] ) => {
205
+ if ( line . match ( find ) ) {
206
+ line = line . replace ( find , replace ) ;
207
+ }
208
+ } ) ;
209
+ }
210
+ return line ;
211
+ } ,
212
+ } ) ,
213
+ } ,
188
214
} ;
189
215
190
216
export default config ;
Original file line number Diff line number Diff line change 53
53
"hardhat-deploy-tenderly" : " ^0.2.0" ,
54
54
"hardhat-docgen" : " ^1.3.0" ,
55
55
"hardhat-gas-reporter" : " ^1.0.9" ,
56
+ "hardhat-preprocessor" : " ^0.1.5" ,
56
57
"hardhat-tracer" : " ^1.1.1" ,
57
58
"hardhat-watcher" : " ^2.5.0" ,
58
59
"json-schema" : " ^0.4.0" ,
Original file line number Diff line number Diff line change
1
+ @ensdomains/=../node_modules/@ensdomains/
2
+ @openzeppelin/=../node_modules/@openzeppelin/
3
+ @kleros/=../node_modules/@kleros/
4
+ ds-test/=lib/forge-std/lib/ds-test/src/
5
+ eth-gas-reporter/=../node_modules/eth-gas-reporter/
6
+ forge-std/=lib/forge-std/src/
7
+ hardhat-deploy/=../node_modules/hardhat-deploy/
8
+ hardhat/=../node_modules/hardhat/
9
+ solmate/=lib/solmate/src/
Original file line number Diff line number Diff line change @@ -2282,6 +2282,7 @@ __metadata:
2282
2282
hardhat-deploy-tenderly: ^0.2.0
2283
2283
hardhat-docgen: ^1.3.0
2284
2284
hardhat-gas-reporter: ^1.0.9
2285
+ hardhat-preprocessor: ^0.1.5
2285
2286
hardhat-tracer: ^1.1.1
2286
2287
hardhat-watcher: ^2.5.0
2287
2288
json-schema: ^0.4.0
@@ -12748,6 +12749,17 @@ __metadata:
12748
12749
languageName: node
12749
12750
linkType: hard
12750
12751
12752
+ "hardhat-preprocessor@npm:^0.1.5":
12753
+ version: 0.1.5
12754
+ resolution: "hardhat-preprocessor@npm:0.1.5"
12755
+ dependencies:
12756
+ murmur-128: ^0.2.1
12757
+ peerDependencies:
12758
+ hardhat: ^2.0.5
12759
+ checksum: 7d543c2965828441741950b153d584ff096d7a006975f06af9870e05a928e56122b463c4a1b3b346f9a3baccaa6ee2dec1dfd026a434ac714ebf127bbe842fef
12760
+ languageName: node
12761
+ linkType: hard
12762
+
12751
12763
"hardhat-tracer@npm:^1.1.1":
12752
12764
version: 1.1.1
12753
12765
resolution: "hardhat-tracer@npm:1.1.1"
You can’t perform that action at this time.
0 commit comments