Skip to content

Commit 7db813b

Browse files
committed
fix encoding
1 parent 37ea6f7 commit 7db813b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

Thirdweb.Console/Program.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@
4343

4444
// Temporary - fund eoa wallet
4545
var fundingWallet = await PrivateKeyWallet.Create(client, privateKey);
46-
await ThirdwebTransaction.SendAndWaitForTransactionReceipt(
47-
await ThirdwebTransaction.Create(fundingWallet, new ThirdwebTransactionInput(chainId: chainWith7702, to: eoaWalletAddress, value: BigInteger.Parse("0.1".ToWei())))
48-
);
46+
var fundingHash = (
47+
await ThirdwebTransaction.SendAndWaitForTransactionReceipt(
48+
await ThirdwebTransaction.Create(fundingWallet, new ThirdwebTransactionInput(chainId: chainWith7702, to: eoaWalletAddress, value: BigInteger.Parse("0.1".ToWei())))
49+
)
50+
).TransactionHash;
51+
Console.WriteLine($"Funding hash: {fundingHash}");
4952

5053
// Sign the authorization to make it point to the delegation contract
5154
var authorization = await eoaWallet.SignAuthorization(chainId: chainWith7702, contractAddress: delegationContractAddress, willSelfExecute: true);

Thirdweb/Thirdweb.Wallets/PrivateKeyWallet/PrivateKeyWallet.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,12 @@ public virtual Task<string> SignTransaction(ThirdwebTransactionInput transaction
348348
{
349349
var encodedItem = new List<byte[]>()
350350
{
351-
RLP.EncodeElement(authorizationList.ChainId.HexToBytes()),
351+
RLP.EncodeElement(authorizationList.ChainId.HexToBigInt().ToBytesForRLPEncoding()),
352352
RLP.EncodeElement(authorizationList.Address.HexToBytes()),
353-
RLP.EncodeElement(authorizationList.Nonce.HexToBytes()),
353+
RLP.EncodeElement(authorizationList.Nonce.HexToBigInt().ToBytesForRLPEncoding()),
354354
RLP.EncodeElement(authorizationList.YParity.HexToBytes()),
355-
RLP.EncodeElement(authorizationList.R.HexToBytes().TrimZeroes()),
356-
RLP.EncodeElement(authorizationList.S.HexToBytes().TrimZeroes())
355+
RLP.EncodeElement(authorizationList.R.HexToBytes()),
356+
RLP.EncodeElement(authorizationList.S.HexToBytes())
357357
};
358358
encodedAuthorizationList.Add(RLP.EncodeList(encodedItem.ToArray()));
359359
}

0 commit comments

Comments
 (0)