Skip to content

Commit

Permalink
Merge pull request #2406 from NomicFoundation/doc-node-gas-cfg-not-fo…
Browse files Browse the repository at this point in the history
…r-ethers

Document that ethers doesn't use Hardhat Network's config values for gas, gasPrice, gasMultiplier
  • Loading branch information
feuGeneA committed May 5, 2022
2 parents fd1f7f8 + 71d1636 commit 07c7f68
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/hardhat-network/reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,20 @@ The address to use as default sender. If not present the first account of the Ha

Its value should be `"auto"` or a number. If a number is used, it will be the gas limit used by default in every transaction. If `"auto"` is used, the gas limit will be automatically estimated. Default value: the same value as `blockGasLimit`.

Note that when using `ethers` this value will not be applied.

#### `gasPrice`

Its value should be `"auto"` or a number (in wei). This parameter behaves like `gas`. Default value: `"auto"`.

Note that when using `ethers` this value will not be applied.

#### `gasMultiplier`

A number used to multiply the results of gas estimation to give it some slack due to the uncertainty of the estimation process. Default value: `1`.

Note that when using `ethers` this value will not be applied.

#### `accounts`

This field can be configured as one of these:
Expand Down
4 changes: 4 additions & 0 deletions packages/hardhat-ethers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,7 @@ To create a contract factory, all libraries must be linked. An error will be thr
Ethers.js polls the network to check if some event was emitted (except when a `WebSocketProvider` is used; see below). This polling is done every 4 seconds. If you have a script or test that is not emitting an event, it's likely that the execution is finishing before the event is detected by the polling mechanism.

If you are connecting to a Hardhat node using a `WebSocketProvider`, events should be emitted immediately. But keep in mind that you'll have to create this provider manually, since Hardhat only supports configuring networks via http. That is, you can't add a `localhost` network with a URL like `ws://localhost:8545`.

### Gas transaction parameters in `hardhat.config` are not used

When using this plugin, the `gas`, `gasPrice` and `gasMultiplier` parameters from your `hardhat.config` are not automatically applied to transactions. In order to provide such values to your transactions, specify them as [overrides](https://docs.ethers.io/v5/single-page/#/v5/api/contract/contract/-%23-contract-functionsSend) on the transaction itself.

0 comments on commit 07c7f68

Please sign in to comment.