Learn how to test your smart contracts using Hardhat.
Update Hardhat configuration
zksolc
, as outlined in the installation guide:Install zksync-ethers
Write test definitions
/test
directory, for example, test/HelloWorld.test.ts
.Add a deployer private key
DEPLOYER_PRIVATE_KEY
that contains the private key of a wallet you want to deploy the contract from.DEPLOYER_PRIVATE_KEY
when using a local node.Run the tests
Run a local node
anvil-zksync
option when prompted:Add the local node as a Hardhat network
Update the deployer private key configuration variable
DEPLOYER_PRIVATE_KEY
configuration variable to use one of the pre-funded rich wallet private keys.DEPLOYER_PRIVATE_KEY
when using a local node.Run the tests
stuff slice staff easily soup parent arm payment cotton trade scatter struggle