Learn how paymasters are built following the IPaymaster standard on Abstract.
prepareForPaymaster
to delegate the payment of the gas fees to a paymaster set in the transaction,
at which point the paymaster will validate and pay for the transaction.
IPaymaster
interface defines the mandatory functions that a paymaster must implement to be
compatible with Abstract. View source code ↗.
First, install the system contracts library:
IPaymaster
interface in your smart contract:
tx.gasprice * tx.gasLimit
to the bootloader. Learn more about gas fees and gas refunds.magic = PAYMASTER_VALIDATION_SUCCESS_MAGIC
.
Optionally, you can also provide context
that is provided to the postTransaction
function
called after the transaction is executed.
out of gas
error.
customData
object containing a valid paymasterParams
object.
View example zksync-ethers script