From a2c1ff101c8e649a47d933c4eb6e8879e6900c12 Mon Sep 17 00:00:00 2001 From: Patricio Palladino Date: Wed, 23 Jun 2021 15:23:20 -0300 Subject: [PATCH] Use --prose-wrap=never in prettier --- docs/advanced/building-plugins.md | 30 ++---- docs/advanced/migrating-buidler-plugin.md | 29 ++---- docs/config/README.md | 29 ++---- docs/errors/buidler-errors.md | 28 ++---- docs/getting-started/README.md | 19 ++-- docs/guides/compile-contracts.md | 4 +- docs/guides/create-task.md | 3 +- docs/guides/deploying.md | 12 +-- docs/guides/ganache-tests.md | 10 +- docs/guides/hardhat-console.md | 3 +- docs/guides/migrate-from-buidler.md | 44 +++------ docs/guides/scripts.md | 13 +-- docs/guides/shorthand.md | 6 +- docs/guides/truffle-migration.md | 26 ++--- docs/guides/typescript.md | 24 ++--- docs/guides/vscode-tests.md | 9 +- docs/guides/waffle-testing.md | 47 +++------ docs/hardhat-network/README.md | 96 ++++++------------- docs/metamask-issue.md | 3 +- docs/package.json | 4 +- docs/reference/solidity-support.md | 22 ++--- docs/troubleshooting/common-problems.md | 3 +- .../creating-a-new-hardhat-project.md | 8 +- docs/tutorial/deploying-to-a-live-network.md | 6 +- .../tutorial/hackathon-boilerplate-project.md | 6 +- docs/tutorial/testing-contracts.md | 4 +- .../writing-and-compiling-contracts.md | 12 +-- packages/common/package.json | 4 +- packages/e2e/README.md | 3 +- packages/e2e/package.json | 4 +- packages/hardhat-core/README.md | 4 +- packages/hardhat-core/package.json | 4 +- .../hardhat-core/sample-project/LICENSE.md | 18 +--- .../hardhat/README.md | 3 +- .../0_6/revert-without-message/README.md | 6 +- packages/hardhat-docker/package.json | 4 +- packages/hardhat-ethers/README.md | 9 +- packages/hardhat-ethers/package.json | 4 +- packages/hardhat-etherscan/README.md | 3 +- packages/hardhat-etherscan/package.json | 4 +- packages/hardhat-ganache/README.md | 12 +-- packages/hardhat-ganache/package.json | 4 +- packages/hardhat-shorthand/README.md | 3 +- packages/hardhat-shorthand/package.json | 4 +- packages/hardhat-solhint/README.md | 3 +- packages/hardhat-solhint/package.json | 4 +- packages/hardhat-solpp/README.md | 3 +- packages/hardhat-solpp/package.json | 4 +- packages/hardhat-truffle4/README.md | 3 +- packages/hardhat-truffle4/package.json | 4 +- packages/hardhat-truffle5/README.md | 6 +- packages/hardhat-truffle5/package.json | 4 +- packages/hardhat-vyper/README.md | 9 +- packages/hardhat-vyper/package.json | 4 +- packages/hardhat-waffle/README.md | 15 +-- packages/hardhat-waffle/package.json | 4 +- packages/hardhat-web3-legacy/README.md | 3 +- packages/hardhat-web3-legacy/package.json | 4 +- packages/hardhat-web3/README.md | 3 +- packages/hardhat-web3/package.json | 4 +- 60 files changed, 207 insertions(+), 463 deletions(-) diff --git a/docs/advanced/building-plugins.md b/docs/advanced/building-plugins.md index ce0a5d2ea5..437f62b463 100644 --- a/docs/advanced/building-plugins.md +++ b/docs/advanced/building-plugins.md @@ -1,32 +1,20 @@ # Building plugins -In this section, we will explore the creation of plugins for Hardhat, which are the key component -for integrating other tools and extending the built-in functionality. +In this section, we will explore the creation of plugins for Hardhat, which are the key component for integrating other tools and extending the built-in functionality. ## What exactly are plugins in Hardhat? -Plugins are bits of reusable configuration. Anything that you can do in a plugin, can -also be done in your config file. You can test your ideas in a config file, and move -them into a plugin when ready. +Plugins are bits of reusable configuration. Anything that you can do in a plugin, can also be done in your config file. You can test your ideas in a config file, and move them into a plugin when ready. -When developing a plugin the main tools available to integrate new functionality are extending the -[Hardhat Runtime Environment](/advanced/hardhat-runtime-environment.md), extending the Hardhat config, defining new tasks and -overriding existing ones, which are all configuration actions achieved through code. +When developing a plugin the main tools available to integrate new functionality are extending the [Hardhat Runtime Environment](/advanced/hardhat-runtime-environment.md), extending the Hardhat config, defining new tasks and overriding existing ones, which are all configuration actions achieved through code. -Some examples of things you could achieve by creating a plugin are running a linter when -the `check` task runs, using different compiler versions for different files or -generating an UML diagram for your contracts. +Some examples of things you could achieve by creating a plugin are running a linter when the `check` task runs, using different compiler versions for different files or generating an UML diagram for your contracts. ## Extending the Hardhat Runtime Environment -Let’s go through the process of creating a plugin that adds new functionality to the Hardhat Runtime Environment. -By doing this, we make sure our new feature is available everywhere. This means your plugin users can access it from -tasks, tests, scripts, and the Hardhat console. +Let’s go through the process of creating a plugin that adds new functionality to the Hardhat Runtime Environment. By doing this, we make sure our new feature is available everywhere. This means your plugin users can access it from tasks, tests, scripts, and the Hardhat console. -The Hardhat Runtime Environment (HRE) is configured through a queue of extension functions -that you can add to using the `extendEnvironment()` function. It receives one parameter which is a callback which will be executed -after the HRE is initialized. If `extendEnvironment` is called multiple times, its -callbacks will be executed in order. +The Hardhat Runtime Environment (HRE) is configured through a queue of extension functions that you can add to using the `extendEnvironment()` function. It receives one parameter which is a callback which will be executed after the HRE is initialized. If `extendEnvironment` is called multiple times, its callbacks will be executed in order. For example, adding the following to `hardhat.config.js`: @@ -57,15 +45,13 @@ $ npx hardhat envtest Hello, Hardhat! ``` -This is literally all it takes to put together a plugin for Hardhat. Now `hi` is available to be used in -the Hardhat console, your tasks, tests and other plugins. +This is literally all it takes to put together a plugin for Hardhat. Now `hi` is available to be used in the Hardhat console, your tasks, tests and other plugins. ## Using the Hardhat TypeScript plugin boilerplate For a complete example of a plugin you can take a look at the [Hardhat TypeScript plugin boilerplate project](https://github.com/nomiclabs/hardhat-ts-plugin-boilerplate/). -Plugins don't need to be written in TypeScript, but we recommend doing it, as many of our users use it. Creating a plugin in -JavaScript can lead to a subpar experience for them. +Plugins don't need to be written in TypeScript, but we recommend doing it, as many of our users use it. Creating a plugin in JavaScript can lead to a subpar experience for them. ### Extending the HRE diff --git a/docs/advanced/migrating-buidler-plugin.md b/docs/advanced/migrating-buidler-plugin.md index 5797e93669..623f98ee03 100644 --- a/docs/advanced/migrating-buidler-plugin.md +++ b/docs/advanced/migrating-buidler-plugin.md @@ -18,8 +18,7 @@ import { extendEnvironment } from "hardhat/config"; ### Plugins -Similarly, references to Buidler plugins should be replaced with their corresponding Hardhat plugins. -For example, `@nomiclabs/buidler-ethers` would be `@nomiclabs/hardhat-ethers`. +Similarly, references to Buidler plugins should be replaced with their corresponding Hardhat plugins. For example, `@nomiclabs/buidler-ethers` would be `@nomiclabs/hardhat-ethers`. ## Adapting your plugin's source code @@ -87,8 +86,7 @@ Then, you need to add an `import "./type-extensions";` in your `src/index.ts` fi ### Extending Hardhat types -Hardhat types are meant to be imported from `hardhat/types`, but when extending them, -you should import them from the module that declares them. +Hardhat types are meant to be imported from `hardhat/types`, but when extending them, you should import them from the module that declares them. For example, if you want you use the `HardhatRuntimeEnvironment` type, you should import it with: @@ -96,8 +94,7 @@ For example, if you want you use the `HardhatRuntimeEnvironment` type, you shoul import { HardhatRuntimeEnvironment } from "hardhat/types"; ``` -But if you want to extend it, you should import the module that declares it -instead, which is `hardhat/types/runtime`. +But if you want to extend it, you should import the module that declares it instead, which is `hardhat/types/runtime`. ```typescript import "hardhat/types/runtime"; @@ -113,29 +110,17 @@ declare module "hardhat/types/runtime" { Config types are handled slightly differently in Hardhat. -For each config element/type, there's two Typescript types defined. One -that ends with `UserConfig`, that represents the user's input, and another -one that ends with just `Config`, which represents the configuration values -after any resolution and default values have been applied. The first kind of -types is used by users when writing their config. The second one is used -during the execution of tasks, tests and scripts, and is present in the -Hardhat Runtime Environment. +For each config element/type, there's two Typescript types defined. One that ends with `UserConfig`, that represents the user's input, and another one that ends with just `Config`, which represents the configuration values after any resolution and default values have been applied. The first kind of types is used by users when writing their config. The second one is used during the execution of tasks, tests and scripts, and is present in the Hardhat Runtime Environment. -For example, `HardhatUserConfig` represents the entire config written by the -user, and all of its fields are optional. `HardhatConfig`, is the result -of resolving/normalizing it, and applying default values. None of its fields -are optional. +For example, `HardhatUserConfig` represents the entire config written by the user, and all of its fields are optional. `HardhatConfig`, is the result of resolving/normalizing it, and applying default values. None of its fields are optional. Some types have been renamed to match this new pattern: - `ProjectPaths` is now `ProjectPathsUserConfig` - `Networks` is now `NetworksUserConfig` -- Both have their resolved versions: `ProjectPathsConfig` and - `NetworksConfig`, respectively. +- Both have their resolved versions: `ProjectPathsConfig` and `NetworksConfig`, respectively. -You can find an example of how to properly extend these types, -resolve/normalize the users's config, and apply default values in the -`src/type-extensions.ts` and `src/index.ts` files. +You can find an example of how to properly extend these types, resolve/normalize the users's config, and apply default values in the `src/type-extensions.ts` and `src/index.ts` files. ### How type extensions are loaded in Hardhat diff --git a/docs/config/README.md b/docs/config/README.md index f49d98f987..559ccec963 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -1,7 +1,6 @@ # Configuration -When Hardhat is run, it searches for the closest `hardhat.config.js` file starting -from the Current Working Directory. This file normally lives in the root of your project. An empty `hardhat.config.js` is enough for Hardhat to work. +When Hardhat is run, it searches for the closest `hardhat.config.js` file starting from the Current Working Directory. This file normally lives in the root of your project. An empty `hardhat.config.js` is enough for Hardhat to work. The entirety of your Hardhat setup (i.e. your config, plugins and custom tasks) is contained in this file. @@ -47,19 +46,15 @@ module.exports = { The `networks` config field is an optional object where network names map to their configuration. -There are two kinds of networks in Hardhat: [JSON-RPC](https://eth.wiki/json-rpc/API) based networks, -and the built-in Hardhat Network. +There are two kinds of networks in Hardhat: [JSON-RPC](https://eth.wiki/json-rpc/API) based networks, and the built-in Hardhat Network. You can customize which network is used by default when running Hardhat by setting the config's `defaultNetwork` field. If you omit this config, its default value is `"hardhat"`. ### Hardhat Network -Hardhat comes built-in with a special network called `hardhat`. When using this network, -an instance of the [Hardhat Network](../hardhat-network/README.md) will be automatically created when you run a task, script or test your smart contracts +Hardhat comes built-in with a special network called `hardhat`. When using this network, an instance of the [Hardhat Network](../hardhat-network/README.md) will be automatically created when you run a task, script or test your smart contracts -Hardhat Network has first-class support of Solidity. It always knows which -smart contracts are being run and knows exactly what they do and why -they fail. Learn more about it [here](../hardhat-network/README.md). +Hardhat Network has first-class support of Solidity. It always knows which smart contracts are being run and knows exactly what they do and why they fail. Learn more about it [here](../hardhat-network/README.md). You can set the following fields on the `hardhat` config: @@ -89,17 +84,10 @@ You can set the following fields on the `hardhat` config: - `hardfork`: This setting changes how Hardhat Network works, to mimic Ethereum's mainnet at a given hardfork. It must be one of `"byzantium"`, `"constantinople"`, `"petersburg"`, `"istanbul"`, `"muirGlacier"`, and `"berlin"`. Default value: `"berlin"` -- `throwOnTransactionFailures`: A boolean that controls if Hardhat Network throws on transaction failures. - If this value is `true`, Hardhat Network will throw [combined JavaScript and Solidity stack traces](../hardhat-network/README.md#solidity-stack-traces) - on transaction failures. If it is `false`, it will return the failing transaction hash. In both cases - the transactions are added into the blockchain. Default value: `true` -- `throwOnCallFailures`: A boolean that controls if Hardhat Network throws on call failures. - If this value is `true`, Hardhat Network will throw [combined JavaScript and Solidity stack traces](../hardhat-network/README.md#solidity-stack-traces) - when a call fails. If it is `false`, it will return the call's `return data`, which can contain - a revert reason. Default value: `true` +- `throwOnTransactionFailures`: A boolean that controls if Hardhat Network throws on transaction failures. If this value is `true`, Hardhat Network will throw [combined JavaScript and Solidity stack traces](../hardhat-network/README.md#solidity-stack-traces) on transaction failures. If it is `false`, it will return the failing transaction hash. In both cases the transactions are added into the blockchain. Default value: `true` +- `throwOnCallFailures`: A boolean that controls if Hardhat Network throws on call failures. If this value is `true`, Hardhat Network will throw [combined JavaScript and Solidity stack traces](../hardhat-network/README.md#solidity-stack-traces) when a call fails. If it is `false`, it will return the call's `return data`, which can contain a revert reason. Default value: `true` -- `loggingEnabled`: A boolean that controls if Hardhat Network logs every request or not. Default value: `false` for the - in-process Hardhat Network provider, `true` for the Hardhat Network backed JSON-RPC server (i.e. the `node` task). +- `loggingEnabled`: A boolean that controls if Hardhat Network logs every request or not. Default value: `false` for the in-process Hardhat Network provider, `true` for the Hardhat Network backed JSON-RPC server (i.e. the `node` task). - `initialDate`: An optional string setting the date of the blockchain. Valid values are [Javascript's date time strings](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#Date_Time_String_Format). Default: The current date and time. @@ -112,8 +100,7 @@ You can set the following fields on the `hardhat` config: ### JSON-RPC based networks -These are networks that connect to an external node. Nodes can be running in your computer, like Ganache, or remotely, -like Alchemy or Infura. +These are networks that connect to an external node. Nodes can be running in your computer, like Ganache, or remotely, like Alchemy or Infura. This kind of networks are configured with objects with the following fields: diff --git a/docs/errors/buidler-errors.md b/docs/errors/buidler-errors.md index f573089593..1660dfcd0d 100644 --- a/docs/errors/buidler-errors.md +++ b/docs/errors/buidler-errors.md @@ -1,7 +1,6 @@ # Buidler errors -This section contains a list of all the possible errors you may encounter when -using Buidler and an explanation of each of them. +This section contains a list of all the possible errors you may encounter when using Buidler and an explanation of each of them. ## General errors @@ -105,15 +104,13 @@ Please check that you are sending a `data` parameter. ### BDLR104: Unrecognized account -You are trying to send a transaction or sign some data with an -account not managed by your Ethereum node nor Buidler. +You are trying to send a transaction or sign some data with an account not managed by your Ethereum node nor Buidler. Please double check your accounts and the `from` parameter in your RPC calls. ### BDLR105: Missing transaction parameter -You are trying to send a transaction with a locally managed -account, and some parameters are missing. +You are trying to send a transaction with a locally managed account, and some parameters are missing. Please double check your transactions' parameters. @@ -163,9 +160,7 @@ Try using another mnemonic or deriving less keys. ### BDLR200: Could not add positional param -Could add a positional param to your task because -there is already a variadic positional param and it has to be the last -positional one. +Could add a positional param to your task because there is already a variadic positional param and it has to be the last positional one. Please double check your task definitions. @@ -195,25 +190,19 @@ Please, double check your task definitions. ### BDLR210: Attempted to add mandatory params to an overridden task -You can't add mandatory (non optional) param definitions in an overridden task. -The only supported param additions for overridden tasks are flags, -and optional params. +You can't add mandatory (non optional) param definitions in an overridden task. The only supported param additions for overridden tasks are flags, and optional params. Please, double check your task definitions. ### BDLR211: Attempted to add positional params to an overridden task -You can't add positional param definitions in an overridden task. -The only supported param additions for overridden tasks are flags, -and optional params. +You can't add positional param definitions in an overridden task. The only supported param additions for overridden tasks are flags, and optional params. Please, double check your task definitions. ### BDLR212: Attempted to add variadic params to an overridden task -You can't add variadic param definitions in an overridden task. -The only supported param additions for overridden tasks are flags, -and optional params. +You can't add variadic param definitions in an overridden task. The only supported param additions for overridden tasks are flags, and optional params. Please, double check your task definitions. @@ -263,8 +252,7 @@ Please double check your arguments. ### BDLR302: Invalid file argument -One of your tasks expected a file as an argument, but you provided a -non-existent or non-readable file. +One of your tasks expected a file as an argument, but you provided a non-existent or non-readable file. Please double check your arguments. diff --git a/docs/getting-started/README.md b/docs/getting-started/README.md index b2d4b59feb..fa1aabe186 100644 --- a/docs/getting-started/README.md +++ b/docs/getting-started/README.md @@ -12,8 +12,7 @@ A lot of Hardhat's functionality comes from plugins, and, as a developer, you're Hardhat is used through a local installation in your project. This way your environment will be reproducible, and you will avoid future version conflicts. -To install it, you need to create an npm project by going to an empty folder, running `npm init`, -and following its instructions. Once your project is ready, you should run +To install it, you need to create an npm project by going to an empty folder, running `npm init`, and following its instructions. Once your project is ready, you should run ``` npm install --save-dev hardhat @@ -25,8 +24,7 @@ To use your local installation of Hardhat, you need to use `npx` to run it (i.e. This guide will explore the basics of creating a Hardhat project. -A barebones installation with no plugins allows you to create your own tasks, compile your Solidity code, -run your tests and run Hardhat Network, a local development network you can deploy your contracts to. +A barebones installation with no plugins allows you to create your own tasks, compile your Solidity code, run your tests and run Hardhat Network, a local development network you can deploy your contracts to. To create your Hardhat project run `npx hardhat` in your project folder: @@ -49,14 +47,11 @@ Welcome to Hardhat v2.0.8 Quit ``` -Let’s create the sample project and go through these steps to try out the sample task and compile, test -and deploy the sample contract. +Let’s create the sample project and go through these steps to try out the sample task and compile, test and deploy the sample contract. The sample project will ask you to install `hardhat-waffle` and `hardhat-ethers`, which makes Hardhat compatible with tests built with Waffle. You can learn more about it [in this guide](../guides/waffle-testing.md). -::: tip -Hardhat will let you know how, but, in case you missed it, you can install them with `npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers` -::: +::: tip Hardhat will let you know how, but, in case you missed it, you can install them with `npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers` ::: ### Running tasks @@ -168,8 +163,7 @@ Changing greeting from 'Hello, world!' to 'Hola, mundo!' ### Deploying your contracts -Next, to deploy the contract we will use a Hardhat script. -Inside `scripts/` you will find `sample-script.js` with the following code: +Next, to deploy the contract we will use a Hardhat script. Inside `scripts/` you will find `sample-script.js` with the following code: <<< @/../packages/hardhat-core/sample-project/scripts/sample-script.js @@ -206,5 +200,4 @@ npx hardhat run scripts/sample-script.js --network localhost Congrats! You have created a project, ran a Hardhat task, compiled a smart contract, installed a Waffle integration plugin, wrote and ran a test using the Waffle and ethers.js plugins, and deployed a contract. -For any questions or feedback you may have, you can find us in the [Hardhat Discord -server](https://hardhat.org/discord). +For any questions or feedback you may have, you can find us in the [Hardhat Discord server](https://hardhat.org/discord). diff --git a/docs/guides/compile-contracts.md b/docs/guides/compile-contracts.md index 04dbf445c0..cf41f5c7e3 100644 --- a/docs/guides/compile-contracts.md +++ b/docs/guides/compile-contracts.md @@ -31,9 +31,7 @@ module.exports = { We recommend always setting a compiler version to avoid unexpected behavior or compiling errors as new releases of Solidity are published. -:::: warning -Hardhat will automatically download the versions of `solc` that you set up. If you are behind an HTTP proxy, you may need to set the `HTTP_PROXY` or `HTTPS_PROXY` environment variable to the URL of your proxy. -:::: +:::: warning Hardhat will automatically download the versions of `solc` that you set up. If you are behind an HTTP proxy, you may need to set the `HTTP_PROXY` or `HTTPS_PROXY` environment variable to the URL of your proxy. :::: The expanded usage allows for more control of the compiler: diff --git a/docs/guides/create-task.md b/docs/guides/create-task.md index ad26ae8448..2adaf36877 100644 --- a/docs/guides/create-task.md +++ b/docs/guides/create-task.md @@ -316,5 +316,4 @@ subtask("print", "Prints a message") }); ``` -For any questions or feedback you may have, you can find us in the [Hardhat Discord -server](https://hardhat.org/discord). +For any questions or feedback you may have, you can find us in the [Hardhat Discord server](https://hardhat.org/discord). diff --git a/docs/guides/deploying.md b/docs/guides/deploying.md index d60a7085bc..302b93d6b2 100644 --- a/docs/guides/deploying.md +++ b/docs/guides/deploying.md @@ -1,13 +1,8 @@ # Deploying your contracts -When it comes to deploying, there are no plugins that implement -a deployment system for Hardhat yet, but there's -[an open issue](https://github.com/nomiclabs/hardhat/issues/381) -with some ideas and we'd value your opinion on how to best design it. +When it comes to deploying, there are no plugins that implement a deployment system for Hardhat yet, but there's [an open issue](https://github.com/nomiclabs/hardhat/issues/381) with some ideas and we'd value your opinion on how to best design it. -In the meantime, we recommend deploying your smart contracts using -scripts. You can deploy the `Greeter` contract from the sample project -with a deploy script `scripts/deploy.js` like the above one: +In the meantime, we recommend deploying your smart contracts using scripts. You can deploy the `Greeter` contract from the sample project with a deploy script `scripts/deploy.js` like the above one: ```js async function main() { @@ -42,7 +37,6 @@ As general rule, you can target any network configured in the `hardhat.config.js ### Truffle migrations support -You can use Hardhat alongside Truffle if you want to use its migration system. -Your contracts written using Hardhat will just work with Truffle. +You can use Hardhat alongside Truffle if you want to use its migration system. Your contracts written using Hardhat will just work with Truffle. All you need to do is install Truffle and follow their [migrations guide](https://www.trufflesuite.com/docs/truffle/getting-started/running-migrations). diff --git a/docs/guides/ganache-tests.md b/docs/guides/ganache-tests.md index 57dbb92a8f..7e37007519 100644 --- a/docs/guides/ganache-tests.md +++ b/docs/guides/ganache-tests.md @@ -1,8 +1,6 @@ # Running tests with Ganache -We recommend using the built-in [Hardhat Network](../hardhat-network/README.md) network to test your -smart contracts, as it generates [combined JavaScript and Solidity stack traces](../hardhat-network/README.md#solidity-stack-traces), -making debugging easier. +We recommend using the built-in [Hardhat Network](../hardhat-network/README.md) network to test your smart contracts, as it generates [combined JavaScript and Solidity stack traces](../hardhat-network/README.md#solidity-stack-traces), making debugging easier. If you still want to run your tests using Ganache, you can do it in two ways. @@ -18,11 +16,9 @@ npx hardhat --network localhost test ## Using the `hardhat-ganache` plugin -If you don't want to manually start and stop Ganache every time, you can use -the `hardhat-ganache` plugin. +If you don't want to manually start and stop Ganache every time, you can use the `hardhat-ganache` plugin. -This plugin creates a network called `ganache`, and automatically -starts and stops Ganache before and after running your tests and scripts. +This plugin creates a network called `ganache`, and automatically starts and stops Ganache before and after running your tests and scripts. To use it, you have to install it with `npm` diff --git a/docs/guides/hardhat-console.md b/docs/guides/hardhat-console.md index 1f0dda9ebf..b1aa44e6a7 100644 --- a/docs/guides/hardhat-console.md +++ b/docs/guides/hardhat-console.md @@ -65,8 +65,7 @@ You will also notice that the console has the handy history feature you expect o ### Asynchronous operations and top-level await -Interacting with the Ethereum network and your smart contracts are asynchronous operations, hence most APIs and libraries -use JavaScript's `Promise` for returning values. +Interacting with the Ethereum network and your smart contracts are asynchronous operations, hence most APIs and libraries use JavaScript's `Promise` for returning values. To make things easier, Hardhat's console supports `await` top-level await (i.e. `console.log(await web3.eth.getBalance()`). To use this feature, you need to be using Node 10 or higher. diff --git a/docs/guides/migrate-from-buidler.md b/docs/guides/migrate-from-buidler.md index fac3a40310..fa9712b6ec 100644 --- a/docs/guides/migrate-from-buidler.md +++ b/docs/guides/migrate-from-buidler.md @@ -8,8 +8,7 @@ This guide will teach you how to migrate your project from Buidler into Hardhat. The first thing you need to do to migrate your project, is installing the new npm packages. -The package `@nomiclabs/buidler` is now `hardhat`. The plugins, which used to have package names like `@nomiclabs/buidler-`, -are now `@nomiclabs/hardhat-`. +The package `@nomiclabs/buidler` is now `hardhat`. The plugins, which used to have package names like `@nomiclabs/buidler-`, are now `@nomiclabs/hardhat-`. For example, if you were using `@nomiclabs/buidler` and `@nomiclabs/buidler-ethers`, you need to run: @@ -17,8 +16,7 @@ For example, if you were using `@nomiclabs/buidler` and `@nomiclabs/buidler-ethe npm install --save-dev hardhat @nomiclabs/hardhat-ethers ``` -If you were using a global installation of Buidler, you also need to install Hardhat locally. -Global installations of Hardhat are not supported. +If you were using a global installation of Buidler, you also need to install Hardhat locally. Global installations of Hardhat are not supported. ## Adapting your config @@ -26,13 +24,11 @@ You can use your Buidler config in Hardhat mostly unchanged. All you need to do ### Renaming your config file -First, you need to rename your config file from `buidler.config.js` to `hardhat.config.js`. Or, -if you are using TypeScript, from `buidler.config.ts` to `hardhat.config.ts`. +First, you need to rename your config file from `buidler.config.js` to `hardhat.config.js`. Or, if you are using TypeScript, from `buidler.config.ts` to `hardhat.config.ts`. ### Changing how your plugins are loaded -Then, you have to change how your plugins are loaded. Instead of using the `usePlugin` function, you just -have to require/import their npm package. For example, if you had +Then, you have to change how your plugins are loaded. Instead of using the `usePlugin` function, you just have to require/import their npm package. For example, if you had ```js usePlugin("@nomiclabs/buidler-ethers"); @@ -50,14 +46,11 @@ Or, if you are using TypeScript, with import "@nomiclabs/hardhat-ethers"; ``` -If you were importing the `usePlugin` function explicitly, you also need to remove that import, as the -function doesn't exist anymore. +If you were importing the `usePlugin` function explicitly, you also need to remove that import, as the function doesn't exist anymore. ### Configuring Hardhat Network -Buidler EVM is now Hardhat Network, so if you are customizing it using the `buidlerevm` network config field, -you need to rename it to `hardhat`. You can learn more about how to customize it, including enabling the Mainnet Forking -functionality, [here](../config/README.md#hardhat-network). +Buidler EVM is now Hardhat Network, so if you are customizing it using the `buidlerevm` network config field, you need to rename it to `hardhat`. You can learn more about how to customize it, including enabling the Mainnet Forking functionality, [here](../config/README.md#hardhat-network). For example, if you had something like this in your config: @@ -81,8 +74,7 @@ networks: { ### Updating your Solidity config -Hardhat has native support for multiple versions of Solidity. This requires a few changes in how you customize your -`solc` setup. +Hardhat has native support for multiple versions of Solidity. This requires a few changes in how you customize your `solc` setup. If you had something like this in your config: @@ -108,25 +100,21 @@ solidity: { } ``` -This is a very simple config, but Hardhat supports arbitrarily complex compilation setups, -down to the individual file level. Take a look at [this guide](./compile-contracts.md) to learn more about it. +This is a very simple config, but Hardhat supports arbitrarily complex compilation setups, down to the individual file level. Take a look at [this guide](./compile-contracts.md) to learn more about it. ## TypeScript support changes -Hardhat enables its TypeScript support when your config is written in TypeScript and ends in `.ts`. If you were using -TypeScript, but a JavaScript config, please take a look at [this guide](./typescript.md). +Hardhat enables its TypeScript support when your config is written in TypeScript and ends in `.ts`. If you were using TypeScript, but a JavaScript config, please take a look at [this guide](./typescript.md). You don't need a `tsconfig.json` file with Hardhat. We recommend you delete it. -If you prefer to keep it, you should base it on the template presented [here](./typescript.md#customizing-typescript-with-a-tsconfig-json-file). Just make -sure you removed all the `type-extension.d.ts` files, and keep your config file in your `files` field. +If you prefer to keep it, you should base it on the template presented [here](./typescript.md#customizing-typescript-with-a-tsconfig-json-file). Just make sure you removed all the `type-extension.d.ts` files, and keep your config file in your `files` field. Finally, if your config has the `BuidlerConfig` type, you should change it to `HardhatUserConfig`. ## Updating your `console.sol` imports -If you are using `console.log` in your contracts, you need to change the imports of `@nomiclabs/buidler/console.sol` -to `hardhat/console.sol`. +If you are using `console.log` in your contracts, you need to change the imports of `@nomiclabs/buidler/console.sol` to `hardhat/console.sol`. If you had this: @@ -146,12 +134,9 @@ Hardhat supports multiple contracts with the same name. If you have contracts which share their name, you can't import their artifacts using just the name. -For example, if you have a contract named `Ownable`, and one of your dependencies has a contract with the same name, you won't be able to do -`artifacts.require("Ownable")` nor `ethers.getContractFactory("Ownable")`. You need to use the contract's Fully -Qualified Name instead (e.g. `contracts/Ownable.sol:Ownable`). +For example, if you have a contract named `Ownable`, and one of your dependencies has a contract with the same name, you won't be able to do `artifacts.require("Ownable")` nor `ethers.getContractFactory("Ownable")`. You need to use the contract's Fully Qualified Name instead (e.g. `contracts/Ownable.sol:Ownable`). -If you try to import a contract with a repeated name, Hardhat will fail and show an error message that includes the different -options to fix it. All you need to do is copy & paste them. +If you try to import a contract with a repeated name, Hardhat will fail and show an error message that includes the different options to fix it. All you need to do is copy & paste them. For example, you may need to replace this @@ -169,8 +154,7 @@ const Ownable = await ethers.getContractFactory( ## Mocha and VSCode setup changes -If you are running your tests directly with Mocha, or through a VSCode Mocha plugin, please take a look at [this -updated guide](./vscode-tests.md). +If you are running your tests directly with Mocha, or through a VSCode Mocha plugin, please take a look at [this updated guide](./vscode-tests.md). ## Community plugins diff --git a/docs/guides/scripts.md b/docs/guides/scripts.md index eaec8f6d39..17d0135008 100644 --- a/docs/guides/scripts.md +++ b/docs/guides/scripts.md @@ -6,17 +6,13 @@ You can write your custom scripts that can use all of Hardhat's functionality. A There are two ways of writing a script that accesses the [Hardhat Runtime Environment]. -::: tip -Hardhat scripts are useful for simple things that don't take user arguments, and for -integrating with external tools that aren't well suited for the Hardhat CLI, like a Node.js debugger. +::: tip Hardhat scripts are useful for simple things that don't take user arguments, and for integrating with external tools that aren't well suited for the Hardhat CLI, like a Node.js debugger. -If you want to automate more complex things, and receive user arguments, you can learn how to [create your own tasks here](../guides/create-task.md). -::: +If you want to automate more complex things, and receive user arguments, you can learn how to [create your own tasks here](../guides/create-task.md). ::: ## Hardhat CLI dependant -You can write scripts that access the [Hardhat Runtime Environment]'s properties -as global variables. +You can write scripts that access the [Hardhat Runtime Environment]'s properties as global variables. These scripts must be run through Hardhat: `npx hardhat run script.js`. @@ -81,8 +77,7 @@ Greeter address: 0x5FbDB2315678afecb367f032d93F642f64180aa3 ### Hardhat arguments -You can still pass arguments to Hardhat when using it as a library. This is done -by setting environment variables. These are: +You can still pass arguments to Hardhat when using it as a library. This is done by setting environment variables. These are: - `HARDHAT_NETWORK`: Sets the network to connect to. diff --git a/docs/guides/shorthand.md b/docs/guides/shorthand.md index 809bc77471..49bf1c4fcd 100644 --- a/docs/guides/shorthand.md +++ b/docs/guides/shorthand.md @@ -1,7 +1,6 @@ # Shorthand (hh) and autocomplete -`hardhat-shorthand` is an NPM package that installs a globally accessible binary -called `hh` that runs the project's locally installed `hardhat` and supports shell autocompletion for tasks. +`hardhat-shorthand` is an NPM package that installs a globally accessible binary called `hh` that runs the project's locally installed `hardhat` and supports shell autocompletion for tasks. ## Installation @@ -34,8 +33,7 @@ To try it out, open a **new** terminal, go to the directory of your Hardhat proj ## Context -Out of best practice, Hardhat projects use a local installation of the NPM package `hardhat` to make sure everyone working on the project is using the -same version. This is why you need to use `npx` or npm scripts to run Hardhat. +Out of best practice, Hardhat projects use a local installation of the NPM package `hardhat` to make sure everyone working on the project is using the same version. This is why you need to use `npx` or npm scripts to run Hardhat. This approach has the downside of there being no way to provide autocomplete suggestions directly for the `hardhat` command, as well as making the CLI commands longer. These are the two issues that `hh` solves. diff --git a/docs/guides/truffle-migration.md b/docs/guides/truffle-migration.md index 2555735e06..8bbf1e6263 100644 --- a/docs/guides/truffle-migration.md +++ b/docs/guides/truffle-migration.md @@ -4,14 +4,11 @@ Hardhat is a task runner that facilitates building Ethereum smart contracts. It The bulk of Hardhat's functionality comes from plugins, which as a developer you're free to choose the ones you want to use. There are plugins for Truffle 4 and 5 that make migrating to Hardhat easy. -To migrate an existing Truffle project onto Hardhat there are -two main things to consider: testing and deployment. +To migrate an existing Truffle project onto Hardhat there are two main things to consider: testing and deployment. ### Testing -When it comes to unit tests, there are two Hardhat plugins -that support the Truffle testing APIs: `hardhat-truffle4` and `hardhat-truffle5`. -Both plugins support Solidity 4+. Using these you can run your existing tests with Hardhat. +When it comes to unit tests, there are two Hardhat plugins that support the Truffle testing APIs: `hardhat-truffle4` and `hardhat-truffle5`. Both plugins support Solidity 4+. Using these you can run your existing tests with Hardhat. Read [this guide](./truffle-testing.md) If you want to learn the details of writing Truffle tests to run in Hardhat, but it's not necessary to migrate your existing test suite. @@ -19,11 +16,7 @@ Read [this guide](./truffle-testing.md) If you want to learn the details of writ If your project uses [Truffle Migrations](https://www.trufflesuite.com/docs/truffle/getting-started/running-migrations) to initialize your testing environment (i.e. your tests call `Contract.deployed()`), then there's some more work to do to be able to run your tests. -The Truffle plugins currently don't fully support Migrations. -Instead, you need to adapt your Migrations to become a hardhat-truffle fixture. -This file, located at `test/truffle-fixture.js`, deploys your contracts -and calls the `setAsDeployed()` method on each of the contract abstractions -you want to test. +The Truffle plugins currently don't fully support Migrations. Instead, you need to adapt your Migrations to become a hardhat-truffle fixture. This file, located at `test/truffle-fixture.js`, deploys your contracts and calls the `setAsDeployed()` method on each of the contract abstractions you want to test. For example, this migration: @@ -48,11 +41,9 @@ module.exports = async () => { These fixtures will run on Mocha's `before`, which runs before each `contract()` function runs, just like Truffle migrations do. -If you have multiple migrations, you don't need to create multiple -hardhat-truffle fixture files. You can deploy all your contracts from the same one. +If you have multiple migrations, you don't need to create multiple hardhat-truffle fixture files. You can deploy all your contracts from the same one. -Once you've written your hardhat-truffle fixtures for your migrations and completed your setup you can run your tests -with `npx hardhat test`. Take a look at the [Truffle testing guide](/guides/truffle-testing.md) to learn more about using Truffle with Hardhat. +Once you've written your hardhat-truffle fixtures for your migrations and completed your setup you can run your tests with `npx hardhat test`. Take a look at the [Truffle testing guide](/guides/truffle-testing.md) to learn more about using Truffle with Hardhat. ### Deployment @@ -60,12 +51,9 @@ When it comes to deploying, there are no plugins that implement a deployment sys ### Truffle 4 and Web3.js' synchronous calls -Truffle 4 uses Web3.js `0.20.x`, which supports doing synchronous calls. -These aren't supported by the `hardhat-web3-legacy` plugin, which is the plugin that integrates Web3.js `0.20.x`. +Truffle 4 uses Web3.js `0.20.x`, which supports doing synchronous calls. These aren't supported by the `hardhat-web3-legacy` plugin, which is the plugin that integrates Web3.js `0.20.x`. -Instead, you should use the promisified version of Web3.js offered by the plugin: `pweb3`. It's available -as a global variable in your tests and tasks, and in the [Hardhat Runtime Environment](../advanced/hardhat-runtime-environment.md). -It has the same API as Web3.js, but asynchronous operations return promises. +Instead, you should use the promisified version of Web3.js offered by the plugin: `pweb3`. It's available as a global variable in your tests and tasks, and in the [Hardhat Runtime Environment](../advanced/hardhat-runtime-environment.md). It has the same API as Web3.js, but asynchronous operations return promises. For example, this code: diff --git a/docs/guides/typescript.md b/docs/guides/typescript.md index 487b4fc142..9ab3eb80e4 100644 --- a/docs/guides/typescript.md +++ b/docs/guides/typescript.md @@ -6,13 +6,11 @@ For a general overview of using Hardhat refer to the [Getting started guide](../ ## Enabling TypeScript support -Hardhat will automatically enable its TypeScript support if your config file ends in `.ts` and is written -in valid TypeScript. This requires a few changes to work properly. +Hardhat will automatically enable its TypeScript support if your config file ends in `.ts` and is written in valid TypeScript. This requires a few changes to work properly. ### Installing dependencies -Hardhat uses TypeScript and `ts-node` under the hood, so you need to install them. -To do it, open your terminal, go to your Hardhat project, and run: +Hardhat uses TypeScript and `ts-node` under the hood, so you need to install them. To do it, open your terminal, go to your Hardhat project, and run: ``` npm install --save-dev ts-node typescript @@ -26,11 +24,9 @@ npm install --save-dev chai @types/node @types/mocha @types/chai ### TypeScript configuration -You can easily turn a JavaScript Hardhat config file into a TypeScript one. Let's see how this is done starting with a -fresh Hardhat project. +You can easily turn a JavaScript Hardhat config file into a TypeScript one. Let's see how this is done starting with a fresh Hardhat project. -Open your terminal, go to an empty folder, run `npx hardhat`, and go through the steps to create a sample -project. When you're done your project directory should look something like this: +Open your terminal, go to an empty folder, run `npx hardhat`, and go through the steps to create a sample project. When you're done your project directory should look something like this: ``` $ ls -l @@ -179,8 +175,7 @@ export default config; Hardhat doesn't need a `tsconfig.json` file to work, but you can still create one. -If you don't know what a `tsconfig.json` file is, or you are not sure if you care about it, -we recommend you skip this section. +If you don't know what a `tsconfig.json` file is, or you are not sure if you care about it, we recommend you skip this section. If you are sure you need a `tsconfig.json` file, here's a template to base yours on: @@ -198,8 +193,7 @@ If you are sure you need a `tsconfig.json` file, here's a template to base yours } ``` -However you modify it, please make sure your config file is included in your project. The easiest way of doing this is -by keeping its path in the `files` array. +However you modify it, please make sure your config file is included in your project. The easiest way of doing this is by keeping its path in the `files` array. ### Support for path mappings @@ -233,11 +227,9 @@ export default config; ## Performance optimizations -Under the hood, Hardhat uses [ts-node](https://www.npmjs.com/package/ts-node) to support TypeScript. By default, it -will recompile and type-check everything on every run. Depending on your project's size, this can get slow. +Under the hood, Hardhat uses [ts-node](https://www.npmjs.com/package/ts-node) to support TypeScript. By default, it will recompile and type-check everything on every run. Depending on your project's size, this can get slow. -You can make Hardhat run faster by preventing `ts-node` from type-checking your project. This is done by setting the -`TS_NODE_TRANSPILE_ONLY` env variable to `1`. +You can make Hardhat run faster by preventing `ts-node` from type-checking your project. This is done by setting the `TS_NODE_TRANSPILE_ONLY` env variable to `1`. For example, you can run your TypeScript-based tests faster like this `TS_NODE_TRANSPILE_ONLY=1 npx hardhat test`. diff --git a/docs/guides/vscode-tests.md b/docs/guides/vscode-tests.md index fc5b3ed8c8..271efa54d0 100644 --- a/docs/guides/vscode-tests.md +++ b/docs/guides/vscode-tests.md @@ -1,7 +1,6 @@ # Running tests on Visual Studio Code -You can run your tests from [Visual Studio Code](https://code.visualstudio.com) -by using one of its Mocha integration extensions. We recommend using [Mocha Test Explorer](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-mocha-test-adapter). +You can run your tests from [Visual Studio Code](https://code.visualstudio.com) by using one of its Mocha integration extensions. We recommend using [Mocha Test Explorer](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-mocha-test-adapter). To use Mocha Test Explorer, you need to install it and follow these instructions. @@ -20,8 +19,7 @@ Then, create a file named `.mocharc.json` in your project's root directory with } ``` -Finally, you can set a shortcut for this VS Code command `test-explorer.run-test-at-cursor`, and you -will be able to run the test you are currently editing with it. +Finally, you can set a shortcut for this VS Code command `test-explorer.run-test-at-cursor`, and you will be able to run the test you are currently editing with it. ## Running TypeScript test @@ -38,5 +36,4 @@ First, you have to change your `.mocharc.json` to this: Then, you have to set the vscode option `"mochaExplorer.files"` to `"test/**/*.{j,t}s"`. -For any help or feedback you may have, you can find us in the [Hardhat Support Discord server](https://hardhat.org/discord). -https://hardhat.org/discord +For any help or feedback you may have, you can find us in the [Hardhat Support Discord server](https://hardhat.org/discord). https://hardhat.org/discord diff --git a/docs/guides/waffle-testing.md b/docs/guides/waffle-testing.md index 33c96efa2d..9a62e4b04d 100644 --- a/docs/guides/waffle-testing.md +++ b/docs/guides/waffle-testing.md @@ -2,15 +2,11 @@ Writing smart contract tests in Hardhat is done using JavaScript or TypeScript. -In this guide, we'll show you how to use [Ethers.js](https://docs.ethers.io/), a JavaScript library to interact with Ethereum, -and [Waffle](https://getwaffle.io/) a simple smart contract testing library built on top of it. This is our recommended -choice for testing. +In this guide, we'll show you how to use [Ethers.js](https://docs.ethers.io/), a JavaScript library to interact with Ethereum, and [Waffle](https://getwaffle.io/) a simple smart contract testing library built on top of it. This is our recommended choice for testing. Let's see how to use it going through Hardhat's sample project. -::: tip -Ethers and Waffle support TypeScript. Learn how to set up Hardhat with TypeScript [here](./typescript.md). -::: +::: tip Ethers and Waffle support TypeScript. Learn how to set up Hardhat with TypeScript [here](./typescript.md). ::: ## Setting up @@ -37,22 +33,17 @@ Welcome to Hardhat v2.0.0 Select `Create a sample project`. This will create some files and install the `@nomiclabs/hardhat-ethers`, `@nomiclabs/hardhat-waffle` plugins, and other necessary packages. -::: tip -Hardhat will let you know how, but in case you missed it you can install them with `npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers` -::: +::: tip Hardhat will let you know how, but in case you missed it you can install them with `npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers` ::: Look at the `hardhat.config.js` file and you'll see that the Waffle plugin is enabled: <<< @/../packages/hardhat-core/sample-project/hardhat.config.js{1} -::: tip -There's no need for `require("@nomiclabs/hardhat-ethers")`, as `@nomiclabs/hardhat-waffle` already does it. -::: +::: tip There's no need for `require("@nomiclabs/hardhat-ethers")`, as `@nomiclabs/hardhat-waffle` already does it. ::: ## Testing -Tests using Waffle are written with [Mocha](https://mochajs.org/) alongside with [Chai](https://www.chaijs.com/). If you -haven't heard of them, they are super popular JavaScript testing utilities. +Tests using Waffle are written with [Mocha](https://mochajs.org/) alongside with [Chai](https://www.chaijs.com/). If you haven't heard of them, they are super popular JavaScript testing utilities. Inside `test` folder you'll find `sample-test.js`. Let's take a look at it, and we'll explain it next: @@ -79,9 +70,7 @@ We are requiring `Chai` which is an assertions library. These asserting function This is why we're using the `@nomiclabs/hardhat-waffle` plugin, which makes it easier to assert values from Ethereum. Check out [this section](https://ethereum-waffle.readthedocs.io/en/latest/matchers.html) in Waffle's documentation for the entire list of Ethereum-specific matchers. -::: warning -Some Waffle matchers return a Promise rather than executing immediately. If you're making a call or sending a transaction, make sure to check Waffle's documentation, and `await` these Promises. Otherwise your tests may pass without running all checks. -::: +::: warning Some Waffle matchers return a Promise rather than executing immediately. If you're making a call or sending a transaction, make sure to check Waffle's documentation, and `await` these Promises. Otherwise your tests may pass without running all checks. ::: ```js describe("Greeter", function () { @@ -132,9 +121,7 @@ const [owner, addr1] = await ethers.getSigners(); A `Signer` in Ethers.js is an object that represents an Ethereum account. It's used to send transactions to contracts and other accounts. Here we're getting a list of the accounts in the node we're connected to, which in this case is **Hardhat Network**, and only keeping the first and second ones. -::: tip -To learn more about `Signer`, you can look at the [Signers documentation](https://docs.ethers.io/v5/api/signer/#Wallet). -::: +::: tip To learn more about `Signer`, you can look at the [Signers documentation](https://docs.ethers.io/v5/api/signer/#Wallet). ::: The `ethers` variable is available in the global scope. If you like your code always being explicit, you can add this line at the top: @@ -150,14 +137,7 @@ await greeter.connect(addr1).setGreeting("Hallo, Erde!"); ## Migrating an existing Waffle project -If you're starting a project from scratch and looking to use Waffle, you can skip this section. If you're setting up an existing Waffle project to use Hardhat you'll need to migrate the [configuration options](https://ethereum-waffle.readthedocs.io/en/latest/configuration.html) Waffle offers. The following table maps Waffle configurations to their Hardhat equivalents: -|Waffle|Hardhat| -|---|---| -|`sourcesPath`|`paths.sources`| -|`targetPath`|`paths.artifacts`| -|`solcVersion`|`solc.version` (version number only)| -|`compilerOptions.evmVersion`|`solc.evmVersion`| -|`compilerOptions.optimizer`|`solc.optimizer`| +If you're starting a project from scratch and looking to use Waffle, you can skip this section. If you're setting up an existing Waffle project to use Hardhat you'll need to migrate the [configuration options](https://ethereum-waffle.readthedocs.io/en/latest/configuration.html) Waffle offers. The following table maps Waffle configurations to their Hardhat equivalents: |Waffle|Hardhat| |---|---| |`sourcesPath`|`paths.sources`| |`targetPath`|`paths.artifacts`| |`solcVersion`|`solc.version` (version number only)| |`compilerOptions.evmVersion`|`solc.evmVersion`| |`compilerOptions.optimizer`|`solc.optimizer`| As an example, this Waffle configuration file: @@ -226,16 +206,11 @@ const { waffle } = require("hardhat"); const { deployContract } = waffle; ``` -::: warning -Importing Waffle's functions from `ethereum-waffle`, can lead to multiple problems. +::: warning Importing Waffle's functions from `ethereum-waffle`, can lead to multiple problems. -For example, Waffle has a -[default gas limit](https://github.com/EthWorks/Waffle/blob/3.0.2/waffle-cli/src/deployContract.ts#L4-L7) of 4 million -gas for contract deployment transactions, which is normally too low. +For example, Waffle has a [default gas limit](https://github.com/EthWorks/Waffle/blob/3.0.2/waffle-cli/src/deployContract.ts#L4-L7) of 4 million gas for contract deployment transactions, which is normally too low. -Please, make sure you import them from the `waffle` field of the [Hardhat Runtime Environment]. It is a version -of Waffle adapted to work well with Hardhat. -::: +Please, make sure you import them from the `waffle` field of the [Hardhat Runtime Environment]. It is a version of Waffle adapted to work well with Hardhat. ::: Also, you don't need to call `chai.use`. This initialization is already handled by `@nomiclabs/hardhat-waffle`. Just be sure to include `require("@nomiclabs/hardhat-waffle");` in your Hardhat config. diff --git a/docs/hardhat-network/README.md b/docs/hardhat-network/README.md index d71469c669..ded9b75c35 100644 --- a/docs/hardhat-network/README.md +++ b/docs/hardhat-network/README.md @@ -37,13 +37,9 @@ If you want to connect Hardhat to this node, you only need to run it using `--ne ## Solidity stack traces -Hardhat Network has first-class Solidity support. It always knows which -smart contracts are being run, what they do exactly and why they fail. +Hardhat Network has first-class Solidity support. It always knows which smart contracts are being run, what they do exactly and why they fail. -If a transaction or call fails, Hardhat Network will throw an exception. -This exception will have a combined JavaScript and Solidity stack -trace: stack traces that start in JavaScript/TypeScript up to your -call to the contract, and continue with the full Solidity call stack. +If a transaction or call fails, Hardhat Network will throw an exception. This exception will have a combined JavaScript and Solidity stack trace: stack traces that start in JavaScript/TypeScript up to your call to the contract, and continue with the full Solidity call stack. This is an example of a Hardhat Network exception using `TruffleContract`: @@ -58,17 +54,13 @@ Error: Transaction reverted: function selector was not recognized and there's no at Context. (test/token/ERC721/ERC721.behavior.js:321:26) ``` -The last two lines correspond to the JavaScript test code that executed a -failing transaction. The rest is the Solidity stack trace. -This way you know exactly why your tests aren't passing. +The last two lines correspond to the JavaScript test code that executed a failing transaction. The rest is the Solidity stack trace. This way you know exactly why your tests aren't passing. ## Automatic error messages -Hardhat Network always knows why your transaction or call failed, and uses this -information to make debugging your contracts easier. +Hardhat Network always knows why your transaction or call failed, and uses this information to make debugging your contracts easier. -When a transaction fails without a reason, Hardhat Network will create a clear -error message in the following cases: +When a transaction fails without a reason, Hardhat Network will create a clear error message in the following cases: - Calling a non-payable function with ETH @@ -153,13 +145,10 @@ There are other things you can do with a forked Hardhat Network, check [our guid Hardhat supports two modes for mining transactions: -- **Automine**: each transaction that is sent is automatically included in a new - block -- **Interval mining**: a new block is periodically mined, which includes as many - pending transactions as possible +- **Automine**: each transaction that is sent is automatically included in a new block +- **Interval mining**: a new block is periodically mined, which includes as many pending transactions as possible -You can use one of these modes, both or neither. By default, only the automine -mode is enabled. +You can use one of these modes, both or neither. By default, only the automine mode is enabled. ### Configuring mining modes @@ -176,9 +165,7 @@ networks: { } ``` -In this example, automining is disabled and interval mining is set so that a new -block is generated every 5 seconds. You can also configure interval mining to -generate a new block after a random delay: +In this example, automining is disabled and interval mining is set so that a new block is generated every 5 seconds. You can also configure interval mining to generate a new block after a random delay: ```js networks: { @@ -191,9 +178,7 @@ networks: { } ``` -In this case, a new block will be mined after a random delay of between 3 and 6 -seconds. For example, the first block could be mined after 4 seconds, the second -block 5.5 seconds after that, and so on. +In this case, a new block will be mined after a random delay of between 3 and 6 seconds. For example, the first block could be mined after 4 seconds, the second block 5.5 seconds after that, and so on. ### Manual mining @@ -210,25 +195,17 @@ networks: { } ``` -This means that no new blocks will be mined by the Hardhat Network, but you can -manually mine new blocks using the `evm_mine` RPC method. This will generate a -new block that will include as many pending transactions as possible. +This means that no new blocks will be mined by the Hardhat Network, but you can manually mine new blocks using the `evm_mine` RPC method. This will generate a new block that will include as many pending transactions as possible. ### Mempool behavior -When automine is disabled, every sent transaction is added to the mempool, -which contains all the transactions that could be mined in the future. Hardhat -Network's mempool follows the same rules as geth. This means, among other -things, that: +When automine is disabled, every sent transaction is added to the mempool, which contains all the transactions that could be mined in the future. Hardhat Network's mempool follows the same rules as geth. This means, among other things, that: - Transactions with a higher gas price are included first -- If two transactions can be included and both have the same gas price, the one - that was received first is included first -- If a transaction is invalid (for example, its nonce is lower than the nonce - of the address that sent it), the transaction is dropped. +- If two transactions can be included and both have the same gas price, the one that was received first is included first +- If a transaction is invalid (for example, its nonce is lower than the nonce of the address that sent it), the transaction is dropped. -You can get the list of pending transactions that will be included in the -next block by using the "pending" block tag: +You can get the list of pending transactions that will be included in the next block by using the "pending" block tag: ```js const pendingBlock = await network.provider.send("eth_getBlockByNumber", [ @@ -239,24 +216,18 @@ const pendingBlock = await network.provider.send("eth_getBlockByNumber", [ ### Removing and replacing transactions -Transactions in the mempool can be removed using the `hardhat_dropTransaction` -method: +Transactions in the mempool can be removed using the `hardhat_dropTransaction` method: ```js const txHash = "0xabc..."; await network.provider.send("hardhat_dropTransaction", [txHash]); ``` -You can also replace a transaction by sending a new one with the same nonce as -the one that it's already in the mempool but with a higher gas price. -Keep in mind that, like in Geth, for this to work the new gas price has to be at least 10% -higher than the gas price of the current transaction. +You can also replace a transaction by sending a new one with the same nonce as the one that it's already in the mempool but with a higher gas price. Keep in mind that, like in Geth, for this to work the new gas price has to be at least 10% higher than the gas price of the current transaction. ### Configuring mining modes using RPC methods -You can change the mining behavior on runtime using two RPC methods: -`evm_setAutomine` and `evm_setIntervalMining`. For example, to disable -automining: +You can change the mining behavior on runtime using two RPC methods: `evm_setAutomine` and `evm_setIntervalMining`. For example, to disable automining: ```js await network.provider.send("evm_setAutomine", [false]); @@ -270,8 +241,7 @@ await network.provider.send("evm_setIntervalMining", [5000]); ## Logging -Hardhat Network uses its tracing infrastructure to offer rich logging that will help -you develop and debug smart contracts. +Hardhat Network uses its tracing infrastructure to offer rich logging that will help you develop and debug smart contracts. For example, a successful transaction and a failed call would look like this: @@ -297,18 +267,13 @@ eth_call at process._tickCallback (internal/process/next_tick.js:68:7) ``` -This logging is enabled by default when using Hardhat Network's node (i.e. `npx hardhat node`), but disabled when using -the in-process Hardhat Network provider. See [Hardhat Network's config](../config/README.md#hardhat-network) to learn more about how to control its logging. +This logging is enabled by default when using Hardhat Network's node (i.e. `npx hardhat node`), but disabled when using the in-process Hardhat Network provider. See [Hardhat Network's config](../config/README.md#hardhat-network) to learn more about how to control its logging. ## The `debug_traceTransaction` method -You can get debug traces of already mined transactions using the -`debug_traceTransaction` RPC method. The returned object has a detailed -description of the transaction execution, including a list of steps describing -each executed opcode and the state of the EVM at that point. +You can get debug traces of already mined transactions using the `debug_traceTransaction` RPC method. The returned object has a detailed description of the transaction execution, including a list of steps describing each executed opcode and the state of the EVM at that point. -To get a trace, call this method with the hash of the transaction as its -argument: +To get a trace, call this method with the hash of the transaction as its argument: ```js const trace = await hre.network.provider.send("debug_traceTransaction", [ @@ -329,16 +294,12 @@ const trace = await hre.network.provider.send("debug_traceTransaction", [ ]); ``` -If you are using [mainnet forking](https://hardhat.org/guides/mainnet-forking.html) with an archive node, -you can get traces of transactions from the remote network even if the node you are using -doesn't support -`debug_traceTransaction`. +If you are using [mainnet forking](https://hardhat.org/guides/mainnet-forking.html) with an archive node, you can get traces of transactions from the remote network even if the node you are using doesn't support `debug_traceTransaction`. ### Known limitations - You can't trace transactions that use a hardfork older than [Spurious Dragon](https://ethereum.org/en/history/#spurious-dragon) -- The last step of a message is not guaranteed to have a correct value in the - `gasCost` property +- The last step of a message is not guaranteed to have a correct value in the `gasCost` property ## Hardhat Network initial state @@ -460,13 +421,10 @@ To customise it, take a look at [the configuration section](/config/README.md#ha Hardhat Network can run any smart contract, but it only understands Solidity 0.5.1 and newer. -If you are compiling with an older version of Solidity, or using another language, you can use Hardhat Network, but -Solidity stack traces won't be generated. +If you are compiling with an older version of Solidity, or using another language, you can use Hardhat Network, but Solidity stack traces won't be generated. ### Solidity optimizer support -Hardhat Network can work with smart contracts compiled with optimizations, -but this may lead to your stack traces' line numbers being a little off. +Hardhat Network can work with smart contracts compiled with optimizations, but this may lead to your stack traces' line numbers being a little off. -We recommend compiling without optimizations when testing and debugging -your contracts. +We recommend compiling without optimizations when testing and debugging your contracts. diff --git a/docs/metamask-issue.md b/docs/metamask-issue.md index 678752ae59..63af2febb4 100644 --- a/docs/metamask-issue.md +++ b/docs/metamask-issue.md @@ -23,5 +23,4 @@ networks: { } ``` -Note that if your setup or any of your plugins depends on the chain id being `31337`, you might need to clean your -cache or make further adaptations in your config. +Note that if your setup or any of your plugins depends on the chain id being `31337`, you might need to clean your cache or make further adaptations in your config. diff --git a/docs/package.json b/docs/package.json index 75d4b08f1d..99eb4a983b 100644 --- a/docs/package.json +++ b/docs/package.json @@ -2,8 +2,8 @@ "scripts": { "dev": "vuepress dev .", "build": "NODE_ENV=production vuepress build .", - "lint": "prettier --check \"**/*.{js,md,json}\"", - "lint:fix": "prettier --write \"**/*.{js,md,json}\"" + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\"", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\"" }, "devDependencies": { "@prettier/plugin-pug": "^1.8.1", diff --git a/docs/reference/solidity-support.md b/docs/reference/solidity-support.md index b2a63ca853..7ea3b26c98 100644 --- a/docs/reference/solidity-support.md +++ b/docs/reference/solidity-support.md @@ -1,13 +1,10 @@ # Solidity support -Hardhat Network has first-class Solidity support. It always knows which smart contracts are -being run, what they do exactly, and why they fail, making smart contracts development easier. +Hardhat Network has first-class Solidity support. It always knows which smart contracts are being run, what they do exactly, and why they fail, making smart contracts development easier. -To do this kind of things, Hardhat integrates very deeply with Solidity, which means that new -versions of it aren't automatically supported. +To do this kind of things, Hardhat integrates very deeply with Solidity, which means that new versions of it aren't automatically supported. -This section of the docs explains which versions are supported, and what happens if you use -an unsupported one. +This section of the docs explains which versions are supported, and what happens if you use an unsupported one. ## Supported versions @@ -18,17 +15,12 @@ These are the versions of Solidity that you can expect to fully work with Hardha - Any 0.7.x version - Any 0.8.x version up to and including 0.8.4 -We recommend against using Hardhat with newer, unsupported versions of Solidity, but if -you need to do it, then please read on. +We recommend against using Hardhat with newer, unsupported versions of Solidity, but if you need to do it, then please read on. ### Using an unsupported version -When running an unsupported version of Solidity our integration with it may not work, or -do it incorrectly. +When running an unsupported version of Solidity our integration with it may not work, or do it incorrectly. -This can mean that Solidity stack traces may stop working, be incorrect, or incomplete. It -can also mean that `console.log` may stop working. +This can mean that Solidity stack traces may stop working, be incorrect, or incomplete. It can also mean that `console.log` may stop working. -Despite those things possibly breaking, the actual compilation and execution of your smart -contracts won't be affected. You can still trust your test results or deploy smart contracts. -You will just get less help from Hardhat when doing so. +Despite those things possibly breaking, the actual compilation and execution of your smart contracts won't be affected. You can still trust your test results or deploy smart contracts. You will just get less help from Hardhat when doing so. diff --git a/docs/troubleshooting/common-problems.md b/docs/troubleshooting/common-problems.md index 0c870193da..6d0abd7527 100644 --- a/docs/troubleshooting/common-problems.md +++ b/docs/troubleshooting/common-problems.md @@ -4,8 +4,7 @@ This section describes common problems with working with Hardhat and how to solv ## Out of memory errors when compiling large projects -If your project has lots of smart contracts, compiling them may require more memory than what -Node allows by default and crash. +If your project has lots of smart contracts, compiling them may require more memory than what Node allows by default and crash. If you are experiencing this problem, you can use Hardhat's `--max-memory` argument: diff --git a/docs/tutorial/creating-a-new-hardhat-project.md b/docs/tutorial/creating-a-new-hardhat-project.md index 0c841937a7..ae3e14b358 100644 --- a/docs/tutorial/creating-a-new-hardhat-project.md +++ b/docs/tutorial/creating-a-new-hardhat-project.md @@ -11,9 +11,7 @@ npm init --yes npm install --save-dev hardhat ``` -::: tip -Installing **Hardhat** will install some Ethereum JavaScript dependencies, so be patient. -::: +::: tip Installing **Hardhat** will install some Ethereum JavaScript dependencies, so be patient. ::: In the same directory where you installed **Hardhat** run: @@ -52,9 +50,7 @@ When **Hardhat** is run, it searches for the closest `hardhat.config.js` file st Every time you're running **Hardhat** from the CLI you're running a task. e.g. `npx hardhat compile` is running the `compile` task. To see the currently available tasks in your project, run `npx hardhat`. Feel free to explore any task by running `npx hardhat help [task]`. -::: tip -You can create your own tasks. Check out the [Creating a task](/guides/create-task.md) guide. -::: +::: tip You can create your own tasks. Check out the [Creating a task](/guides/create-task.md) guide. ::: ### Plugins diff --git a/docs/tutorial/deploying-to-a-live-network.md b/docs/tutorial/deploying-to-a-live-network.md index 120f48893e..fcb174a824 100644 --- a/docs/tutorial/deploying-to-a-live-network.md +++ b/docs/tutorial/deploying-to-a-live-network.md @@ -79,13 +79,11 @@ We're using [Alchemy](https://www.alchemyapi.io), but pointing `url` to any Ethe To deploy on Ropsten you need to send ropsten-ETH into the address that's going to be making the deployment. You can get some ETH for testnets from a faucet, a service that distributes testing-ETH for free. [Here's the one for Ropsten](https://faucet.ropsten.be/), you'll have to change Metamask's network to Ropsten before transacting. -::: tip -You can get some ETH for other testnets following these links: +::: tip You can get some ETH for other testnets following these links: - [Kovan faucet](https://faucet.kovan.network/) - [Rinkeby faucet](https://faucet.rinkeby.io/) -- [Goerli faucet](https://goerli-faucet.slock.it/) - ::: +- [Goerli faucet](https://goerli-faucet.slock.it/) ::: Finally, run: diff --git a/docs/tutorial/hackathon-boilerplate-project.md b/docs/tutorial/hackathon-boilerplate-project.md index 2f45859bf7..275265f82d 100644 --- a/docs/tutorial/hackathon-boilerplate-project.md +++ b/docs/tutorial/hackathon-boilerplate-project.md @@ -61,8 +61,7 @@ npm install npm run start ``` -To start the react web app. Open [http://localhost:3000/](http://localhost:3000/) in your browser and you should see this: -![](/front-5.png) +To start the react web app. Open [http://localhost:3000/](http://localhost:3000/) in your browser and you should see this: ![](/front-5.png) Set your network in MetaMask to `localhost:8545`, and click the button. You should then see this: @@ -99,7 +98,6 @@ eth_sendTransaction Transferring from 0xc783df8a850f42e7f7e57013759c285caa701eb6 to 0x0987a41e73e69f60c5071ce3c8f7e730f9a60f90 100 tokens ``` -Showing the `console.log` output from the `transfer()` function in our contract, and this is what the web app will look like after you run the faucet task: -![](/front-6.png) +Showing the `console.log` output from the `transfer()` function in our contract, and this is what the web app will look like after you run the faucet task: ![](/front-6.png) Try playing around with it and reading the code. It's full of comments explaining what's going on and clearly indicating what code is Ethereum boilerplate and what's actually dApp logic. This should make the repository easy to reuse for your project. diff --git a/docs/tutorial/testing-contracts.md b/docs/tutorial/testing-contracts.md index 21d6061e3d..a4a0d4ffa8 100644 --- a/docs/tutorial/testing-contracts.md +++ b/docs/tutorial/testing-contracts.md @@ -51,9 +51,7 @@ The `ethers` variable is available in the global scope. If you like your code al const { ethers } = require("hardhat"); ``` -::: tip -To learn more about `Signer`, you can look at the [Signers documentation](https://docs.ethers.io/v5/api/signer/). -::: +::: tip To learn more about `Signer`, you can look at the [Signers documentation](https://docs.ethers.io/v5/api/signer/). ::: ```js const Token = await ethers.getContractFactory("Token"); diff --git a/docs/tutorial/writing-and-compiling-contracts.md b/docs/tutorial/writing-and-compiling-contracts.md index c50efdedf5..c1e72237dd 100644 --- a/docs/tutorial/writing-and-compiling-contracts.md +++ b/docs/tutorial/writing-and-compiling-contracts.md @@ -8,9 +8,7 @@ We're going to create a simple smart contract that implements a token that can b - Anyone with at least one token can transfer tokens. - The token is non-divisible. You can transfer 1, 2, 3 or 37 tokens but not 2.5. -::: tip -You might have heard about ERC20, which is a token standard in Ethereum. Tokens such as DAI, USDC, MKR and ZRX follow the ERC20 standard which allows them all to be compatible with any software that can deal with ERC20 tokens. **For simplicity's sake the token we're going to build is _not_ an ERC20.** -::: +::: tip You might have heard about ERC20, which is a token standard in Ethereum. Tokens such as DAI, USDC, MKR and ZRX follow the ERC20 standard which allows them all to be compatible with any software that can deal with ERC20 tokens. **For simplicity's sake the token we're going to build is _not_ an ERC20.** ::: ## Writing smart contracts @@ -18,9 +16,7 @@ Start by creating a new directory called `contracts` and create a file inside th Paste the code below into the file and take a minute to read the code. It's simple and it's full of comments explaining the basics of Solidity. -::: tip -To get syntax highlighting you should add Solidity support to your text editor. Just look for Solidity or Ethereum plugins. We recommend using Visual Studio Code or Sublime Text 3. -::: +::: tip To get syntax highlighting you should add Solidity support to your text editor. Just look for Solidity or Ethereum plugins. We recommend using Visual Studio Code or Sublime Text 3. ::: ```solidity // Solidity files have to start with this pragma. @@ -85,9 +81,7 @@ contract Token { } ``` -::: tip -`*.sol` is used for Solidity files. We recommend matching the file name to the contract it contains, which is a common practice. -::: +::: tip `*.sol` is used for Solidity files. We recommend matching the file name to the contract it contains, which is a common practice. ::: ## Compiling contracts diff --git a/packages/common/package.json b/packages/common/package.json index e8c50adf1b..f86a96596b 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -8,8 +8,8 @@ "license": "MIT", "private": true, "scripts": { - "lint:fix": "prettier --write \"**/*.{js,md,json}\"", - "lint": "prettier --check \"**/*.{js,md,json}\"" + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\"", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\"" }, "devDependencies": { "detect-port": "^1.3.0", diff --git a/packages/e2e/README.md b/packages/e2e/README.md index 4f5bec93c3..4aaf962341 100644 --- a/packages/e2e/README.md +++ b/packages/e2e/README.md @@ -1,4 +1,3 @@ # hardhat e2e tests -This package has end to end tests for the packaged version of Hardhat. You can run them with `yarn test`. This will -build and package Hardhat and install it in the fixture projects, that then will be used in the tests. +This package has end to end tests for the packaged version of Hardhat. You can run them with `yarn test`. This will build and package Hardhat and install it in the fixture projects, that then will be used in the tests. diff --git a/packages/e2e/package.json b/packages/e2e/package.json index d841732f8d..c8518d663d 100644 --- a/packages/e2e/package.json +++ b/packages/e2e/package.json @@ -8,8 +8,8 @@ "author": "Nomic Labs LLC", "license": "MIT", "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", "pretest": "node prepare-tests.js", "test": "mocha --recursive \"test/**/*.ts\" --exit", "build": "tsc --build .", diff --git a/packages/hardhat-core/README.md b/packages/hardhat-core/README.md index 50476c0c59..b67ecc8f7f 100644 --- a/packages/hardhat-core/README.md +++ b/packages/hardhat-core/README.md @@ -1,6 +1,4 @@ -![](https://user-images.githubusercontent.com/176499/96893278-ebc67580-1460-11eb-9530-d5df3a3d65d0.png) -[![NPM Package](https://img.shields.io/npm/v/hardhat.svg?style=flat-square)](https://www.npmjs.org/package/hardhat) -![Build Status](https://github.com/nomiclabs/hardhat/workflows/CI/badge.svg) +![](https://user-images.githubusercontent.com/176499/96893278-ebc67580-1460-11eb-9530-d5df3a3d65d0.png) [![NPM Package](https://img.shields.io/npm/v/hardhat.svg?style=flat-square)](https://www.npmjs.org/package/hardhat) ![Build Status](https://github.com/nomiclabs/hardhat/workflows/CI/badge.svg) --- diff --git a/packages/hardhat-core/package.json b/packages/hardhat-core/package.json index de4b44d64e..f04362d229 100644 --- a/packages/hardhat-core/package.json +++ b/packages/hardhat-core/package.json @@ -26,8 +26,8 @@ "node": ">=8.2.0" }, "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && yarn lint-src && yarn lint-tests", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && yarn lint-src --fix && yarn lint-tests --fix", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && yarn lint-src && yarn lint-tests", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && yarn lint-src --fix && yarn lint-tests --fix", "lint-src": "NODE_OPTIONS='--require ts-node/register/transpile-only' tslint --config tslint.json --project src/tsconfig.json", "lint-tests": "NODE_OPTIONS='--require ts-node/register/transpile-only' tslint --config tslint.json --project ./tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\"", diff --git a/packages/hardhat-core/sample-project/LICENSE.md b/packages/hardhat-core/sample-project/LICENSE.md index e10669f12c..0f12edbc86 100644 --- a/packages/hardhat-core/sample-project/LICENSE.md +++ b/packages/hardhat-core/sample-project/LICENSE.md @@ -2,22 +2,10 @@ This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, -commercial or non-commercial, and by any means. +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to -this software under copyright law. +In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [https://unlicense.org](https://unlicense.org) diff --git a/packages/hardhat-core/test/fixture-projects/project-with-hardhat-directory/hardhat/README.md b/packages/hardhat-core/test/fixture-projects/project-with-hardhat-directory/hardhat/README.md index ec090bf64d..69e7e6b9b5 100644 --- a/packages/hardhat-core/test/fixture-projects/project-with-hardhat-directory/hardhat/README.md +++ b/packages/hardhat-core/test/fixture-projects/project-with-hardhat-directory/hardhat/README.md @@ -1,4 +1,3 @@ # Test description -This fixture project is used in a test for the `source-names` module. -In particular it was created to write a regression test for this [issue](https://github.com/nomiclabs/hardhat/issues/998). +This fixture project is used in a test for the `source-names` module. In particular it was created to write a regression test for this [issue](https://github.com/nomiclabs/hardhat/issues/998). diff --git a/packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/0_6/revert-without-message/README.md b/packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/0_6/revert-without-message/README.md index 2d6b8a6fd5..0411d4dc94 100644 --- a/packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/0_6/revert-without-message/README.md +++ b/packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/0_6/revert-without-message/README.md @@ -1,9 +1,7 @@ ## Tests before and after 0.6.3 -Starting from solc 0.6.3, `revert`s and `require`s without an error message don't have an associated sourcemap. See -[this issue](https://github.com/ethereum/solidity/issues/9006). +Starting from solc 0.6.3, `revert`s and `require`s without an error message don't have an associated sourcemap. See [this issue](https://github.com/ethereum/solidity/issues/9006). -The tests in `solc-before-0.6.3` produce the same result as the equivalent tests in the main directory, even if the -erorr message is missing, since in those versions the source maps work fine. +The tests in `solc-before-0.6.3` produce the same result as the equivalent tests in the main directory, even if the erorr message is missing, since in those versions the source maps work fine. The tests in `solc-after-0.6.3` produce a less complete stack trace that also warns the users to upgrade the compiler and use error messages. diff --git a/packages/hardhat-docker/package.json b/packages/hardhat-docker/package.json index 6132e74520..449724e4b7 100644 --- a/packages/hardhat-docker/package.json +++ b/packages/hardhat-docker/package.json @@ -13,8 +13,8 @@ "docker" ], "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\" --exit", "build": "tsc --build .", "clean": "rimraf dist" diff --git a/packages/hardhat-ethers/README.md b/packages/hardhat-ethers/README.md index ae4f3689fc..77b9ab47d6 100644 --- a/packages/hardhat-ethers/README.md +++ b/packages/hardhat-ethers/README.md @@ -1,5 +1,4 @@ -[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-ethers.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-ethers) -[![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) +[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-ethers.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-ethers) [![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) # hardhat-ethers @@ -35,13 +34,11 @@ This plugin creates no additional tasks. This plugins adds an `ethers` object to the Hardhat Runtime Environment. -This object has the same API than `ethers.js`, with some extra Hardhat-specific -functionality. +This object has the same API than `ethers.js`, with some extra Hardhat-specific functionality. ### Provider object -A `provider` field is added to `ethers`, which is an `ethers.providers.Provider` -automatically connected to the selected network. +A `provider` field is added to `ethers`, which is an `ethers.providers.Provider` automatically connected to the selected network. ### Helpers diff --git a/packages/hardhat-ethers/package.json b/packages/hardhat-ethers/package.json index fa8af139e7..b73b72ce38 100644 --- a/packages/hardhat-ethers/package.json +++ b/packages/hardhat-ethers/package.json @@ -16,8 +16,8 @@ "ethers.js" ], "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && yarn lint-src && yarn lint-tests", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && yarn lint-src --fix && yarn lint-tests --fix", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && yarn lint-src && yarn lint-tests", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && yarn lint-src --fix && yarn lint-tests --fix", "lint-tests": "tslint --config tslint.json --project ./tsconfig.json", "lint-src": "tslint --config tslint.json --project ./src/tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\" --exit", diff --git a/packages/hardhat-etherscan/README.md b/packages/hardhat-etherscan/README.md index 50f788d932..dcc8ac038e 100644 --- a/packages/hardhat-etherscan/README.md +++ b/packages/hardhat-etherscan/README.md @@ -1,5 +1,4 @@ -[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-etherscan.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-etherscan) -[![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) +[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-etherscan.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-etherscan) [![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) # hardhat-etherscan diff --git a/packages/hardhat-etherscan/package.json b/packages/hardhat-etherscan/package.json index ff0e1b56f6..80e869b614 100644 --- a/packages/hardhat-etherscan/package.json +++ b/packages/hardhat-etherscan/package.json @@ -20,8 +20,8 @@ "etherscan" ], "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\" --exit", "build": "tsc --build .", "clean": "rimraf dist" diff --git a/packages/hardhat-ganache/README.md b/packages/hardhat-ganache/README.md index 6e5187b8b6..3a9cfc08e2 100644 --- a/packages/hardhat-ganache/README.md +++ b/packages/hardhat-ganache/README.md @@ -1,5 +1,4 @@ -[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-ganache.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-ganache) -[![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) +[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-ganache.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-ganache) [![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) # hardhat-ganache @@ -7,8 +6,7 @@ This Hardhat plugin automatically starts and stops [Ganache](https://github.com/ ## What -This plugin creates a network named `ganache`. When this network is used, a Ganache server will be -automatically started before running tests and scripts, and stopped when finished. +This plugin creates a network named `ganache`. When this network is used, a Ganache server will be automatically started before running tests and scripts, and stopped when finished. ## Installation @@ -30,8 +28,7 @@ import "@nomiclabs/hardhat-ganache"; ## Tasks -This plugin hooks into the `test` and `run` tasks to wrap them in the instantiation and termination of a `ganache-core` instance. -This plugin creates no additional tasks. +This plugin hooks into the `test` and `run` tasks to wrap them in the instantiation and termination of a `ganache-core` instance. This plugin creates no additional tasks. ## Environment extensions @@ -43,8 +40,7 @@ There are no additional steps you need to take for this plugin to work. ## Configuration -You can set any of the [Ganache's options](https://github.com/trufflesuite/ganache-core#options) through the `ganache` -network config. All of them are supported, with the exception of `accounts`. +You can set any of the [Ganache's options](https://github.com/trufflesuite/ganache-core#options) through the `ganache` network config. All of them are supported, with the exception of `accounts`. This example sets a larger block gas limit and the default balance of Ganache's accounts. diff --git a/packages/hardhat-ganache/package.json b/packages/hardhat-ganache/package.json index 90f4230cb6..4a42837fe1 100644 --- a/packages/hardhat-ganache/package.json +++ b/packages/hardhat-ganache/package.json @@ -17,8 +17,8 @@ "testing-network" ], "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\" --exit", "build": "tsc --build .", "clean": "rimraf dist" diff --git a/packages/hardhat-shorthand/README.md b/packages/hardhat-shorthand/README.md index 9d170e275c..545f4ece48 100644 --- a/packages/hardhat-shorthand/README.md +++ b/packages/hardhat-shorthand/README.md @@ -2,8 +2,7 @@ # hardhat-shorthand -`hardhat-shorthand` is an NPM package that installs a globally accessible binary -called `hh` that runs the project's locally installed `hardhat` and supports shell autocompletion for tasks. +`hardhat-shorthand` is an NPM package that installs a globally accessible binary called `hh` that runs the project's locally installed `hardhat` and supports shell autocompletion for tasks. Check [the guide](https://hardhat.org/guides/shorthand.html) to learn more. diff --git a/packages/hardhat-shorthand/package.json b/packages/hardhat-shorthand/package.json index 34aec03c81..c563dd7605 100644 --- a/packages/hardhat-shorthand/package.json +++ b/packages/hardhat-shorthand/package.json @@ -17,8 +17,8 @@ "cli" ], "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\" --exit", "build": "tsc --build .", "clean": "rimraf dist" diff --git a/packages/hardhat-solhint/README.md b/packages/hardhat-solhint/README.md index a45470cf2b..584ca7c296 100644 --- a/packages/hardhat-solhint/README.md +++ b/packages/hardhat-solhint/README.md @@ -1,5 +1,4 @@ -[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-solhint.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-solhint) -[![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) +[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-solhint.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-solhint) [![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) # hardhat-solhint diff --git a/packages/hardhat-solhint/package.json b/packages/hardhat-solhint/package.json index e470338e7c..bb2c2f8470 100644 --- a/packages/hardhat-solhint/package.json +++ b/packages/hardhat-solhint/package.json @@ -18,8 +18,8 @@ "linter" ], "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\" --exit", "build": "tsc --build .", "clean": "rimraf dist" diff --git a/packages/hardhat-solpp/README.md b/packages/hardhat-solpp/README.md index ae74ea0bcd..386490a54c 100644 --- a/packages/hardhat-solpp/README.md +++ b/packages/hardhat-solpp/README.md @@ -1,5 +1,4 @@ -[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-solpp.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-solpp) -[![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) +[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-solpp.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-solpp) [![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) # hardhat-solpp diff --git a/packages/hardhat-solpp/package.json b/packages/hardhat-solpp/package.json index 0a371bef75..2702e7bff1 100644 --- a/packages/hardhat-solpp/package.json +++ b/packages/hardhat-solpp/package.json @@ -18,8 +18,8 @@ "solpp" ], "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\" --exit", "build": "tsc --build .", "clean": "rimraf dist" diff --git a/packages/hardhat-truffle4/README.md b/packages/hardhat-truffle4/README.md index 83f6dde910..7fc1f3becc 100644 --- a/packages/hardhat-truffle4/README.md +++ b/packages/hardhat-truffle4/README.md @@ -1,5 +1,4 @@ -[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-truffle4.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-truffle4) -[![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) +[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-truffle4.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-truffle4) [![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) # hardhat-truffle4 diff --git a/packages/hardhat-truffle4/package.json b/packages/hardhat-truffle4/package.json index 52d59d72ad..ec1339fae0 100644 --- a/packages/hardhat-truffle4/package.json +++ b/packages/hardhat-truffle4/package.json @@ -17,8 +17,8 @@ "truffle-contract" ], "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\" --exit", "build": "tsc --build .", "clean": "rimraf dist" diff --git a/packages/hardhat-truffle5/README.md b/packages/hardhat-truffle5/README.md index 5ad455c7ae..a570149c41 100644 --- a/packages/hardhat-truffle5/README.md +++ b/packages/hardhat-truffle5/README.md @@ -1,5 +1,4 @@ -[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-truffle5.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-truffle5) -[![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) +[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-truffle5.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-truffle5) [![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) # hardhat-truffle5 @@ -41,7 +40,6 @@ An instance of [`TruffleEnvironmentArtifacts`](https://github.com/nomiclabs/hard ## Usage -There are no additional steps you need to take for this plugin to work. -Install it, run `npx hardhat test` and your Truffle tests should run with no need to make any modifications. +There are no additional steps you need to take for this plugin to work. Install it, run `npx hardhat test` and your Truffle tests should run with no need to make any modifications. Take a look at the [testing guide](https://hardhat.org/guides/testing) for a tutorial using it. diff --git a/packages/hardhat-truffle5/package.json b/packages/hardhat-truffle5/package.json index e36eb98df5..338a456d24 100644 --- a/packages/hardhat-truffle5/package.json +++ b/packages/hardhat-truffle5/package.json @@ -17,8 +17,8 @@ "truffle-contract" ], "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\" --exit", "build": "tsc --build .", "clean": "rimraf dist" diff --git a/packages/hardhat-vyper/README.md b/packages/hardhat-vyper/README.md index e99e42865e..2cfdbe6061 100644 --- a/packages/hardhat-vyper/README.md +++ b/packages/hardhat-vyper/README.md @@ -1,7 +1,6 @@ # hardhat-vyper -[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-vyper.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-vyper) -[![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) +[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-vyper.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-vyper) [![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) [Hardhat](https://hardhat.org) plugin to develop smart contracts with Vyper. @@ -9,8 +8,7 @@ This plugin adds support for Vyper to Hardhat. Once installed, Vyper contracts can be compiled by running the `compile` task. -This plugin generates the same artifact format as the built-in Solidity compiler, so that it can be used in conjunction with -all other plugins. +This plugin generates the same artifact format as the built-in Solidity compiler, so that it can be used in conjunction with all other plugins. The Vyper compiler is run using the [official Docker images](https://hub.docker.com/r/vyperlang/vyper). @@ -50,8 +48,7 @@ This plugin does not extend the Hardhat Runtime Environment. ## Configuration -This plugin adds an optional `vyper` entry to Hardhat's config, which lets you specify the Vyper version to use. If no -version is given, the [latest one on Docker Hub](https://hub.docker.com/r/vyperlang/vyper/tags) will be used. +This plugin adds an optional `vyper` entry to Hardhat's config, which lets you specify the Vyper version to use. If no version is given, the [latest one on Docker Hub](https://hub.docker.com/r/vyperlang/vyper/tags) will be used. This is an example of how to set it: diff --git a/packages/hardhat-vyper/package.json b/packages/hardhat-vyper/package.json index 921d7d5231..e0157e8c41 100644 --- a/packages/hardhat-vyper/package.json +++ b/packages/hardhat-vyper/package.json @@ -16,8 +16,8 @@ "vyper" ], "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\" --exit", "build": "tsc --build .", "clean": "rimraf dist" diff --git a/packages/hardhat-waffle/README.md b/packages/hardhat-waffle/README.md index b7cc1553ae..0b5462837f 100644 --- a/packages/hardhat-waffle/README.md +++ b/packages/hardhat-waffle/README.md @@ -1,5 +1,4 @@ -[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-waffle.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-waffle) -[![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) +[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-waffle.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-waffle) [![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) # hardhat-waffle @@ -7,11 +6,9 @@ ## What -You can use this plugin to build smart contract tests using Waffle in Hardhat, -taking advantage of both. +You can use this plugin to build smart contract tests using Waffle in Hardhat, taking advantage of both. -This plugin adds a Hardhat-ready version of Waffle to the Hardhat Runtime Environment, -and automatically initializes the [Waffle Chai matchers](https://ethereum-waffle.readthedocs.io/en/latest/matchers.html). +This plugin adds a Hardhat-ready version of Waffle to the Hardhat Runtime Environment, and automatically initializes the [Waffle Chai matchers](https://ethereum-waffle.readthedocs.io/en/latest/matchers.html). ## Installation @@ -49,8 +46,7 @@ The `waffle` object has these properties: - `createFixtureLoader` - `loadFixture` -This plugin depends on [`@nomiclabs/hardhat-ethers`](https://github.com/nomiclabs/hardhat/tree/master/packages/hardhat-ethers), -so it also injects an `ethers` object into the HRE, which is documented [here](https://github.com/nomiclabs/hardhat/tree/master/packages/hardhat-ethers#environment-extensions). +This plugin depends on [`@nomiclabs/hardhat-ethers`](https://github.com/nomiclabs/hardhat/tree/master/packages/hardhat-ethers), so it also injects an `ethers` object into the HRE, which is documented [here](https://github.com/nomiclabs/hardhat/tree/master/packages/hardhat-ethers#environment-extensions). ## Usage @@ -73,5 +69,4 @@ const { deployContract } = waffle; Also, you don't need to call `chai.use`. -Note that by default, Hardhat saves its compilation output into `artifacts/` instead of `build/`. You can either use -that directory in your tests, or [customize your Hardhat config](https://hardhat.org/config/#path-configuration). +Note that by default, Hardhat saves its compilation output into `artifacts/` instead of `build/`. You can either use that directory in your tests, or [customize your Hardhat config](https://hardhat.org/config/#path-configuration). diff --git a/packages/hardhat-waffle/package.json b/packages/hardhat-waffle/package.json index ec4336d5c3..8000b77260 100644 --- a/packages/hardhat-waffle/package.json +++ b/packages/hardhat-waffle/package.json @@ -16,8 +16,8 @@ "ethers.js" ], "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\" --exit", "build": "tsc --build .", "clean": "rimraf dist" diff --git a/packages/hardhat-web3-legacy/README.md b/packages/hardhat-web3-legacy/README.md index 005c988d50..4ef730752a 100644 --- a/packages/hardhat-web3-legacy/README.md +++ b/packages/hardhat-web3-legacy/README.md @@ -1,5 +1,4 @@ -[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-web3-legacy.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-web3-legacy) -[![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) +[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-web3-legacy.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-web3-legacy) [![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) # hardhat-web3-legacy diff --git a/packages/hardhat-web3-legacy/package.json b/packages/hardhat-web3-legacy/package.json index df3ae17b28..f8cff48d48 100644 --- a/packages/hardhat-web3-legacy/package.json +++ b/packages/hardhat-web3-legacy/package.json @@ -17,8 +17,8 @@ "web3.js" ], "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\" --exit", "build": "tsc --build .", "clean": "rimraf dist" diff --git a/packages/hardhat-web3/README.md b/packages/hardhat-web3/README.md index 1a69e4e238..c71d11751a 100644 --- a/packages/hardhat-web3/README.md +++ b/packages/hardhat-web3/README.md @@ -1,5 +1,4 @@ -[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-web3.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-web3) -[![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) +[![npm](https://img.shields.io/npm/v/@nomiclabs/hardhat-web3.svg)](https://www.npmjs.com/package/@nomiclabs/hardhat-web3) [![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org) # hardhat-web3 diff --git a/packages/hardhat-web3/package.json b/packages/hardhat-web3/package.json index 5d825cf38d..994bb6bc10 100644 --- a/packages/hardhat-web3/package.json +++ b/packages/hardhat-web3/package.json @@ -17,8 +17,8 @@ "web3.js" ], "scripts": { - "lint": "prettier --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", - "lint:fix": "prettier --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", + "lint": "prettier --prose-wrap=never --check \"**/*.{js,md,json}\" && tslint --config tslint.json --project ./tsconfig.json", + "lint:fix": "prettier --prose-wrap=never --write \"**/*.{js,md,json}\" && tslint --fix --config tslint.json --project ./tsconfig.json", "test": "mocha --recursive \"test/**/*.ts\" --exit && node web3-lazy-object-tests/when-accessing-web3-class.js && node web3-lazy-object-tests/when-accessing-web3-object.js && node web3-lazy-object-tests/when-requiring-web3-module.js", "build": "tsc --build .", "clean": "rimraf dist"