@@ -383,7 +383,7 @@ private async Task<object> SignUserOp(ThirdwebTransactionInput transactionInput,
383
383
// Estimate gas
384
384
385
385
var gasEstimates = await BundlerClient . EthEstimateUserOperationGas ( this . Client , this . _bundlerUrl , requestId , EncodeUserOperation ( partialUserOp ) , this . _entryPointContract . Address ) ;
386
- partialUserOp . CallGasLimit = 50000 + new HexBigInteger ( gasEstimates . CallGasLimit ) . Value ;
386
+ partialUserOp . CallGasLimit = Math . Max ( ( long ) ( 50000 + new HexBigInteger ( gasEstimates . CallGasLimit ) . Value ) , ( long ? ) transactionInput . Gas ? . Value ?? 0 ) ;
387
387
partialUserOp . VerificationGasLimit = new HexBigInteger ( gasEstimates . VerificationGasLimit ) . Value ;
388
388
partialUserOp . PreVerificationGas = new HexBigInteger ( gasEstimates . PreVerificationGas ) . Value ;
389
389
@@ -462,11 +462,11 @@ private async Task<object> SignUserOp(ThirdwebTransactionInput transactionInput,
462
462
var res = await this . GetPaymasterAndData ( requestId , EncodeUserOperation ( partialUserOp ) , simulation ) ;
463
463
partialUserOp . Paymaster = res . Paymaster ;
464
464
partialUserOp . PaymasterData = res . PaymasterData ? . HexToBytes ( ) ?? Array . Empty < byte > ( ) ;
465
- partialUserOp . PreVerificationGas = new HexBigInteger ( res . PreVerificationGas ?? "0 " ) . Value ;
466
- partialUserOp . VerificationGasLimit = new HexBigInteger ( res . VerificationGasLimit ?? "0 " ) . Value ;
467
- partialUserOp . CallGasLimit = new HexBigInteger ( res . CallGasLimit ?? "0 " ) . Value ;
468
- partialUserOp . PaymasterVerificationGasLimit = new HexBigInteger ( res . PaymasterVerificationGasLimit ?? "0 " ) . Value ;
469
- partialUserOp . PaymasterPostOpGasLimit = new HexBigInteger ( res . PaymasterPostOpGasLimit ?? "0 " ) . Value ;
465
+ partialUserOp . PreVerificationGas = new HexBigInteger ( res . PreVerificationGas ?? "0x0 " ) . Value ;
466
+ partialUserOp . VerificationGasLimit = new HexBigInteger ( res . VerificationGasLimit ?? "0x0 " ) . Value ;
467
+ partialUserOp . CallGasLimit = new HexBigInteger ( res . CallGasLimit ?? "0x0 " ) . Value ;
468
+ partialUserOp . PaymasterVerificationGasLimit = new HexBigInteger ( res . PaymasterVerificationGasLimit ?? "0x0 " ) . Value ;
469
+ partialUserOp . PaymasterPostOpGasLimit = new HexBigInteger ( res . PaymasterPostOpGasLimit ?? "0x0 " ) . Value ;
470
470
}
471
471
472
472
// Hash, sign and encode the user operation
0 commit comments