@@ -60,22 +60,21 @@ public static async Task<TransactionReceipt> ThirdwebWriteRawResult<TWFunction>(
60
60
string relayerUrl = ThirdwebManager . Instance . SDK . options . gasless . Value . openzeppelin ? . relayerUrl ;
61
61
string relayerForwarderAddress = ThirdwebManager . Instance . SDK . options . gasless . Value . openzeppelin ? . relayerForwarderAddress ;
62
62
63
- ContractBuilder b = new ContractBuilder ( functionMessage . GetType ( ) , contractAddress ) ;
64
- var f = b . GetFunctionBuilder < TWFunction > ( ) ;
63
+ functionMessage . Nonce = (
64
+ await ThirdwebRead < MinimalForwarder . GetNonceFunction , MinimalForwarder . GetNonceOutputDTO > (
65
+ relayerForwarderAddress ,
66
+ new MinimalForwarder . GetNonceFunction ( ) { From = functionMessage . FromAddress }
67
+ )
68
+ ) . ReturnValue1 ;
65
69
66
70
var request = new MinimalForwarder . ForwardRequest ( )
67
71
{
68
72
From = functionMessage . FromAddress ,
69
73
To = contractAddress ,
70
74
Value = functionMessage . AmountToSend ,
71
75
Gas = functionMessage . Gas . Value ,
72
- Nonce = (
73
- await ThirdwebRead < MinimalForwarder . GetNonceFunction , MinimalForwarder . GetNonceOutputDTO > (
74
- relayerForwarderAddress ,
75
- new MinimalForwarder . GetNonceFunction ( ) { From = functionMessage . FromAddress }
76
- )
77
- ) . ReturnValue1 ,
78
- Data = f . GetData ( functionMessage )
76
+ Nonce = functionMessage . Nonce . Value ,
77
+ Data = functionMessage . GetCallData ( ) . ByteArrayToHexString ( )
79
78
} ;
80
79
81
80
var signature = await EIP712 . GenerateSignature_MinimalForwarder ( "GSNv2 Forwarder" , "0.0.1" , ThirdwebManager . Instance . SDK . nativeSession . lastChainId , relayerForwarderAddress , request ) ;
@@ -84,6 +83,8 @@ public static async Task<TransactionReceipt> ThirdwebWriteRawResult<TWFunction>(
84
83
85
84
string txHash = null ;
86
85
86
+ Debug . Log ( JsonConvert . SerializeObject ( postData ) ) ;
87
+
87
88
using ( UnityWebRequest req = UnityWebRequest . Post ( relayerUrl , "" ) )
88
89
{
89
90
byte [ ] bodyRaw = System . Text . Encoding . UTF8 . GetBytes ( JsonConvert . SerializeObject ( postData ) ) ;
0 commit comments