Git Product home page Git Product logo

hardhat-zksync's Introduction

ZKsync Era: Welcome to ZKsync Hardhat plugins repository

Era Logo

ZKsync Era is a layer 2 rollup that uses zero-knowledge proofs to scale Ethereum without compromising on security or decentralization. Since it's EVM compatible (Solidity/Vyper), 99% of Ethereum projects can redeploy without refactoring or re-auditing a single line of code. ZKsync Era also uses an LLVM-based compiler that will eventually let developers write smart contracts in C++, Rust and other popular languages.

This repository contains a collection of plugins to aid in the development and deployment of smart contracts on the ZKsync network. These plugins are designed to integrate seamlessly with the Hardhat development environment, providing developers with an easy-to-use and powerful toolset.

Here is an overview of the plugins currently available:

🔌 Plugin 📄 Description
hardhat-zksync-solc Simplifies compiling Solidity contracts for the ZKsync network, streamlining deployment preparation.
hardhat-zksync-deploy Facilitates the deployment of contracts on ZKsync, utilizing artifacts from hardhat-zksync-solc/vyper.
hardhat-zksync-verify Automates the process of verifying smart contracts on the ZKsync network, enhancing transparency and trust.
hardhat-zksync-verify-vyper Specialized for automating the verification of Vyper contracts on the ZKsync network.
hardhat-zksync-vyper Streamlines the compilation of Vyper contracts for deployment on the ZKsync network.
hardhat-zksync Offers a suite of ZKsync-related Hardhat plugins in one package, enhancing accessibility and efficiency.
hardhat-zksync-upgradeable Enables easier deployment and upgrading of smart contracts on the ZKsync network, improving contract lifecycle management.
hardhat-zksync-node Convenient plugin to run the ZKsync era-test-node locally.
hardhat-zksync-ethers A zksync-ethers SDK wrapper providing additional methods for accelerated development on ZKsync.

You can find more detailed explanations on how to use hardhat ZKsync plugins on our documentation page where each plugin has its own section:

hardhat-zksync-solc
hardhat-zksync-deploy
hardhat-zksync-verify
hardhat-zksync-verify-vyper
hardhat-zksync-vyper
hardhat-zksync
hardhat-zksync-upgradeable
hardhat-zksync-node
hardhat-zksync-ethers

We hope you find these plugins useful in your development efforts.
Happy coding!🙌🎉

License

hardhat-zksync is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, LICENSE-MIT for details.

Official Links

hardhat-zksync's People

Contributors

artmakh avatar asimaranov avatar dependabot[bot] avatar dutterbutter avatar filiptxfusion avatar github-actions[bot] avatar githubdoramon avatar hatemosphere avatar jackhamer09 avatar keienwang avatar kiriyaga avatar kiriyaga-txfusion avatar krauspt avatar ly0va avatar mikemcdonald avatar mpavlovic-txfusion avatar mpopovac-txfusion avatar nikola-bozin-txfusion avatar otani88 avatar patrickalphac avatar pcaversaccio avatar perekopskiy avatar popzxc avatar romanbrodetski avatar roushou avatar shamatar avatar stanislavbreadless avatar vincentysc avatar xiaoxianboy avatar zeroonesymphony avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hardhat-zksync's Issues

Error by starting our API with @matterlabs/hardhat-zksync-deploy functionality

Hello Girls and Guys,

we have faced a problem by starting our API written in Typescript. If we use in our services for example the Deployer object from your provided package "@matterlabs/hardhat-zksync-deploy" our API can not be started at all (its a little bit more here, explained later). If you comment out the usage of the deployer (see in our example the problematic line of code and just this line of code) everything works fine. If you uncomment it our API will not start.

Our example Service

import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { Contract, Provider, Wallet } from "zksync-web3";
import * as hre from "hardhat";

export class ContractSmartService {
  constructor(
  ) { }

  public async deployContract(walletKey: string, artifactName: string, deploymentConstructor: Object[]): Promise<string> {
    const wallet = new Wallet(walletKey);

    const deployer = new Deployer(hre, wallet); // Problematic line of code
    /*const artifact = await deployer.loadArtifact(artifactName);

    const contract = await deployer.deploy(artifact, deploymentConstructor);

    return contract.address;*/
    return 'deploy function not implemented';
  }
}

Hardhat Config

require("@matterlabs/hardhat-zksync-deploy");
require("@matterlabs/hardhat-zksync-solc");

module.exports = {
  zksolc: {
    version: "1.1.5",
    compilerSource: "docker",
    settings: {
      optimizer: {
        enabled: true,
      },
      experimental: {
        dockerImage: "matterlabs/zksolc",
        tag: "v1.1.5"
      },
    },
  },
  zkSyncDeploy: {
    zkSyncNetwork: "https://zksync2-testnet.zksync.dev",
    ethNetwork: "goerli",
  },
  networks: {
    hardhat: {
      zksync: true,
    },
  },
  solidity: {
    version: "0.8.16",
  },
};

Error Code

HardhatError: HH5: HardhatContext is not created.
    at HardhatContext.getHardhatContext (/home/auel/Projekte/daura/api/node_modules/hardhat/internal/context.js:35:19)
    at extendConfig (/home/auel/Projekte/daura/api/node_modules/hardhat/internal/core/config/config-env.js:66:42)
    at Object.<anonymous> (/home/auel/Projekte/daura/api/node_modules/@matterlabs/hardhat-zksync-deploy/dist/index.js:22:27)
    at Module._compile (node:internal/modules/cjs/loader:1112:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:834:12)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/auel/Projekte/daura/api/dist/src/services/smartContracts/contract.service.js:4:33)
    at Module._compile (node:internal/modules/cjs/loader:1112:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:834:12)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/auel/Projekte/daura/api/dist/src/services/smartContracts/cmtat.service.js:17:28)
    at Module._compile (node:internal/modules/cjs/loader:1112:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:834:12)
    at Module.require (node:internal/modules/cjs/loader:1012:19) {
  parent: undefined,
  _stack: 'HardhatError: HH5: HardhatContext is not created.\n' +
    '    at HardhatContext.getHardhatContext (/home/auel/Projekte/daura/api/node_modules/hardhat/internal/context.js:35:19)\n' +
    '    at extendConfig (/home/auel/Projekte/daura/api/node_modules/hardhat/internal/core/config/config-env.js:66:42)\n' +
    '    at Object.<anonymous> (/home/auel/Projekte/daura/api/node_modules/@matterlabs/hardhat-zksync-deploy/dist/index.js:22:27)\n' +
    '    at Module._compile (node:internal/modules/cjs/loader:1112:14)\n' +
    '    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)\n' +
    '    at Module.load (node:internal/modules/cjs/loader:988:32)\n' +
    '    at Module._load (node:internal/modules/cjs/loader:834:12)\n' +
    '    at Module.require (node:internal/modules/cjs/loader:1012:19)\n' +
    '    at require (node:internal/modules/cjs/helpers:102:18)\n' +
    '    at Object.<anonymous> (/home/auel/Projekte/daura/api/dist/src/services/smartContracts/contract.service.js:4:33)\n' +
    '    at Module._compile (node:internal/modules/cjs/loader:1112:14)\n' +
    '    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)\n' +
    '    at Module.load (node:internal/modules/cjs/loader:988:32)\n' +
    '    at Module._load (node:internal/modules/cjs/loader:834:12)\n' +
    '    at Module.require (node:internal/modules/cjs/loader:1012:19)\n' +
    '    at require (node:internal/modules/cjs/helpers:102:18)\n' +
    '    at Object.<anonymous> (/home/auel/Projekte/daura/api/dist/src/services/smartContracts/cmtat.service.js:17:28)\n' +
    '    at Module._compile (node:internal/modules/cjs/loader:1112:14)\n' +
    '    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)\n' +
    '    at Module.load (node:internal/modules/cjs/loader:988:32)\n' +
    '    at Module._load (node:internal/modules/cjs/loader:834:12)\n' +
    '    at Module.require (node:internal/modules/cjs/loader:1012:19)',
  errorDescriptor: {
    number: 5,
    message: 'HardhatContext is not created.',
    title: "Hardhat wasn't initialized",
    description: 'Hardhat initialization failed. This is a bug.\n' +
      '\n' +
      'Please [report it](https://github.com/nomiclabs/hardhat/issues/new) to help us improve Hardhat.',
    shouldBeReported: true
  },
  number: 5,
  messageArguments: {},
  _isHardhatError: true
}

Node.js v18.4.0

Some for you interesting dependencies we are using

"@matterlabs/hardhat-zksync-deploy": "^0.4.0",
"@matterlabs/hardhat-zksync-solc": "^0.3.9",
"@matterlabs/zksync-contracts": "^0.3.3",
"hardhat": "^2.11.2",
"zksync-web3": "^0.9.0",
"ts-node": "^10.9.1",

From the stacktrace we found out that there is a problem by using the HardhatContext. This will be extended in your package with the needed network adresses etc. and at this moment you want to extend the context from Hardhat you get the error that Hardhat isn´t created at this point. We testet a little bit around. In our other services we could identify that the context from hardhat is created and we could use it for example to make some log outs by starting this services etc. so we would think that this isn´t a problem at all with hardhat but maybe you have more hints as we have (or we are wrong and should interact with the hardhat team?)

Another intersting fact is, that we have another Service which looks like the same as the one obove and our API started with it. We tested so something around and its something like a coin toss that our API will start. It doesn´t matter if you use one of this services or two or having just one place to interact with the deployer etc.

Service which makes no Problem(?)

import { utils, Wallet } from "zksync-web3";
import * as hre from "hardhat";
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";

import { Contract, Web3Provider, Provider } from "zksync-web3";

const GREETER_CONTRACT_ABI = hre.artifacts.readArtifactSync('Greeter').abi;

export class ContractService {
  // Create Contracts
  async createAndDeployContract(greeting: string, walletKey: string): Promise<string> {
    console.log(`WalletKey: ${walletKey}`);
    // Initialize the wallet.
    const wallet = new Wallet(walletKey);

    // Create deployer object
    const deployer = new Deployer(hre, wallet);
    const artifact = await deployer.loadArtifact("Greeter");

    // Deploy this contract
    const greeterContract = await deployer.deploy(artifact, [greeting]);

    // Show the contract info.
    const contractAddress = greeterContract.address;
    console.log(`${artifact.contractName} was deployed to ${contractAddress}`);

    return contractAddress;
  }
}

What we have tested out so far:

  • Deleting, comment out etc. something from the services to see when we get to the Problem -> using the Deployer
  • Importing Hardhat or using require("hardhat) to interact with the HardhatContext -> at one point require was helping but overall we get the same problem at one point out of nowere
  • Using older versions from the dependencies -> didn´t work so far
  • See if it is loopback which initialize the services etc. -> Same error if we did´t use loopback to initalize our class
  • Playing around with nodejs versions down to 16.x -> not helping

We start our API with the "npm run start" functionality, but would have the same problem if we build and deploy our code in a docker. We didn´t have any problem if we used a script via hardhat to deploy our smart contracts.

Would be nice if you have an Idea whats going wrong :)

determining chainid inside of deploy script

this.__hardhatContext.environment.network does not contain chainId property, this property is available for other L1 networks on hardhat and it is convenient to use it to determine chain id for saving contract addresses.

{
  name: 'zkSyncTestnet',
  config: {
    accounts: {
      initialIndex: 0,
      count: 20,
      path: "m/44'/60'/0'/0",
      passphrase: '',
      mnemonic: ''
    },
    gas: 'auto',
    gasPrice: 'auto',
    gasMultiplier: 1,
    httpHeaders: {},
    timeout: 20000,
    url: 'https://zksync2-testnet.zksync.dev',
    ethNetwork: 'goerli',
    zksync: true
  },
}

hardhat-zksync-chai-matchers: revertedWith reason is not what it should be when running on local-setup

Hello,

I am running tests with hardhat-zksync-chai-matchers' revertedWith property, which seems to be parsing a wrong reason from the error data.

I am testing a simple onlyOwner function, and I should get the Ownable: caller is not the owner, but instead I get caller is not the owne

Full error message: AssertionError: Expected transaction to be reverted with reason 'Ownable: caller is not the owner', but it reverted with reason ' caller is not the owne'

I believe the reason to be in the utils.ts file, where the "message" is expected to start with Cannot estimate transaction: and end with a dot. However, with the local-setup, I receive a message starting with cannot estimate gas: and not ending with a dot, resulting in the odd truncation.

