-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Filipp Makarov
authored and
Filipp Makarov
committed
Oct 22, 2024
1 parent
85d1340
commit 362bf12
Showing
2 changed files
with
3 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,6 @@ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
import { SafeTransferLib } from "solady/utils/SafeTransferLib.sol"; | ||
import { IBiconomySponsorshipPaymaster } from "../interfaces/IBiconomySponsorshipPaymaster.sol"; | ||
|
||
import "forge-std/console2.sol"; | ||
|
||
/** | ||
* @title BiconomySponsorshipPaymaster | ||
* @author livingrockrises<[email protected]> | ||
|
@@ -332,8 +330,6 @@ contract BiconomySponsorshipPaymaster is | |
// Include unaccountedGas since EP doesn't include this in actualGasCost | ||
// unaccountedGas = postOpGas + EP overhead gas + estimated penalty | ||
actualGasCost = actualGasCost + (unaccountedGas * actualUserOpFeePerGas); | ||
console2.log("gas at pm.postOp sent by EP + unaccountedGas ", actualGasCost); | ||
console2.log("actual unaccountedGas (postOp overload) units at pm.postOp ", unaccountedGas); | ||
// Apply the price markup | ||
uint256 adjustedGasCost = (actualGasCost * priceMarkup) / _PRICE_DENOMINATOR; | ||
|
||
|
@@ -344,11 +340,9 @@ contract BiconomySponsorshipPaymaster is | |
|
||
if (prechargedAmount > adjustedGasCost) { | ||
// If overcharged refund the excess | ||
console2.log("overcharged ", prechargedAmount - adjustedGasCost); | ||
paymasterIdBalances[paymasterId] += (prechargedAmount - adjustedGasCost); | ||
} else { | ||
// deduct what needs to be deducted from paymasterId | ||
console2.log("undercharged ", (adjustedGasCost - prechargedAmount)); | ||
paymasterIdBalances[paymasterId] -= (adjustedGasCost - prechargedAmount); | ||
} | ||
// here adjustedGasCost does not account for gasPenalty. prechargedAmount accounts for penalty with maxGasPenalty | ||
|
@@ -425,11 +419,6 @@ contract BiconomySponsorshipPaymaster is | |
) * 10 * userOp.unpackMaxFeePerGas() | ||
) / 100; | ||
|
||
console2.log("call gas limit in pm ", uint128(uint256(userOp.accountGasLimits))); | ||
console2.log("pm gas limit in pm", uint128(bytes16(userOp.paymasterAndData[_PAYMASTER_POSTOP_GAS_OFFSET:_PAYMASTER_DATA_OFFSET]))); | ||
|
||
console2.log("max penalty ", maxPenalty); | ||
|
||
// Deduct the max gas cost. | ||
uint256 effectiveCost = | ||
(((requiredPreFund + unaccountedGas * userOp.unpackMaxFeePerGas()) * priceMarkup) / _PRICE_DENOMINATOR); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters