EeseePaymaster

EeseePaymaster

A paymaster allowing addresses holding ESE tokens to pay for a GSN transaction.

ESE

contract IERC20 ESE

ESE token this contract uses.

nonces

mapping(address => uint256) nonces

Nonces for each address.

SIGNER_ROLE

bytes32 SIGNER_ROLE

Signer role in {accessManager}.

approvedContracts

mapping(address => bool) approvedContracts

Contracts approved for use.

Refilled

event Refilled(address sender, uint256 eth)

TokensCharged

event TokensCharged(address payer, uint256 nonce, uint256 gasUseWithPost, uint256 tokenActualCharge, uint256 ethActualCharge, uint256 actualDiscount)

Withdrawn

event Withdrawn(address to, uint256 amount)

ApproveContract

event ApproveContract(address _contract)

RevokeContractApproval

event RevokeContractApproval(address _contract)

InvalidESE

error InvalidESE()

ExpiredDeadline

error ExpiredDeadline()

InvalidSender

error InvalidSender()

InvalidSignature

error InvalidSignature()

ActualChargeHigher

error ActualChargeHigher()

AddressNotApproved

error AddressNotApproved()

AlreadyApproved

error AlreadyApproved()

withdrawTokens

function withdrawTokens(address target) external returns (uint256 amount)

Withdraws ESE collected from users.

Parameters

Return Values

approveContract

function approveContract(address _address) external

Approves contract for use. Emits {ApproveContract} event.

Parameters

revokeContractApproval

function revokeContractApproval(address _address) external

_Revokes contract approval from {address}. Emits {RevokeContractApproval} event.

Parameters

versionPaymaster

function versionPaymaster() external pure returns (string)

Return Values

getGasAndDataLimits

function getGasAndDataLimits() public pure returns (struct IPaymaster.GasAndDataLimits limits)

Return the Gas Limits for Paymaster's functions and maximum msg.data length values for this Paymaster. This function allows different paymasters to have different properties without changes to the RelayHub.

Return Values

Inherited from EeseeRoleHandler

Inherited from EIP712

eip712Domain

function eip712Domain() public view virtual returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions)

_See {EIP-5267}.

Available since v4.9._

Inherited from IERC5267

EIP712DomainChanged

event EIP712DomainChanged()

MAY be emitted to signal that the domain could have changed.

Inherited from BasePaymaster

getRelayHub

function getRelayHub() public view returns (address)

Return Values

supportsInterface

function supportsInterface(bytes4 interfaceId) public view virtual returns (bool)

_Returns true if this contract implements the interface defined by interfaceId. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created.

This function call must use less than 30 000 gas._

setRelayHub

function setRelayHub(contract IRelayHub hub) public

setTrustedForwarder

function setTrustedForwarder(address forwarder) public virtual

The owner of the Paymaster can change the instance of the Forwarder this Paymaster works with. the Recipients must trust this Forwarder as well in order for the configuration to remain functional.

getTrustedForwarder

function getTrustedForwarder() public view virtual returns (address)

Return Values

withdrawRelayHubDepositTo

function withdrawRelayHubDepositTo(uint256 amount, address payable target) public

Withdraw deposit from the RelayHub.

Parameters

preRelayedCall

function preRelayedCall(struct GsnTypes.RelayRequest relayRequest, bytes signature, bytes approvalData, uint256 maxPossibleGas) external returns (bytes, bool)

Called by the Relay in view mode and later by the RelayHub on-chain to validate that the Paymaster agrees to pay for this call.

The request is considered to be rejected by the Paymaster in one of the following conditions:

  • preRelayedCall() method reverts

  • the Forwarder reverts because of nonce or signature error

  • the Paymaster returned rejectOnRecipientRevert: true and the recipient contract reverted (and all that did not consume more than acceptanceBudget gas).

In any of the above cases, all Paymaster calls and the recipient call are reverted. In any other case the Paymaster will pay for the gas cost of the transaction. Note that even if postRelayedCall is reverted the Paymaster will be charged.

Parameters

Return Values

postRelayedCall

function postRelayedCall(bytes context, bool success, uint256 gasUseWithoutPost, struct GsnTypes.RelayData relayData) external

This method is called after the actual relayed function call. It may be used to record the transaction (e.g. charge the caller by some contract logic) for this call.

Revert in this functions causes a revert of the client's relayed call (and preRelayedCall(), but the Paymaster is still committed to pay the relay for the entire transaction.

Parameters

Inherited from Ownable

owner

function owner() public view virtual returns (address)

Returns the address of the current owner.

renounceOwnership

function renounceOwnership() public virtual

_Leaves the contract without owner. It will not be possible to call onlyOwner functions. Can only be called by the current owner.

NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner._

transferOwnership

function transferOwnership(address newOwner) public virtual

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

OwnershipTransferred

event OwnershipTransferred(address previousOwner, address newOwner)

Last updated