latticexyz / mud

MUD is a framework for building autonomous worlds
https://mud.dev
MIT License
729 stars 184 forks source link

custom estimate fees action for cached fees #3289

Open holic opened 2 hours ago

holic commented 2 hours ago

currently we fetch+override fees in writeContract and sendTransaction (which recently lead to a bug and fixed in https://github.com/latticexyz/mud/pull/3288)

instead, we could add an action override for estimateFeesPerGas that would cache/refresh these values and allow us to remove the manual overrides of args in writeContract/sendTransaction

holic commented 2 hours ago

note that whatever uses this new may need to override the rest of the actions in the call stack (e.g. prepareTransactionRequest) due to the issue demonstrated in https://github.com/wevm/viem/pull/2680#discussion_r1739700440