File tree Expand file tree Collapse file tree 6 files changed +32
-0
lines changed
test-integrations/new-api/internal/new-execution Expand file tree Collapse file tree 6 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @nomicfoundation/ignition-core " : patch
3+ " @nomicfoundation/hardhat-ignition " : patch
4+ ---
5+
6+ Add configurable maxFeePerGas and default to it if set
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export async function deploy<
5252 strategy,
5353 strategyConfig,
5454 maxFeePerGasLimit,
55+ maxFeePerGas,
5556 maxPriorityFeePerGas,
5657 gasPrice,
5758 disableFeeBumping,
@@ -72,6 +73,7 @@ export async function deploy<
7273 strategy ?: StrategyT ;
7374 strategyConfig ?: StrategyConfig [ StrategyT ] ;
7475 maxFeePerGasLimit ?: bigint ;
76+ maxFeePerGas ?: bigint ;
7577 maxPriorityFeePerGas ?: bigint ;
7678 gasPrice ?: bigint ;
7779 disableFeeBumping ?: boolean ;
@@ -120,6 +122,7 @@ export async function deploy<
120122
121123 const jsonRpcClient = new EIP1193JsonRpcClient ( provider , {
122124 maxFeePerGasLimit,
125+ maxFeePerGas,
123126 maxPriorityFeePerGas,
124127 gasPrice,
125128 } ) ;
Original file line number Diff line number Diff line change @@ -193,6 +193,7 @@ export class EIP1193JsonRpcClient implements JsonRpcClient {
193193 private readonly _provider : EIP1193Provider ,
194194 private readonly _config ?: {
195195 maxFeePerGasLimit ?: bigint ;
196+ maxFeePerGas ?: bigint ;
196197 maxPriorityFeePerGas ?: bigint ;
197198 gasPrice ?: bigint ;
198199 }
@@ -687,6 +688,7 @@ export class EIP1193JsonRpcClient implements JsonRpcClient {
687688
688689 // Logic copied from ethers v6
689690 const maxFeePerGas =
691+ this . _config ?. maxFeePerGas ??
690692 latestBlock . baseFeePerGas * 2n + maxPriorityFeePerGas ;
691693
692694 return {
Original file line number Diff line number Diff line change @@ -121,6 +121,20 @@ describe("JSON-RPC client", function () {
121121 assert . equal ( fees . maxPriorityFeePerGas , 1n ) ;
122122 } ) ;
123123
124+ it ( "Should use the configured maxFeePerGas" , async function ( ) {
125+ const maxFeeClient = new EIP1193JsonRpcClient (
126+ this . hre . network . provider ,
127+ {
128+ maxFeePerGas : 1n ,
129+ }
130+ ) ;
131+ const fees = await maxFeeClient . getNetworkFees ( ) ;
132+
133+ assert ( "maxFeePerGas" in fees ) ;
134+
135+ assert . equal ( fees . maxFeePerGas , 1n ) ;
136+ } ) ;
137+
124138 it ( "Should use return legacy fees when deploying to polygon network (chainId 137)" , async function ( ) {
125139 const polygonClient = new EIP1193JsonRpcClient (
126140 {
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ extendConfig((config, userConfig) => {
4949
5050 config . networks [ networkName ] . ignition = {
5151 maxFeePerGasLimit : userNetworkConfig . ignition ?. maxFeePerGasLimit ,
52+ maxFeePerGas : userNetworkConfig . ignition ?. maxFeePerGas ,
5253 maxPriorityFeePerGas : userNetworkConfig . ignition ?. maxPriorityFeePerGas ,
5354 gasPrice : userNetworkConfig . ignition ?. gasPrice ,
5455 disableFeeBumping : userNetworkConfig . ignition ?. disableFeeBumping ,
@@ -325,6 +326,8 @@ ignitionScope
325326 strategyConfig,
326327 maxFeePerGasLimit :
327328 hre . config . networks [ hre . network . name ] ?. ignition . maxFeePerGasLimit ,
329+ maxFeePerGas :
330+ hre . config . networks [ hre . network . name ] ?. ignition . maxFeePerGas ,
328331 maxPriorityFeePerGas :
329332 hre . config . networks [ hre . network . name ] ?. ignition
330333 . maxPriorityFeePerGas ,
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ declare module "hardhat/types/config" {
1616 export interface HardhatNetworkUserConfig {
1717 ignition ?: {
1818 maxFeePerGasLimit ?: bigint ;
19+ maxFeePerGas ?: bigint ;
1920 maxPriorityFeePerGas ?: bigint ;
2021 gasPrice ?: bigint ;
2122 disableFeeBumping ?: boolean ;
@@ -26,6 +27,7 @@ declare module "hardhat/types/config" {
2627 export interface HardhatNetworkConfig {
2728 ignition : {
2829 maxFeePerGasLimit ?: bigint ;
30+ maxFeePerGas ?: bigint ;
2931 maxPriorityFeePerGas ?: bigint ;
3032 gasPrice ?: bigint ;
3133 disableFeeBumping ?: boolean ;
@@ -36,6 +38,7 @@ declare module "hardhat/types/config" {
3638 export interface HttpNetworkUserConfig {
3739 ignition ?: {
3840 maxFeePerGasLimit ?: bigint ;
41+ maxFeePerGas ?: bigint ;
3942 maxPriorityFeePerGas ?: bigint ;
4043 gasPrice ?: bigint ;
4144 disableFeeBumping ?: boolean ;
@@ -46,6 +49,7 @@ declare module "hardhat/types/config" {
4649 export interface HttpNetworkConfig {
4750 ignition : {
4851 maxFeePerGasLimit ?: bigint ;
52+ maxFeePerGas ?: bigint ;
4953 maxPriorityFeePerGas ?: bigint ;
5054 gasPrice ?: bigint ;
5155 disableFeeBumping ?: boolean ;
You can’t perform that action at this time.
0 commit comments