This project was scaffolded with zksync-cli.
/contracts: smart contracts./deploy: deployment and contract interaction scripts./test: test fileshardhat.config.ts: configuration file.
yarn hardhat compilewill compile the contracts.yarn run deploywill execute the deployment script/deploy/deploy.ts. Requires environment variable setup.yarn run usewill execute the script/deploy/use.tswhich interacts with the Greeter contract deployed.yarn test: run tests. Check test requirements below.
Both yarn run deploy and yarn run greet are configured in the package.json file and run yarn hardhat deploy-zksync.
In order to prevent users to leak private keys, this project includes the dotenv package which is used to load environment variables. It's used to load the wallet private key, required to run the deploy script.
To use it, rename .env.example to .env and enter your private key.
WALLET_PRIVATE_KEY=123cde574ccff....
In order to run test, you need to start the zkSync local environment. Please check this section of the docs which contains all the details.
If you do not start the zkSync local environment, the tests will fail with error Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.2)