tokamak-network / ton-staking-v2

11 stars 3 forks source link

[feature suggest] v 2.5 Layer 2 Auto Withdraw #49

Closed DevUreak closed 1 month ago

DevUreak commented 1 month ago

Is your feature request related to a problem? Please describe.

In v2.5, we will be able to deposit staked amounts directly to Layer2 via withdrawAndDepositL2().

Users will be able to circulate tokens without the 14-day waiting period.

I propose a feature that allows users to withdraw at the same time as depositing L2.

Describe the solution you'd like

idea1

Fig. 1 is the process in v 2.5. It would be more reasonable for users to wait for 7 days of challenge in Layer2 rather than waiting for 14 days of unstaking.

I propose that this part can be automated.

In terms of UX, users must separately request withdrawal in Layer2.

However, if it is automated, users can request withdrawal at the same time as withdrawing staked amounts in Layer1, allowing them to request TON withdrawal in a shorter period of time.

Fig. 2 shows the improved flow.

The process I propose is simple. Call the withdrawal function after depositERC20() is called.

It seems that a separate additional function development is needed for this.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

suahnkim commented 1 month ago

Our goal for withdrawandDeposit function is to

If they want to unstake and withdraw in 7 days instead of unstake+withdraw in 14 days, they should do so using the Tokamak Bridge UI and check out how L2 works. Without that process, they would be able to interact just with L1 and withdraw without interacting with L2 at all.

We also do not want to provide withdraw from L2 to L1 guarantee from our staking contract as some bridge contracts may have a different withdraw process. (Not all L2s are the same and they do not all share the same interface for withdrawals from L2 to L1)

So, we will not support this function

DevUreak commented 1 month ago

I didn't consider the contract withdrawal process of other bridges. Thanks.