NineLivesPaymaster
State Variables
version
uint256 public version;
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 public USDC;
INITIAL_CHAIN_ID
uint256 public INITIAL_CHAIN_ID;
INITIAL_SALT
bytes32 public INITIAL_SALT;
ADMIN
address public ADMIN;
STARGATE
IStargate public STARGATE;
nonces
mapping(bytes32 domain => mapping(address addr => uint256 nonce)) public nonces;
domainSeparators
mapping(uint256 => bytes32) public domainSeparators;
CAMELOT_SWAP_ROUTER
ICamelotSwapRouter public CAMELOT_SWAP_ROUTER;
WETH
IWETH10 public WETH;
Functions
initialise
function initialise(address _erc20, address _admin, IStargate _stargate, ICamelotSwapRouter _swapRouter, IWETH10 _weth)
external;
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 recovered);
recoverAddressNewChain
function recoverAddressNewChain(Operation calldata op) public returns (bytes32 domain, address recovered);
stargateSendAmount
function stargateSendAmount(SendParam memory _sendParam, MessagingFee memory _messagingFee, Operation memory _op)
internal
returns (uint256, bool);
execute
function execute(Operation calldata op) internal returns (uint256, bool);
multicall
function multicall(Operation[] calldata operations) external returns (bool[] memory statuses);
drain
function drain(address _recipient) external;
changeAdmin
function changeAdmin(address _admin) external;
receive
receive() external payable;
Events
PaymasterPaidFor
event PaymasterPaidFor(
address indexed owner,
uint256 indexed maximumFee,
uint256 indexed amountToSpend,
uint256 feeTaken,
address referrer,
bytes8 outcome
);
StargateBridged
event StargateBridged(
bytes32 indexed guid,
address indexed spender,
uint256 indexed amountReceived,
uint256 amountFee,
uint32 destinationEid
);
Errors
MulticallFailure
error MulticallFailure(uint256);