SponsorPaymaster

Deployment Address
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. 1.
    addDepositFor
Deposits ETH for a specific account, allowing it to be used to pay for gas.
function addDepositFor(address account) payable external override;
Parameter
Type
Explanation
account
address
The account for which to deposit.
  1. 2.
    unlockTokenDeposit
Unlocks the deposit, enabling it to be withdrawn.
function unlockTokenDeposit() public override;
No parameters.
  1. 3.
    lockTokenDeposit
Locks the ETH deposited for an account so they can be used to pay for gas.
function lockTokenDeposit() public override;
No parameters.
  1. 4.
    withdrawTokensTo
Withdraws ETH to a specified target address.
function withdrawTokensTo(address target, uint256 amount) external override nonReentrant();
Parameter
Type
Explanation
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. 1.
    depositInfo
Returns deposit information for a specific account.
function depositInfo(address account) external view returns (uint256 amount, uint256 _unlockBlock);
Parameter
Type
Explanation
account
address
The account to query deposit info.
  1. 2.
    appUserLimit
Returns current user limits for an app.
function appUserLimit(address user, address app) external view override returns (uint256, uint256, uint256, uint256);
Parameter
Type
Explanation
user
address
The user account.
app
address
The app contract.