-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temp remove post op cost and add tests #6
Temp remove post op cost and add tests #6
Conversation
@@ -155,15 +145,19 @@ contract BiconomySponsorshipPaymaster is | |||
function withdrawTo(address payable withdrawAddress, uint256 amount) external override nonReentrant { | |||
if (withdrawAddress == address(0)) revert CanNotWithdrawToZeroAddress(); | |||
uint256 currentBalance = paymasterIdBalances[msg.sender]; | |||
require(amount <= currentBalance, "Sponsorship Paymaster: Insufficient funds to withdraw from gas tank"); | |||
if (amount > currentBalance) { | |||
revert InsufficientFundsInGasTank(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure to add test cases
abi.decode(context, (address, uint32, bytes32)); | ||
|
||
uint256 balToDeduct = actualGasCost + postopCost * actualUserOpFeePerGas; | ||
uint256 adjustedGasCost = (actualGasCost * dynamicAdjustment) / PRICE_DENOMINATOR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dynamicAdjustment can be worded better.
|
||
uint256 maxFeePerGas = userOp.unpackMaxFeePerGas(); | ||
if (priceMarkup > 2e6 || priceMarkup == 0) { | ||
revert InvalidPriceMarkup(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure these are caught properly all the way bubbled up to entry point.
by writing negative test cases
"Sponsorship Paymaster: paymasterId does not have enough deposit" | ||
); | ||
if (effectiveCost > paymasterIdBalances[paymasterId]) { | ||
revert InsufficientFundsForPaymasterId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
write a test that catches this from entrypoint handleOps execution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review i
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving as discussed
31a4ea1
into
feat/paymaster-foundry-tests
No description provided.