From 88604413bbf07b598403d39dd8c61bd2806216aa Mon Sep 17 00:00:00 2001 From: Ramon Recuero Date: Thu, 5 Dec 2024 07:48:14 +0900 Subject: [PATCH] Update --- src/paymasters/SponsorPaymaster.sol | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/paymasters/SponsorPaymaster.sol b/src/paymasters/SponsorPaymaster.sol index 300030de..9fe316f9 100644 --- a/src/paymasters/SponsorPaymaster.sol +++ b/src/paymasters/SponsorPaymaster.sol @@ -344,15 +344,14 @@ contract SponsorPaymaster is Initializable, BasePaymaster, UUPSUpgradeable, Reen uint256 ethMaxCost = (maxCost + COST_OF_POST * gasPriceUserOp); if (ethMaxCost > userOpMaxCost) revert GasTooHighForUserOp(); - address targetContract = _decodeCallData(userOp.callData); - address sponsor = appRegistry.getApp(targetContract); + address sponsor = appRegistry.getApp(_decodeCallData(userOp.callData)); if (unlockBlock[sponsor] != 0) revert DepositNotLocked(); if (balances[sponsor] < ethMaxCost) { // Apps need to pay - if (sponsor != targetContract) { + if (sponsor != userOp.sender) { revert DepositTooLow(); } - // Wallets get automatically funded by kinto core app + // Wallets get automfunded by kinto core app sponsor = appRegistry.getApp(address(walletFactory)); } return (abi.encode(sponsor, userOp.sender, userOp.maxFeePerGas, userOp.maxPriorityFeePerGas), 0);