Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Commit

Permalink
Use EIP-1559 maxFeePerGas only on mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Oct 20, 2021
1 parent e582c19 commit f96f34f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "safe-react",
"version": "3.14.4",
"version": "3.14.5",
"description": "Allowing crypto users manage funds in a safer way",
"website": "https://github.com/gnosis/safe-react#readme",
"bugs": {
Expand Down
5 changes: 4 additions & 1 deletion src/logic/safe/store/actions/createTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import { checkIfOffChainSignatureIsPossible, getPreValidatedSignatures } from 's
import { TxParameters } from 'src/routes/safe/container/hooks/useTransactionParameters'
import { isTxPendingError } from 'src/logic/wallets/getWeb3'
import { Errors, logError } from 'src/logic/exceptions/CodedException'
import { getNetworkId } from 'src/config'
import { ETHEREUM_NETWORK } from 'src/config/networks/network.d'

export interface CreateTransactionArgs {
navigateToTransactionsTab?: boolean
Expand Down Expand Up @@ -148,11 +150,12 @@ export const createTransaction =
}

const tx = isExecution ? getExecutionTransaction(txArgs) : getApprovalTransaction(safeInstance, safeTxHash)
const gasParam = getNetworkId() === ETHEREUM_NETWORK.MAINNET ? 'maxFeePerGas' : 'gasPrice'
const sendParams: PayableTx = {
from,
value: 0,
gas: ethParameters?.ethGasLimit,
maxFeePerGas: ethParameters?.ethGasPriceInGWei,
[gasParam]: ethParameters?.ethGasPriceInGWei,
nonce: ethParameters?.ethNonce,
}

Expand Down
5 changes: 4 additions & 1 deletion src/logic/safe/store/actions/processTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import { Confirmation } from 'src/logic/safe/store/models/types/confirmation'
import { Operation, TransactionStatus } from '@gnosis.pm/safe-react-gateway-sdk'
import { isTxPendingError } from 'src/logic/wallets/getWeb3'
import { Errors, logError } from 'src/logic/exceptions/CodedException'
import { getNetworkId } from 'src/config'
import { ETHEREUM_NETWORK } from 'src/config/networks/network.d'

interface ProcessTransactionArgs {
approveAndExecute: boolean
Expand Down Expand Up @@ -134,11 +136,12 @@ export const processTransaction =

transaction = isExecution ? getExecutionTransaction(txArgs) : getApprovalTransaction(safeInstance, tx.safeTxHash)

const gasParam = getNetworkId() === ETHEREUM_NETWORK.MAINNET ? 'maxFeePerGas' : 'gasPrice'
const sendParams: PayableTx = {
from,
value: 0,
gas: ethParameters?.ethGasLimit,
maxFeePerGas: ethParameters?.ethGasPriceInGWei,
[gasParam]: ethParameters?.ethGasPriceInGWei,
nonce: ethParameters?.ethNonce,
}

Expand Down

0 comments on commit f96f34f

Please sign in to comment.