From dff3eb43c3e34c50c31bdab352c519b08d8d06a3 Mon Sep 17 00:00:00 2001 From: Marko Arambasic <131957563+kiriyaga-txfusion@users.noreply.github.com> Date: Wed, 3 Jul 2024 20:55:38 +0200 Subject: [PATCH] docs: switch-to-default-codegen-with-zksolc (#141) # Description Switches to the default codegen with the zksolc These changes with new version 1.5.0 of zksolc will affect a plugin where arguments will be sent from standard json input. ## Additional context https://github.com/matter-labs/hardhat-zksync/pull/1176 https://github.com/matter-labs/hardhat-zksync/pull/1062 Co-authored-by: Marko Arambasic Co-authored-by: Sabrina --- .../20.hardhat/40.hardhat-zksync-solc.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/content/00.build/40.tooling/20.hardhat/40.hardhat-zksync-solc.md b/content/00.build/40.tooling/20.hardhat/40.hardhat-zksync-solc.md index a8a626c8..90bb8bd8 100644 --- a/content/00.build/40.tooling/20.hardhat/40.hardhat-zksync-solc.md +++ b/content/00.build/40.tooling/20.hardhat/40.hardhat-zksync-solc.md @@ -68,8 +68,8 @@ zksolc: { compilerPath: "zksolc", // optional. Ignored for compilerSource "docker". Can be used if compiler is located in a specific folder libraries:{}, // optional. References to non-inlinable libraries missingLibrariesPath: "./.zksolc-libraries-cache/missingLibraryDependencies.json", // optional. This path serves as a cache that stores all the libraries that are missing or have dependencies on other libraries. A `hardhat-zksync-deploy` plugin uses this cache later to compile and deploy the libraries, especially when the `deploy-zksync:libraries` task is executed - isSystem: false, // optional. Enables Yul instructions available only for ZKsync system contracts and libraries - forceEvmla: false, // optional. Falls back to EVM legacy assembly if there is a bug with Yul + enableEraVMExtensions: false, // optional. Enables Yul instructions available only for ZKsync system contracts and libraries + forceEVMLA: false, // optional. Falls back to EVM legacy assembly if there is a bug with Yul optimizer: { enabled: true, // optional. True by default mode: '3', // optional. 3 by default, z to optimize bytecode size @@ -100,8 +100,8 @@ Learn more about [compiling libraries here](compiling-libraries) A `hardhat-zksync-deploy` plugin uses this cache later to compile and deploy the libraries, especially when the `deploy-zksync:libraries` task is executed. Defaults to `./.zksolc-libraries-cache/missingLibraryDependencies.json`. -- `isSystem` - required if contracts use enables Yul instructions available only for ZKsync system contracts and libraries -- `forceEvmla` - falls back to EVM legacy assembly if there is an issue with the Yul IR compilation pipeline. +- `enableEraVMExtensions` - required if contracts use enables Yul instructions available only for ZKsync system contracts and libraries +- `forceEVMLA` - falls back to EVM legacy assembly if there is an issue with the Yul IR compilation pipeline. - `optimizer` - Compiler optimizations: - `enabled`: `true` (default) or `false`. - `mode`: `3` (default) recommended for most projects. Mode `z` reduces bytecode size for large projects that make heavy use of `keccak` and far calls. @@ -114,9 +114,16 @@ The contract names do not necessarily need to be written in full qualified form. The plugin will perform an include operation, attempting to match the provided contract names. ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} -**forceEvmla usage** +The `isSystem` and `forceEvmla` arguments are deprecated in favor of `enableEraVMExtensions` and `forceEVMLA`. +If the deprecated arguments are used, a warning will be displayed and they will be automatically switched to the new naming with the provided values. -Setting the `forceEvmla` field to true can have the following negative impacts: +Starting from zksolc version 1.5.0, the ZKSync Era Solidity Compiler will be used by default with the latest version if not specified in hardhat.config.ts +:: + +::callout{icon="i-heroicons-exclamation-triangle" color="amber"} +**forceEVMLA usage** + +Setting the `forceEVMLA` field to true can have the following negative impacts: - No support for recursion. - No support for internal function pointers.