Skip to content

Commit fd4cd05

Browse files
Fix contracts 0.8.9 build for test:fix on win platform (#699)
1 parent aa7238a commit fd4cd05

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

CONTRIBUTING.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,28 @@ We welcome all contributions!
44

55
## Developing
66

7-
Heads up: we use pnpm instead of yarn or npm. It might be new for you but I promise it's worth the hassle - it's really
8-
good at making big monorepos deterministic. Please ensure that you are running pnpm version 7.
7+
Heads up: we use pnpm instead of yarn or npm. It might be new for you but I promise it's worth the hassle - it's
8+
really good at making big monorepos deterministic. Please ensure that you are running pnpm version 7.
99

1010
First, run `pnpm i` to install all deps.
1111

1212
We use TypeScript monorepo, each target is a separate package and has another package with tests. You need to run
1313
`pnpm watch` to automatically recompile all the projects as you introduce changes.
1414

15-
Run `pnpm test:fix` before pushing, it will run eslint, prettier in fix mode and run all tests.
15+
Run `pnpm test:fix` before pushing, it will run eslint, prettier in fix mode and run all tests.
16+
NB: due to a [known issue](https://github.com/npm/cli/issues/3210) in the npm version newer than 6 it is not possible to
17+
start the commands. A quick fix is to downgrade the npm version `npm install -g [email protected]`.
18+
19+
### Visual Code Solidity Version
20+
21+
Since we develop using multiple versions of Solidity to avoid Linter errors from Visual Code in the following way we can
22+
set the current solidity version.
23+
24+
1. Install the "Solidity" extension from the Marketplace
25+
2. Inside `.sol` file, run right click -> `Solidity: change workspace compiler version (remote)`
26+
3. Choose version from dropdown menu (0.6.4 or 0.8.9 or ...)
27+
28+
[Official Documentation](https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity)
1629

1730
### Local linking
1831

scripts/compile-contracts.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ function generateABIs({ rootDir, contracts }: Files) {
9999
`-o ./contracts/compiled/${dirName}`,
100100
]
101101

102-
execSync(`npx solc@${semver} --abi ${contractPaths} --bin -o ./contracts/compiled/${dirName}`, {
102+
/**
103+
* Fix contract v.0.8.9 on win platform
104+
*/
105+
const winPlatform = process.platform === 'win32' ? `--base-path . --include-path ./contracts/${dirName}` : ''
106+
execSync(`npx solc@${semver} ${winPlatform} --abi ${contractPaths} --bin -o ./contracts/compiled/${dirName}`, {
103107
cwd: rootDir,
104108
stdio: ['ignore', 'ignore', 'inherit'],
105109
})

0 commit comments

Comments
 (0)