diff --git a/backend/CHANGELOG.md b/backend/CHANGELOG.md index 6c4e729..57b8d27 100644 --- a/backend/CHANGELOG.md +++ b/backend/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## [3.1.3] - 2025-03-13 +### Fixes +- Fixed Verifying Paymaster execution for undeployed wallets + ## [3.1.2] - 2025-02-28 ### Fixes - Fixed invalid address error on cronJob diff --git a/backend/package.json b/backend/package.json index a9a88f4..5912f87 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "arka", - "version": "3.1.2", + "version": "3.1.3", "description": "ARKA - (Albanian for Cashier's case) is the first open source Paymaster as a service software", "type": "module", "directories": { diff --git a/backend/src/paymaster/index.ts b/backend/src/paymaster/index.ts index 57905a5..3c303b4 100644 --- a/backend/src/paymaster/index.ts +++ b/backend/src/paymaster/index.ts @@ -112,7 +112,25 @@ export class Paymaster { if (!userOp.signature) userOp.signature = '0x'; if (userOp.factory && userOp.factoryData) userOp.initCode = hexConcat([userOp.factory, userOp.factoryData ?? '']) if (!userOp.initCode) userOp.initCode = "0x"; + const paymasterPostOpGasLimit = BigNumber.from("40000").toHexString(); if (estimate) { + userOp.paymaster = paymasterAddress; + userOp.paymasterVerificationGasLimit = this.EP7_PVGL; + userOp.paymasterPostOpGasLimit = paymasterPostOpGasLimit; + const accountGasLimits = this.packUint(userOp.verificationGasLimit, userOp.callGasLimit) + const gasFees = this.packUint(userOp.maxPriorityFeePerGas, userOp.maxFeePerGas); + const packedUserOp = { + sender: userOp.sender, + nonce: userOp.nonce, + initCode: userOp.initCode, + callData: userOp.callData, + accountGasLimits: accountGasLimits, + preVerificationGas: userOp.preVerificationGas, + gasFees: gasFees, + paymasterAndData: this.packPaymasterData(paymasterAddress, this.EP7_PVGL, paymasterPostOpGasLimit), + signature: userOp.signature + } + userOp.paymasterData = await this.getPaymasterData(packedUserOp, validUntil, validAfter, paymasterContract, signer); const response = await provider.send('eth_estimateUserOperationGas', [userOp, entryPoint]); userOp.verificationGasLimit = response.verificationGasLimit; userOp.callGasLimit = response.callGasLimit; @@ -128,7 +146,7 @@ export class Paymaster { accountGasLimits: accountGasLimits, preVerificationGas: userOp.preVerificationGas, gasFees: gasFees, - paymasterAndData: this.packPaymasterData(paymasterAddress, this.EP7_PVGL, "0x1"), + paymasterAndData: this.packPaymasterData(paymasterAddress, this.EP7_PVGL, paymasterPostOpGasLimit), signature: userOp.signature } @@ -142,7 +160,7 @@ export class Paymaster { verificationGasLimit: BigNumber.from(userOp.verificationGasLimit).toHexString(), callGasLimit: BigNumber.from(userOp.callGasLimit).toHexString(), paymasterVerificationGasLimit: this.EP7_PVGL.toHexString(), - paymasterPostOpGasLimit: "0x1" + paymasterPostOpGasLimit } } else { returnValue = {