Skip to content

[General] Paymaster - How to send all the refunded ETH back to the user #278

Closed Answered by StanislavBreadless
lutr0 asked this question in General
Discussion options

You must be logged in to vote

Hey! The _maxRefundedGas is the number of how much gas (not ETH) has been left after all the execution steps.

It does not include:

  • The fact that paymaster itself will consume a certain amount of gas in the postOp.
  • Potential refunds that might come from places like a storage slot that has not been edited.

If you try to refund the user with anything above, then _maxRefundedGas there might be situations when the paymaster will not get compensated.

A more correct way for implementing functionality like these is: to send something around block.gasprice * (_maxRefundedGas - PAYMASTER_GAS to the user), where PAYMASTER_GAS is some constant of how much gas a paymaster is expected to consume. How…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by lutr0

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
General
Labels
general General question gas Gas related question aa Question related to Account Abstraction
6 participants