From e8207aface7553781720befae7a0e9114621d395 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Mon, 21 Feb 2022 06:55:10 -0600 Subject: [PATCH 1/4] Doc: ethers doesn't use node cfg's gas, etc --- docs/hardhat-network/reference/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/hardhat-network/reference/README.md b/docs/hardhat-network/reference/README.md index fa4fefd729..6e59d45f4a 100644 --- a/docs/hardhat-network/reference/README.md +++ b/docs/hardhat-network/reference/README.md @@ -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 when 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: From 67f0a1c1dd33cd0aada560aa8467c5f86240b69b Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Mon, 21 Feb 2022 15:59:16 -0600 Subject: [PATCH 2/4] "Note that when" not "Note when when" Co-authored-by: Franco Victorio --- docs/hardhat-network/reference/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hardhat-network/reference/README.md b/docs/hardhat-network/reference/README.md index 6e59d45f4a..45f56cfe4a 100644 --- a/docs/hardhat-network/reference/README.md +++ b/docs/hardhat-network/reference/README.md @@ -34,7 +34,7 @@ Note that when using `ethers` this value will not be applied. Its value should be `"auto"` or a number (in wei). This parameter behaves like `gas`. Default value: `"auto"`. -Note when when using `ethers` this value will not be applied. +Note that when using `ethers` this value will not be applied. #### `gasMultiplier` From 25dcefe716c3a32e34bc62f176477b8c4492cd60 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Thu, 10 Mar 2022 20:54:30 -0600 Subject: [PATCH 3/4] explaining this in the ethers plugin's readme Addresses review comment https://github.com/NomicFoundation/hardhat/pull/2406#issuecomment-1048791381 --- packages/hardhat-ethers/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/hardhat-ethers/README.md b/packages/hardhat-ethers/README.md index 006b56744b..fe373677dd 100644 --- a/packages/hardhat-ethers/README.md +++ b/packages/hardhat-ethers/README.md @@ -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. From 71d1636e023486413591e2916a658d0ee5bcc131 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Mon, 14 Mar 2022 10:03:11 -0600 Subject: [PATCH 4/4] add link to ethers overrides Co-authored-by: Franco Victorio --- packages/hardhat-ethers/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hardhat-ethers/README.md b/packages/hardhat-ethers/README.md index fe373677dd..002ee16b6e 100644 --- a/packages/hardhat-ethers/README.md +++ b/packages/hardhat-ethers/README.md @@ -132,4 +132,4 @@ If you are connecting to a Hardhat node using a `WebSocketProvider`, events shou ### 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. +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.