Skip to content

Commit 4a7ea6b

Browse files
committed
Fix TokenERC721_MintTo invalid signature
1 parent ea5254e commit 4a7ea6b

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

Thirdweb/Thirdweb.Extensions/ThirdwebExtensions.cs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,13 +1953,12 @@ public static async Task<VerifyResult> TokenERC20_VerifyMintSignature(this Third
19531953
/// <param name="contract">The contract to interact with.</param>
19541954
/// <param name="wallet">The wallet to use for the transaction.</param>
19551955
/// <param name="receiverAddress">The address of the receiver.</param>
1956-
/// <param name="tokenId">The ID of the token.</param>
19571956
/// <param name="uri">The URI of the token metadata.</param>
19581957
/// <returns>A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.</returns>
19591958
/// <exception cref="ArgumentNullException">Thrown when the contract or wallet is null.</exception>
19601959
/// <exception cref="ArgumentException">Thrown when the receiver address or URI is null or empty.</exception>
19611960
/// <exception cref="ArgumentOutOfRangeException">Thrown when the token ID is less than 0.</exception>
1962-
public static async Task<ThirdwebTransactionReceipt> TokenERC721_MintTo(this ThirdwebContract contract, IThirdwebWallet wallet, string receiverAddress, BigInteger tokenId, string uri)
1961+
public static async Task<ThirdwebTransactionReceipt> TokenERC721_MintTo(this ThirdwebContract contract, IThirdwebWallet wallet, string receiverAddress, string uri)
19631962
{
19641963
if (contract == null)
19651964
{
@@ -1976,12 +1975,7 @@ public static async Task<ThirdwebTransactionReceipt> TokenERC721_MintTo(this Thi
19761975
throw new ArgumentException("Receiver address must be provided");
19771976
}
19781977

1979-
if (tokenId < 0)
1980-
{
1981-
throw new ArgumentOutOfRangeException(nameof(tokenId), "Token ID must be equal or greater than 0");
1982-
}
1983-
1984-
return uri == null ? throw new ArgumentException("URI must be provided") : await ThirdwebContract.Write(wallet, contract, "mintTo", 0, receiverAddress, tokenId, uri);
1978+
return uri == null ? throw new ArgumentException("URI must be provided") : await ThirdwebContract.Write(wallet, contract, "mintTo", 0, receiverAddress, uri);
19851979
}
19861980

19871981
/// <summary>
@@ -1990,13 +1984,12 @@ public static async Task<ThirdwebTransactionReceipt> TokenERC721_MintTo(this Thi
19901984
/// <param name="contract">The contract to interact with.</param>
19911985
/// <param name="wallet">The wallet to use for the transaction.</param>
19921986
/// <param name="receiverAddress">The address of the receiver.</param>
1993-
/// <param name="tokenId">The ID of the token.</param>
19941987
/// <param name="metadata">The metadata of the token.</param>
19951988
/// <returns>A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.</returns>
19961989
/// <exception cref="ArgumentNullException">Thrown when the contract or wallet is null.</exception>
19971990
/// <exception cref="ArgumentException">Thrown when the receiver address is null or empty.</exception>
19981991
/// <exception cref="ArgumentOutOfRangeException">Thrown when the token ID is less than 0.</exception>
1999-
public static async Task<ThirdwebTransactionReceipt> TokenERC721_MintTo(this ThirdwebContract contract, IThirdwebWallet wallet, string receiverAddress, BigInteger tokenId, NFTMetadata metadata)
1992+
public static async Task<ThirdwebTransactionReceipt> TokenERC721_MintTo(this ThirdwebContract contract, IThirdwebWallet wallet, string receiverAddress, NFTMetadata metadata)
20001993
{
20011994
if (contract == null)
20021995
{
@@ -2013,18 +2006,13 @@ public static async Task<ThirdwebTransactionReceipt> TokenERC721_MintTo(this Thi
20132006
throw new ArgumentException("Receiver address must be provided");
20142007
}
20152008

2016-
if (tokenId < 0)
2017-
{
2018-
throw new ArgumentOutOfRangeException(nameof(tokenId), "Token ID must be equal or greater than 0");
2019-
}
2020-
20212009
var json = JsonConvert.SerializeObject(metadata);
20222010

20232011
var jsonBytes = System.Text.Encoding.UTF8.GetBytes(json);
20242012

20252013
var ipfsResult = await ThirdwebStorage.UploadRaw(contract.Client, jsonBytes);
20262014

2027-
return await ThirdwebContract.Write(wallet, contract, "mintTo", 0, receiverAddress, tokenId, $"ipfs://{ipfsResult.IpfsHash}");
2015+
return await ThirdwebContract.Write(wallet, contract, "mintTo", 0, receiverAddress, $"ipfs://{ipfsResult.IpfsHash}");
20282016
}
20292017

20302018
/// <summary>

0 commit comments

Comments
 (0)