编译
编译solidity 代码,需要下载 zksolc。
进入到创建的项目目录
cd hello-zksync
yarn compile
yarn run v1.22.21
$ hardhat compile
Downloading zksolc 1.4.0
^@^@^@^@^@^@^@^@^@^@^@^@^@^@zksolc version 1.4.0 successfully downloaded
Downloading solc 0.8.17
^@Compiling contracts for zkSync Era with zksolc v1.4.0 and solc v0.8.17
Compiling 48 Solidity files
Warning: This declaration shadows an existing declaration.Successfully compiled 48 Solidity files
✨ Done in 475.74s.
编译后的文件目录是:
artifacts-zk
folder
zksolc编译器的配置在 hardhat.config.ts里zksolc一节,更多请参考:
hardhat-zksync-solc plugin and the compiler section
下一节讲部署和验证。