Skip to content

Commit 47ead92

Browse files
Merge branch 'main' into general-cleanup
2 parents a89a41a + cc619ce commit 47ead92

File tree

12 files changed

+33
-444
lines changed

12 files changed

+33
-444
lines changed

.changeset/hot-spoons-sparkle.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": minor
3+
---
4+
5+
Remove support for `console.log` selectors that wrongly use "(u)int" type aliases in the selector calculation

docs/src/content/ignition/docs/config/index.md

+21
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module.exports = {
1414
timeBeforeBumpingFees: 3 * 60 * 1_000,
1515
maxFeeBumps: 4,
1616
requiredConfirmations: 5,
17+
disableFeeBumping: false,
1718
},
1819
};
1920
```
@@ -44,6 +45,12 @@ The number of confirmations Hardhat Ignition waits before considering a transact
4445

4546
Default value: 5
4647

48+
### `disableFeeBumping`
49+
50+
If set to `true`, Hardhat Ignition will not bump the fee for unconfirmed transactions. Overrides the `disableFeeBumping` option in the network configuration.
51+
52+
Default value: false
53+
4754
## Network configuration options
4855

4956
You can use the `ignition` field under specific network configurations to customize deployments on a per-network basis:
@@ -57,6 +64,8 @@ module.exports = {
5764
ignition: {
5865
maxFeePerGasLimit: 50_000_000_000n, // 50 gwei
5966
maxPriorityFeePerGas: 2_000_000_000n, // 2 gwei
67+
gasPrice: 50_000_000_000n, // 50 gwei
68+
disableFeeBumping: false,
6069
},
6170
// ...
6271
},
@@ -77,3 +86,15 @@ Default value: undefined
7786
The maximum priority fee per gas, in wei, that Hardhat Ignition will use for gas fee calculations when sending transactions. If not set then Hardhat Ignition will try to use `eth_maxPriorityFeePerGas` if available, or default to 1 gwei.
7887

7988
Default value: undefined
89+
90+
### `gasPrice`
91+
92+
The gas price, in wei, that Hardhat Ignition will use for gas fee calculations when sending transactions. **This field only applies to deployments on the Polygon network. It will not be used on other networks even if set.**
93+
94+
Default value: undefined
95+
96+
### `disableFeeBumping`
97+
98+
If set to `true`, Hardhat Ignition will not bump the fee for unconfirmed transactions on this network. Is overridden by the top-level `disableFeeBumping` option.
99+
100+
Default value: false

packages/hardhat-core/scripts/console-library-generator.ts

+7-19
Original file line numberDiff line numberDiff line change
@@ -101,27 +101,15 @@ const CONSOLE_LOG_FUNCTIONS =
101101
);
102102

103103
/** Maps from a 4-byte function selector to a signature (argument types) */
104-
const CONSOLE_LOG_SIGNATURES: Map<string, string[]> =
105-
CONSOLE_LOG_FUNCTIONS.reduce((acc, { params }) => {
106-
// We always use `log` for the selector, even if it's logUint, for example.
104+
const CONSOLE_LOG_SIGNATURES = Object.fromEntries(
105+
CONSOLE_LOG_FUNCTIONS.map(({ params }) => {
106+
// We always use "log" for the selector, even if it's logUint, for example.
107107
const signature = toHex(selector({ name: "log", params }));
108108
const types = params.map((p) => p.type);
109-
acc.set(signature, types);
110-
111-
// For backwards compatibility, we additionally support the (invalid)
112-
// selectors that contain the `int`/`uint` aliases in the selector calculation.
113-
if (params.some((p) => ["uint256", "int256"].includes(p.type))) {
114-
const aliased = params.map((p) => ({
115-
...p,
116-
type: p.type.replace("int256", "int"),
117-
}));
118-
119-
const signature = toHex(selector({ name: "log", params: aliased }));
120-
acc.set(signature, types);
121-
}
122109

123-
return acc;
124-
}, new Map());
110+
return [signature, types];
111+
})
112+
);
125113

126114
// Finally, render and save the console.sol and logger.ts files
127115
const consoleSolFile = `\
@@ -190,7 +178,7 @@ ${Array.from(SINGLE_TYPES.map((param) => capitalize(param.type)))
190178
191179
/** Maps from a 4-byte function selector to a signature (argument types) */
192180
export const CONSOLE_LOG_SIGNATURES: Record<number, string[]> = {
193-
${Array.from(CONSOLE_LOG_SIGNATURES)
181+
${Object.entries(CONSOLE_LOG_SIGNATURES)
194182
.map(([sig, types]) => {
195183
const typeNames = types.map((type) => `${capitalize(type)}Ty`).join(", ");
196184
return ` ${sig}: [${typeNames}],`;

0 commit comments

Comments
 (0)