There's an error when running make build-contracts (it is not working on main).
🔄 Reproduction Steps
Clone the repo.
Run make build-contracts.
🤔 Expected Behavior
This should compile the contracts with no errors.
😯 Current Behavior
An error is thrown and the contracts are not built.
🖥️ Environment
Rust version: [e.g., rustc 1.74.0]
Operating System & Version: [e.g., macOS 14.0]
📋 Additional Context
-
📎 Log Output
➜ era-test-node git:(main) make build-contracts
cd etc/system-contracts && yarn; yarn install; yarn build; yarn preprocess; yarn build-bootloader
yarn install v1.22.19
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning " > @matterlabs/hardhat-zksync-deploy@0.6.5" has incorrect peer dependency "zksync-web3@^0.14.3".
warning " > @typechain/ethers-v5@10.2.1" has unmet peer dependency "@ethersproject/abi@^5.0.0".
warning " > @typechain/ethers-v5@10.2.1" has unmet peer dependency "@ethersproject/providers@^5.0.0".
warning " > @typechain/ethers-v6@0.4.0" has incorrect peer dependency "ethers@6.x".
warning " > @typechain/hardhat@8.0.0" has incorrect peer dependency "ethers@^6.1.0".
[4/4] 🔨 Building fresh packages...
✨ Done in 5.98s.
yarn install v1.22.19
[1/4] 🔍 Resolving packages...
success Already up-to-date.
✨ Done in 0.10s.
yarn run v1.22.19
$ hardhat compile
An unexpected error occurred:
/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/hardhat.config.ts:1
import '@nomiclabs/hardhat-solpp';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1124:15)
at Module._compile (node:internal/modules/cjs/loader:1160:27)
at Module.m._compile (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
at Object.require.extensions.<computed> [as .ts] (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1074:32)
at Function.Module._load (node:internal/modules/cjs/loader:909:12)
at Module.require (node:internal/modules/cjs/loader:1098:19)
at require (node:internal/modules/cjs/helpers:108:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
yarn run v1.22.19
$ rm -rf ./bootloader/build && yarn ts-node scripts/process.ts
$ /Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/.bin/ts-node scripts/process.ts
(node:73595) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/scripts/process.ts:2
import { existsSync, mkdirSync, writeFileSync } from 'fs';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1124:15)
at Module._compile (node:internal/modules/cjs/loader:1160:27)
at Module.m._compile (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
at Object.require.extensions.<computed> [as .ts] (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1074:32)
at Function.Module._load (node:internal/modules/cjs/loader:909:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at phase4 (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/bin.ts:649:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
yarn run v1.22.19
$ yarn hardhat run ./scripts/compile-yul.ts
$ /Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/.bin/hardhat run ./scripts/compile-yul.ts
An unexpected error occurred:
/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/hardhat.config.ts:1
import '@nomiclabs/hardhat-solpp';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1124:15)
at Module._compile (node:internal/modules/cjs/loader:1160:27)
at Module.m._compile (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
at Object.require.extensions.<computed> [as .ts] (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1074:32)
at Function.Module._load (node:internal/modules/cjs/loader:909:12)
at Module.require (node:internal/modules/cjs/loader:1098:19)
at require (node:internal/modules/cjs/helpers:108:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
make: *** [build-contracts] Error 1
🐛 Bug Report for zkSync Era In-Memory Node
📝 Description
There's an error when running
make build-contracts
(it is not working onmain
).🔄 Reproduction Steps
make build-contracts
.🤔 Expected Behavior
This should compile the contracts with no errors.
😯 Current Behavior
An error is thrown and the contracts are not built.
🖥️ Environment
📋 Additional Context
-
📎 Log Output