Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.

Commit bbc254d

Browse files
authored
Merge pull request #110 from morpho-dao/fix/import-paths
Make imports relative
2 parents 8c19f7d + d45336e commit bbc254d

9 files changed

Lines changed: 44 additions & 20 deletions

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
[submodule "lib/forge-std"]
55
path = lib/forge-std
66
url = https://github.com/foundry-rs/forge-std
7+
[submodule "lib/openzeppelin-contracts"]
8+
path = lib/openzeppelin-contracts
9+
url = https://github.com/OpenZeppelin/openzeppelin-contracts
10+
branch = v4.8.0

hardhat.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,27 @@ dotenv.config({ path: './.env.local' });
33
import '@nomiclabs/hardhat-etherscan';
44
import '@nomiclabs/hardhat-waffle';
55
import 'hardhat-gas-reporter';
6+
import 'hardhat-contract-sizer';
7+
import 'solidity-coverage';
68

79
module.exports = {
810
defaultNetwork: 'hardhat',
911
networks: {
1012
hardhat: {},
1113
},
1214
solidity: {
13-
version: '0.8.7',
15+
version: '0.8.17',
1416
settings: {
1517
optimizer: {
1618
enabled: true,
1719
runs: 200,
1820
},
1921
},
2022
},
23+
paths: {
24+
sources: './src',
25+
tests: './test-ts',
26+
},
2127
etherscan: {
2228
apiKey: process.env.ETHERSCAN_API_KEY,
2329
},

lib/openzeppelin-contracts

Submodule openzeppelin-contracts added at 49c0e43

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"scripts": {
99
"test": "npx hardhat test test-ts/*.ts",
1010
"coverage": "npx hardhat coverage",
11-
"lint": "yarn run lint:sol && yarn run lint:js",
11+
"lint": "yarn run lint:sol && yarn run lint:ts",
1212
"lint:ts": "eslint . --ext .ts",
1313
"lint:sol": "solhint 'contracts/**/*.sol'",
14-
"fix": "yarn fix:sol && yarn fix:js",
14+
"fix": "yarn fix:sol && yarn fix:ts",
1515
"fix:ts": "prettier --config .prettierrc.json './**/*.ts' --write",
16-
"fix:sol": "prettier --write 'contracts/**/*.sol'",
17-
"size": "yarn run hardhat size-contracts",
16+
"fix:sol": "prettier --write 'src/**/*.sol'",
17+
"size": "npx hardhat size-contracts",
1818
"postinstall": "husky install"
1919
},
2020
"devDependencies": {
@@ -32,6 +32,7 @@
3232
"ethereum-waffle": "^3.4.0",
3333
"ethers": "^5.4.1",
3434
"hardhat": "^2.5.0",
35+
"hardhat-contract-sizer": "^2.6.1",
3536
"hardhat-gas-reporter": "^1.0.4",
3637
"husky": "^7.0.1",
3738
"prettier": "^2.3.2",
@@ -41,8 +42,5 @@
4142
"solidity-coverage": "^0.7.16",
4243
"ts-node": "10.4.0",
4344
"typescript": "4.5.2"
44-
},
45-
"dependencies": {
46-
"@openzeppelin/contracts": "4.7.3"
4745
}
4846
}

remappings.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
@openzeppelin/=node_modules/@openzeppelin/
2-
forge-std/=lib/forge-std/src/
31
ds-test/=lib/ds-test/src/
4-
hardhat/=node_modules/hardhat/
2+
forge-std/=lib/forge-std/src/

src/HeapOrdering.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: AGPL-3.0-only
22
pragma solidity ^0.8.0;
33

4-
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
4+
import "../lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol";
55

66
library HeapOrdering {
77
struct Account {

src/ThreeHeapOrdering.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: AGPL-3.0-only
22
pragma solidity ^0.8.0;
33

4-
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
4+
import "../lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol";
55

66
library ThreeHeapOrdering {
77
struct Account {

test-ts/test-print-tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('Test RedBlackBinaryTree Library', () => {
2222

2323
describe('Print tree', () => {
2424
it('Apply instructions', async () => {
25-
await testScenario('./test/instruction.json', testRedBlackBinaryTree);
25+
await testScenario('./test-ts/instruction.json', testRedBlackBinaryTree);
2626
await printTreeStucture(testRedBlackBinaryTree);
2727
});
2828
});

yarn.lock

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
chalk "^2.0.0"
2424
js-tokens "^4.0.0"
2525

26+
"@colors/colors@1.5.0":
27+
version "1.5.0"
28+
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
29+
integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==
30+
2631
"@cspotcode/source-map-consumer@0.8.0":
2732
version "0.8.0"
2833
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b"
@@ -743,11 +748,6 @@
743748
"@types/sinon-chai" "^3.2.3"
744749
"@types/web3" "1.0.19"
745750

746-
"@openzeppelin/contracts@4.7.3":
747-
version "4.7.3"
748-
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.7.3.tgz#939534757a81f8d69cc854c7692805684ff3111e"
749-
integrity sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw==
750-
751751
"@resolver-engine/core@^0.3.3":
752752
version "0.3.3"
753753
resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967"
@@ -2638,7 +2638,7 @@ chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2:
26382638
escape-string-regexp "^1.0.5"
26392639
supports-color "^5.3.0"
26402640

2641-
chalk@^4.1.0:
2641+
chalk@^4.0.0, chalk@^4.1.0:
26422642
version "4.1.2"
26432643
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
26442644
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
@@ -2775,6 +2775,15 @@ cli-table3@^0.5.0:
27752775
optionalDependencies:
27762776
colors "^1.1.2"
27772777

2778+
cli-table3@^0.6.0:
2779+
version "0.6.3"
2780+
resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.3.tgz#61ab765aac156b52f222954ffc607a6f01dbeeb2"
2781+
integrity sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==
2782+
dependencies:
2783+
string-width "^4.2.0"
2784+
optionalDependencies:
2785+
"@colors/colors" "1.5.0"
2786+
27782787
cli-width@^2.0.0:
27792788
version "2.2.1"
27802789
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48"
@@ -4953,6 +4962,14 @@ har-validator@~5.1.3:
49534962
ajv "^6.12.3"
49544963
har-schema "^2.0.0"
49554964

4965+
hardhat-contract-sizer@^2.6.1:
4966+
version "2.6.1"
4967+
resolved "https://registry.yarnpkg.com/hardhat-contract-sizer/-/hardhat-contract-sizer-2.6.1.tgz#2b0046a55fa1ec96f19fdab7fde372377401c874"
4968+
integrity sha512-b8wS7DBvyo22kmVwpzstAQTdDCThpl/ySBqZh5ga9Yxjf61/uTL12TEg5nl7lDeWy73ntEUzxMwY6XxbQEc2wA==
4969+
dependencies:
4970+
chalk "^4.0.0"
4971+
cli-table3 "^0.6.0"
4972+
49564973
hardhat-gas-reporter@^1.0.4:
49574974
version "1.0.9"
49584975
resolved "https://registry.yarnpkg.com/hardhat-gas-reporter/-/hardhat-gas-reporter-1.0.9.tgz#9a2afb354bc3b6346aab55b1c02ca556d0e16450"

0 commit comments

Comments
 (0)