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 {
313313 accessEncoding. append ( encoded)
314314 }
315315 params. accessList = accessEncoding
316- let gasEncoding = self . gasLimit. abiEncode ( bits: 256 )
316+ let gasEncoding = gasLimit > 21100 ? self . gasLimit. abiEncode ( bits: 256 ) : nil
317317 params. gas = gasEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
318318 let maxFeeEncoding = self . maxFeePerGas. abiEncode ( bits: 256 )
319319 params. maxFeePerGas = maxFeeEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
Original file line number Diff line number Diff line change @@ -288,9 +288,9 @@ extension EIP2930Envelope {
288288 accessEncoding. append ( encoded)
289289 }
290290 params. accessList = accessEncoding
291- let gasEncoding = self . gasLimit. abiEncode ( bits: 256 )
291+ let gasEncoding = gasLimit > 21100 ? self . gasLimit. abiEncode ( bits: 256 ) : nil
292292 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
294294 params. gasPrice = gasPriceEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
295295 let valueEncoding = self . value. abiEncode ( bits: 256 )
296296 params. value = valueEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
Original file line number Diff line number Diff line change @@ -251,9 +251,9 @@ extension LegacyEnvelope {
251251 break
252252 }
253253 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
255255 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
257257 params. gasPrice = gasPriceEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
258258 let valueEncoding = self . value. abiEncode ( bits: 256 )
259259 params. value = valueEncoding? . toHexString ( ) . addHexPrefix ( ) . stripLeadingZeroes ( )
You can’t perform that action at this time.
0 commit comments