AA13 initCode failed or OOG

The initCode failed to create the account or ran out of gas.


The initCode failed to create the account or ran out of gas. "OOG" is an abbreviation for Out-Of-Gas.


There are two causes:

  1. The initCode ran out of gas
  2. The initCode has an error.


Solutions

  1. Check the account has ETH to pay for its creation if you aren't using a paymaster.
  2. If you are using a paymaster, verify the paymaster is set.
  3. Check that the first 20 bytes of the initCode are the factory address.
  4. Verify that the verificationGasLimit is high enough to pay for the initCode.
    1. Simple user operations should be between 50,000 and 100,000 gas, while more complex user operations can be as much as 2 million gas.
    2. Check your verificationGasLimit against the values returned by eth_estimateUserOperationGas and pm_sponsorUserOperation API methods.
    3. If you are hard-coding the verificationGasLimit, consider using the eth_estimateUserOperationGas limit.
  5. Investigate why the initCode used more gas than expected using tools like userop.dev, Tenderly, or the ERC-4337 Devnet.
  6. Reach out to your bundler provider or ask a question in the Stackup Discord server for help. Be sure to include the user operation and any relevant information about how you're building it.