Skip to content

Commit 2ab8103

Browse files
authored
feat: disable strict mode in Transaction.prepare (#6643)
* feat: disable strict mode in Transaction.prepare * Create gold-months-try.md
1 parent 67f1e95 commit 2ab8103

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

.changeset/gold-months-try.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": patch
3+
---
4+
5+
Relax validations for transaction signing introduced in the previous version by disabling strict mode in `Transaction.prepare`.

packages/hardhat-core/src/internal/core/providers/accounts.ts

+2-10
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ export class LocalAccountsProvider extends ProviderWrapperWithChainId {
295295
);
296296

297297
let transaction;
298+
// strict mode is not meant to be used in the context of hardhat
299+
const strictMode = false;
298300
const baseTxParams = {
299301
to: checksummedAddress,
300302
nonce: txData.nonce,
@@ -304,16 +306,6 @@ export class LocalAccountsProvider extends ProviderWrapperWithChainId {
304306
gasLimit: txData.gasLimit,
305307
};
306308

307-
// Disable strict mode for chainIds > 2 ** 32 - 1.
308-
//
309-
// micro-eth-signer throws if strict mode is enabled with a chainId above 2 ** 32 - 1
310-
// (see: https://github.com/paulmillr/micro-eth-signer/blob/baa4b8c922c3253b125e3f46b1fce6dee7c33853/src/tx.ts#L500).
311-
//
312-
// As a workaround we disable strict mode for larger chains. This also bypasses
313-
// other internal checks enforced by the library, which is not ideal.
314-
const strictMode =
315-
txData.chainId === undefined || txData.chainId <= BigInt(2 ** 32 - 1);
316-
317309
if (authorizationList !== undefined) {
318310
assertHardhatInvariant(
319311
txData.maxFeePerGas !== undefined,

0 commit comments

Comments
 (0)