File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
Sources/web3swift/Transaction Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ extension EIP1559Envelope {
313
313
accessEncoding. append ( encoded)
314
314
}
315
315
params. accessList = accessEncoding
316
- let gasEncoding = self . gasLimit. abiEncode ( bits: 256 )
316
+ let gasEncoding = gasLimit > 21100 ? self . gasLimit. abiEncode ( bits: 256 ) : nil
317
317
params. gas = gasEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
318
318
let maxFeeEncoding = self . maxFeePerGas. abiEncode ( bits: 256 )
319
319
params. maxFeePerGas = maxFeeEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
Original file line number Diff line number Diff line change @@ -288,9 +288,9 @@ extension EIP2930Envelope {
288
288
accessEncoding. append ( encoded)
289
289
}
290
290
params. accessList = accessEncoding
291
- let gasEncoding = self . gasLimit. abiEncode ( bits: 256 )
291
+ let gasEncoding = gasLimit > 21100 ? self . gasLimit. abiEncode ( bits: 256 ) : nil
292
292
params. gas = gasEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
293
- let gasPriceEncoding = self . gasPrice. abiEncode ( bits: 256 )
293
+ let gasPriceEncoding = gasPrice > 10000000 ? self . gasPrice. abiEncode ( bits: 256 ) : nil
294
294
params. gasPrice = gasPriceEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
295
295
let valueEncoding = self . value. abiEncode ( bits: 256 )
296
296
params. value = valueEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
Original file line number Diff line number Diff line change @@ -251,9 +251,9 @@ extension LegacyEnvelope {
251
251
break
252
252
}
253
253
var params = TransactionParameters ( from: from? . address. lowercased ( ) , to: toString)
254
- let gasEncoding = self . gasLimit. abiEncode ( bits: 256 )
254
+ let gasEncoding = gasLimit > 21100 ? self . gasLimit. abiEncode ( bits: 256 ) : nil
255
255
params. gas = gasEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
256
- let gasPriceEncoding = self . gasPrice. abiEncode ( bits: 256 )
256
+ let gasPriceEncoding = gasPrice > 10000000 ? self . gasPrice. abiEncode ( bits: 256 ) : nil
257
257
params. gasPrice = gasPriceEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
258
258
let valueEncoding = self . value. abiEncode ( bits: 256 )
259
259
params. value = valueEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
You can’t perform that action at this time.
0 commit comments