File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Assets/Thirdweb/Core/Scripts Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,16 @@ public static async Task<TransactionReceipt> ThirdwebWriteRawResult<TWFunction>(
59
59
else
60
60
{
61
61
var gasEstimator = new Web3 ( ThirdwebManager . Instance . SDK . session . RPC ) . Eth . GetContractTransactionHandler < TWFunction > ( ) ;
62
- var gas = await gasEstimator . EstimateGasAsync ( contractAddress , functionMessage ) ;
63
- functionMessage . Gas = gas . Value < 100000 ? 100000 : gas . Value ;
62
+ functionMessage . Gas = 100000 ;
63
+ try
64
+ {
65
+ var gas = await gasEstimator . EstimateGasAsync ( contractAddress , functionMessage ) ;
66
+ functionMessage . Gas = gas . Value < 100000 ? 100000 : gas . Value ;
67
+ }
68
+ catch ( System . Exception e )
69
+ {
70
+ Debug . LogWarning ( $ "Failed to estimate gas for transaction, proceeding with 100k gas: { e . Message } ") ;
71
+ }
64
72
}
65
73
66
74
bool isGasless = ThirdwebManager . Instance . SDK . session . Options . gasless . HasValue && ThirdwebManager . Instance . SDK . session . Options . gasless . Value . openzeppelin . HasValue ;
You can’t perform that action at this time.
0 commit comments