From f4e50938e8449523c21e0ff9a316c2a9994ad63e Mon Sep 17 00:00:00 2001 From: Marko Arambasic <131957563+kiriyaga-txfusion@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:10:12 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20update=20upgradable=20and=20solc=20doc?= =?UTF-8?q?s=20with=20new=20released=20plugin=20chang=E2=80=A6=20(#232)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …es details # Description Update upgradable and solc docs with new released plugin changing ## Linked Issues ## Additional context --------- Co-authored-by: Marko Arambasic Co-authored-by: Antonio --- .../30.plugins/40.hardhat-zksync-solc.md | 6 ++++ .../70.hardhat-zksync-upgradable.md | 28 +++++++++++-------- cspell-config/cspell-dev.txt | 2 ++ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/content/00.build/40.tooling/20.hardhat/30.plugins/40.hardhat-zksync-solc.md b/content/00.build/40.tooling/20.hardhat/30.plugins/40.hardhat-zksync-solc.md index ce274696..1b970813 100644 --- a/content/00.build/40.tooling/20.hardhat/30.plugins/40.hardhat-zksync-solc.md +++ b/content/00.build/40.tooling/20.hardhat/30.plugins/40.hardhat-zksync-solc.md @@ -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 @@ -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. diff --git a/content/00.build/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md b/content/00.build/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md index 7de54154..069af21c 100644 --- a/content/00.build/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md +++ b/content/00.build/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md @@ -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"} @@ -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 @@ -287,7 +289,7 @@ contract BoxUups is Initializable, { function initialize(uint256 initValue) public initializer { value = initValue; - __Ownable_init(); + __Ownable_init(msg.sender); __UUPSUpgradeable_init(); } @@ -830,6 +832,7 @@ yarn hardhat deploy-zksync:proxy --contract-name \ [--constructor-args ] \ [--deployment-type ] \ [--initializer ] \ + [--initial-owner ] \ [--no-compile] ``` @@ -852,6 +855,7 @@ yarn hardhat deploy-zksync:beacon --contract-name \ [--constructor-args ] \ [--deployment-type ] \ [--initializer ] \ + [--initial-owner ] \ [--no-compile] ``` @@ -885,6 +889,8 @@ e.g. `yarn hardhat upgrade-zksync:beacon --contract-name BoxV2 --beacon-address - `--proxy-address ` - deployed proxy contract address, e.g. `yarn hardhat upgrade-zksync:proxy --contract-name BoxV2 --proxy-address 0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520`. - `--initializer ` - 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`. diff --git a/cspell-config/cspell-dev.txt b/cspell-config/cspell-dev.txt index 24e2ddad..f35201ba 100644 --- a/cspell-config/cspell-dev.txt +++ b/cspell-config/cspell-dev.txt @@ -90,8 +90,10 @@ smod sqlx-cli sstore syncvm +sendtransaction tlsv1 tokio +txorigin unroller viem Viem