@@ -60,22 +60,21 @@ public static async Task<TransactionReceipt> ThirdwebWriteRawResult<TWFunction>(
6060 string relayerUrl = ThirdwebManager . Instance . SDK . options . gasless . Value . openzeppelin ? . relayerUrl ;
6161 string relayerForwarderAddress = ThirdwebManager . Instance . SDK . options . gasless . Value . openzeppelin ? . relayerForwarderAddress ;
6262
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 ;
6569
6670 var request = new MinimalForwarder . ForwardRequest ( )
6771 {
6872 From = functionMessage . FromAddress ,
6973 To = contractAddress ,
7074 Value = functionMessage . AmountToSend ,
7175 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 ( )
7978 } ;
8079
8180 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>(
8483
8584 string txHash = null ;
8685
86+ Debug . Log ( JsonConvert . SerializeObject ( postData ) ) ;
87+
8788 using ( UnityWebRequest req = UnityWebRequest . Post ( relayerUrl , "" ) )
8889 {
8990 byte [ ] bodyRaw = System . Text . Encoding . UTF8 . GetBytes ( JsonConvert . SerializeObject ( postData ) ) ;
0 commit comments