0

I generated some random adrresses and simply want to impersonate one and send eth between them in a HardHat test:

const impersonatedSigner = await ethers.getImpersonatedSigner("0xAE7aE836fDFCcE859103CA8cb8455aE18611b852");
await impersonatedSigner.sendTransaction(
        {
                to: "0x1825FE1AEa79312FFBf44890Fc74DC28DC826386",
                value: ethers.utils.parseEther("0.01"),
        }
      );

However I'm running into an error which is hard to interpret:

InvalidArgumentsError: Errors encountered in param 0: Invalid value undefined supplied to : HASH at validateParams (/root/node_modules/hardhat/src/internal/core/jsonrpc/types/input/validation.ts:64:13) at EthModule._getTransactionReceiptParams (/root/node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:854:26) at EthModule.processRequest (/root/node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:209:19) at HardhatNetworkProvider._send (/root/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:195:31) at processTicksAndRejections (node:internal/process/task_queues:95:5) at HardhatNetworkProvider.request (/root/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:118:18) at TracerWrapper.request (/root/node_modules/hardhat-tracer/src/wrapper.ts:57:19) at EthersProviderWrapper.send (/root/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

I'm doing this on a forked mainnet but that shouldn't really matter.

2
  • This only happens with an ImpersonatedSigner. With an ethers.getSigners() it works fine.
    – Majiick
    Commented Jan 26, 2023 at 16:18
  • It works when impersonating the address 0x1234567890123456789012345678901234567890 and 0x6C61f101b6501449908e22818eb934693674ebe9 but not other randomly generated ones AND ones that already exist.
    – Majiick
    Commented Jan 26, 2023 at 16:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.