Skip to content

Commit

Permalink
fix(signer): fix sendTransaction populating from address
Browse files Browse the repository at this point in the history
  • Loading branch information
petarTxFusion committed Feb 12, 2025
1 parent 7bf3400 commit 2f18080
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,19 +647,22 @@ export class Signer extends AdapterL2(ethers.JsonRpcSigner) {
override async sendTransaction(
transaction: TransactionRequest
): Promise<TransactionResponse> {
if (!transaction.type) {
transaction.type = EIP712_TX_TYPE;
}
const address = await this.getAddress();
transaction.from ??= address;
const tx = await this.populateFeeData(transaction);
if (!isAddressEq(await ethers.resolveAddress(tx.from!), address)) {
throw new Error('Transaction `from` address mismatch!');
}

if (
tx.type === null ||
tx.type === undefined ||
tx.type === EIP712_TX_TYPE ||
tx.customData
) {
const address = await this.getAddress();
tx.from ??= address;
if (!isAddressEq(await ethers.resolveAddress(tx.from), address)) {
throw new Error('Transaction `from` address mismatch!');
}
const zkTx: TransactionLike = {
type: tx.type ?? EIP712_TX_TYPE,
value: tx.value ?? 0,
Expand Down

0 comments on commit 2f18080

Please sign in to comment.