Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,28 @@ We welcome all contributions!

## Developing

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
good at making big monorepos deterministic. Please ensure that you are running pnpm version 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 good at making big monorepos deterministic. Please ensure that you are running pnpm version 7.

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

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

Run `pnpm test:fix` before pushing, it will run eslint, prettier in fix mode and run all tests.
Run `pnpm test:fix` before pushing, it will run eslint, prettier in fix mode and run all tests.
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
start the commands. A quick fix is to downgrade the npm version `npm install -g [email protected]`.

### Visual Code Solidity Version

Since we develop using multiple versions of Solidity to avoid Linter errors from Visual Code in the following way we can
set the current solidity version.

1. Install the "Solidity" extension from the Marketplace
2. Inside `.sol` file, run right click -> `Solidity: change workspace compiler version (remote)`
3. Choose version from dropdown menu (0.6.4 or 0.8.9 or ...)

[Official Documentation](https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity)

### Local linking

Expand Down
6 changes: 5 additions & 1 deletion scripts/compile-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ function generateABIs({ rootDir, contracts }: Files) {
`-o ./contracts/compiled/${dirName}`,
]

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