ape-foundry
ape-foundry copied to clipboard
Transactions fail requiring funds for gas when impersonating smart contracts (version 0.7.3 only)
Environment information
-
ape
and plugin versions:
$ ape --version
0.7.10
$ ape plugins list
Installed Plugins
foundry 0.7.3
vyper 0.7.0
- Python 3.10.0
- OS: macOS
What went wrong?
After upgrading from ape-foundry 0.7.2 to 0.7.3 I started getting the error Insufficient funds for gas * price + value
when impersonating smart-contracts from tests. The error makes sense, because the contracts don't have any eth, but it used to work normally in prior versions.
Yes, it no longer is going to work, you have to set balances now for accounts. This is because of some checks in ape core and changes to fee settings.
Alternatively, if you want it to just work like it before you can set the fees all to 0 in the config, but that is not as ideal imo.
I think it makes more sense to ensure you accounts have balances before spending money in tests:
account.balance += 100_000_000_000_000