Skip to content

Commit

Permalink
chore: update upgradable and solc docs with new released plugin chang… (
Browse files Browse the repository at this point in the history
#232)

…es details

<!--

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

Update upgradable and solc docs with new released plugin changing

## Linked Issues

<!-- If you have any issues this PR is related to, link them here. -->
<!--
Check out
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
on how to automate linking a GitHub Issue to a PR.
-->

## Additional context

---------

Co-authored-by: Marko Arambasic <[email protected]>
Co-authored-by: Antonio <[email protected]>
  • Loading branch information
3 people authored Oct 2, 2024
1 parent b2c2cae commit f4e5093
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ zksolc: {
mode: '3', // optional. 3 by default, z to optimize bytecode size
fallback_to_optimizing_for_size: false, // optional. Try to recompile with optimizer mode "z" if the bytecode is too large
},
suppressedWarnings: ['txorigin', 'sendtransfer'], // Suppress specified warnings. Currently supported: txorigin, sendtransfer
suppressedErrors: ['txorigin', 'sendtransfer'], // Suppress specified errors. Currently supported: txorigin, sendtransfer
experimental: {
dockerImage: '', // deprecated
tag: '' // deprecated
Expand Down Expand Up @@ -107,6 +109,10 @@ Defaults to `./.zksolc-libraries-cache/missingLibraryDependencies.json`.
- `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.
- `fallback_to_optimizing_for_size` (optional) indicates that the compiler will try to recompile with optimizer mode "z" if the bytecode is too large.
- `suppressedWarnings` - Suppress specified warnings. Supported values: "txorigin" (when contracts use `tx.origin`),
and "sendtransfer" (when contracts use `.transfer`)
- `suppressedErrors` - Suppress specified errors. Supported values: "txorigin" (when contracts use `tx.origin`),
and "sendtransfer" (when contracts use `.transfer`)
- `metadata`: Metadata settings. If the option is omitted, the metadata hash appends by default:
- `bytecodeHash`: Can only be `none`. It removes metadata hash from the bytecode.
- `dockerImage` and `tag` are deprecated options used to identify the name of the compiler docker image.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ Ensure you are using the correct version of the plugin with ethers:
Examples are adopted for plugin version **>=1.0.0**
::

::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
Ensure that you're using the correct version of OpenZeppelin Contracts Upgradable for compatibility with your plugin:

- For plugin version **<1.6.0**:

- Compatible with `@openzeppelin/contracts-upgradeable` **v4**.

- For plugin version **≥1.7.0**:
- Compatible with `@openzeppelin/contracts-upgradeable` **v5** (⭐ Recommended)

::

## Installation

::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
Expand Down Expand Up @@ -216,16 +228,6 @@ npx hardhat run SCRIPT_FILE

::

### Openzeppelin Version

The plugin does not work with the latest versions due to a blocker on the `@matterlab/zksync-contracts` package.
The solution is to change the development dependencies to the previous version in your `package.json`.

```json
"@openzeppelin/contracts": "^4.9.5",
"@openzeppelin/contracts-upgradeable": "^4.9.5",
```

### Hardhat config

```typescript
Expand Down Expand Up @@ -287,7 +289,7 @@ contract BoxUups is Initializable, {

function initialize(uint256 initValue) public initializer {
value = initValue;
__Ownable_init();
__Ownable_init(msg.sender);
__UUPSUpgradeable_init();
}

Expand Down Expand Up @@ -830,6 +832,7 @@ yarn hardhat deploy-zksync:proxy --contract-name <contract name or FQN> \
[--constructor-args <javascript module name>] \
[--deployment-type <deployment type>] \
[--initializer <initialize method>] \
[--initial-owner <initial owner>] \
[--no-compile]
```
Expand All @@ -852,6 +855,7 @@ yarn hardhat deploy-zksync:beacon --contract-name <contract name or FQN> \
[--constructor-args <javascript module name>] \
[--deployment-type <deployment type>] \
[--initializer <initialize method>] \
[--initial-owner <initial owner>] \
[--no-compile]
```
Expand Down Expand Up @@ -885,6 +889,8 @@ e.g. `yarn hardhat upgrade-zksync:beacon --contract-name BoxV2 --beacon-address
- `--proxy-address <proxy address>` - deployed proxy contract address, e.g. `yarn hardhat upgrade-zksync:proxy --contract-name BoxV2 --proxy-address 0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520`.
- `--initializer <initializer method>` - initializer method name present in the contract,
e.g. `hardhat deploy-zksync:proxy --contract-name Contract --initializer store`. If this parameter is omitted, the default value will be `initialize`.
- `--initial-owner` - specify inital contract owner, e.g. `hardhat deploy-zksync:beacon --contract-name Contract --initial-owner 0xa61464658AfeAf65CccaaFD3a512b69A83B77618`.
If this argument is omitted wallet address will be used.
- `--no-compile`- skip the compilation process, e.g. `hardhat deploy-zksync:beacon --contract-name Contract --no-compile`.
- `--deployment-type` - specify which deployer smart contract function will be called.
Permissible values for this parameter include `create`, `create2`, `createAccount`, and `create2Account`.
Expand Down
2 changes: 2 additions & 0 deletions cspell-config/cspell-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ smod
sqlx-cli
sstore
syncvm
sendtransaction
tlsv1
tokio
txorigin
unroller
viem
Viem
Expand Down

0 comments on commit f4e5093

Please sign in to comment.