Skip to content

Commit

Permalink
fix(core): Fix gas price overrides on polygon pos and linea
Browse files Browse the repository at this point in the history
  • Loading branch information
RPate97 committed Sep 6, 2023
1 parent 0d1ce46 commit c13da7c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/brown-houses-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@sphinx-labs/plugins': patch
'@sphinx-labs/core': patch
---

Fix gas price overrides on Linea and Polygon POS
17 changes: 12 additions & 5 deletions packages/core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,18 @@ export const getGasPriceOverrides = async (
// Do not do anything for polygon zkevm and it's testnet
case 1101 || 1442:
return overridden
case 127 || 80001:
case 59144:
if (gasPrice !== null) {
overridden.gasPrice = gasPrice
return overridden
}
case 137:
if (maxFeePerGas !== null && maxPriorityFeePerGas !== null) {
overridden.maxFeePerGas = maxFeePerGas
overridden.maxPriorityFeePerGas = maxFeePerGas.toString()
}
return overridden
case 80001:
overridden.nonce = await signer.provider.getTransactionCount(
await signer.getAddress(),
'latest'
Expand All @@ -466,10 +477,6 @@ export const getGasPriceOverrides = async (
if (maxFeePerGas !== null && maxPriorityFeePerGas !== null) {
overridden.maxFeePerGas = maxFeePerGas
overridden.maxPriorityFeePerGas = maxPriorityFeePerGas
overridden.nonce = await signer.provider.getTransactionCount(
await signer.getAddress(),
'latest'
)
}
return overridden
}
Expand Down

0 comments on commit c13da7c

Please sign in to comment.