[Untracked] Fix feesPerGas null check & bump up default gas fee multiplier #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
When testing ARB-SEPOLIA there were errors running a token-transfer since there were errors getting the gas fee. After looking closer, one of the values being returned
maxPriorityFeePerGas
was 0. On the next line we did a null check, but based on on JavaScript handles falsly values it treated 0 as false 🙃So I updated the comparison to explicitly check for null or undefined. I also adjusted the calculations we did with
adjustedMaxPriorityFeePerGas
so we'd also scale up the value we got from alchemy. Without scaling this up the gas was too low to get accepted, kept gettingreplacement underpriced
responses.Also bumped up default gas fee to 1.2 multiplier. If at 1 most of the time there are problems sending out a transaction.
Detail
Testing
Documentation
Requested Reviewers: @mention