I am starting to explore account-abstraction and trying to run all the unit tests. Right now I am getting error in should deploy the factory test when trying to execute it on a private test evm network. When I run the same test against ganache or test hardhat network, it runs successfully.

The error I got when running against my private test network:

Error: insufficient funds for intrinsic transaction cost [ See: https://links.ethers.org/v5-errors-INSUFFICIENT_FUNDS ] (error={"name":"ProviderError","_stack":"ProviderError: HttpProviderError\n at HttpProvider.request (/Users/asad/Dev/caduceus/Account-Abstraction/eth-infinitism/account-abstraction/node_modules/hardhat/src/internal/core/providers/http.ts:78:19)\n at HDWalletProvider.request (/Users/asad/Dev/caduceus/Account-Abstraction/eth-infinitism/account-abstraction/node_modules/hardhat/src/internal/core/providers/accounts.ts:187:34)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async EthersProviderWrapper.send (/Users/asad/Dev/caduceus/Account-Abstraction/eth-infinitism/account-abstraction/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)","code":-32000,"_isProviderError":true}, method="sendTransaction", transaction="0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222", code=INSUFFICIENT_FUNDS, version=providers/5.7.2)

Although I deposit enough funds to the signer as well as the wallet i am running the test with.

More Questions:

  • The test, should deploy the factory is sending an already signed transaction, which ensure deployment of contract to a pre-computed address. Is this necessary to deploy this particular contract to the same address?
  • What does this particular contract (deployed by should deploy the factory test) do and where can we find source code for this?

2 Answers 2


If you are asking about this test case :

  it('should deploy the factory', async () => {
    expect(await factory._isFactoryDeployed()).to.equal(false, 'factory exists before test deploy')
    await factory.deployFactory()
    expect(await factory._isFactoryDeployed()).to.equal(true, 'factory failed to deploy')

Then : its only checking the factory deployment.

  • No. It checks whether factory is deployed or not and deploys if factory is not deployed.
    – Asad Hayat
    Commented Jul 18, 2023 at 21:33

Test tests are meant to run on local network. they were tested to work on local hardhat and geth

It is a standard deterministic deployer, not directly related to ERC-4337. The deployer is created from address 0x3fab184622dc19b6109349b94811493bf2a45362, so you can try to fund it and see if it works.

  • I tried multiple times to deploy the contract. I have funded the deployer address with sufficient balance, more than 150 ETHs. But still I get the same error.
    – Asad Hayat
    Commented Jul 24, 2023 at 14:27

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.