Skip to content

Commit e0af57c

Browse files
committed
Document why HardhatEthersSigner validates and ENS-resolves from
1 parent 6f9df4e commit e0af57c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • packages/hardhat-ethers/src/internal/signers

packages/hardhat-ethers/src/internal/signers/signers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,10 @@ export class HardhatEthersSigner implements HardhatEthersSignerI {
252252

253253
const promises: Array<Promise<void>> = [];
254254

255-
// Make sure the from matches the sender
255+
// Mirror stock ethers: ENS-resolve `from` and assert it matches the
256+
// signer. Hardhat can be pointed at mainnet/testnets via --network, where
257+
// ENS works and users expect ethers-compatible `from` handling. Don't
258+
// "simplify" this by letting the node handle the mismatch.
256259
if (resolvedTx.from !== null && resolvedTx.from !== undefined) {
257260
const _from = resolvedTx.from;
258261
promises.push(

0 commit comments

Comments
 (0)