This section provides detailed information about various Hardhat tasks defined in our project. These tasks are essential for managing and interacting with our EVM blockchain and smart contracts.
The deployEns
task is responsible for deploying an ENS (Ethereum Name Service) registry. It checks if an existing ENS registry is deployed and uses it; otherwise, it deploys a new ENS registry. Additionally, it sets up a public resolver and a reverse registrar for the ENS system.
This task does not require any parameters and can be executed simply with the command:
npx hardhat deployEns
The deployModule
task is responsible for deploying a module according to its manifest. This task reads the manifest file located at the specified module path and deploys the contracts as defined in the manifest.
To use this task, you need to provide the absolute path to the module. Optionally, you can specify whether to redeploy the root contract and a list of contracts to be deployed.
npx hardhat deployModule --modulePath <module_path> [--deployRoot] [<deploy>...]
To effectively structure a module for deployment using our EVM blockchain backend and the manifest file, follow these guidelines:
The manifest file (manifest.json
) plays a crucial role in defining how a module should be deployed. Its structure is as follows:
name
: The unique name of your module.source
: The main source file for the module.args
: Arguments to pass to the module's constructor.deploy
: An object containing deployment configurations for different components of the module.
Each key under deploy
represents a component of the module, with the following properties:
source
: The source file for this specific component.args
: Arguments for the component's constructor.ownSubdomain
: A boolean indicating whether this component should have its own subdomain.
The module should be organized in a specific folder structure:
contracts/
: Contains all Solidity contract files.artifacts/
: Generated by Hardhat; includes compiled contract JSON files.scripts/
: Contains deployment scripts and other useful scripts.tests/
: Includes tests for the contracts.manifest.json
: The manifest file as described above.
- myModule/
- contracts/
- MyContract.sol
- artifacts/
- MyContract.json
- scripts/
- deploy.js
- tests/
- myContract.test.js
- manifest.json
- contracts/
By adhering to this structure and manifest file semantics, you ensure a smooth deployment process of your module on the local blockchain backend.