celo-org / staked-celo

GNU Lesser General Public License v3.0
8 stars 2 forks source link

Aggregate withdrawable funds #57

Open m-chrzan opened 2 years ago

m-chrzan commented 2 years ago

Currently, when completing a withdrawal, funds are immediately sent to the user as soon as they're available (so a potential immediate withdrawal at Manager.withdraw time, then once per each Account.finishPendingWithdrawal). This is fine for direct interactions with the smart contracts, but can lead wallet users to confusion when they see their withdrawn CELO appear in their wallet across multiple transactions spread over time.

Instead, we could keep an account of how much CELO is withdrawable by each address, and allow funds to be sent to the beneficiary at their request, e.g. after an entire withdrawal finishes.