Skip to content

Commit 32d0b99

Browse files
committed
Fix compiler issue abi = null -> abi = ""
1 parent 01f240a commit 32d0b99

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

Assets/Thirdweb/Scripts/Contract.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class Contract
2727
/// </summary>
2828
public Marketplace marketplace;
2929

30-
public Contract(string chain, string address, string abi = null)
30+
public Contract(string chain, string address, string abi = "")
3131
{
3232
this.chain = chain;
3333
this.address = address;
@@ -68,7 +68,7 @@ public async Task<TransactionResult> Write(string functionName, params object[]
6868

6969
private string getRoute(string functionPath)
7070
{
71-
return abi != null ? this.address + "#" + abi + "." + functionPath : this.address + "." + functionPath;
71+
return abi != "" ? this.address + "#" + abi + "." + functionPath : this.address + "." + functionPath;
7272
}
7373
}
7474
}

Assets/Thirdweb/Scripts/ERC1155.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class ERC1155
2424
/// <summary>
2525
/// Interact with any ERC1155 compatible contract.
2626
/// </summary>
27-
public ERC1155(string chain, string address, string abi = null)
27+
public ERC1155(string chain, string address, string abi = "")
2828
{
2929
this.chain = chain;
3030
this.address = address;
@@ -177,7 +177,7 @@ public async Task<TransactionResult> MintAdditionalSupplyTo(string address, stri
177177

178178
private string getRoute(string functionPath)
179179
{
180-
return abi != null ? this.address + "#" + abi + ".erc1155." + functionPath : this.address + ".erc1155." + functionPath;
180+
return abi != "" ? this.address + "#" + abi + ".erc1155." + functionPath : this.address + ".erc1155." + functionPath;
181181
}
182182
}
183183

@@ -190,7 +190,7 @@ public class ERC1155ClaimConditions
190190
public string address;
191191
public string abi;
192192

193-
public ERC1155ClaimConditions(string chain, string address, string abi = null)
193+
public ERC1155ClaimConditions(string chain, string address, string abi = "")
194194
{
195195
this.chain = chain;
196196
this.address = address;
@@ -231,7 +231,7 @@ public async Task<bool> GetClaimerProofs(string tokenId, string claimerAddress)
231231

232232
private string getRoute(string functionPath)
233233
{
234-
return abi != null ? this.address + "#" + abi + ".erc1155.claimConditions." + functionPath : this.address + ".erc1155.claimConditions." + functionPath;
234+
return abi != "" ? this.address + "#" + abi + ".erc1155.claimConditions." + functionPath : this.address + ".erc1155.claimConditions." + functionPath;
235235
}
236236
}
237237

@@ -333,7 +333,7 @@ public class ERC1155Signature
333333
public string address;
334334
public string abi;
335335

336-
public ERC1155Signature(string chain, string address, string abi = null)
336+
public ERC1155Signature(string chain, string address, string abi = "")
337337
{
338338
this.chain = chain;
339339
this.address = address;
@@ -362,7 +362,7 @@ public async Task<TransactionResult> Mint(ERC1155SignedPayload signedPayload)
362362

363363
private string getRoute(string functionPath)
364364
{
365-
return abi != null ? this.address + "#" + abi + ".erc1155.signature." + functionPath : this.address + ".erc1155.signature." + functionPath;
365+
return abi != "" ? this.address + "#" + abi + ".erc1155.signature." + functionPath : this.address + ".erc1155.signature." + functionPath;
366366
}
367367
}
368368
}

Assets/Thirdweb/Scripts/ERC20.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ public class ERC20
2323
/// <summary>
2424
/// Interact with any ERC20 compatible contract.
2525
/// </summary>
26-
public ERC20(string chain, string address, string abi = null)
26+
public ERC20(string chain, string address, string abi = "")
2727
{
2828
this.chain = chain;
2929
this.address = address;
30-
this.abi = null;
30+
this.abi = abi;
3131
this.signature = new ERC20Signature(chain, address);
3232
this.claimConditions = new ERC20ClaimConditions(chain, address);
3333
}
@@ -144,7 +144,7 @@ public async Task<TransactionResult> MintTo(string address, string amount)
144144

145145
private string getRoute(string functionPath)
146146
{
147-
return abi != null ? this.address + "#" + abi + ".erc20." + functionPath : this.address + ".erc20." + functionPath;
147+
return abi != "" ? this.address + "#" + abi + ".erc20." + functionPath : this.address + ".erc20." + functionPath;
148148
}
149149
}
150150

