Skip to content

Commit

Permalink
docs: switch-to-default-codegen-with-zksolc (#141)
Browse files Browse the repository at this point in the history
<!--

Thank you for contributing to the ZKsync Docs!

Before submitting the PR, please make sure you do the following:

- Update your PR title to follow [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/)
- Read the [Contributing
Guide](https://github.com/matter-labs/zksync-docs/blob/main/CONTRIBUTING.md).
- Understand our [Code of
Conduct](https://github.com/matter-labs/zksync-docs/blob/main/CODE_OF_CONDUCT.md)
- Please delete any unused parts of the template when submitting your PR

-->

# 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
matter-labs/hardhat-zksync#1176
matter-labs/hardhat-zksync#1062

Co-authored-by: Marko Arambasic <makiarambasic@gmail.com>
Co-authored-by: Sabrina <sf@matterlabs.dev>
  • Loading branch information
3 people authored Jul 3, 2024
1 parent e595970 commit dff3eb4
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions content/00.build/40.tooling/20.hardhat/40.hardhat-zksync-solc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit dff3eb4

Please sign in to comment.