Full error data: {\"code\":104,\"message\":\"cannot estimate gas: Ownable: caller is not the owner\"}}

Thank you in advance for your help!

Verifying smart contracts stopped working for some reason

9 days ago all verifications (on zkSync Era Testnet) went through smoothly, but now it fails after this warning is emitted in the console:

 Warning: It looks like your code or one of its dependencies uses the 'extcodesize' instruction,  │
│ which is usually needed in the following cases:                                                  │
│   1. To detect whether an address belongs to a smart contract.                                   │
│   2. To detect whether the deploy code execution has finished.                                   │
│ zkSync era comes with native account abstraction support (so accounts are smart contracts,       │
│ including private-key controlled EOAs), and you should avoid differentiating between contracts   │
│ and non-contract addresses.                                                                      │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
--> @openzeppelin/contracts/utils/Address.sol

The Address.sol is a library from OpenZeppelin and many projects depend on it.

It is not clear whether this warning is the cause of the problem, or something else which silently fails and is not printed out in the console.

The smart contract gets deployed, it's just the verification part that fails.


compile error: unknown variant `metadata`, expected one of `abi`, `evm.methodIdentifiers`, `storageLayout`, `ast`, `irOptimized`, `evm.legacyAssembly`

When adding hardhat-zksync-libraries to an existing hardhat-project, I face the following compiler error:

Error: Command failed: ~/Library/Caches/hardhat-nodejs/compilers-v2/zksolc/zksolc-v1.3.5 --standard-json    --solc ~/Library/Caches/hardhat-nodejs/compilers-v2/macosx-amd64/solc-macosx-amd64-v0.8.17+commit.8df45f5f
unknown variant `metadata`, expected one of `abi`, `evm.methodIdentifiers`, `storageLayout`, `ast`, `irOptimized`, `evm.legacyAssembly` at line 1 column 218856

This happens once

import "@matterlabs/hardhat-zksync-solc";

will be added to hardhat.config.ts

Has someone already faced this?

Compile ERC721A contract failed

Compile ERC721A contract failed. Here is the ERC721A repo https://github.com/chiru-labs/ERC721A .

  • A simple contract like this:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import {ERC721A} from "erc721a/contracts/ERC721A.sol";
import {ERC721AQueryable} from "erc721a/contracts/extensions/ERC721AQueryable.sol";

contract FooBarNFT is ERC721AQueryable {
    constructor(string memory name_, string memory symbol_) ERC721A(name_, symbol_) {
        //TODO:
    }
}
  • Command:
yarn hardhat compile
  • Error message:
Solidity 0.8.12 is not fully supported yet. You can still use Hardhat, but some features, like stack traces, might not work correctly.

Learn more at https://hardhat.org/reference/solidity-support

InternalCompilerError: Invalid stack item name: slot


Error HH600: Compilation failed

For more info go to https://hardhat.org/HH600 or run Hardhat with --show-stack-traces
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  • Package deps:
  "dependencies": {
    "@matterlabs/hardhat-zksync-deploy": "^0.1.5",
    "@matterlabs/hardhat-zksync-solc": "^0.3.4",
    "erc721a": "4.1.0",
    "zksync-web3": "^0.4.0"
  }
  • hardhat.config.ts
require("@matterlabs/hardhat-zksync-deploy");
require("@matterlabs/hardhat-zksync-solc");

module.exports = {
  zksolc: {
    version: "0.1.0",
    compilerSource: "docker",
    settings: {
      optimizer: {
        enabled: true,
      },
      experimental: {
        dockerImage: "matterlabs/zksolc",
      },
    },
  },
  zkSyncDeploy: {
    zkSyncNetwork: "https://zksync2-testnet.zksync.dev",
    ethNetwork: "goerli",
  },
  networks: {
    // To compile with zksolc, this must be the default network.
    hardhat: {
      zksync: true,
    },
  },
  solidity: {
    version: "0.8.12",
  },
};

Thank you :D

How to use specificated nonce

Hello, we need to use a specificated nonce sometimes. When deploying a contract, we use the function deployer.deploy(artifact, []). But how to use an input nonce?

Will this be working? deployer.deploy(artifact, [], { nonce: nonce++} )

I use the vypey Greeter tutorial to deploy the contract, there is an error:'cannot estimate gas; transaction may fail or may require manual gas limit'

I use the vypey Greeter tutorial to deploy the contract, there is an error:'cannot estimate gas; transaction may fail or may require manual gas limit'

image

package.json
{
"name": "harhat-zksync-example-vyper",
"version": "0.1.0",
"author": "Matter Labs",
"license": "MIT",
"scripts": {
"lint": "yarn prettier --check && yarn eslint",
"lint:fix": "yarn eslint --fix",
"fmt": "yarn prettier --write",
"eslint": "eslint deploy/.ts",
"prettier": "prettier deploy/
.ts",
"test": "mocha test/tests.ts --exit",
"build": "tsc --build .",
"clean": "rimraf dist"
},
"devDependencies": {
"@matterlabs/hardhat-zksync-deploy": "^0.5.2",
"@matterlabs/hardhat-zksync-vyper": "^0.1.5",
"@types/node": "^17.0.21",
"@typescript-eslint/eslint-plugin": "4.29.2",
"@typescript-eslint/parser": "5.13.0",
"eslint": "^8.10.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-prettier": "3.4.0",
"prettier": "2.3.2",
"rimraf": "^3.0.2",
"ts-node": "^10.6.0"
},
"dependencies": {
"@matterlabs/hardhat-zksync-solc": "^0.3.10",
"@nomiclabs/hardhat-vyper": "^3.0.1",
"ethers": "~5.7.0",
"hardhat": "^2.12.1",
"typescript": "^4.8.4",
"zksync-web3": "^0.9.0"
},
"prettier": {
"tabWidth": 4,
"printWidth": 120,
"parser": "typescript",
"singleQuote": true,
"bracketSpacing": true
}
}

hardhat.config.ts
import "@nomiclabs/hardhat-vyper"; import "@matterlabs/hardhat-zksync-vyper"; import "@matterlabs/hardhat-zksync-deploy"; import { HardhatUserConfig } from 'hardhat/config'; const config: HardhatUserConfig = { zkvyper: { version: "1.2.0", compilerSource: "binary", // compilerSource: "docker", // settings: { // experimental: { // dockerImage: "matterlabs/zkvyper", // tag: "latest" // } // }, }, zkSyncDeploy: { zkSyncNetwork: "https://zksync2-testnet.zksync.dev", ethNetwork: "goerli", }, networks: { hardhat: { zksync: true, }, }, // Currently, only Vyper ^0.3.3 is supported. vyper: { version: "0.3.3" }, }; export default config;

Issue with deploy command

Hello all.. i've been following this tutorial to deploy a contract to zksync 2.0 https://v2-docs.zksync.io/dev/guide/hello-world.html#initializing-the-project-deploying-smart-contract

When I get to the deploy section and run the npx hardhat deploy-zksync command, i get an error pointing to the import in the deploy/deploy.ts file. Any ideas what could be causing this?

import { utils, Wallet } from 'zksync-web3';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:988:16)

deploy/deploy.ts file

import { utils, Wallet } from 'zksync-web3';
import * as ethers from 'ethers';
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { Deployer } from '@matterlabs/hardhat-zksync-deploy';

export default async function (hre: HardhatRuntimeEnvironment) {
  // Initialize the wallet.
  const wallet = new Wallet(process.env.WALLET_KEY);

  // Create deployer object and load the artifact of the contract we want to deploy.
  const deployer = new Deployer(hre, wallet);
  const artifact = await deployer.loadArtifact('ZkSync_NFT');

  // Deposit some funds to L2 in order to be able to perform L2 transactions.
  const depositAmount = ethers.utils.parseEther('0.001');
  const depositHandle = await deployer.zkWallet.deposit({
    to: deployer.zkWallet.address,
    token: utils.ETH_ADDRESS,
    amount: depositAmount,
  });
  // Wait until the deposit is processed on zkSync
  await depositHandle.wait();

  // Deploy the contract
  const nftContract = await deployer.deploy(artifact, []);

  // show the contract info
  const contractAddress = nftContract.address;
  console.log(`${artifact.contractName} was deployed to ${contractAddress}`);
};

deploy-zksync errors with wrong nonce

Hi,
I've been using this tutorial to try to deploy my own very simple Smart Contract. I've got the compile command to work. When I run the deploy command. It seems to be working, but after a minute or so I get an error saying the Tx nonce is incorrect.
In the error output you can see the nonce is 0, which seems wrong. Am I missing something in how the nonce is chosen?
Thanks for any help or guidance!

Here's the full error:

Error: processing response error (body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":3,\"message\":\"Execution error\",\"data\":{\"code\":104,\"message\":\"Tx nonce is incorrect. Another transaction with the nonce 0 is already accepted.\"}},\"id\":685}\n", error={"code":3,"data":{"code":104,"message":"Tx nonce is incorrect. Another transaction with the nonce 0 is already accepted."}}, requestBody="{\"method\":\"eth_sendRawTransaction\",\"params\":[\"0x70f9537e80826f9c82294094" ... many more characters ],\"id\":685,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="https://zksync2-testnet.zksync.dev", code=SERVER_ERROR, version=web/5.5.1)
    at Logger.makeError (/path/to/repo/node_modules/ethers/node_modules/@ethersproject/logger/src.ts/index.ts:225:28)
    at Logger.throwError (/path/to/repo/node_modules/ethers/node_modules/@ethersproject/logger/src.ts/index.ts:237:20)
    at /path/to/repo/node_modules/ethers/node_modules/@ethersproject/web/src.ts/index.ts:321:28
    at step (/path/to/repo/node_modules/ethers/node_modules/@ethersproject/web/lib/index.js:33:23)
    at Object.next (/path/to/repo/node_modules/ethers/node_modules/@ethersproject/web/lib/index.js:14:53)
    at fulfilled (/path/to/repo/node_modules/ethers/node_modules/@ethersproject/web/lib/index.js:5:58)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  reason: 'processing response error',
  code: 'SERVER_ERROR',
  body: '{"jsonrpc":"2.0","error":{"code":3,"message":"Execution error","data":{"code":104,"message":"Tx nonce is incorrect. Another transaction with the nonce 0 is already accepted."}},"id":685}\n',
  error: Error: Execution error
      at getResult (/path/to/repo/node_modules/ethers/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:97:28)
      at processJsonFunc (/path/to/repo/node_modules/ethers/node_modules/@ethersproject/web/src.ts/index.ts:363:22)
      at /path/to/repo/node_modules/ethers/node_modules/@ethersproject/web/src.ts/index.ts:300:42
      at step (/path/to/repo/node_modules/ethers/node_modules/@ethersproject/web/lib/index.js:33:23)
      at Object.next (/path/to/repo/node_modules/ethers/node_modules/@ethersproject/web/lib/index.js:14:53)
      at fulfilled (/path/to/repo/node_modules/ethers/node_modules/@ethersproject/web/lib/index.js:5:58)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (node:internal/process/task_queues:96:5) {
    code: 3,
    data: {
      code: 104,
      message: 'Tx nonce is incorrect. Another transaction with the nonce 0 is already accepted.'
    }
  },
  requestBody: '{"method":"eth_sendRawTransaction","params":["0x70f9537e80826f9c8'... many more characters,
  requestMethod: 'POST',
  url: 'https://zksync2-testnet.zksync.dev',
  transaction: {
    type: 112,
    nonce: 0,
    gasPrice: BigNumber { _hex: '0x6f9c', _isBigNumber: true },
    gasLimit: BigNumber { _hex: '0x2940', _isBigNumber: true },
    to: '0x0000000000000000000000000000000000000000',
    value: BigNumber { _hex: '0x00', _isBigNumber: true },
    data: '0xbe253f146b07e69aff69fa8c7aa24214e9d5deed65571b271fe4b777969621050000000000000000010000000000000000000000000000000000000000000000',
    chainId: BigNumber { _hex: '0x0118', _isBigNumber: true },
    customData: {
      feeToken: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
      withdrawToken: '0x0000000000000000000000000000000000000000',
      validFrom: [BigNumber],
      validUntil: [BigNumber],
      ergsPerStorage: [BigNumber],
      ergsPerPubdata: [BigNumber],
      factoryDeps: [Array]
    },
    hash: '0x47262a7da8aefd96be4fb255dc316d62345b62219cefb38621f33c4fdd028151',
    from: '0xd535bAd504CDd77e2C51dE26F416693DF7a01ac8',
    confirmations: 0
  },
  transactionHash: '0x47262a7da8aefd96be4fb255dc316d62345b62219cefb38621f33c4fdd028151'
}

My hardhat config:

const config: HardhatUserConfig = {
  solidity: {
    version: "0.8.4",
    settings: {
      optimizer: {
        enabled: true,
        runs: 2,
      },
    },
  },

   zksolc: {
    version: "0.1.0",
    compilerSource: "docker",
    settings: {
      optimizer: {
        enabled: true,
      },
      experimental: {
        dockerImage: "matterlabs/zksolc",
      },
    },
  },
  zkSyncDeploy: {
    zkSyncNetwork: "https://zksync2-testnet.zksync.dev",
    ethNetwork: `https://goerli.infura.io/v3/${process.env.INFURA_PROJECT_ID}`,
  },
  networks: {
    // To compile with zksolc, this must be the default network.
    hardhat: {
      zksync: true,
    },
  },
}

memory leak during zk-solc compilation

I tried to migrate the https://github.com/GridexProtocol/core project according to the migration tutorial on the official website (https://era.zksync.io/docs/api/hardhat/migrating-to-zksync.html), but there was a memory leak problem.

image

It seems that rewriting the assembly code in https://github.com/GridexProtocol/core/blob/d2bf72bf7354251b70042515d7f6df5b55326bb0/contracts/libraries/BoundaryMath.sol#L131 as Solidity code fixed the memory leak issue during zk-solc compilation.

Got Error: Cannot find module './task-names' when using 0.3.3

npx hardhat compile
An unexpected error occurred:

Error: Cannot find module './task-names'
Require stack:
- /Users/jishankai/PoLeVeDi/SignalPlus/node_modules/@matterlabs/hardhat-zksync-deploy/dist/index.js
- /Users/jishankai/PoLeVeDi/SignalPlus/hardhat.config.js
- /Users/jishankai/PoLeVeDi/SignalPlus/node_modules/hardhat/internal/core/config/config-loading.js
- /Users/jishankai/PoLeVeDi/SignalPlus/node_modules/hardhat/internal/cli/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/Users/jishankai/PoLeVeDi/SignalPlus/node_modules/@matterlabs/hardhat-zksync-deploy/dist/index.js:18:22)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/jishankai/PoLeVeDi/SignalPlus/node_modules/@matterlabs/hardhat-zksync-deploy/dist/index.js',
    '/Users/jishankai/PoLeVeDi/SignalPlus/hardhat.config.js',
    '/Users/jishankai/PoLeVeDi/SignalPlus/node_modules/hardhat/internal/core/config/config-loading.js',
    '/Users/jishankai/PoLeVeDi/SignalPlus/node_modules/hardhat/internal/cli/cli.js'
  ]
}

