ApeWorX / ape-foundry

Foundry network provider for the Ape Framework
https://www.apeworx.io/
Apache License 2.0
33 stars 13 forks source link

feat: allow configuring `base_fee` and `priority_fee` [APE-847] #46

Closed antazoey closed 1 year ago

antazoey commented 1 year ago

What I did

Noticed that ape-hardhat uses both base_fee and priority_fee values of 0, which allows being able to use any account you want as an impersonated account, regardless of how much funds it has.

ape-foundry differs here. Instead, it defaults to having values returned for each field. We can discuss if we want to conform one or the other to the same (0.7 ?) or if it is ok to have them be different. But for now, to allow them to work the same if desired, allow configuring these fields.

How I did it

How to verify it

Create an use a config like:

foundry:
  priority_fee: 0
  base_fee: 0

then crack open a console:

ape console --network ethereum:local:foundry

then check that it is set:

In [1]: chain.provider.priority_fee
Out[1]: 2000000000
In [2]: In [1]: chain.provider.base_fee
Out[2]: 1000000000

Checklist

linear[bot] commented 1 year ago
APE-847 "feat: allow configuring `base_fee` and `priority_fee`" (ApeWorX/ape-foundry #46)

### What I did Noticed that `ape-hardhat` uses both `base_fee` and `priority_fee` values of `0`, which allows being able to use any account you want as an impersonated account, regardless of how much funds it has. `ape-foundry` differs here. Instead, it defaults to having values returned for each field. **We can discuss if we want to conform one or the other to the same (0.7 ?) or if it is ok to have them be different.** But for now, to allow them to work the same if desired, allow configuring these fields. ### How I did it * Add options to foundry config * Honor options respectively * Add test ### How to verify it Create an use a config like: ``` foundry: priority_fee: 0 base_fee: 0 ``` ### Checklist * [ ] Passes all linting checks (pre-commit and CI jobs) * [ ] New test cases have been added and are passing * [ ] Documentation has been updated * [ ] PR title follows [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) standard (will be automatically included in the changelog) --- [ApeWorX/ape-foundry #46](https://github.com/ApeWorX/ape-foundry/pull/46) by [antazoey](https://github.com/antazoey) on GitHub *via LinearSync*

antazoey commented 1 year ago

the latest foundry seems to be broken