Skip to content

Commit

Permalink
fix maxPenalty
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipp Makarov authored and Filipp Makarov committed Nov 5, 2024
1 parent 74de3c5 commit d4345eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions contracts/token/BiconomyTokenPaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,10 @@ contract BiconomyTokenPaymaster is
// Transfer full amount to this address. Unused amount will be refunded in postOP
SafeTransferLib.safeTransferFrom(tokenAddress, userOp.sender, address(this), tokenAmount);

console2.log("max pnalty in validatePaymasterUserOp", maxPenalty);

// deduct max penalty from the token amount we pass to the postOp
// so we don't refund it at postOp
// other way to do it is not adding it to the tokenAmount and just charge
// tokenAmount + maxPenalty on line 492
context = abi.encode(userOp.sender, tokenAddress, tokenAmount-maxPenalty, tokenPrice, externalPriceMarkup, userOpHash);
validationData = _packValidationData(false, validUntil, validAfter);
} else if (mode == PaymasterMode.INDEPENDENT) {
Expand Down

0 comments on commit d4345eb

Please sign in to comment.