Skip to content

Commit

Permalink
fix r
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipp Makarov authored and Filipp Makarov committed Nov 22, 2024
1 parent aa29fb0 commit 4341bed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion contracts/token/BiconomyTokenPaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ contract BiconomyTokenPaymaster is


uint256 tokenAmount;
// Review
{
uint256 maxFeePerGas = UserOperationLib.unpackMaxFeePerGas(userOp);
tokenAmount = ((maxCost + maxPenalty + (unaccountedGas * maxFeePerGas)) * externalPriceMarkup * tokenPrice)
Expand Down
7 changes: 3 additions & 4 deletions test/base/TestBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ abstract contract TestBase is CheatCodes, TestHelper, BaseEventsAndErrors {
using UserOperationLib for PackedUserOperation;

address constant ENTRYPOINT_ADDRESS = address(0x0000000071727De22E5E9d8BAf0edAc6f37da032);
// NotE: updating below to WETH on Base.
// Note: review addresses if testing on other chains
address constant WRAPPED_NATIVE_ADDRESS = address(0x4200000000000000000000000000000000000006);
// Review address kept
address constant SWAP_ROUTER_ADDRESS = address(0x2626664c2603336E57B271c5C0b26F421741e481);

uint32 internal constant _PRICE_MARKUP_DENOMINATOR = 1e6;
Expand Down Expand Up @@ -485,8 +484,8 @@ abstract contract TestBase is CheatCodes, TestHelper, BaseEventsAndErrors {

uint256 gasPaidBySAInNativeTokens = gasPaidBySAInERC20 * 1e18 / tokenPrice;

// Review we will also need to update premium numbers in below if there is premium: multiply by 1e6 / premium
assertGt(gasPaidBySAInNativeTokens, BUNDLER.addr.balance - initialBundlerBalance);
// Assert we never undercharge
assertGte(gasPaidBySAInNativeTokens, BUNDLER.addr.balance - initialBundlerBalance);

// Ensure that max 2% difference between what is should have been charged and what was charged
// this difference comes from difference of postop gas and estimated postop gas (paymaster.unaccountedGas)
Expand Down

0 comments on commit 4341bed

Please sign in to comment.