Skip to content

draft-IERC4337: split EntryPoint interfaces into IEntryPointStake and IEntryPointDeposit [WIP] #5806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions contracts/interfaces/draft-IERC4337.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ interface IEntryPointNonces {
}

/**
* @dev Handle stake management for entities (i.e. accounts, paymasters, factories).
* @dev Handle deposit management for entities (i.e. accounts, paymasters).
*
* The EntryPoint must implement the following API to let entities like paymasters have a stake,
* and thus have more flexibility in their storage access
* (see https://eips.ethereum.org/EIPS/eip-4337#reputation-scoring-and-throttlingbanning-for-global-entities[reputation, throttling and banning.])
* The paymaster must have a deposit, which the EntryPoint will charge UserOperation costs from.
* The deposit (for paying gas fees) is separate from the stake (which is locked).
*
* The EntryPoint must implement the following interface to allow Paymasters (and optionally Accounts)
* to manage their deposit.
*/
interface IEntryPointStake {
interface IEntryPointDeposit {
/**
* @dev Returns the balance of the account.
*/
Expand All @@ -120,7 +122,16 @@ interface IEntryPointStake {
* @dev Withdraws `withdrawAmount` from the account to `withdrawAddress`.
*/
function withdrawTo(address payable withdrawAddress, uint256 withdrawAmount) external;
}

/**
* @dev Handle stake management for entities (i.e. accounts, paymasters, factories).
*
* The EntryPoint must implement the following API to let entities like paymasters have a stake,
* and thus have more flexibility in their storage access
* (see https://eips.ethereum.org/EIPS/eip-4337#reputation-scoring-and-throttlingbanning-for-global-entities[reputation, throttling and banning.])
*/
interface IEntryPointStake {
/**
* @dev Adds stake to the account with an unstake delay of `unstakeDelaySec`.
*/
Expand All @@ -142,7 +153,7 @@ interface IEntryPointStake {
*
* User operations are validated and executed by this contract.
*/
interface IEntryPoint is IEntryPointNonces, IEntryPointStake {
interface IEntryPoint is IEntryPointNonces, IEntryPointStake, IEntryPointDeposit {
/**
* @dev A user operation at `opIndex` failed with `reason`.
*/
Expand Down
Loading