@@ -205,7 +205,7 @@ public class ERC20ClaimConditions
205205
public string address;
206206
public string abi;
207207

208-
public ERC20ClaimConditions(string chain, string address, string abi = null)
208+
public ERC20ClaimConditions(string chain, string address, string abi = "")
209209
{
210210
this.chain = chain;
211211
this.address = address;
@@ -247,7 +247,7 @@ public async Task<bool> GetClaimerProofs(string claimerAddress)
247247

248248
private string getRoute(string functionPath)
249249
{
250-
return abi != null ? this.address + "#" + abi + ".erc20.claimConditions." + functionPath : this.address + ".erc20.claimConditions." + functionPath;
250+
return abi != "" ? this.address + "#" + abi + ".erc20.claimConditions." + functionPath : this.address + ".erc20.claimConditions." + functionPath;
251251
}
252252
}
253253

@@ -264,7 +264,7 @@ public class ERC20Signature
264264
/// <summary>
265265
/// Generate, verify and mint signed mintable payloads
266266
/// </summary>
267-
public ERC20Signature(string chain, string address, string abi = null)
267+
public ERC20Signature(string chain, string address, string abi = "")
268268
{
269269
this.chain = chain;
270270
this.address = address;
@@ -297,7 +297,7 @@ public async Task<TransactionResult> Mint(ERC20SignedPayload signedPayload)
297297

298298
private string getRoute(string functionPath)
299299
{
300-
return abi != null ? this.address + "#" + abi + ".erc20.signature." + functionPath : this.address + ".erc20.signature." + functionPath;
300+
return abi != "" ? this.address + "#" + abi + ".erc20.signature." + functionPath : this.address + ".erc20.signature." + functionPath;
301301
}
302302
}
303303
}

Assets/Thirdweb/Scripts/ERC721.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ public class ERC721
2424
/// <summary>
2525
/// Interact with any ERC721 compatible contract.
2626
/// </summary>
27-
public ERC721(string chain, string address, string abi = null)
27+
public ERC721(string chain, string address, string abi = "")
2828
{
2929
this.chain = chain;
3030
this.address = address;
31-
this.abi = null;
31+
this.abi = abi;
3232
this.signature = new ERC721Signature(chain, address);
3333
this.claimConditions = new ERC721ClaimConditions(chain, address);
3434
}
@@ -180,7 +180,7 @@ public async Task<TransactionResult> MintTo(string address, NFTMetadata nft)
180180

181181
private string getRoute(string functionPath)
182182
{
183-
return abi != null ? this.address + "#" + abi + ".erc721." + functionPath : this.address + ".erc721." + functionPath;
183+
return abi != "" ? this.address + "#" + abi + ".erc721." + functionPath : this.address + ".erc721." + functionPath;
184184
}
185185
}
186186

@@ -193,7 +193,7 @@ public class ERC721ClaimConditions
193193
public string address;
194194
public string abi;
195195

196-
public ERC721ClaimConditions(string chain, string address, string abi = null)
196+
public ERC721ClaimConditions(string chain, string address, string abi = "")
197197
{
198198
this.chain = chain;
199199
this.address = address;
@@ -235,7 +235,7 @@ public async Task<bool> GetClaimerProofs(string claimerAddress)
235235

236236
private string getRoute(string functionPath)
237237
{
238-
return abi != null ? this.address + "#" + abi + ".erc721.claimConditions." + functionPath : this.address + ".erc721.claimConditions." + functionPath;
238+
return abi != "" ? this.address + "#" + abi + ".erc721.claimConditions." + functionPath : this.address + ".erc721.claimConditions." + functionPath;
239239
}
240240
}
241241

@@ -302,7 +302,7 @@ public class ERC721Signature
302302
public string address;
303303
public string abi;
304304

305-
public ERC721Signature(string chain, string address, string abi = null)
305+
public ERC721Signature(string chain, string address, string abi = "")
306306
{
307307
this.chain = chain;
308308
this.address = address;
@@ -326,7 +326,7 @@ public async Task<TransactionResult> Mint(ERC721SignedPayload signedPayload)
326326

327327
private string getRoute(string functionPath)
328328
{
329-
return abi != null ? this.address + "#" + abi + ".erc721.signature." + functionPath : this.address + ".erc721.signature." + functionPath;
329+
return abi != "" ? this.address + "#" + abi + ".erc721.signature." + functionPath : this.address + ".erc721.signature." + functionPath;
330330
}
331331
}
332332
}

0 commit comments

Comments
 (0)