Skip to content

Commit eceda79

Browse files
yann300Aniket-Engg
authored andcommitted
fix fee calculation
1 parent 73c5894 commit eceda79

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libs/remix-lib/src/execution/txRunnerWeb3.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { EventManager } from '../eventManager'
33
import type { Transaction as InternalTransaction } from './txRunner'
44
import Web3 from 'web3'
5-
import {toBigInt} from 'web3-utils'
5+
import {toBigInt, toHex} from 'web3-utils'
66

77
export class TxRunnerWeb3 {
88
event
@@ -27,11 +27,11 @@ export class TxRunnerWeb3 {
2727
}
2828
if (txFee) {
2929
if (txFee.baseFeePerGas) {
30-
tx.maxPriorityFeePerGas = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.maxPriorityFee, 'gwei'))
31-
tx.maxFeePerGas = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.maxFee, 'gwei'))
30+
tx.maxPriorityFeePerGas = toHex(BigInt(this.getWeb3().utils.toWei(txFee.maxPriorityFee, 'gwei')))
31+
tx.maxFeePerGas = toHex(BigInt(this.getWeb3().utils.toWei(txFee.maxFee, 'gwei')))
3232
tx.type = '0x2'
3333
} else {
34-
tx.gasPrice = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.gasPrice, 'gwei'))
34+
tx.gasPrice = toHex(BigInt(this.getWeb3().utils.toWei(txFee.gasPrice, 'gwei')))
3535
tx.type = '0x1'
3636
}
3737
}

0 commit comments

Comments
 (0)