Skip to content

Commit

Permalink
optional auto gas price
Browse files Browse the repository at this point in the history
  • Loading branch information
demon-xxi committed Mar 23, 2023
1 parent 9a3f7b7 commit 01289e3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const config: HardhatUserConfig = {
url: `https://ropsten.infura.io/v3/${process.env.INFURA_KEY}`,
gcpKmsKeyName: "YOUR KMS KEY ID",
minMaxFeePerGas: 1600000000,
mixMaxPriorityFeePerGas: 1200000000
minMaxPriorityFeePerGas: 1200000000
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@conduitxyz/hardhat-gcp-kms-signer",
"version": "1.1.4",
"version": "1.1.5",
"description": "Sign Hardhat deployment transactions using KMS key",
"repository": "github:conduitxyz/hardhat-gcp-kms-signer",
"author": "Conduit XYZ",
Expand Down
20 changes: 11 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,17 @@ extendEnvironment((hre) => {
eip1193Provider,
hre.network.config.gcpKmsKeyName
);
wrappedProvider = new AutomaticGasProvider(
wrappedProvider,
hre.network.config.gasMultiplier
);
wrappedProvider = new AutomaticGasPriceProvider(
wrappedProvider,
hre.network.config.minMaxFeePerGas,
hre.network.config.minMaxPriorityFeePerGas
);
if (hre.network.config.minMaxFeePerGas || hre.network.config.minMaxPriorityFeePerGas) {
wrappedProvider = new AutomaticGasProvider(
wrappedProvider,
hre.network.config.gasMultiplier
);
wrappedProvider = new AutomaticGasPriceProvider(
wrappedProvider,
hre.network.config.minMaxFeePerGas,
hre.network.config.minMaxPriorityFeePerGas
);
}
hre.network.provider = new BackwardsCompatibilityProviderAdapter(
wrappedProvider
);
Expand Down

0 comments on commit 01289e3

Please sign in to comment.