@@ -24,8 +24,8 @@ public async void CustomCall()
24
24
Contract contract = ThirdwebManager . Instance . SDK . GetContract ( "0x62Cf5485B6C24b707E47C5E0FB2EAe7EbE18EC4c" , MY_CUSTOM_CONTRACT_ABI ) ;
25
25
26
26
// Contract.Read
27
- // string uri = await contract.Read<string>("uri", 0);
28
- // Debugger.Instance.Log("[Custom Call] Read Custom URI Successful", uri);
27
+ string uri = await contract . Read < string > ( "uri" , 0 ) ;
28
+ Debugger . Instance . Log ( "[Custom Call] Read Custom URI Successful" , uri ) ;
29
29
30
30
// Contract.Write
31
31
// TransactionResult transactionResult = await contract.Write("claimKitten");
@@ -37,41 +37,41 @@ public async void CustomCall()
37
37
// }, "0xE79ee09bD47F4F5381dbbACaCff2040f2FbC5803", 0, 1);
38
38
39
39
// Contract.Prepare
40
- string connectedAddress = await ThirdwebManager . Instance . SDK . wallet . GetAddress ( ) ;
41
- Transaction transaction = await contract . Prepare ( functionName : "claim" , from : connectedAddress , connectedAddress , 0 , 1 ) ;
42
- // transaction.SetValue("0.00000000001");
43
- // transaction.SetGasLimit("100000");
40
+ // string connectedAddress = await ThirdwebManager.Instance.SDK.wallet.GetAddress();
41
+ // Transaction transaction = await contract.Prepare(functionName: "claim", from: connectedAddress, connectedAddress, 0, 1);
42
+ // // transaction.SetValue("0.00000000001");
43
+ // // transaction.SetGasLimit("100000");
44
44
45
- try
46
- {
47
- var data = await transaction . Simulate ( ) ;
48
- Debugger . Instance . Log ( "[Custom Call] Simulate Successful" , "Data: " + data . ToString ( ) + " \n Sending Transaction..." ) ;
49
- }
50
- catch ( System . Exception e )
51
- {
52
- Debugger . Instance . Log ( "[Custom Call] Simulate Error" , e . Message ) ;
53
- return ;
54
- }
45
+ // try
46
+ // {
47
+ // var data = await transaction.Simulate();
48
+ // Debugger.Instance.Log("[Custom Call] Simulate Successful", "Data: " + data.ToString() + " \nSending Transaction...");
49
+ // }
50
+ // catch (System.Exception e)
51
+ // {
52
+ // Debugger.Instance.Log("[Custom Call] Simulate Error", e.Message);
53
+ // return;
54
+ // }
55
55
56
- await transaction . EstimateAndSetGasLimitAsync ( ) ;
56
+ // await transaction.EstimateAndSetGasLimitAsync();
57
57
58
- var gasPrice = await transaction . GetGasPrice ( ) ;
59
- Debug . Log ( $ "Gas Price: { gasPrice } ") ;
58
+ // var gasPrice = await transaction.GetGasPrice();
59
+ // Debug.Log($"Gas Price: {gasPrice}");
60
60
61
- var gasCosts = await transaction . EstimateGasCosts ( ) ;
62
- Debug . Log ( $ "Gas Cost: { gasCosts . wei } WEI") ;
61
+ // var gasCosts = await transaction.EstimateGasCosts();
62
+ // Debug.Log($"Gas Cost: {gasCosts.wei} WEI");
63
63
64
- Debugger . Instance . Log ( "[Custom Call] Transaction Preview" , transaction . ToString ( ) ) ;
64
+ // Debugger.Instance.Log("[Custom Call] Transaction Preview", transaction.ToString());
65
65
66
- try
67
- {
68
- string transactionResult = await transaction . Send ( gasless : false ) ;
69
- Debugger . Instance . Log ( "[Custom Call] Send Successful" , "Tx Hash: " + transactionResult ) ;
70
- }
71
- catch ( System . Exception e )
72
- {
73
- Debugger . Instance . Log ( "[Custom Call] Send Error" , e . ToString ( ) ) ;
74
- }
66
+ // try
67
+ // {
68
+ // string transactionResult = await transaction.Send(gasless: false);
69
+ // Debugger.Instance.Log("[Custom Call] Send Successful", "Tx Hash: " + transactionResult);
70
+ // }
71
+ // catch (System.Exception e)
72
+ // {
73
+ // Debugger.Instance.Log("[Custom Call] Send Error", e.ToString());
74
+ // }
75
75
}
76
76
catch ( System . Exception e )
77
77
{
0 commit comments