Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update upgradable and solc docs with new released plugin chang… #232

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,8 @@ 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. Currently supported: txorigin, sendtransfer
kiriyaga-txfusion marked this conversation as resolved.
Show resolved Hide resolved
- `suppressedErrors` - Suppress specified errors. Currently supported: txorigin, sendtransfer
kiriyaga-txfusion marked this conversation as resolved.
Show resolved Hide resolved
- `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
Loading