[General] Paymaster - How to send all the refunded ETH back to the user #278
-
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Hey! The It does not include:
If you try to refund the user with anything above, then A more correct way for implementing functionality like these is: to send something around Overall, while returning all the refunded eth to the user offers a better UX in some cases, there is no canonical easy way to do it |
Beta Was this translation helpful? Give feedback.
Hey! The
_maxRefundedGas
is the number of how much gas (not ETH) has been left after all the execution steps.It does not include:
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), wherePAYMASTER_GAS
is some constant of how much gas a paymaster is expected to consume. How…