IFactoryPaymaster
Base interface for factory contracts to integrate with paymasters
Provides standardized methods for paymaster-based fee collection
Functions
updatePaymasterSupport
Update paymaster support
function updatePaymasterSupport(address paymaster, bool supported) external;
Parameters
paymaster
address
Paymaster address
supported
bool
Whether to support this paymaster
isPaymasterSupported
Check if a paymaster is supported
function isPaymasterSupported(address paymaster) external view returns (bool supported);
Parameters
paymaster
address
Paymaster address
Returns
supported
bool
Whether the paymaster is supported
getSupportedPaymasters
Get all supported paymasters
function getSupportedPaymasters() external view returns (address[] memory paymasters);
Returns
paymasters
address[]
Array of supported paymaster addresses
preValidatePayment
Pre-validate payment before operation
function preValidatePayment(address user, address paymaster, PackedUserOperation calldata userOp)
external
view
returns (bool validated);
Parameters
user
address
User who will pay
paymaster
address
Paymaster address
userOp
PackedUserOperation
User operation (for gas estimation)
Returns
validated
bool
Whether the payment is pre-validated
getBaseFee
Get the base creation fee for factory operations
function getBaseFee(string calldata operationType) external view returns (uint256 fee);
Parameters
operationType
string
Type of operation
Returns
fee
uint256
Base fee in ETH (wei)
calculateTotalFee
Calculate total fee including any factory-specific multipliers
function calculateTotalFee(string calldata operationType, uint256 baseAmount)
external
view
returns (uint256 totalFee);
Parameters
operationType
string
Type of operation
baseAmount
uint256
Base amount in ETH
Returns
totalFee
uint256
Total fee including multipliers
Events
PaymasterSupportUpdated
Emitted when paymaster support is updated
event PaymasterSupportUpdated(address indexed paymaster, bool supported);
Parameters
paymaster
address
Paymaster address
supported
bool
Whether the paymaster is supported
PaymasterUsed
Emitted when a creation operation uses a paymaster
event PaymasterUsed(address indexed user, address indexed paymaster, string operationType);
Parameters
user
address
User who initiated the operation
paymaster
address
Paymaster used
operationType
string
Type of operation performed
Errors
UnsupportedPaymaster
error UnsupportedPaymaster(address paymaster);
PaymasterValidationFailed
error PaymasterValidationFailed(address paymaster, string reason);
Last updated
Was this helpful?