Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

NineLivesPaymaster

Git Source

State Variables

NAME

NAME here is a concatenation of the chain id as well! We don't intend to deploy this anywhere else, but we want cross-chain signing functionality, so we reuse the domain separator to discover nonces that we supply to this contract relative to the chain id here.

string constant NAME = "NineLivesPaymaster";

USDC

IERC20 immutable USDC;

INITIAL_CHAIN_ID

uint256 public immutable INITIAL_CHAIN_ID;

INITIAL_SALT

bytes32 public immutable INITIAL_SALT;

nonces

mapping(bytes32 domain => mapping(address addr => uint256 nonce)) public nonces;

domainSeparators

mapping(uint256 => bytes32) public domainSeparators;

Functions

constructor

constructor(address _erc20);

NEW_DOMAIN_SEPARATOR

function NEW_DOMAIN_SEPARATOR(uint256 _chainId) internal returns (bytes32 sep);

computeDomainSeparator

function computeDomainSeparator(uint256 _chainId) public view returns (bytes32);

recoverAddress

function recoverAddress(bytes32 domain, Operation calldata op) public view returns (address);

recoverAddressNewChain

function recoverAddressNewChain(Operation calldata op) public returns (bytes32 domain, address recovered);

execute

function execute(Operation calldata op) internal returns (uint256, bool);

multicall

function multicall(Operation[] calldata operations) external returns (bool[] memory statuses);

Events

PaymasterPaidFor

event PaymasterPaidFor(
    address indexed owner,
    uint256 indexed maximumFee,
    uint256 indexed amountToSpend,
    uint256 feeTaken,
    address referrer,
    bytes8 outcome
);