From 314f845c91436eeabd1ea0a980c9d9dfcfd67a91 Mon Sep 17 00:00:00 2001 From: nikhil kumar Date: Sat, 14 Dec 2024 01:35:17 +0530 Subject: [PATCH] fix: remove hardcoded chain id --- backend/src/paymaster/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/paymaster/index.ts b/backend/src/paymaster/index.ts index 7bedc3c..ce632a1 100644 --- a/backend/src/paymaster/index.ts +++ b/backend/src/paymaster/index.ts @@ -202,7 +202,7 @@ export class Paymaster { } async getPaymasterAndDataForMultiTokenPaymaster(userOp: any, validUntil: string, validAfter: string, feeToken: string, - ethPrice: string, paymasterContract: Contract, signer: Wallet) { + ethPrice: string, paymasterContract: Contract, signer: Wallet, chainId: number) { const priceMarkup = this.multiTokenMarkUp; const hash = ethers.utils.keccak256( @@ -237,7 +237,7 @@ export class Paymaster { userOp.preVerificationGas, userOp.maxFeePerGas, userOp.maxPriorityFeePerGas, - 80002, + chainId, paymasterContract.address, 0, validUntil, @@ -626,7 +626,7 @@ export class Paymaster { const ETHprice = await ecContract.cachedPrice(); ethPrice = ETHprice } - const paymasterAndData = await this.getPaymasterAndDataForMultiTokenPaymaster(userOp, validUntil, validAfter, feeToken, ethPrice, paymasterContract, signer); + const paymasterAndData = await this.getPaymasterAndDataForMultiTokenPaymaster(userOp, validUntil, validAfter, feeToken, ethPrice, paymasterContract, signer, chainId); if (!userOp.signature) userOp.signature = '0x'; const response = await provider.send('eth_estimateUserOperationGas', [userOp, entryPoint]);