SponsorPaymaster

Deployment Address

Mainnet: 0x1842a4EFf3eFd24c50B63c3CF89cECEe245Fc2bd

Interface: ISponsorPaymaster.sol


Basics

  • An ETH-based paymaster contract for handling ETH deposits.

  • Ensures that the user pays for transactions with their ETH deposited at the entry point.

  • Features deposit management functions like adding, locking, unlocking, and withdrawing deposits.

  • Implements rate and cost-limiting features to control gas usage and prevent abuse.

  • Includes view functions to provide information about user limits and deposit statuses.


State functions

addDepositFor(address account) payable external override

unlockTokenDeposit() public override

lockTokenDeposit() public override

withdrawTokensTo(address target, uint256 amount) external override nonReentrant()
  1. addDepositFor

Deposits ETH for a specific account, allowing it to be used to pay for gas.

function addDepositFor(address account) payable external override;
ParameterTypeExplanation

account

address

The account for which to deposit.

  1. unlockTokenDeposit

Unlocks the deposit, enabling it to be withdrawn.

function unlockTokenDeposit() public override;

No parameters.

  1. lockTokenDeposit

Locks the ETH deposited for an account so they can be used to pay for gas.

function lockTokenDeposit() public override;

No parameters.

  1. withdrawTokensTo

Withdraws ETH to a specified target address.

function withdrawTokensTo(address target, uint256 amount) external override nonReentrant();
ParameterTypeExplanation

target

address

Address to send ETH to.

amount

uint256

Amount of ETH to withdraw.


View functions

depositInfo(address account) external view returns (uint256 amount, uint256 _unlockBlock)

appUserLimit(address user, address app) external view override returns (uint256, uint256, uint256, uint256)
  1. depositInfo

Returns deposit information for a specific account.

function depositInfo(address account) external view returns (uint256 amount, uint256 _unlockBlock);
ParameterTypeExplanation

account

address

The account to query deposit info.

  1. appUserLimit

Returns current user limits for an app.

function appUserLimit(address user, address app) external view override returns (uint256, uint256, uint256, uint256);
ParameterTypeExplanation

user

address

The user account.

app

address

The app contract.

Last updated