1

I have a test file for testing an upgradable smart contract on zkSync by looking at the docs here. I'm getting a typescript error on this line

await hre.zkUpgrades.deployProxy(deployer.zkWallet, contract, [42]).then((r) => r.deployed());

error

Property 'zkUpgrades' does not exist on type 'HardhatRuntimeEnvironment'.ts(2339)

The code runs fine but how do I get rid of the typescript complaint.

1 Answer 1

1

The issue was with the hardhat.config.ts file. The HardhatUserConfig was imported before the upgradable plugin, but it should be imported after the plugin is imported.

Before

.
.
import { HardhatUserConfig } from "hardhat/types";
.
import "@matterlabs/hardhat-zksync-upgradable";

.
.
.

After

.
.
import "@matterlabs/hardhat-zksync-upgradable";
.
import { HardhatUserConfig } from "hardhat/types";

.
.
.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.