Skip to content

Commit

Permalink
Solidity Build System: first iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
alcuadrado committed Oct 8, 2024
1 parent 86aa02f commit 2bb19ed
Show file tree
Hide file tree
Showing 107 changed files with 6,893 additions and 419 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@
"lint:fix": "pnpm run --recursive lint:fix && pnpm prettier --write",
"prettier": "prettier *.md \"{docs,.github}/**/*.{md,yml,ts,js}\" \"scripts/**/*.js\"",
"vnext-full-check": "pnpm run --recursive --filter \"./v-next/**\" build && pnpm run --recursive --filter \"./v-next/**\" lint && pnpm run --recursive --filter \"./v-next/**\" test"
},
"dependencies": {}
}
}
100 changes: 46 additions & 54 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions v-next/example-project/contracts/A.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
pragma solidity *;

import "./B.sol";

contract A is B {}
6 changes: 6 additions & 0 deletions v-next/example-project/contracts/B.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";

contract B {}
8 changes: 8 additions & 0 deletions v-next/example-project/contracts/C.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

import "./B.sol";

contract C {}

contract C2 {}
1 change: 1 addition & 0 deletions v-next/example-project/contracts/D.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "./C.sol";
4 changes: 4 additions & 0 deletions v-next/example-project/contracts/NoImports.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity ^0.7.0;

contract NoImports {}
4 changes: 4 additions & 0 deletions v-next/example-project/contracts/UserRemappedImport.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity ^0.8.0;

import "remapped/Ownable.sol";
29 changes: 29 additions & 0 deletions v-next/example-project/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { viemScketchPlugin } from "./viem-scketch-plugin.js";
import hardhatNetworkHelpersPlugin from "@ignored/hardhat-vnext-network-helpers";
import hardhatEthersPlugin from "@ignored/hardhat-vnext-ethers";

util.inspect.defaultOptions.depth = null;

const exampleEmptyTask = emptyTask("empty", "An example empty task").build();

const exampleEmptySubtask = task(["empty", "task"])
Expand Down Expand Up @@ -135,6 +137,33 @@ const config: HardhatUserConfig = {
nodeTest: "test/node",
},
},
solidity: {
profiles: {
default: {
compilers: [
{
version: "0.8.22",
},
{
version: "0.7.1",
},
],
overrides: {
"foo/bar.sol": {
version: "0.8.1",
},
},
},
test: {
version: "0.8.2",
},
coverage: {
version: "0.8.2",
},
},
dependenciesToCompile: ["@openzeppelin/contracts/token/ERC20/ERC20.sol"],
remappings: ["remapped/=npm/@openzeppelin/[email protected]/access/"],
},
};

export default config;
9 changes: 5 additions & 4 deletions v-next/example-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
},
"devDependencies": {
"@ignored/hardhat-vnext": "workspace:^3.0.0-next.4",
"@ignored/hardhat-vnext-ethers": "workspace:^3.0.0-next.0",
"@ignored/hardhat-vnext-keystore": "workspace:^3.0.0-next.0",
"@ignored/hardhat-vnext-mocha-test-runner": "workspace:^3.0.0-next.0",
"@ignored/hardhat-vnext-network-helpers": "workspace:^3.0.0-next.0",
"@ignored/hardhat-vnext-node-test-runner": "workspace:^3.0.0-next.0",
"@ignored/hardhat-vnext-network-helpers": "workspace:^3.0.0-next.0",
"@ignored/hardhat-vnext-mocha-test-runner": "workspace:^3.0.0-next.0",
"@ignored/hardhat-vnext-keystore": "workspace:^3.0.0-next.0",
"@ignored/hardhat-vnext-ethers": "workspace:^3.0.0-next.0",
"@openzeppelin/contracts": "^5.0.2",
"@types/mocha": ">=9.1.0",
"@types/node": "^20.14.9",
"mocha": "^10.0.0",
Expand Down
Loading

0 comments on commit 2bb19ed

Please sign in to comment.