Closed chimera-defi closed 1 year ago
Thanks for documenting the issue @chimera-defi -> making a start on this today.
Update I'm around half way through this issue, should have it done in the next couple of days.
To do
Hey @chimera-defi - I didn't see anything in the ABI / withdrawals contract code that allows the frontend to check the amount of vEth2 user has deposited to redeem. Do you need to expose the userEntries first, or am I missing some inherited method/helper to get that?
Need this to check the userEntries[currentUserWalletAddr]
balance before showing the Claim button.
Hey @WJakub Yea i realized this after deploying to goerli.
Thanks for taking a look!
The new contract has a userEntries field thats public so you can just assume itll be there.
ABI here https://github.com/chimera-defi/SharedDeposit/blob/main/data/abi/Withdrawals.json
Sweet - thanks sir @chimera-defi that makes sense. Other that than progress going well - aiming for v1 this weekend.
Awesome!
Lmk if you think the contract needs anything else and I'll add it.
Throw up a PR when you can.
Ill deploy a new contract and add it to the PR and test it out on goerli.
@chimera-defi Still WIP, gonna try and get through more of it tmrw, but wanted to share my progress if you wanna pull the draft PR locally and test it out: https://github.com/SharedStake/SharedStake-ui/pull/143
Hey @WJakub thanks for getting started! I deployed new contracts on goerli here
WithdrawalsvETH2 deployed to 0x0f779f0c7d0c8b9cD6e23e62D9aE51ED39aa256a at https://goerli.etherscan.io/address/0x0f779f0c7d0c8b9cD6e23e62D9aE51ED39aa256a
Rollover deployed to 0x17b9Ee3963a58c82d64Aa9fdaCce261257834623 at https://goerli.etherscan.io/address/0x17b9Ee3963a58c82d64Aa9fdaCce261257834623
Rollovers is just withdrawals but the user gets back the new LSD token sgETH
abi's here https://github.com/SharedStake/SharedDeposit/tree/main/data/abi
Thanks @chimera-defi - will have bit more time on Saturday to sync with the new contracts.
BTW What's the plan in your head? Get the new page up once I finish up the last few bits and get it out for others to test, then roll out to mainnet once done? Perhaps to keep Discord at bay, it'd be good to offer a few step plan - no need to commit to a timeline, but just the final steps we're planning out to get withdrawals on mainnet would IMO help the folks that are managing all the comms at the mo.
Also could you expand on rollovers please? Do we want to think through UI for that, or are you just sharing for reference?
Yep. Plan: -get it out for others to test,
Since rollovers is just the same contract as withdrawals it should be possible to just copy paste the code for withdrawals.
Users deposit veth2. instead of getting eth back on calling redeem they get sgETH back, the new liquid staking derivative
Also left a comment on #143
Per announcements, a series of screenshots or a gif/vid would be nice for the announcements
Ahhh okay yeah that makes sense RE rollover, thanks.
Yup I will sort some visuals when I work on this tomorrow (I'm only able to code on this weekends around my job), will share in the PR thread.
@WJakub what do you think is left to do? imo:
Anything I missed?
The withdrawals code seems functional to me.
And anything youre already working on so i dont start on it too?
above done on v2-dev branch at #146
[Withdrawals] UI component / button for withdrawals contract: https://goerli.etherscan.io/address/0x4db116ad5cca33ba5d2956dba80d56f27b6b2455
In essence you have 1 number input with 1 button below needed. The button changes state depending on conditions.
connectedWallet.balance of vETH2 > veth2.approval(user, withdrawalContract)
otherwise show an approve button which triggers max approval and callsveth2.approve(withdrawalContract, maxUint)
deposit
button. Let the user input how many tokens they want to withdraw. With a max button in the number input to let them withdraw all. (See uniswap UI for ex).deposit(value)
call on withdrawal contractif the user wallet connected is in withdrawals.userEntries with balance returned > 0;
. And checkwithdrawalContract ETH balance > userEntries.amount
.Therefore if the user has any tokens they can redeem show a redeem button.
Please wait. Contract ETH too low