Fixed if downgrading it to 0.1.

ERC721 Compile error

Hello everybody,
i was following the tutorial to compile an ERC721, i get this error:

Compiling 14 files with 0.8.10
Error in plugin @matterlabs/hardhat-zksync-solc: thread 'main' panicked at 'Always valid: Error("missing field `irOptimized`", line: 1, column: 719)', src/solc/mod.rs:86:76
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


NomicLabsHardhatPluginError: thread 'main' panicked at 'Always valid: Error("missing field `irOptimized`", line: 1, column: 719)', src/solc/mod.rs:86:76
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

    at pluginError (/home/pietro/Documenti/Projects/zkloot-example/node_modules/@matterlabs/hardhat-zksync-solc/src/utils.ts:10:12)
    at runZksolcContainer (/home/pietro/Documenti/Projects/zkloot-example/node_modules/@matterlabs/hardhat-zksync-solc/src/compile/docker.ts:68:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at handleCommonErrors (/home/pietro/Documenti/Projects/zkloot-example/node_modules/@matterlabs/hardhat-zksync-solc/src/compile/docker.ts:143:16)
    at compileWithDocker (/home/pietro/Documenti/Projects/zkloot-example/node_modules/@matterlabs/hardhat-zksync-solc/src/compile/docker.ts:138:12)
    at DockerCompiler.compile (/home/pietro/Documenti/Projects/zkloot-example/node_modules/@matterlabs/hardhat-zksync-solc/src/compile/index.ts:61:16)
    at compile (/home/pietro/Documenti/Projects/zkloot-example/node_modules/@matterlabs/hardhat-zksync-solc/src/compile/index.ts:24:12)
    at OverriddenTaskDefinition._action (/home/pietro/Documenti/Projects/zkloot-example/node_modules/@matterlabs/hardhat-zksync-solc/src/index.ts:82:12)
    at Environment._runTaskDefinition (/home/pietro/Documenti/Projects/zkloot-example/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
    at Environment.run (/home/pietro/Documenti/Projects/zkloot-example/node_modules/hardhat/src/internal/core/runtime-environment.ts:129:14)
error Command failed with exit code 1.

I'm using there imports:

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

Am I using features that are not yet supported?

docs are missing in readme.md

as someone who likes to use github when working with packages to read the source code and stuff it'd be great to have the documentation linked in github readme

Violated validation rules: Called contract with no code

Hi, I modify and run the multi-sig script in the basic-example:

import * as ethers from "ethers"
import * as zk from "zksync-web3"
import { HardhatRuntimeEnvironment } from "hardhat/types"
import { Deployer } from "@matterlabs/hardhat-zksync-deploy"
import chalk from "chalk"

const EIP1271_MAGIC_BYTES = "0x1626ba7e"

export default async function (hre: HardhatRuntimeEnvironment) {
    console.info(chalk.yellow("Running deploy script for the Account Abstraction"))

    // Initialize an Ethereum wallet.
    const testMnemonic =
        "stuff slice staff easily soup parent arm payment cotton trade scatter struggle"
    const zkWallet = zk.Wallet.fromMnemonic(testMnemonic, "m/44'/60'/0'/0/0")

    // Create deployer objects and load desired artifacts.
    const contractDeployer = new Deployer(hre, zkWallet, "create")
    const aaDeployer = new Deployer(hre, zkWallet, "createAccount")
    const greeterArtifact = await contractDeployer.loadArtifact("Greeter")
    const aaArtifact = await aaDeployer.loadArtifact("MultiSigAccount")

    const provider = aaDeployer.zkWallet.provider

    // Deposit some funds to L2 in order to be able to perform L2 transactions.
    const depositHandle = await contractDeployer.zkWallet.deposit({
        to: contractDeployer.zkWallet.address,
        token: zk.utils.ETH_ADDRESS,
        amount: ethers.utils.parseEther("0.001"),
    })
    await depositHandle.wait()

    const greeterContract = await contractDeployer.deploy(greeterArtifact, ["Hi there!"])

    console.info(chalk.green(`Greeter was deployed to ${greeterContract.address}`))

    // The two owners of the multisig
    const owner1 = zk.Wallet.createRandom()
    const owner2 = zk.Wallet.createRandom()

    const aa = await aaDeployer.deploy(aaArtifact, [owner1.address, owner2.address], undefined, [])

    const multisigAddress = aa.address

    console.info(chalk.green(`Multisig was deployed to ${multisigAddress}`))

    await (
        await contractDeployer.zkWallet.sendTransaction({
            to: multisigAddress,
            // You can increase the amount of ETH sent to the multisig
            value: ethers.utils.parseEther("0.003"),
        })
    ).wait()

    const newGreeting = "Hello!"
    let aaTx = await greeterContract.populateTransaction.setGreeting(newGreeting)

    const gasLimit = await provider.estimateGas(aaTx)
    const gasPrice = await provider.getGasPrice()

    aaTx = {
        ...aaTx,
        from: multisigAddress,
        gasLimit: gasLimit,
        gasPrice: gasPrice,
        chainId: (await provider.getNetwork()).chainId,
        nonce: await provider.getTransactionCount(multisigAddress),
        type: 113,
        customData: {
            gasPerPubdata: zk.utils.DEFAULT_GAS_PER_PUBDATA_LIMIT,
        } as zk.types.Eip712Meta,
        value: ethers.BigNumber.from(0),
    }
    
    const signedTxHash = zk.EIP712Signer.getSignedDigest(aaTx)

    const signature = ethers.utils.concat([
        // Note, that `signMessage` wouldn't work here, since we don't want
        // the signed hash to be prefixed with `\x19Ethereum Signed Message:\n`
        ethers.utils.joinSignature(owner1._signingKey().signDigest(signedTxHash)),
        ethers.utils.joinSignature(owner2._signingKey().signDigest(signedTxHash)),
    ])

    // Check the Signature is Valid
    const isValidSignature = await aa.isValidSignature(signedTxHash, signature)
    if (isValidSignature == EIP1271_MAGIC_BYTES) {
        console.info(chalk.green(`Signaure is Valid in MultiSigAccount!`))
    } else {
        throw new Error(`Signature is not valid in MultiSigAccount!`)
    }

    aaTx.customData = {
        ...aaTx.customData,
        customSignature: signature,
    }

    console.log(
        `The multisig's nonce before the first tx is ${await provider.getTransactionCount(
            multisigAddress,
        )}`,
    )
    const sentTx = await provider.sendTransaction(zk.utils.serialize(aaTx))
    await sentTx.wait()

    // Checking that the nonce for the account has increased.
    console.log(
        `The multisig's nonce after the first tx is ${await provider.getTransactionCount(
            multisigAddress,
        )}`,
    )

    // Confirm that tx was successful.
    const greetingFromContract = await greeterContract.greet()
    if (greetingFromContract === newGreeting) {
        console.info(chalk.green("Successfully initiated tx from deployed multisig!"))
    } else {
        throw new Error(`Contract said something unexpected: ${greetingFromContract}`)
    }
}

And the contract is:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@matterlabs/zksync-contracts/l2/system-contracts/interfaces/IAccount.sol";
import "@matterlabs/zksync-contracts/l2/system-contracts/libraries/TransactionHelper.sol";

import "@openzeppelin/contracts/interfaces/IERC1271.sol";

// Used for signature validation
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

// Access zkSync system contracts, in this case for nonce validation vs NONCE_HOLDER_SYSTEM_CONTRACT
import "@matterlabs/zksync-contracts/l2/system-contracts/Constants.sol";
// to call non-view method of system contracts
import "@matterlabs/zksync-contracts/l2/system-contracts/libraries/SystemContractsCaller.sol";

contract MultiSigAccount is IAccount, IERC1271 {
    // to get transaction hash
    using TransactionHelper for Transaction;

    // state variables for account owners
    address public owner1;
    address public owner2;

    bytes4 constant EIP1271_SUCCESS_RETURN_VALUE = 0x1626ba7e;

    modifier onlyBootloader() {
        require(msg.sender == BOOTLOADER_FORMAL_ADDRESS, "Only bootloader can call this method");
        // Continure execution if called from the bootloader.
        _;
    }

    constructor(address _owner1, address _owner2) {
        owner1 = _owner1;
        owner2 = _owner2;
    }

    function validateTransaction(
        bytes32,
        bytes32 _suggestedSignedHash,
        Transaction calldata _transaction
    ) external payable override onlyBootloader returns (bytes4 magic) {
        magic = _validateTransaction(_suggestedSignedHash, _transaction);
    }

    function _validateTransaction(
        bytes32 _suggestedSignedHash,
        Transaction calldata _transaction
    ) internal returns (bytes4 magic) {
        // Incrementing the nonce of the account.
        // Note, that reserved[0] by convention is currently equal to the nonce passed in the transaction
        SystemContractsCaller.systemCallWithPropagatedRevert(
            uint32(gasleft()),
            address(NONCE_HOLDER_SYSTEM_CONTRACT),
            0,
            abi.encodeCall(INonceHolder.incrementMinNonceIfEquals, (_transaction.nonce))
        );

        bytes32 txHash;
        // While the suggested signed hash is usually provided, it is generally
        // not recommended to rely on it to be present, since in the future
        // there may be tx types with no suggested signed hash.
        if (_suggestedSignedHash == bytes32(0)) {
            txHash = _transaction.encodeHash();
        } else {
            txHash = _suggestedSignedHash;
        }

        // The fact there is are enough balance for the account
        // should be checked explicitly to prevent user paying for fee for a
        // transaction that wouldn't be included on Ethereum.
        uint256 totalRequiredBalance = _transaction.totalRequiredBalance();
        require(
            totalRequiredBalance <= address(this).balance,
            "Not enough balance for fee + value"
        );

        if (isValidSignature(txHash, _transaction.signature) == EIP1271_SUCCESS_RETURN_VALUE) {
            magic = ACCOUNT_VALIDATION_SUCCESS_MAGIC;
        }
    }

    function executeTransaction(
        bytes32,
        bytes32,
        Transaction calldata _transaction
    ) external payable override onlyBootloader {
        _executeTransaction(_transaction);
    }

    function _executeTransaction(Transaction calldata _transaction) internal {
        address to = address(uint160(_transaction.to));
        uint128 value = Utils.safeCastToU128(_transaction.value);
        bytes memory data = _transaction.data;

        if (to == address(DEPLOYER_SYSTEM_CONTRACT)) {
            uint32 gas = Utils.safeCastToU32(gasleft());

            // Note, that the deployer contract can only be called
            // with a "systemCall" flag.
            SystemContractsCaller.systemCallWithPropagatedRevert(gas, to, value, data);
        } else {
            bool success;
            assembly {
                success := call(gas(), to, value, add(data, 0x20), mload(data), 0, 0)
            }
            require(success);
        }
    }

    function executeTransactionFromOutside(Transaction calldata _transaction) external payable {
        _validateTransaction(bytes32(0), _transaction);
        _executeTransaction(_transaction);
    }

    function isValidSignature(
        bytes32 _hash,
        bytes memory _signature
    ) public view override returns (bytes4 magic) {
        magic = EIP1271_SUCCESS_RETURN_VALUE;

        if (_signature.length != 130) {
            // Signature is invalid anyway, but we need to proceed with the signature verification as usual
            // in order for the fee estimation to work correctly
            _signature = new bytes(130);

            // Making sure that the signatures look like a valid ECDSA signature and are not rejected rightaway
            // while skipping the main verification process.
            _signature[64] = bytes1(uint8(27));
            _signature[129] = bytes1(uint8(27));
        }

        (bytes memory signature1, bytes memory signature2) = extractECDSASignature(_signature);

        if (
            !checkValidECDSASignatureFormat(signature1) ||
            !checkValidECDSASignatureFormat(signature2)
        ) {
            magic = bytes4(0);
        }

        address recoveredAddr1 = ECDSA.recover(_hash, signature1);
        address recoveredAddr2 = ECDSA.recover(_hash, signature2);

        // Note, that we should abstain from using the require here in order to allow for fee estimation to work
        if (recoveredAddr1 != owner1 || recoveredAddr2 != owner2) {
            magic = bytes4(0);
        }
    }

    // This function verifies that the ECDSA signature is both in correct format and non-malleable
    function checkValidECDSASignatureFormat(bytes memory _signature) internal pure returns (bool) {
        if (_signature.length != 65) {
            return false;
        }

        uint8 v;
        bytes32 r;
        bytes32 s;
        // Signature loading code
        // we jump 32 (0x20) as the first slot of bytes contains the length
        // we jump 65 (0x41) per signature
        // for v we load 32 bytes ending with v (the first 31 come from s) then apply a mask
        assembly {
            r := mload(add(_signature, 0x20))
            s := mload(add(_signature, 0x40))
            v := and(mload(add(_signature, 0x41)), 0xff)
        }
        if (v != 27 && v != 28) {
            return false;
        }

        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return false;
        }

        return true;
    }

    function extractECDSASignature(
        bytes memory _fullSignature
    ) internal pure returns (bytes memory signature1, bytes memory signature2) {
        require(_fullSignature.length == 130, "Invalid length");

        signature1 = new bytes(65);
        signature2 = new bytes(65);

        // Copying the first signature. Note, that we need an offset of 0x20
        // since it is where the length of the `_fullSignature` is stored
        assembly {
            let r := mload(add(_fullSignature, 0x20))
            let s := mload(add(_fullSignature, 0x40))
            let v := and(mload(add(_fullSignature, 0x41)), 0xff)

            mstore(add(signature1, 0x20), r)
            mstore(add(signature1, 0x40), s)
            mstore8(add(signature1, 0x60), v)
        }

        // Copying the second signature.
        assembly {
            let r := mload(add(_fullSignature, 0x61))
            let s := mload(add(_fullSignature, 0x81))
            let v := and(mload(add(_fullSignature, 0x82)), 0xff)

            mstore(add(signature2, 0x20), r)
            mstore(add(signature2, 0x40), s)
            mstore8(add(signature2, 0x60), v)
        }
    }

    function payForTransaction(
        bytes32,
        bytes32,
        Transaction calldata _transaction
    ) external payable override onlyBootloader {
        bool success = _transaction.payToTheBootloader();
        require(success, "Failed to pay the fee to the operator");
    }

    function prepareForPaymaster(
        bytes32, // _txHash
        bytes32, // _suggestedSignedHash
        Transaction calldata _transaction
    ) external payable override onlyBootloader {
        _transaction.processPaymasterInput();
    }

    fallback() external {
        // fallback of default account shouldn't be called by bootloader under no circumstances
        assert(msg.sender != BOOTLOADER_FORMAL_ADDRESS);

        // If the contract is called directly, behave like an EOA
    }

    receive() external payable {
        // If the contract is called directly, behave like an EOA.
        // Note, that is okay if the bootloader sends funds with no calldata as it may be used for refunds/operator payments
    }
}

but it return some error:

$ hardhat deploy-zksync --network zkSyncLocal --script multiSigAccountDemo.ts
>
Running deploy script for the Account Abstraction
Greeter was deployed to 0x111C3E89Ce80e62EE88318C2804920D4c96f92bb
Multisig was deployed to 0x4B5DF730c2e6b28E17013A1485E5d9BC41Efe021
Signaure is Valid in MultiSigAccount!
The multisig's nonce before the first tx is 0
An unexpected error occurred:

Error: processing response error (body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":3,\"message\":\"failed to validate the transaction. reason: Violated validation rules: Called contract with no code: 000000000000000000000000000000000000fff5\",\"data\":\"0x\"},\"id\":83}\n", error={"code":3,"data":"0x"}, requestBody="{\"method\":\"eth_sendRawTransaction\",\"params\":[\"0x71f9013180840ee6b280840ee6b280830249e194111c3e89ce80e62ee88318c2804920d4c96f92bb80b864a41368620000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000648656c6c6f21000000000000000000000000000000000000000000000000000082010e808082010e944b5df730c2e6b28e17013a1485e5d9bc41efe02182c350c0b88222756c15938377898d445c27c67983c8541bb3f5534069ca62fc4be4d3fb579f21041fb682fca3f295c8893fa230d64de6f9bc058e168b8fe4e44000242dfb571cb186feb35ee37819745a39685993becb8ac5b4eed0fbdec8e86c4753da59bf2030dc820773a4845be4a6a6fe769260a3c8cf7dd6a6947698340ecc27845e965b1cc0\"],\"id\":83,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="http://localhost:3050", code=SERVER_ERROR, version=web/5.7.1)
    at Logger.makeError (/Users/chihaolu/Desktop/zkSync/zkSync-contracts/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
    at Logger.throwError (/Users/chihaolu/Desktop/zkSync/zkSync-contracts/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
    at /Users/chihaolu/Desktop/zkSync/zkSync-contracts/node_modules/@ethersproject/web/src.ts/index.ts:341:28
    at step (/Users/chihaolu/Desktop/zkSync/zkSync-contracts/node_modules/@ethersproject/web/lib/index.js:33:23)
    at Object.next (/Users/chihaolu/Desktop/zkSync/zkSync-contracts/node_modules/@ethersproject/web/lib/index.js:14:53)
    at fulfilled (/Users/chihaolu/Desktop/zkSync/zkSync-contracts/node_modules/@ethersproject/web/lib/index.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  reason: 'processing response error',
  code: 'SERVER_ERROR',
  body: '{"jsonrpc":"2.0","error":{"code":3,"message":"failed to validate the transaction. reason: Violated validation rules: Called contract with no code: 000000000000000000000000000000000000fff5","data":"0x"},"id":83}\n',
  error: Error: failed to validate the transaction. reason: Violated validation rules: Called contract with no code: 000000000000000000000000000000000000fff5
      at getResult (/Users/chihaolu/Desktop/zkSync/zkSync-contracts/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:142:28)
      at processJsonFunc (/Users/chihaolu/Desktop/zkSync/zkSync-contracts/node_modules/@ethersproject/web/src.ts/index.ts:383:22)
      at /Users/chihaolu/Desktop/zkSync/zkSync-contracts/node_modules/@ethersproject/web/src.ts/index.ts:320:42
      at step (/Users/chihaolu/Desktop/zkSync/zkSync-contracts/node_modules/@ethersproject/web/lib/index.js:33:23)
      at Object.next (/Users/chihaolu/Desktop/zkSync/zkSync-contracts/node_modules/@ethersproject/web/lib/index.js:14:53)
      at fulfilled (/Users/chihaolu/Desktop/zkSync/zkSync-contracts/node_modules/@ethersproject/web/lib/index.js:5:58)
      at processTicksAndRejections (node:internal/process/task_queues:96:5) {
    code: 3,
    data: '0x'
  },
  requestBody: '{"method":"eth_sendRawTransaction","params":["0x71f9013180840ee6b280840ee6b280830249e194111c3e89ce80e62ee88318c2804920d4c96f92bb80b864a41368620000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000648656c6c6f21000000000000000000000000000000000000000000000000000082010e808082010e944b5df730c2e6b28e17013a1485e5d9bc41efe02182c350c0b88222756c15938377898d445c27c67983c8541bb3f5534069ca62fc4be4d3fb579f21041fb682fca3f295c8893fa230d64de6f9bc058e168b8fe4e44000242dfb571cb186feb35ee37819745a39685993becb8ac5b4eed0fbdec8e86c4753da59bf2030dc820773a4845be4a6a6fe769260a3c8cf7dd6a6947698340ecc27845e965b1cc0"],"id":83,"jsonrpc":"2.0"}',
  requestMethod: 'POST',
  url: 'http://localhost:3050',
  transaction: {
    type: 113,
    nonce: 0,
    maxPriorityFeePerGas: BigNumber { _hex: '0x0ee6b280', _isBigNumber: true },
    maxFeePerGas: BigNumber { _hex: '0x0ee6b280', _isBigNumber: true },
    gasLimit: BigNumber { _hex: '0x0249e1', _isBigNumber: true },
    to: '0x111C3E89Ce80e62EE88318C2804920D4c96f92bb',
    value: BigNumber { _hex: '0x00', _isBigNumber: true },
    data: '0xa41368620000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000648656c6c6f210000000000000000000000000000000000000000000000000000',
    chainId: BigNumber { _hex: '0x010e', _isBigNumber: true },
    from: '0x4B5DF730c2e6b28E17013A1485E5d9BC41Efe021',
    customData: {
      gasPerPubdata: [BigNumber],
      factoryDeps: [],
      customSignature: '0x22756c15938377898d445c27c67983c8541bb3f5534069ca62fc4be4d3fb579f21041fb682fca3f295c8893fa230d64de6f9bc058e168b8fe4e44000242dfb571cb186feb35ee37819745a39685993becb8ac5b4eed0fbdec8e86c4753da59bf2030dc820773a4845be4a6a6fe769260a3c8cf7dd6a6947698340ecc27845e965b1c',
      paymasterParams: undefined
    },
    hash: '0xbde73ef00da6f34d0804585c5bd9e3ae16ac9904ce1b0615db1e36ae3c098551',
    confirmations: 0
  },
  transactionHash: '0xbde73ef00da6f34d0804585c5bd9e3ae16ac9904ce1b0615db1e36ae3c098551'
}
error Command failed with exit code 1.

I have checked the Greeter and MultiSigAccount Contract have been deployed, and the isValidSignature returns are valid in the script, I could not figure out which call contract has no code.


OS - MacOS M2 Pro 2022

Here are my dependencies:

  "dependencies": {
    "@matterlabs/hardhat-zksync-deploy": "^0.6.3",
    "@matterlabs/hardhat-zksync-solc": "^0.3.17",
    "@matterlabs/zksync-contracts": "^0.6.1",
    "@openzeppelin/contracts": "^4.8.3",
    "@openzeppelin/contracts-upgradeable": "^4.8.3",
    "@types/shelljs": "^0.8.11",
    "@typescript-eslint/eslint-plugin": "^5.43.0",
    "@typescript-eslint/parser": "^5.43.0",
    "chalk": "4.1.2",
    "dotenv": "^16.0.3",
    "eslint": "^8.28.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-mocha-no-only": "^1.1.1",
    "ethers": "5.7.2",
    "hardhat": "^2.14.0",
    "prettier": "^2.7.1",
    "prettier-plugin-solidity": "^1.0.0",
    "prompts": "^2.4.2",
    "yargs": "^17.7.2",
    "zksync-web3": "^0.14.3"
  }

zk-solc compilation does not work in hre.

When i run npx hardhat compile, I do not think it successfully compiles using the zksolc but the regular solc.
my artifacts folder is named 'artifacts' and not 'artifacts-zk'. How do I set it up so it uses the zksolc?

Hardhat ignores hardhat-zksync-solc plugin

Hello,
I'm following this tutorial to setup a zkSync hardhat project from scratch. When I run yarn hardhat compile it seems to run the standard hardhat task, there is no tmp folder.

If I run yarn hardhat deploy-zksync to execute the deploy script, it throws an error on

await deployer.loadArtifact("Greeter");

saying "Error in plugin @matterlabs/hardhat-zksync-solc: Artifact Greeter was not compiled by zksolc".
Any idea on what can cause this issue?

message: 'Transaction requires too much gas or exceed VM execution limits to commit on L1'

reason: 'processing response error',
code: 'SERVER_ERROR',
body: '{"jsonrpc":"2.0","error":{"code":3,"message":"Failed to submit transaction: Transaction requires too much gas or exceed VM execution limits to commit on L1","data":{"code":104,"message":"Transaction requires too much gas or exceed VM execution limits to commit on L1"}},"id":54}\n',

How to solve this problem? code must be split?

Bytecodes differ only in last 32 bytes. The contract cannot be verified.

I deployed the contract first, but the code of the deployed contract was not committed immediately, after the deployment, I clean up the code and deleted the newlines or spaces. But when i want to verify the contract, the bytecodes does not match in last 32 bytes.

Theoretically the original code should produce the same bytecodes as the code added with some blank lines, but I found that zk mainnet/testnet source code verification system rejects such changes.

I am able to compiled to a bytecodes that matched the one on-chain except the last 32 bytes. Will the zk team are able to update the validation rules for the plugin to support this case? Just similar to the validation rules of Ethereum. As more developers get into zksync, I think a lot of people will encounter this problem.

Thanks.

how to implement multiple compilation targets with hardhat?

At Safe, we're trying to implement zksync support but we want to keep our contracts compiled for EVM with [email protected]

I implemented conditional compiler settings depending on an environment variable:

const getCompilerSettings = (): CompilerSettings => {
  if (TARGET_ZKSYNC) {
    return {
      solidity: {
        version: "0.8.15",
      },
      zksolc: {
        version: "1.1.0",
        compilerSource: "binary",
        settings: {},
      },
    };
  }

  return {
    solidity: {
      compilers: [
        { version: primarySolidityVersion, settings: soliditySettings },
        { version: "0.6.12" },
        { version: "0.5.17" },
      ],
    },
  };
};

The full source can be found here:
https://github.com/safe-global/safe-contracts/blob/zksync/hardhat.config.ts

The issue I'm facing is when TARGET_ZKSYNC is not set, it still invokes the zksolc compiler and does not generate solidity files

~/projects/safe/safe-contracts/build zksync ❯ tree -L 1                                                                                                                                                   
.
├── artifacts-zk
└── cache-zk

[BUG] - transaction on testnet reverts when contract calls opcode (Create) [Error panic]

Transaction reverts without reason on testnet but works correctly on local environment.

Details

Chain - zkSync Testnet
Transaction hash - 0xe6dda04eb75cc63a1d873db5537d44927350ecfea856dbebb287d8c4764d4482 - View it on explorer
Contract address - 0xb1D27F0838932cC92990585977050107802bC54c - View it on explorer

Description

I setup local environment using zksync--local-setup and deployed contract WeightedPoolFactory. I called create function and transaction passed with no problems.

I deployed WeightedPoolFactory contract on zkSync Testnet but for some reason I cannot execute create function.
Transaction reverts with Error: transaction failed [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ].
I changed gasLimit to maximum but it didn't help.

Code

 const { WeightedPoolFactory } = zkSyncDeploymentsAddresses;

 const contract = new Contract(WeightedPoolFactory, WeightedPoolFactory.abi, wallet);

  const handleCreatePool = await contract.create(
    'WBTC/USDC',
    'TEST-WBTC-USDC-POOL',
    tokensAddresses,
    ['500000000000000000', '500000000000000000'],
    ['0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000'],
    3000000000000000,
    '0xBA1BA1ba1BA1bA1bA1Ba1BA1ba1BA1bA1ba1ba1B'
  );

  const receipt = await handleCreatePool.wait();

Debug

I can deploy WeightedPool directly but can't perform it using WeightedPoolFactory

If I make eth_call with the same params request is successful.

curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to": "0xb1D27F0838932cC92990585977050107802bC54c","data":"0x80773a9300000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000aa87bee538000000000000000000000000000ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b0000000000000000000000000000000000000000000000000000000000000009574254432f5553444300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013544553542d574254432d555344432d504f4f4c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bfce1d53451b4a8175dd94e6e029f7d8a701e9c0000000000000000000000000faf6df7054946141266420b43783387a78d82a9000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","from":"0xABfB1a497fAa51B667Aa2bacA2c768255cb1725c" },"latest"],"id":1}' https://testnet.era.zksync.dev
{"jsonrpc":"2.0","result":"0x0000000000000000000000004a2e0b25b88360fbc14a7e02b74ccb9784f2289c","id":1}

Also I tried to find some details using debug_traceTransaction

curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_traceTransaction","params": ["0xe6dda04eb75cc63a1d873db5537d44927350ecfea856dbebb287d8c4764d4482"],"id":1}' https://testnet.era.zksync.dev

{
  "jsonrpc": "2.0",
  "result": {
    "calls": [
      {
        "calls": [],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0xf50c5f80",
        "gasUsed": "0x27e",
        "input": "0x6ef25c3a",
        "output": "0x000000000000000000000000000000000000000000000000000000000ee6b280",
        "revertReason": null,
        "to": "0x000000000000000000000000000000000000800b",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [
          {
            "calls": [],
            "error": null,
            "from": "0x000000000000000000000000000000000000800c",
            "gas": "0xf1381623",
            "gasUsed": "0x278",
            "input": "0x9a8a0592",
            "output": "0x0000000000000000000000000000000000000000000000000000000000000118",
            "revertReason": null,
            "to": "0x000000000000000000000000000000000000800b",
            "type": "Call",
            "value": "0x0"
          },
          {
            "calls": [],
            "error": null,
            "from": "0x000000000000000000000000000000000000800c",
            "gas": "0xf137ff7f",
            "gasUsed": "0x99b",
            "input": "0xf902ac3d840ee6b28083bebc2094b1d27f0838932cc92990585977050107802bc54c80b9028480773a9300000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000aa87bee538000000000000000000000000000ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b0000000000000000000000000000000000000000000000000000000000000009574254432f5553444300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013544553542d574254432d555344432d504f4f4c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bfce1d53451b4a8175dd94e6e029f7d8a701e9c0000000000000000000000000faf6df7054946141266420b43783387a78d82a9000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008201188080",
            "output": "0xa07f2bc3a6fab957392a583976c806e22ec4bef8715e9b752e9ef3560ea1733e",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008010",
            "type": "Call",
            "value": "0x0"
          },
          {
            "calls": [],
            "error": null,
            "from": "0x000000000000000000000000000000000000800c",
            "gas": "0xf137dec4",
            "gasUsed": "0x278",
            "input": "0x9a8a0592",
            "output": "0x0000000000000000000000000000000000000000000000000000000000000118",
            "revertReason": null,
            "to": "0x000000000000000000000000000000000000800b",
            "type": "Call",
            "value": "0x0"
          },
          {
            "calls": [],
            "error": null,
            "from": "0x000000000000000000000000000000000000800c",
            "gas": "0xf137c724",
            "gasUsed": "0x9ff",
            "input": "0xf902ec3d840ee6b28083bebc2094b1d27f0838932cc92990585977050107802bc54c80b9028480773a9300000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000aa87bee538000000000000000000000000000ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b0000000000000000000000000000000000000000000000000000000000000009574254432f5553444300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013544553542d574254432d555344432d504f4f4c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bfce1d53451b4a8175dd94e6e029f7d8a701e9c0000000000000000000000000faf6df7054946141266420b43783387a78d82a9000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000820253a07fe7bf7ba1dcdddbac4b6e85ea247300e32e6598142b152cf25208c05733a461a03911ad29fbcde44105b1b46ffb26e16b9851b8fa1057469e622f7fbf326491d1",
            "output": "0xe6dda04eb75cc63a1d873db5537d44927350ecfea856dbebb287d8c4764d4482",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008010",
            "type": "Call",
            "value": "0x0"
          }
        ],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0xf50c581e",
        "gasUsed": "0x6bbe",
        "input": "0xebe4a3d700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c000000000000000000000000b1d27f0838932cc92990585977050107802bc54c0000000000000000000000000000000000000000000000000000000000bebc200000000000000000000000000000000000000000000000000000000000004e20000000000000000000000000000000000000000000000000000000000ee6b280000000000000000000000000000000000000000000000000000000000ee6b2800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000005c000000000000000000000000000000000000000000000000000000000000005e0000000000000000000000000000000000000000000000000000000000000028480773a9300000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000aa87bee538000000000000000000000000000ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b0000000000000000000000000000000000000000000000000000000000000009574254432f5553444300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013544553542d574254432d555344432d504f4f4c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bfce1d53451b4a8175dd94e6e029f7d8a701e9c0000000000000000000000000faf6df7054946141266420b43783387a78d82a9000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000417fe7bf7ba1dcdddbac4b6e85ea247300e32e6598142b152cf25208c05733a4613911ad29fbcde44105b1b46ffb26e16b9851b8fa1057469e622f7fbf326491d11b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "output": "0xe6dda04eb75cc63a1d873db5537d44927350ecfea856dbebb287d8c4764d4482a07f2bc3a6fab957392a583976c806e22ec4bef8715e9b752e9ef3560ea1733e",
        "revertReason": null,
        "to": "0x000000000000000000000000000000000000800c",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0x63c31e",
        "gasUsed": "0x357",
        "input": "0xa851ae780000000000000000000000000000000000000000000000000000000000008001",
        "output": "0x",
        "revertReason": null,
        "to": "0x000000000000000000000000000000000000800b",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0x63bd75",
        "gasUsed": "0x295",
        "input": "0xbf1fe420000000000000000000000000000000000000000000000000000000000ee6b280",
        "output": "0x",
        "revertReason": null,
        "to": "0x000000000000000000000000000000000000800b",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [
          {
            "calls": [],
            "error": null,
            "from": "0x0000000000000000000000000000000000008006",
            "gas": "0x6225ae",
            "gasUsed": "0x1d6",
            "input": "0x000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c0000000000000000000000000000000000000000000000000000000000000000",
            "output": "0x1437d09eb72d19a79c7f1854c53bbb541e5db8d7f7646d385604e95e95d8eb02",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008010",
            "type": "Call",
            "value": "0x0"
          },
          {
            "calls": [],
            "error": null,
            "from": "0x0000000000000000000000000000000000008006",
            "gas": "0x622005",
            "gasUsed": "0x291",
            "input": "0x4de2e468000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c",
            "output": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008002",
            "type": "Call",
            "value": "0x0"
          }
        ],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0x63b84a",
        "gasUsed": "0xd7a",
        "input": "0xbb0fd610000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c",
        "output": "0x0000000000000000000000000000000000000000000000000000000000000001",
        "revertReason": null,
        "to": "0x0000000000000000000000000000000000008006",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [
          {
            "calls": [],
            "error": null,
            "from": "0x0000000000000000000000000000000000008003",
            "gas": "0x6215af",
            "gasUsed": "0x1d6",
            "input": "0x000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c0000000000000000000000000000000000000000000000000000000000000000",
            "output": "0x1437d09eb72d19a79c7f1854c53bbb541e5db8d7f7646d385604e95e95d8eb02",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008010",
            "type": "Call",
            "value": "0x0"
          },
          {
            "calls": [],
            "error": null,
            "from": "0x0000000000000000000000000000000000008003",
            "gas": "0x621102",
            "gasUsed": "0x1d6",
            "input": "0x000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c0000000000000000000000000000000000000000000000000000000000000001",
            "output": "0xdd27b003eb6768f9365e2168444485f2683b40753c149615a713adea090fa0cb",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008010",
            "type": "Call",
            "value": "0x0"
          },
          {
            "calls": [],
            "error": null,
            "from": "0x0000000000000000000000000000000000008003",
            "gas": "0x620d12",
            "gasUsed": "0x1d6",
            "input": "0x000000000000000000000000000000000000000000000000000000000000003ddd27b003eb6768f9365e2168444485f2683b40753c149615a713adea090fa0cb",
            "output": "0x593e69cb70cd56f4846bade1253e5596db2e18d6913fb5b437ec07d6d0b8bd52",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008010",
            "type": "Call",
            "value": "0x0"
          }
        ],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0x63a80c",
        "gasUsed": "0xf1f",
        "input": "0x6ee1dc20000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c000000000000000000000000000000000000000000000000000000000000003d0000000000000000000000000000000000000000000000000000000000000000",
        "output": "0x",
        "revertReason": null,
        "to": "0x0000000000000000000000000000000000008003",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [
          {
            "calls": [
              {
                "calls": [],
                "error": null,
                "from": "0x0000000000000000000000000000000000008003",
                "gas": "0x60750c",
                "gasUsed": "0x1d6",
                "input": "0x000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c0000000000000000000000000000000000000000000000000000000000000000",
                "output": "0x1437d09eb72d19a79c7f1854c53bbb541e5db8d7f7646d385604e95e95d8eb02",
                "revertReason": null,
                "to": "0x0000000000000000000000000000000000008010",
                "type": "Call",
                "value": "0x0"
              },
              {
                "calls": [],
                "error": null,
                "from": "0x0000000000000000000000000000000000008003",
                "gas": "0x607020",
                "gasUsed": "0x1d6",
                "input": "0x000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c0000000000000000000000000000000000000000000000000000000000000000",
                "output": "0x1437d09eb72d19a79c7f1854c53bbb541e5db8d7f7646d385604e95e95d8eb02",
                "revertReason": null,
                "to": "0x0000000000000000000000000000000000008010",
                "type": "Call",
                "value": "0x0"
              }
            ],
            "error": null,
            "from": "0xabfb1a497faa51b667aa2baca2c768255cb1725c",
            "gas": "0x620085",
            "gasUsed": "0x751e3",
            "input": "0xe1239cd8000000000000000000000000000000000000000000000000000000000000003d",
            "output": "0x",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008003",
            "type": "Call",
            "value": "0x0"
          },
          {
            "calls": [
              {
                "calls": [],
                "error": null,
                "from": "0x000000000000000000000000000000000000800a",
                "gas": "0x5958b1",
                "gasUsed": "0x1d6",
                "input": "0x000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c0000000000000000000000000000000000000000000000000000000000000000",
                "output": "0x1437d09eb72d19a79c7f1854c53bbb541e5db8d7f7646d385604e95e95d8eb02",
                "revertReason": null,
                "to": "0x0000000000000000000000000000000000008010",
                "type": "Call",
                "value": "0x0"
              }
            ],
            "error": null,
            "from": "0xabfb1a497faa51b667aa2baca2c768255cb1725c",
            "gas": "0x5ac79e",
            "gasUsed": "0x6b7",
            "input": "0x9cc7f708000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c",
            "output": "0x00000000000000000000000000000000000000000000000005697bef4ff53e2d",
            "revertReason": null,
            "to": "0x000000000000000000000000000000000000800a",
            "type": "Call",
            "value": "0x0"
          },
          {
            "calls": [],
            "error": null,
            "from": "0xabfb1a497faa51b667aa2baca2c768255cb1725c",
            "gas": "0x5ab958",
            "gasUsed": "0x5b8",
            "input": "0xa07f2bc3a6fab957392a583976c806e22ec4bef8715e9b752e9ef3560ea1733e000000000000000000000000000000000000000000000000000000000000001b7fe7bf7ba1dcdddbac4b6e85ea247300e32e6598142b152cf25208c05733a4613911ad29fbcde44105b1b46ffb26e16b9851b8fa1057469e622f7fbf326491d1",
            "output": "0x000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000000001",
            "type": "Call",
            "value": "0x0"
          }
        ],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0x6393de",
        "gasUsed": "0x77132",
        "input": "0x202bcce7e6dda04eb75cc63a1d873db5537d44927350ecfea856dbebb287d8c4764d4482a07f2bc3a6fab957392a583976c806e22ec4bef8715e9b752e9ef3560ea1733e00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c000000000000000000000000b1d27f0838932cc92990585977050107802bc54c0000000000000000000000000000000000000000000000000000000000bebc200000000000000000000000000000000000000000000000000000000000004e20000000000000000000000000000000000000000000000000000000000ee6b280000000000000000000000000000000000000000000000000000000000ee6b2800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000005c000000000000000000000000000000000000000000000000000000000000005e0000000000000000000000000000000000000000000000000000000000000028480773a9300000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000aa87bee538000000000000000000000000000ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b0000000000000000000000000000000000000000000000000000000000000009574254432f5553444300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013544553542d574254432d555344432d504f4f4c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bfce1d53451b4a8175dd94e6e029f7d8a701e9c0000000000000000000000000faf6df7054946141266420b43783387a78d82a9000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000417fe7bf7ba1dcdddbac4b6e85ea247300e32e6598142b152cf25208c05733a4613911ad29fbcde44105b1b46ffb26e16b9851b8fa1057469e622f7fbf326491d11b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "output": "0x202bcce700000000000000000000000000000000000000000000000000000000",
        "revertReason": null,
        "to": "0xabfb1a497faa51b667aa2baca2c768255cb1725c",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [
          {
            "calls": [],
            "error": null,
            "from": "0x0000000000000000000000000000000000008003",
            "gas": "0x5ac89a",
            "gasUsed": "0x1d6",
            "input": "0x000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c0000000000000000000000000000000000000000000000000000000000000000",
            "output": "0x1437d09eb72d19a79c7f1854c53bbb541e5db8d7f7646d385604e95e95d8eb02",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008010",
            "type": "Call",
            "value": "0x0"
          }
        ],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0x5c3d6f",
        "gasUsed": "0x689",
        "input": "0x6ee1dc20000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c000000000000000000000000000000000000000000000000000000000000003d0000000000000000000000000000000000000000000000000000000000000001",
        "output": "0x",
        "revertReason": null,
        "to": "0x0000000000000000000000000000000000008003",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [
          {
            "calls": [],
            "error": null,
            "from": "0x000000000000000000000000000000000000800a",
            "gas": "0x5abf7f",
            "gasUsed": "0x1d6",
            "input": "0x00000000000000000000000000000000000000000000000000000000000080010000000000000000000000000000000000000000000000000000000000000000",
            "output": "0x31b66141c575a054316a84da9cf4aa6fe0abd373cab1bf4ac029ffc061aae0da",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008010",
            "type": "Call",
            "value": "0x0"
          }
        ],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0x5c3415",
        "gasUsed": "0x6b7",
        "input": "0x9cc7f7080000000000000000000000000000000000000000000000000000000000008001",
        "output": "0x000000000000000000000000000000000000000000000000017856407dc6bcb0",
        "revertReason": null,
        "to": "0x000000000000000000000000000000000000800a",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [
          {
            "calls": [
              {
                "calls": [
                  {
                    "calls": [],
                    "error": null,
                    "from": "0x000000000000000000000000000000000000800a",
                    "gas": "0x57dbbd",
                    "gasUsed": "0x1d6",
                    "input": "0x000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c0000000000000000000000000000000000000000000000000000000000000000",
                    "output": "0x1437d09eb72d19a79c7f1854c53bbb541e5db8d7f7646d385604e95e95d8eb02",
                    "revertReason": null,
                    "to": "0x0000000000000000000000000000000000008010",
                    "type": "Call",
                    "value": "0x0"
                  },
                  {
                    "calls": [],
                    "error": null,
                    "from": "0x000000000000000000000000000000000000800a",
                    "gas": "0x57d710",
                    "gasUsed": "0x1d6",
                    "input": "0x000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c0000000000000000000000000000000000000000000000000000000000000000",
                    "output": "0x1437d09eb72d19a79c7f1854c53bbb541e5db8d7f7646d385604e95e95d8eb02",
                    "revertReason": null,
                    "to": "0x0000000000000000000000000000000000008010",
                    "type": "Call",
                    "value": "0x0"
                  },
                  {
                    "calls": [],
                    "error": null,
                    "from": "0x000000000000000000000000000000000000800a",
                    "gas": "0x50a8fd",
                    "gasUsed": "0x1d6",
                    "input": "0x00000000000000000000000000000000000000000000000000000000000080010000000000000000000000000000000000000000000000000000000000000000",
                    "output": "0x31b66141c575a054316a84da9cf4aa6fe0abd373cab1bf4ac029ffc061aae0da",
                    "revertReason": null,
                    "to": "0x0000000000000000000000000000000000008010",
                    "type": "Call",
                    "value": "0x0"
                  },
                  {
                    "calls": [],
                    "error": null,
                    "from": "0x000000000000000000000000000000000000800a",
                    "gas": "0x50a315",
                    "gasUsed": "0x13d",
                    "input": "0x000000000000000000000000000000000000000000000000000b1a2bc2ec5000",
                    "output": "0x",
                    "revertReason": null,
                    "to": "0x000000000000000000000000000000000000800d",
                    "type": "Call",
                    "value": "0x0"
                  }
                ],
                "error": null,
                "from": "0x0000000000000000000000000000000000008009",
                "gas": "0x5944c2",
                "gasUsed": "0x75b53",
                "input": "0x579952fc000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c0000000000000000000000000000000000000000000000000000000000008001000000000000000000000000000000000000000000000000000b1a2bc2ec5000",
                "output": "0x",
                "revertReason": null,
                "to": "0x000000000000000000000000000000000000800a",
                "type": "Call",
                "value": "0x0"
              },
              {
                "calls": [],
                "error": null,
                "from": "0xabfb1a497faa51b667aa2baca2c768255cb1725c",
                "gas": "0x5203fb",
                "gasUsed": "0x17",
                "input": "0x",
                "output": "0x",
                "revertReason": null,
                "to": "0x0000000000000000000000000000000000008001",
                "type": "Call",
                "value": "0xb1a2bc2ec5000"
              }
            ],
            "error": null,
            "from": "0xabfb1a497faa51b667aa2baca2c768255cb1725c",
            "gas": "0x5ab3ee",
            "gasUsed": "0x76463",
            "input": "0x",
            "output": "0x",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008009",
            "type": "Call",
            "value": "0x0"
          }
        ],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0x5c2902",
        "gasUsed": "0x76925",
        "input": "0xe2f318e3e6dda04eb75cc63a1d873db5537d44927350ecfea856dbebb287d8c4764d4482a07f2bc3a6fab957392a583976c806e22ec4bef8715e9b752e9ef3560ea1733e00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c000000000000000000000000b1d27f0838932cc92990585977050107802bc54c0000000000000000000000000000000000000000000000000000000000bebc200000000000000000000000000000000000000000000000000000000000004e20000000000000000000000000000000000000000000000000000000000ee6b280000000000000000000000000000000000000000000000000000000000ee6b2800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000005c000000000000000000000000000000000000000000000000000000000000005e0000000000000000000000000000000000000000000000000000000000000028480773a9300000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000aa87bee538000000000000000000000000000ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b0000000000000000000000000000000000000000000000000000000000000009574254432f5553444300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013544553542d574254432d555344432d504f4f4c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bfce1d53451b4a8175dd94e6e029f7d8a701e9c0000000000000000000000000faf6df7054946141266420b43783387a78d82a9000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000417fe7bf7ba1dcdddbac4b6e85ea247300e32e6598142b152cf25208c05733a4613911ad29fbcde44105b1b46ffb26e16b9851b8fa1057469e622f7fbf326491d11b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "output": "0x",
        "revertReason": null,
        "to": "0xabfb1a497faa51b667aa2baca2c768255cb1725c",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [
          {
            "calls": [],
            "error": null,
            "from": "0x000000000000000000000000000000000000800a",
            "gas": "0x538422",
            "gasUsed": "0x1d6",
            "input": "0x00000000000000000000000000000000000000000000000000000000000080010000000000000000000000000000000000000000000000000000000000000000",
            "output": "0x31b66141c575a054316a84da9cf4aa6fe0abd373cab1bf4ac029ffc061aae0da",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008010",
            "type": "Call",
            "value": "0x0"
          }
        ],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0x54db30",
        "gasUsed": "0x6b7",
        "input": "0x9cc7f7080000000000000000000000000000000000000000000000000000000000008001",
        "output": "0x0000000000000000000000000000000000000000000000000183706c40b30cb0",
        "revertReason": null,
        "to": "0x000000000000000000000000000000000000800a",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0x545ee9",
        "gasUsed": "0x260",
        "input": "0xe516761e000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000",
        "output": "0x",
        "revertReason": null,
        "to": "0x0000000000000000000000000000000000008004",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0x5457c6",
        "gasUsed": "0x291",
        "input": "0x4de2e468000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c",
        "output": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "revertReason": null,
        "to": "0x0000000000000000000000000000000000008002",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0x54529b",
        "gasUsed": "0x357",
        "input": "0xa851ae78000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c",
        "output": "0x",
        "revertReason": null,
        "to": "0x000000000000000000000000000000000000800b",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [
          {
            "calls": [
              {
                "calls": [
                  {
                    "calls": [],
                    "error": null,
                    "from": "0x0000000000000000000000000000000000008005",
                    "gas": "0x504a3e",
                    "gasUsed": "0x1d6",
                    "input": "0x000000000000000000000000b1d27f0838932cc92990585977050107802bc54c0000000000000000000000000000000000000000000000000000000000000000",
                    "output": "0x32fa848f8de75671971c47f4769c53e6a3dbbe7e298ae49a51c5a385a0787ef1",
                    "revertReason": null,
                    "to": "0x0000000000000000000000000000000000008010",
                    "type": "Call",
                    "value": "0x0"
                  },
                  {
                    "calls": [],
                    "error": null,
                    "from": "0x0000000000000000000000000000000000008005",
                    "gas": "0x50460f",
                    "gasUsed": "0x1d6",
                    "input": "0x000000000000000000000000000000000000000000000000000000000000000032fa848f8de75671971c47f4769c53e6a3dbbe7e298ae49a51c5a385a0787ef1",
                    "output": "0xc92f1d6ea1567bc1d2a4ee97f6f5c7a8e336f65cd850773624252b7038a81446",
                    "revertReason": null,
                    "to": "0x0000000000000000000000000000000000008010",
                    "type": "Call",
                    "value": "0x0"
                  }
                ],
                "error": null,
                "from": "0xb1d27f0838932cc92990585977050107802bc54c",
                "gas": "0x519441",
                "gasUsed": "0xabf",
                "input": "0x310ab089000000000000000000000000b1d27f0838932cc92990585977050107802bc54c0000000000000000000000000000000000000000000000000000000000000000",
                "output": "0x0000000000000000000000000000000000000000000000000000000064bfa57f",
                "revertReason": null,
                "to": "0x0000000000000000000000000000000000008005",
                "type": "Call",
                "value": "0x0"
              },
              {
                "calls": [],
                "error": null,
                "from": "0xb1d27f0838932cc92990585977050107802bc54c",
                "gas": "0x518736",
                "gasUsed": "0x284",
                "input": "0x796b89b9",
                "output": "0x0000000000000000000000000000000000000000000000000000000064490f5b",
                "revertReason": null,
                "to": "0x000000000000000000000000000000000000800b",
                "type": "Call",
                "value": "0x0"
              },
              {
                "calls": [],
                "error": null,
                "from": "0xb1d27f0838932cc92990585977050107802bc54c",
                "gas": "0x518289",
                "gasUsed": "0x284",
                "input": "0x796b89b9",
                "output": "0x0000000000000000000000000000000000000000000000000000000064490f5b",
                "revertReason": null,
                "to": "0x000000000000000000000000000000000000800b",
                "type": "Call",
                "value": "0x0"
              },
              {
                "calls": [],
                "error": null,
                "from": "0xb1d27f0838932cc92990585977050107802bc54c",
                "gas": "0x517d9d",
                "gasUsed": "0x284",
                "input": "0x796b89b9",
                "output": "0x0000000000000000000000000000000000000000000000000000000064490f5b",
                "revertReason": null,
                "to": "0x000000000000000000000000000000000000800b",
                "type": "Call",
                "value": "0x0"
              },
              {
                "calls": [
                  {
                    "calls": [
                      {
                        "calls": [],
                        "error": null,
                        "from": "0x0000000000000000000000000000000000008003",
                        "gas": "0x4edc4d",
                        "gasUsed": "0x1d6",
                        "input": "0x000000000000000000000000b1d27f0838932cc92990585977050107802bc54c0000000000000000000000000000000000000000000000000000000000000000",
                        "output": "0x32fa848f8de75671971c47f4769c53e6a3dbbe7e298ae49a51c5a385a0787ef1",
                        "revertReason": null,
                        "to": "0x0000000000000000000000000000000000008010",
                        "type": "Call",
                        "value": "0x0"
                      },
                      {
                        "calls": [],
                        "error": null,
                        "from": "0x0000000000000000000000000000000000008003",
                        "gas": "0x4ed7df",
                        "gasUsed": "0x1d6",
                        "input": "0x000000000000000000000000b1d27f0838932cc92990585977050107802bc54c0000000000000000000000000000000000000000000000000000000000000000",
                        "output": "0x32fa848f8de75671971c47f4769c53e6a3dbbe7e298ae49a51c5a385a0787ef1",
                        "revertReason": null,
                        "to": "0x0000000000000000000000000000000000008010",
                        "type": "Call",
                        "value": "0x0"
                      }
                    ],
                    "error": null,
                    "from": "0x0000000000000000000000000000000000008006",
                    "gas": "0x5020e6",
                    "gasUsed": "0xbafed",
                    "input": "0x306395c6000000000000000000000000b1d27f0838932cc92990585977050107802bc54c",
                    "output": "0x0000000000000000000000000000000000000000000000000000000000000000",
                    "revertReason": null,
                    "to": "0x0000000000000000000000000000000000008003",
                    "type": "Call",
                    "value": "0x0"
                  },
                  {
                    "calls": [],
                    "error": null,
                    "from": "0x0000000000000000000000000000000000008006",
                    "gas": "0x449bb6",
                    "gasUsed": "0x208",
                    "input": "0x63bae3a9951d38e8a3fbb7b70909afc1200610fc5bc55ade242f815974674f23000000000000000000000000b1d27f0838932cc92990585977050107802bc54c0000000000000000000000000000000000000000000000000000000000000000",
                    "output": "0x351ba2cb5b6fa36001921f2e4a2e0b25b88360fbc14a7e02b74ccb9784f2289c",
                    "revertReason": null,
                    "to": "0x0000000000000000000000000000000000008010",
                    "type": "Call",
                    "value": "0x0"
                  },
                  {
                    "calls": [
                      {
                        "calls": [
                          {
                            "calls": [],
                            "error": null,
                            "from": "0x0000000000000000000000000000000000008003",
                            "gas": "0x426d14",
                            "gasUsed": "0x1d6",
                            "input": "0x0000000000000000000000004a2e0b25b88360fbc14a7e02b74ccb9784f2289c0000000000000000000000000000000000000000000000000000000000000000",
                            "output": "0x4fbc89dc1647bc68199ec903ad6ec8344c111f63f37e260eb38a8e30ff47f571",
                            "revertReason": null,
                            "to": "0x0000000000000000000000000000000000008010",
                            "type": "Call",
                            "value": "0x0"
                          }
                        ],
                        "error": null,
                        "from": "0x0000000000000000000000000000000000008002",
                        "gas": "0x437efb",
                        "gasUsed": "0x6cf",
                        "input": "0x5aa9b6b50000000000000000000000004a2e0b25b88360fbc14a7e02b74ccb9784f2289c",
                        "output": "0x0000000000000000000000000000000000000000000000000000000000000000",
                        "revertReason": null,
                        "to": "0x0000000000000000000000000000000000008003",
                        "type": "Call",
                        "value": "0x0"
                      }
                    ],
                    "error": null,
                    "from": "0x0000000000000000000000000000000000008006",
                    "gas": "0x44964c",
                    "gasUsed": "0xd74",
                    "input": "0xe03fe1770000000000000000000000004a2e0b25b88360fbc14a7e02b74ccb9784f2289c",
                    "output": "0x0000000000000000000000000000000000000000000000000000000000000000",
                    "revertReason": null,
                    "to": "0x0000000000000000000000000000000000008002",
                    "type": "Call",
                    "value": "0x0"
                  },
                  {
                    "calls": [
                      {
                        "calls": [],
                        "error": null,
                        "from": "0x0000000000000000000000000000000000008003",
                        "gas": "0x436ff8",
                        "gasUsed": "0x1d6",
                        "input": "0x0000000000000000000000004a2e0b25b88360fbc14a7e02b74ccb9784f2289c0000000000000000000000000000000000000000000000000000000000000000",
                        "output": "0x4fbc89dc1647bc68199ec903ad6ec8344c111f63f37e260eb38a8e30ff47f571",
                        "revertReason": null,
                        "to": "0x0000000000000000000000000000000000008010",
                        "type": "Call",
                        "value": "0x0"
                      }
                    ],
                    "error": null,
                    "from": "0x0000000000000000000000000000000000008006",
                    "gas": "0x4485cf",
                    "gasUsed": "0x6cf",
                    "input": "0x5aa9b6b50000000000000000000000004a2e0b25b88360fbc14a7e02b74ccb9784f2289c",
                    "output": "0x0000000000000000000000000000000000000000000000000000000000000000",
                    "revertReason": null,
                    "to": "0x0000000000000000000000000000000000008003",
                    "type": "Call",
                    "value": "0x0"
                  },
                  {
                    "calls": [],
                    "error": null,
                    "from": "0x0000000000000000000000000000000000008006",
                    "gas": "0x447bf7",
                    "gasUsed": "0x261",
                    "input": "0x4c6314f001000c47dac31cb05e48c94440b77d560c926f1d31ebd312a554a270bde984c2",
                    "output": "0x0000000000000000000000000000000000000000000000000000000000000001",
                    "revertReason": null,
                    "to": "0x0000000000000000000000000000000000008004",
                    "type": "Call",
                    "value": "0x0"
                  },
                  {
                    "calls": [],
                    "error": null,
                    "from": "0x0000000000000000000000000000000000008006",
                    "gas": "0x44760f",
                    "gasUsed": "0x1d6",
                    "input": "0x0000000000000000000000004a2e0b25b88360fbc14a7e02b74ccb9784f2289c0000000000000000000000000000000000000000000000000000000000000000",
                    "output": "0x4fbc89dc1647bc68199ec903ad6ec8344c111f63f37e260eb38a8e30ff47f571",
                    "revertReason": null,
                    "to": "0x0000000000000000000000000000000000008010",
                    "type": "Call",
                    "value": "0x0"
                  },
                  {
                    "calls": [],
                    "error": null,
                    "from": "0x0000000000000000000000000000000000008006",
                    "gas": "0x38f93d",
                    "gasUsed": "0x2d9",
                    "input": "0x1806aa180000000000000000000000000000000000000000000000000000000000008002",
                    "output": "0x0000000000000000000000000000000000000000000000000000000000001220",
                    "revertReason": null,
                    "to": "0x0000000000000000000000000000000000008002",
                    "type": "Call",
                    "value": "0x0"
                  },
                  {
                    "calls": [],
                    "error": null,
                    "from": "0x0000000000000000000000000000000000008006",
                    "gas": "0x38f394",
                    "gasUsed": "0xba6e6",
                    "input": "0x4f1e1be00000000000000000000000004a2e0b25b88360fbc14a7e02b74ccb9784f2289c01010c47dac31cb05e48c94440b77d560c926f1d31ebd312a554a270bde984c2",
                    "output": "0x",
                    "revertReason": null,
                    "to": "0x0000000000000000000000000000000000008002",
                    "type": "Call",
                    "value": "0x0"
                  },
                  {
                    "calls": [
                      {
                        "calls": [],
                        "error": null,
                        "from": "0x4a2e0b25b88360fbc14a7e02b74ccb9784f2289c",
                        "gas": "0x9fee2",
                        "gasUsed": "0x1bd",
                        "input": "0x574254432f55534443",
                        "output": "0xc4a4e865aa0aa1da3eb8811d14d304839f3002161a919075a08340898d445010",
                        "revertReason": null,
                        "to": "0x0000000000000000000000000000000000008010",
                        "type": "Call",
                        "value": "0x0"
                      },
                      {
                        "calls": [],
                        "error": null,
                        "from": "0x4a2e0b25b88360fbc14a7e02b74ccb9784f2289c",
                        "gas": "0x9fab3",
                        "gasUsed": "0x1bd",
                        "input": "0x31",
                        "output": "0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6",
                        "revertReason": null,
                        "to": "0x0000000000000000000000000000000000008010",
                        "type": "Call",
                        "value": "0x0"
                      },
                      {
                        "calls": [],
                        "error": null,
                        "from": "0x4a2e0b25b88360fbc14a7e02b74ccb9784f2289c",
                        "gas": "0x9f645",
                        "gasUsed": "0x284",
                        "input": "0x796b89b9",
                        "output": "0x0000000000000000000000000000000000000000000000000000000064490f5b",
                        "revertReason": null,
                        "to": "0x000000000000000000000000000000000000800b",
                        "type": "Call",
                        "value": "0x0"
                      }
                    ],
                    "error": "Panic",
                    "from": "0xb1d27f0838932cc92990585977050107802bc54c",
                    "gas": "0x2d483f",
                    "gasUsed": "0x2d483f",
                    "input": "0x0000000000000000000000005fba46d2c847715540fe9fe02c3e3cd77db1900a0000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000aa87bee53800000000000000000000000000000000000000000000000000000000000007696240000000000000000000000000000000000000000000000000000000000278d00000000000000000000000000ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b0000000000000000000000000000000000000000000000000000000000000009574254432f5553444300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013544553542d574254432d555344432d504f4f4c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bfce1d53451b4a8175dd94e6e029f7d8a701e9c0000000000000000000000000faf6df7054946141266420b43783387a78d82a9000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                    "output": "0x",
                    "revertReason": null,
                    "to": "0x4a2e0b25b88360fbc14a7e02b74ccb9784f2289c",
                    "type": "Create",
                    "value": "0x0"
                  }
                ],
                "error": null,
                "from": "0xb1d27f0838932cc92990585977050107802bc54c",
                "gas": "0x516b28",
                "gasUsed": "0x50b36c",
                "input": "0x9c4d535b000000000000000000000000000000000000000000000000000000000000000001000c47dac31cb05e48c94440b77d560c926f1d31ebd312a554a270bde984c2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000005fba46d2c847715540fe9fe02c3e3cd77db1900a0000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000aa87bee53800000000000000000000000000000000000000000000000000000000000007696240000000000000000000000000000000000000000000000000000000000278d00000000000000000000000000ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b0000000000000000000000000000000000000000000000000000000000000009574254432f5553444300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013544553542d574254432d555344432d504f4f4c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bfce1d53451b4a8175dd94e6e029f7d8a701e9c0000000000000000000000000faf6df7054946141266420b43783387a78d82a9000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                "output": "0x",
                "revertReason": "Unknown revert reason",
                "to": "0x0000000000000000000000000000000000008006",
                "type": "Call",
                "value": "0x0"
              }
            ],
            "error": null,
            "from": "0xabfb1a497faa51b667aa2baca2c768255cb1725c",
            "gas": "0x52f137",
            "gasUsed": "0x50ef32",
            "input": "0x80773a9300000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000aa87bee538000000000000000000000000000ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b0000000000000000000000000000000000000000000000000000000000000009574254432f5553444300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013544553542d574254432d555344432d504f4f4c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bfce1d53451b4a8175dd94e6e029f7d8a701e9c0000000000000000000000000faf6df7054946141266420b43783387a78d82a9000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "output": "0x",
            "revertReason": "Unknown revert reason",
            "to": "0xb1d27f0838932cc92990585977050107802bc54c",
            "type": "Call",
            "value": "0x0"
          }
        ],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0x544b39",
        "gasUsed": "0x50f886",
        "input": "0xdf9c1589e6dda04eb75cc63a1d873db5537d44927350ecfea856dbebb287d8c4764d4482a07f2bc3a6fab957392a583976c806e22ec4bef8715e9b752e9ef3560ea1733e00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c000000000000000000000000b1d27f0838932cc92990585977050107802bc54c0000000000000000000000000000000000000000000000000000000000bebc200000000000000000000000000000000000000000000000000000000000004e20000000000000000000000000000000000000000000000000000000000ee6b280000000000000000000000000000000000000000000000000000000000ee6b2800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000005c000000000000000000000000000000000000000000000000000000000000005e0000000000000000000000000000000000000000000000000000000000000028480773a9300000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000aa87bee538000000000000000000000000000ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b0000000000000000000000000000000000000000000000000000000000000009574254432f5553444300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013544553542d574254432d555344432d504f4f4c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bfce1d53451b4a8175dd94e6e029f7d8a701e9c0000000000000000000000000faf6df7054946141266420b43783387a78d82a9000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000417fe7bf7ba1dcdddbac4b6e85ea247300e32e6598142b152cf25208c05733a4613911ad29fbcde44105b1b46ffb26e16b9851b8fa1057469e622f7fbf326491d11b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "output": "0x",
        "revertReason": "Unknown revert reason",
        "to": "0xabfb1a497faa51b667aa2baca2c768255cb1725c",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0xf4ad24b7",
        "gasUsed": "0x357",
        "input": "0xa851ae780000000000000000000000000000000000000000000000000000000000008001",
        "output": "0x",
        "revertReason": null,
        "to": "0x000000000000000000000000000000000000800b",
        "type": "Call",
        "value": "0x0"
      },
      {
        "calls": [
          {
            "calls": [],
            "error": null,
            "from": "0x000000000000000000000000000000000000800a",
            "gas": "0xf0da6598",
            "gasUsed": "0x1d6",
            "input": "0x00000000000000000000000000000000000000000000000000000000000080010000000000000000000000000000000000000000000000000000000000000000",
            "output": "0x31b66141c575a054316a84da9cf4aa6fe0abd373cab1bf4ac029ffc061aae0da",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008010",
            "type": "Call",
            "value": "0x0"
          },
          {
            "calls": [],
            "error": null,
            "from": "0x000000000000000000000000000000000000800a",
            "gas": "0xf0da612a",
            "gasUsed": "0x1d6",
            "input": "0x00000000000000000000000000000000000000000000000000000000000080010000000000000000000000000000000000000000000000000000000000000000",
            "output": "0x31b66141c575a054316a84da9cf4aa6fe0abd373cab1bf4ac029ffc061aae0da",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008010",
            "type": "Call",
            "value": "0x0"
          },
          {
            "calls": [],
            "error": null,
            "from": "0x000000000000000000000000000000000000800a",
            "gas": "0xf0da5c3e",
            "gasUsed": "0x1d6",
            "input": "0x000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c0000000000000000000000000000000000000000000000000000000000000000",
            "output": "0x1437d09eb72d19a79c7f1854c53bbb541e5db8d7f7646d385604e95e95d8eb02",
            "revertReason": null,
            "to": "0x0000000000000000000000000000000000008010",
            "type": "Call",
            "value": "0x0"
          },
          {
            "calls": [],
            "error": null,
            "from": "0x000000000000000000000000000000000000800a",
            "gas": "0xf0da5617",
            "gasUsed": "0x13d",
            "input": "0x0000000000000000000000000000000000000000000000000004ec84f8273580",
            "output": "0x",
            "revertReason": null,
            "to": "0x000000000000000000000000000000000000800d",
            "type": "Call",
            "value": "0x0"
          }
        ],
        "error": null,
        "from": "0x0000000000000000000000000000000000008001",
        "gas": "0xf4ad1e12",
        "gasUsed": "0x14fb",
        "input": "0x579952fc0000000000000000000000000000000000000000000000000000000000008001000000000000000000000000abfb1a497faa51b667aa2baca2c768255cb1725c0000000000000000000000000000000000000000000000000004ec84f8273580",
        "output": "0x",
        "revertReason": null,
        "to": "0x000000000000000000000000000000000000800a",
        "type": "Call",
        "value": "0x0"
      }
    ],
    "error": null,
    "from": "0x0000000000000000000000000000000000000000",
    "gas": "0xbebc20",
    "gasUsed": "0x6a2491",
    "input": "0x80773a9300000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000aa87bee538000000000000000000000000000ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b0000000000000000000000000000000000000000000000000000000000000009574254432f5553444300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013544553542d574254432d555344432d504f4f4c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bfce1d53451b4a8175dd94e6e029f7d8a701e9c0000000000000000000000000faf6df7054946141266420b43783387a78d82a9000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "output": "0x",
    "revertReason": null,
    "to": "0x0000000000000000000000000000000000008001",
    "type": "Call",
    "value": "0x0"
  },
  "id": 1
}

Expected behavior

If staticCall has passed with the same params, transaction also should be successfully on chain

The forge project uses hardhat to verify bytecode inconsistencies

verify error, I have a project, first use forge to build the project, and then use hardhat to deploy the verification contract.
After verification many times, it keeps prompting that the contract bytecode is inconsistent.
Later I found out that it was added,

preprocess: {
     eachLine: (hre) => ({
       transform: (line: string) => {
         if (line.match(/^\s*import /i)) {
           for (const [from, to] of getRemappings()) {
             if (line. includes(from)) {
               line = line. replace(from, to);
               break;
             }
           }
         }
         return line;
       },
     })
   },

caused by.

Update to ethers v6

Hi, we recently updated all of our official plugins to rely on ethers v6. It would be great if these plugins would do the same, because that would enable templates like this one to completely upgrade to these new versions.

From what I can tell, the necessary changes are:

  • hardhat-zksync-deploy should update its peer dependency on ethers to ^6.0.0
  • That change requires zksync-web3 to also upgrade its peer dependency (this will probably be the biggest change)
  • hardaht-zksync-verify should change its dependency on @nomiclabs/hardhat-etherscan to @nomicfoundation/hardhat-verify. This is not strictly related to ethers v6, but our new Toolbox uses this new plugin. This will require some changes on the subtasks you are using/overriding.

In all cases, I'm happy to help in any way I can.

Thanks!

how to make cache-zk work?

I have the feeling that cache-zk is not working, my branch is at: https://github.com/para-space/paraspace-core/blob/feat/zksync-era/hardhat.config.ts

when I compile, I always need to add --no-compile flag, otherwise it always compiles more than 500 contracts, which is super super slow (> 10 minutes)

also before of this issue, when I verify my contracts it automatically recompiles because --no-compile doesn't work in task, these two things cause it hard to verify contracts as it always recompiles

Path configuration is not supported

hardhat-zksync-solc is compiled according to ./contracts by default, and does not support path configuration

  1. Please note that the folder is named "contracts", it cannot be "contract", otherwise zksync-solc cannot find the contract file

  2. hardhat-zksync-solc also has a lot of incompatibilities with hardhat, which means there is a lot of work to be done, please let me know if you need help

Screen Shot 2022-04-12 at 19 12 09

LLVM IR generator definition pass error

I'm trying to compile Safe contracts for zksync, but I'm facing an error:

Error in plugin @matterlabs/hardhat-zksync-solc: The contract contracts/proxies/GnosisSafeProxyFactory.sol:GnosisSafeProxyFactory LLVM IR generator definition pass error: Contract with identifier GnosisSafeProxy_39.GnosisSafeProxy_39_deployed not found in the project

I've tried it with Solidity 0.7.6 and 0.8.15, same error in both cases

To reproduce, you can use https://github.com/safe-global/safe-contracts/tree/zksync:

  1. Clone the repo
  2. run yarn

I'm using macOS 12.5 with an M1 laptop. Would appreciate your help in debugging

Support deploymentType in Deployer (createAA, ...)

It would be good to add a deploymentType optional parameter in the Deployer object constructor

constructor(hre: HardhatRuntimeEnvironment, zkWallet: zk.Wallet) {

... and then to use it when creating new instances of zk.ContractFactory

const factory = new zk.ContractFactory(artifact.abi, artifact.bytecode, this.zkWallet);

const factory = new zk.ContractFactory(artifact.abi, artifact.bytecode, this.zkWallet);

`zksync-web3` version `0.14.x` breaks `hardhat-zksync-deploy` due to peer dependency issue

The recent update of zksync-web3 to version 0.14.x will lead to the following breaking peer dependency issue:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/zksync-web3
npm ERR!   dev zksync-web3@"^0.14.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer zksync-web3@"^0.13.4" from @matterlabs/[email protected]
npm ERR! node_modules/@matterlabs/hardhat-zksync-deploy
npm ERR!   dev @matterlabs/hardhat-zksync-deploy@"^0.6.2" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

The underlying reason is the caret ^ in the following line: https://github.com/matter-labs/hardhat-zksync/blob/main/packages/hardhat-zksync-deploy/package.json#L55

"zksync-web3": "^0.13.4"

1.3.2 zksolc not compatible with 0.8.18 Solidity

I've been trying to get the zksync compiler to compile contracts which use 0.8.18 but I consistently get this error:

Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
error Command failed with exit code 1.

I tried multiple versions but it happens even with all the latest zksync tools and 1.3.2 zksolc compiler binary.

hardhat zksync-solc breaks when using compiler overrides

When using solidity compiler overrides for specific contracts in the hardhat config, hardhat zksync-solc only loops through the compilers config to filterSupportedOutputSelections on compiler.settings.outputSelection.

hre.config.solidity.compilers.forEach((compiler) => {

This also needs to be applied on each override hre.config.solidity.overrides, otherwise zksolc will throw with something like unknown variant evm.bytecode`

hardhat-zksync-verify is not compatible with zksolc v1.2.3

Verifying a contract compiled with zksolc v1.2.3 returns the following error:

ZkSyncVerifyPluginError: Unknown zksolc version: v1.2.3
    at SimpleTaskDefinition.verifyMinimumBuild [as action] (/xdomain/packages/zksync-dai-bridge/node_modules/@matterlabs/hardhat-zksync-verify/src/task-actions.ts:194:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Environment._runTaskDefinition (/xdomain/packages/zksync-dai-bridge/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
    at async Environment.run (/xdomain/packages/zksync-dai-bridge/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
    at async OverriddenTaskDefinition.verifyContract [as _action] (/xdomain/packages/zksync-dai-bridge/node_modules/@matterlabs/hardhat-zksync-verify/src/task-actions.ts:146:5)
    at async Environment._runTaskDefinition (/xdomain/packages/zksync-dai-bridge/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
    at async Object.Environment.run (/xdomain/packages/zksync-dai-bridge/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
    at async deployL2Contract (/xdomain/packages/zksync-dai-bridge/zksync-helpers/deploy.ts:25:7)
    at async Context.<anonymous> (/xdomain/packages/zksync-dai-bridge/test-e2e/bridge.test.ts:84:25)

A space in the path to the compiler causes a crash

At least on Windows a space in the path to the compiler (default c://users/<user>/AppData/...) causes compilation to crash without explanation. Most likely, you forgot to wrap the path in quotes somewhere.

Error in plugin @matterlabs/hardhat-zksync-solc: Docker Desktop is not running.

When I want to compile contracts, I keep getting Docker Desktop is not running, even though it's running. I don't know how to diagnose this further.

OS: Pop!_OS 22.04 LTS
Docker version 20.10.21, build baeda1f
hardhat: "^2.9.6",

stack trace:

Error in plugin @matterlabs/hardhat-zksync-solc: Docker Desktop is not running.
Please open it and wait until it finishes booting.

NomicLabsHardhatPluginError: Docker Desktop is not running.
Please open it and wait until it finishes booting.
    at pluginError (/home/spsina/dev/unitap/funds-manager/node_modules/@matterlabs/hardhat-zksync-solc/src/utils.ts:12:12)
    at handleCommonErrors (/home/spsina/dev/unitap/funds-manager/node_modules/@matterlabs/hardhat-zksync-solc/src/compile/docker.ts:157:30)
    at async createDocker (/home/spsina/dev/unitap/funds-manager/node_modules/@matterlabs/hardhat-zksync-solc/src/compile/docker.ts:87:12)
    at async Function.initialize (/home/spsina/dev/unitap/funds-manager/node_modules/@matterlabs/hardhat-zksync-solc/src/compile/index.ts:50:24)
    at async compile (/home/spsina/dev/unitap/funds-manager/node_modules/@matterlabs/hardhat-zksync-solc/src/compile/index.ts:23:20)
    at async OverriddenTaskDefinition._action (/home/spsina/dev/unitap/funds-manager/node_modules/@matterlabs/hardhat-zksync-solc/src/index.ts:132:12)
    at async Environment._runTaskDefinition (/home/spsina/dev/unitap/funds-manager/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
    at async Environment.run (/home/spsina/dev/unitap/funds-manager/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
    at async SimpleTaskDefinition.action (/home/spsina/dev/unitap/funds-manager/node_modules/hardhat/src/builtin-tasks/compile.ts:700:18)
    at async Environment._runTaskDefinition (/home/spsina/dev/unitap/funds-manager/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)

    Caused by: Error
        at Function.create (/home/spsina/dev/unitap/funds-manager/node_modules/@nomiclabs/hardhat-docker/src/hardhat-docker.ts:28:13)
        at async handleCommonErrors (/home/spsina/dev/unitap/funds-manager/node_modules/@matterlabs/hardhat-zksync-solc/src/compile/docker.ts:154:16)
        at async createDocker (/home/spsina/dev/unitap/funds-manager/node_modules/@matterlabs/hardhat-zksync-solc/src/compile/docker.ts:87:12)
        at async Function.initialize (/home/spsina/dev/unitap/funds-manager/node_modules/@matterlabs/hardhat-zksync-solc/src/compile/index.ts:50:24)
        at async compile (/home/spsina/dev/unitap/funds-manager/node_modules/@matterlabs/hardhat-zksync-solc/src/compile/index.ts:23:20)
        at async OverriddenTaskDefinition._action (/home/spsina/dev/unitap/funds-manager/node_modules/@matterlabs/hardhat-zksync-solc/src/index.ts:132:12)
        at async Environment._runTaskDefinition (/home/spsina/dev/unitap/funds-manager/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
        at async Environment.run (/home/spsina/dev/unitap/funds-manager/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
        at async SimpleTaskDefinition.action (/home/spsina/dev/unitap/funds-manager/node_modules/hardhat/src/builtin-tasks/compile.ts:700:18)
        at async Environment._runTaskDefinition (/home/spsina/dev/unitap/funds-manager/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)

I can't verify the zkSync Era contract.

I am using: yarn hardhat verify --network zkSyncMainnet [contract address]

However, I am getting an error:

Error: Axios error (code: ERR_BAD_REQUEST) during the contract verification request. Reason: There is no deployed contract on this address.

How to Deploy an Upgradeable Smart Contract using hardhat-zksync-deploy

I can easily deploy an upgradeable SC with hardhat in other EVM platform with code

  import { upgrades } from "hardhat";

  const Proxy = await ethers.getContractFactory("Proxy");
  const proxy= await upgrades.deployProxy(
    Proxy,
    [
      params,
    ],
    {
      initializer: "initialize",
    }
  );

How can I do the same on zksync, could anyone give me an example about upgradeable SC or Is there a method on @matterlabs/hardhat-zksync-deploy that does it?
Such as:

  import {Deployer} from '@matterlabs/hardhat-zksync-deploy';

  const Proxy= await deployer.loadArtifact('Proxy');
  const proxy = await deployer.deployProxy(Proxy, [params]);

stack overflow when run compile

hardhat compile

zkSyncTestnet
Compiling 70 Solidity files
An unexpected error occurred:

Error: Command failed: /home/xxx/.cache/hardhat-nodejs/compilers-v2/zksolc/zksolc-v1.3.5 --standard-json --solc /home/xxx/.cache/hardhat-nodejs/compilers-v2/linux-amd64/solc-linux-amd64-v0.7.6+commit.7338295f
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

thread '' has overflowed its stack
fatal runtime error: stack overflow

at ChildProcess.exithandler (node:child_process:412:12)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1091:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) {

code: null,
killed: false,
signal: 'SIGABRT',
cmd: '/home/xxx/.cache/hardhat-nodejs/compilers-v2/zksolc/zksolc-v1.3.5 --standard-json --solc /home/xxx/.cache/hardhat-nodejs/compilers-v2/linux-amd64/solc-linux-amd64-v0.7.6+commit.7338295f'
}

language missing on package.json

I'm getting the following error on the console after running: yarn hardhat compile

Error in plugin @matterlabs/hardhat-zksync-solc: Json(Error("missing field language", line: 1, column: 70))

I added the "language" prop to the package.json and now it compiles.

"language": "english"

Just wanted to share :)

The code hash is not known

trying to deploy https://app.para.space to zksync (goerli), I work on this PR: para-space/paraspace-core#393. Although most of the contracts work, I do get some strange error like:

The code hash is not known

while calling PoolAddressProvider#updatePoolImpl: https://github.com/para-space/paraspace-core/blob/c0931e1a35d6ba4c6c978ee14fca2e42cab6be86/contracts/protocol/configuration/PoolAddressesProvider.sol#L105-L113

    await waitForTx(
      await addressesProvider.updatePoolImpl(
        [
          {
            implAddress: poolParameters.address,
            action: 0,
            functionSelectors: poolParametersSelectors,
          },
        ],
        ZERO_ADDRESS,
        "0x",
        GLOBAL_OVERRIDES
      )
    );

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.