Skip to content

Commit e2d575b

Browse files
committed
remove contract builder
1 parent 40927a7 commit e2d575b

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

Assets/Thirdweb/Core/Scripts/TransactionManager.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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));

Assets/Thirdweb/Examples/Scenes/Scene_Prefabs.unity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2282,7 +2282,7 @@ PrefabInstance:
22822282
m_Modifications:
22832283
- target: {fileID: 4404896360829706404, guid: 379ed01658d62a14484f953196ff19db, type: 3}
22842284
propertyPath: relayerUrl
2285-
value: https://api.defender.openzeppelin.com/autotasks/b511c05f-2e3f-4cf0-b7dc-b0e41dee3db1/runs/webhook/76da2beb-fbb1-4082-bbb8-d4429dedee81/61fqU3Avg7fheoP4qjehVt
2285+
value: https://api.defender.openzeppelin.com/autotasks/7d795312-855d-4f02-900a-30c1dde211cb/runs/webhook/76da2beb-fbb1-4082-bbb8-d4429dedee81/E33wsMacq1ZDCQVHPTZVo
22862286
objectReference: {fileID: 0}
22872287
- target: {fileID: 4404896360829706404, guid: 379ed01658d62a14484f953196ff19db, type: 3}
22882288
propertyPath: relayerForwarderAddress

0 commit comments

Comments
 (0)