chimera-defi / SharedDeposit

13 stars 6 forks source link

Create withdrawal queue contract #17

Open chimera-defi opened 1 month ago

chimera-defi commented 1 month ago

Add a lido-esque withdrawal queue.
Modular WQ contract that can be used by users to queue up exits and receive eth when its ready.
It should receive rewards/exits as part of our v2 architecture.
The payment splitter can be extended e.g. be used to track incoming ETH, and if incoming eth >= 32 Eth, send to withdraw queue
Users stake their w/sgeth when total requested exits > 32E, any 32E chunks coming into the payment splitter get directed to the queue queue has open/admin/oracle fn that can be invoked to process it processing the queue, goes through open withdrawal requests, fulfilling and closing them, till theres insufficient eth to close the next one. q should be FIFO, block number based

devlancer412 commented 1 month ago

Could you leave more details here?

In this aspect

chimera-defi commented 1 month ago

@devlancer412 See reference contracts: Users of this stakewise lib - https://github.com/stakewise/v3-core/blob/main/contracts/libraries/ExitQueue.sol or lido withdrawal system. Basically withdrawals.sol with a fifo queue. maybe we can use that lib? ^

wsgeth or sgeth enters, eth is returned to users.

devlancer412 commented 4 weeks ago

@chimera-defi Should I modify Withdrawals.sol?