Skip to content

Commit

Permalink
chore:refactor logging and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
livingrockrises committed Nov 6, 2024
1 parent 094fd24 commit 42f8da2
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions contracts/token/BiconomyTokenPaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,6 @@ contract BiconomyTokenPaymaster is

// 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)/1e18), tokenPrice, externalPriceMarkup, userOpHash);
validationData = _packValidationData(false, validUntil, validAfter);
} else if (mode == PaymasterMode.INDEPENDENT) {
Expand Down Expand Up @@ -555,13 +553,6 @@ contract BiconomyTokenPaymaster is
uint256 actualTokenAmount = (
(actualGasCost + (unaccountedGas * actualUserOpFeePerGas)) * appliedPriceMarkup * tokenPrice
) / (1e18 * _PRICE_DENOMINATOR);
console2.log("tokenPrice", tokenPrice);
console2.log("appliedPriceMarkup", appliedPriceMarkup);
console2.log("actualGasCost", actualGasCost);
console2.log("actualUserOpFeePerGas", actualUserOpFeePerGas);
console2.log("actualTokenAmount", actualTokenAmount);
console2.log("prechargedAmount", prechargedAmount);

if (prechargedAmount > actualTokenAmount) {
// If the user was overcharged, refund the excess tokens
uint256 refundAmount = prechargedAmount - actualTokenAmount;
Expand Down Expand Up @@ -589,12 +580,9 @@ contract BiconomyTokenPaymaster is
// Calculate price by using token and native oracle
uint192 tokenPrice = _fetchPrice(tokenInfo.oracle);
uint192 nativeAssetPrice = _fetchPrice(nativeAssetToUsdOracle);
console2.log("tokenPrice oracle", tokenPrice);
console2.log("nativeAssetPrice oracle", nativeAssetPrice);

// Adjust to token decimals
price = (nativeAssetPrice * tokenInfo.decimals) / tokenPrice;
console2.log("derived & used price", price);
}

/// @notice Fetches the latest price from the given oracle.
Expand Down

0 comments on commit 42f8da2

Please sign in to comment.