Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that ethers doesn't use Hardhat Network's config values for gas, gasPrice, gasMultiplier #2406

Merged
merged 4 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 on the transaction itself.
feuGeneA marked this conversation as resolved.
Show resolved Hide resolved