eth-infinitism / account-abstraction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does Paymaster have to call addStack() before depositTo()?

ipromise2324 opened this issue · comments

[This link]https://github.com/eth-infinitism/account-abstraction/blob/abff2aca61a8f0934e533d0d352978055fddbd96/contracts/core/StakeManager.sol#LL40C9-L40C54

Don't we have to check that whether the PayMaster addStack() or not before PayMaster depositTo()?

no need.
the deposit and stake are two separate accounting mechanisms.
deposit is used for gas payment. it can be added by anyone, and withdrawn at any time (by the account/paymaster itself)
the "stake" is used only by paymasters. It is a value locked in the entrypoint and has delayed withdrawn . It comes to prevent Sybil attacks by paymasters.