Forrest logo
tool overview
On this page you find all important commands for the CLI tool hardhat. If the command you are looking for is missing please ask our AI.

hardhat

Hardhat is a powerful command line tool specifically built for Ethereum developers and smart contract development. It helps streamline the development workflow by automating various tasks and providing essential tools.

Firstly, Hardhat offers a development environment that allows developers to set up an Ethereum network locally for testing and debugging purposes. This local network closely resembles the Ethereum mainnet or testnets, enabling efficient smart contract development and testing.

Secondly, it provides a comprehensive testing framework that enables developers to write and run tests for their smart contracts. This framework supports both JavaScript and Solidity testing, making it easier to ensure the correctness and robustness of contracts.

Thirdly, Hardhat facilitates smart contract compilation by providing a built-in Solidity compiler. It automatically compiles contracts into bytecode, which can then be deployed on Ethereum networks.

Fourthly, it includes powerful debugging tools that simplify the process of finding and fixing issues in smart contracts. Developers can leverage these tools, such as console.log and stack traces, to identify and resolve bugs quickly.

Fifthly, Hardhat integrates well with other popular Ethereum tools and frameworks, such as Ganache, Metamask, and Truffle. This interoperability allows developers to seamlessly migrate their existing projects to Hardhat or combine its functionality with other tools.

Sixthly, it offers a built-in task runner that allows developers to define and execute custom tasks. These tasks automate various development activities, such as contract deployment, testing, and network management.

Seventhly, Hardhat provides advanced support for plugin development, allowing developers to extend its functionality according to their specific needs. This extensibility enables the creation of custom plugins tailored to individual project requirements.

Eighthly, it integrates with popular JavaScript testing frameworks like Mocha and Jest, making it easier for developers to write tests with familiar syntax and assertions.

Ninthly, Hardhat offers a built-in Ethereum network timestamp manipulation feature. Developers can alter the timestamp in their local network, enabling testing of time-sensitive features like time-based unlock mechanisms.

Lastly, Hardhat ensures security and reliability by providing built-in tasks and plugins for smart contract code analysis and verification. These features help identify potential vulnerabilities and ensure safe development practices are followed.

List of commands for hardhat:

  • hardhat:tldr:004e9 hardhat: Clean the cache and all artifacts.
    $ hardhat clean
    try on your machine
    explain this command
  • hardhat:tldr:191e4 hardhat: List available subcommands (or create a new project if no configuration exists).
    $ hardhat
    try on your machine
    explain this command
  • hardhat:tldr:5875a hardhat: Start a local Ethereum JSON-RPC node with a specific hostname and port.
    $ hardhat node --hostname ${hostname} --port ${port}
    try on your machine
    explain this command
  • hardhat:tldr:8af57 hardhat: Compile the current project and build all artifacts.
    $ hardhat compile
    try on your machine
    explain this command
  • hardhat:tldr:a4471 hardhat: Run all given test files.
    $ hardhat test ${filename1-js} ${filename2-js}
    try on your machine
    explain this command
  • hardhat:tldr:a84f9 hardhat: Run Mocha tests.
    $ hardhat test
    try on your machine
    explain this command
  • hardhat:tldr:c7815 hardhat: Run a user-defined script after compiling the project.
    $ hardhat run ${path-to-script-js}
    try on your machine
    explain this command
  • hardhat:tldr:cb947 hardhat: Start a local Ethereum JSON-RPC node for development.
    $ hardhat node
    try on your machine
    explain this command
tool overview