Skip to content

Commit 018ec19

Browse files
committed
Remove MinimalForwarder signature support
Eliminated the Forwarder_ForwardRequest type and related EIP712 signature generation methods, as well as associated test code. This streamlines the codebase by removing unused or deprecated minimal forwarder functionality.
1 parent a816486 commit 018ec19

File tree

3 files changed

+0
-113
lines changed

3 files changed

+0
-113
lines changed

Thirdweb.Tests/Thirdweb.Contracts/Thirdweb.Contracts.Tests.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -219,19 +219,6 @@ public async Task SignatureMint_Generate()
219219
var randomChainId = 421614;
220220
var randomContractAddress = "0xD04F98C88cE1054c90022EE34d566B9237a1203C";
221221

222-
// GenerateSignature_MinimalForwarder
223-
var forwardRequest = new Forwarder_ForwardRequest
224-
{
225-
From = "0x123",
226-
To = "0x456",
227-
Value = BigInteger.Zero,
228-
Gas = BigInteger.Zero,
229-
Nonce = BigInteger.Zero,
230-
Data = "0x",
231-
};
232-
var signature = await EIP712.GenerateSignature_MinimalForwarder(randomDomain, randomVersion, randomChainId, randomContractAddress, forwardRequest, signer);
233-
Assert.NotNull(signature);
234-
Assert.StartsWith("0x", signature);
235222
// GenerateSignature_TokenERC20
236223
var mintRequest20 = new TokenERC20_MintRequest
237224
{

Thirdweb/Thirdweb.Extensions/ThirdwebExtensions.Types.cs

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -80,59 +80,6 @@ public class ContractMetadata
8080

8181
#endregion
8282

83-
#region Forwarder
84-
85-
/// <summary>
86-
/// Represents a forward request for a forwarder.
87-
/// </summary>
88-
[Struct("ForwardRequest")]
89-
public class Forwarder_ForwardRequest
90-
{
91-
/// <summary>
92-
/// Gets or sets the address of the sender.
93-
/// </summary>
94-
[Parameter("address", "from", 1)]
95-
[JsonProperty("from")]
96-
public string From { get; set; }
97-
98-
/// <summary>
99-
/// Gets or sets the address of the recipient.
100-
/// </summary>
101-
[Parameter("address", "to", 2)]
102-
[JsonProperty("to")]
103-
public string To { get; set; }
104-
105-
/// <summary>
106-
/// Gets or sets the value to be transferred.
107-
/// </summary>
108-
[Parameter("uint256", "value", 3)]
109-
[JsonProperty("value")]
110-
public BigInteger Value { get; set; }
111-
112-
/// <summary>
113-
/// Gets or sets the gas limit for the transaction.
114-
/// </summary>
115-
[Parameter("uint256", "gas", 4)]
116-
[JsonProperty("gas")]
117-
public BigInteger Gas { get; set; }
118-
119-
/// <summary>
120-
/// Gets or sets the nonce for the transaction.
121-
/// </summary>
122-
[Parameter("uint256", "nonce", 5)]
123-
[JsonProperty("nonce")]
124-
public BigInteger Nonce { get; set; }
125-
126-
/// <summary>
127-
/// Gets or sets the data to be sent with the transaction.
128-
/// </summary>
129-
[Parameter("bytes", "data", 6)]
130-
[JsonProperty("data")]
131-
public string Data { get; set; }
132-
}
133-
134-
#endregion
135-
13683
#region NFT
13784

13885
/// <summary>

Thirdweb/Thirdweb.Utils/EIP712.cs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -127,29 +127,6 @@ IThirdwebWallet signer
127127
return SerializeEip712(transaction, signatureRaw, chainId);
128128
}
129129

130-
/// <summary>
131-
/// Generates a signature for a minimal forwarder request.
132-
/// </summary>
133-
/// <param name="domainName">The domain name.</param>
134-
/// <param name="version">The version.</param>
135-
/// <param name="chainId">The chain ID.</param>
136-
/// <param name="verifyingContract">The verifying contract.</param>
137-
/// <param name="forwardRequest">The forward request.</param>
138-
/// <param name="signer">The wallet signer.</param>
139-
/// <returns>The generated signature.</returns>
140-
public static async Task<string> GenerateSignature_MinimalForwarder(
141-
string domainName,
142-
string version,
143-
BigInteger chainId,
144-
string verifyingContract,
145-
Forwarder_ForwardRequest forwardRequest,
146-
IThirdwebWallet signer
147-
)
148-
{
149-
var typedData = GetTypedDefinition_MinimalForwarder(domainName, version, chainId, verifyingContract);
150-
return await signer.SignTypedDataV4(forwardRequest, typedData);
151-
}
152-
153130
/// <summary>
154131
/// Generates a signature for an ERC20 token mint request.
155132
/// </summary>
@@ -420,30 +397,6 @@ public static TypedData<Domain> GetTypedDefinition_TokenERC1155(string domainNam
420397
};
421398
}
422399

423-
/// <summary>
424-
/// Gets the typed data definition for a minimal forwarder request.
425-
/// </summary>
426-
/// <param name="domainName">The domain name.</param>
427-
/// <param name="version">The version.</param>
428-
/// <param name="chainId">The chain ID.</param>
429-
/// <param name="verifyingContract">The verifying contract.</param>
430-
/// <returns>The typed data definition.</returns>
431-
public static TypedData<Domain> GetTypedDefinition_MinimalForwarder(string domainName, string version, BigInteger chainId, string verifyingContract)
432-
{
433-
return new TypedData<Domain>
434-
{
435-
Domain = new Domain
436-
{
437-
Name = domainName,
438-
Version = version,
439-
ChainId = chainId,
440-
VerifyingContract = verifyingContract,
441-
},
442-
Types = MemberDescriptionFactory.GetTypesMemberDescription(typeof(Domain), typeof(Forwarder_ForwardRequest)),
443-
PrimaryType = "ForwardRequest",
444-
};
445-
}
446-
447400
#endregion
448401

449402
#region Helpers

0 commit comments

Comments
 (0)