Bundle simulation failed

Hi there, I have a problem.

I’m trying to send a bundle of transactions in a single block.

I have two accounts:

  • the first one has 100 USDC
  • the second one has 10 USDC.

The first transaction in the bundle should send 10 USDC from the second account to the first. Then I tried to send all 110 USDC in a third party smart contract.

However, when I tried to simulate this bundle, I got an error in the second transaction that said ERC20: transfer amount exceeds balance.

This worked perfectly two weeks ago, what happened now?

Are you using Foundry to perform the simulation? Recently, the last Foundry update had a modification in addresses used to perform some operations. Inexplicably, it is occurring a problem when using address(0) … address(#anynumber) with vm.prank cheatcode, which obtains this message even with enough balance for some tokens. Maybe, they can provide some fix, but at the moment you can set a workaround by using the address of the test contract itself (address(this)).